Fix bug #14287 with decoding EOL by *-dos coding systems.
[bpt/emacs.git] / src / ChangeLog
1 2013-04-28 Eli Zaretskii <eliz@gnu.org>
2
3 * coding.c (decode_coding_gap): Don't remove the character before
4 a newline unless it's a CR character. (Bug#14287)
5
6 2013-04-28 Dan Nicolaescu <dann@gnu.org>
7
8 * dispextern.h (struct face): Move enum face_underline_type
9 earlier so that bitfields can be in the same word.
10
11 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
12
13 * nsfns.m (handlePanelKeys): New function.
14 (EmacsOpenPanel:performKeyEquivalent:)
15 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
16 arrows/function/control and copy/paste keys (Bug#14296).
17
18 2013-04-27 Juri Linkov <juri@jurta.org>
19
20 * callint.c (Fcall_interactively): Call `Qread_number' for
21 interactive code letter `n' instead of using duplicate code.
22 (Bug#14254)
23
24 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
25
26 * systime.h (make_timeval): Declare as 'const'.
27
28 2013-04-27 Kenichi Handa <handa@gnu.org>
29
30 * font.c (font_open_entity): Always open a font of manageable
31 size.
32
33 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
34 Port better to AIX (Bug#14258).
35 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
36 to pacify AIX xlc.
37
38 2013-04-24 Kenichi Handa <handa@gnu.org>
39
40 * coding.c (decode_coding_iso_2022): When an invalid escape
41 sequence is encountered, reset the invocation and designation
42 status to the safest one.
43
44 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
45
46 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
47 Without this fix, "make distclean" leaves stamp-h1 behind.
48
49 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
50
51 * w32fns.c (w32_fullscreen_rect): New function to compute the
52 window rectangle for the given fullscreen mode.
53 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
54 longer tunes the window size. This keeps the window's edges flush
55 with the screen and allows the taskbar to hide itself in fullboth.
56
57 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
58 window decorations and uses the entire screen.
59
60 * w32term.h (w32_fullscreen_rect) Add prototype.
61 (struct w32_output): Replace normal_width, normal_height,
62 normal_top, and normal_left members with a single normal_placement
63 struct.
64 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
65 Remove macros.
66 (FRAME_NORMAL_PLACEMENT): New macro.
67
68 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
69
70 * minibuf.c (Ftest_completion): Silence compiler warning.
71
72 2013-04-15 Eli Zaretskii <eliz@gnu.org>
73
74 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
75 bug#14062.
76
77 * frame.h (WINDOW_FRAME): Protect macro and its argument with
78 parentheses.
79
80 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
81 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
82 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
83 parentheses where appropriate.
84
85 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
86
87 * keyboard.c (timer_start_idle): Remove no-longer-used local.
88
89 2013-04-14 Eli Zaretskii <eliz@gnu.org>
90
91 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
92 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
93 Mention in the doc string that setting these variables takes
94 effect only after a call to set-window-buffer. (Bug#14200)
95
96 2013-04-13 Eli Zaretskii <eliz@gnu.org>
97
98 * indent.c (Fvertical_motion): Don't consider display strings on
99 overlay strings as display strings on the buffer position we
100 started from. This prevents vertical cursor motion from jumping
101 more than one line when there's an overlay string with a display
102 property at end of line.
103 Reported by Karl Chen <Karl.Chen@quarl.org> in
104 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
105
106 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
107
108 * window.c (select_window): `record_buffer' even if window is
109 already selected (bug#14191).
110
111 2013-04-11 Eli Zaretskii <eliz@gnu.org>
112
113 * window.c (Fwindow_end): Test more flags, including the buffer's
114 last_overlay_modified flag, to determine whether the window's
115 display is really up-to-date. Prevents the function from
116 returning a stale value. (Bug#14170)
117 (Fwindow_line_height): Fix the test for up-to-date-ness of the
118 current matrix.
119
120 2013-04-10 Eli Zaretskii <eliz@gnu.org>
121
122 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
123 garbaged only if it is not already the top frame on its TTY.
124 This prevents flickering due to constant redrawing of TTY frames when
125 there are GUI frames open in the same session. (Bug#13864)
126
127 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
128
129 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
130 of marking the idle timers directly.
131
132 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
133
134 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
135 tables (bug#14054).
136
137 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
138
139 * window.c (select_window): Don't record_buffer while the invariant is
140 temporarily broken (bug#14161).
141
142 * fns.c (Fdelq): Don't assume !NILP => CONSP.
143
144 2013-04-07 Eli Zaretskii <eliz@gnu.org>
145
146 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
147
148 2013-04-07 Romain Francoise <romain@orebokech.com>
149
150 Ignore additional platform-specific ACL errors (Bug#13702).
151 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
152 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
153
154 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
155
156 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
157 f->output_data.ns.
158
159 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
160
161 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
162 This bug was introduced by my 2013-02-25 change that simplified
163 data_start configuration. Without this change, on GNU/Linux
164 an Emacs configured with --enable-profiling fails immediately
165 due to a profiler signal.
166 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
167 with these flags. On platforms where special flags are needed
168 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
169 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
170 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
171
172 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
173
174 Get rid of some platform-specific functions examining window
175 system and its capabilities. This is a partial rework of the
176 2013-04-05 change.
177 * lisp.h (have_menus_p): Remove prototype. This function is
178 replaced with platform-independent window_system_available.
179 (check_window_system): Move to...
180 * frame.h (decode_window_system_frame, window_system_available):
181 ...here, add new prototypes.
182 * frame.c (window_system_available, decode_window_system_frame):
183 New functions.
184 (check_window_system): Platform-independent now.
185 * xterm.h (x_in_use): Remove declaration.
186 (check_x_frame):
187 * w32term.h (check_x_frame):
188 * nsterm.h (check_x_frame): Remove prototypes. This function
189 is replaced with platform-independent decode_window_system_frame.
190 * msdos.c (have_menus_p): Remove.
191 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
192 Remove platform-specific functions. Use check_window_system,
193 decode_window_system_frame and check_ns_display_info where
194 appropriate. Minor style and comment tweaks.
195 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
196 (check_x_frame): Likewise.
197 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
198 Likewise.
199 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
200 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
201 * xmenu.c, xselect.c: All related users changed.
202
203 2013-04-03 Kenichi Handa <handa@gnu.org>
204
205 The following changes is to optimize the code for reading UTF-8
206 files.
207
208 * coding.c (check_ascii): Rename from detect_ascii. Return value
209 changed. Check EOL format. Do not call adjust_coding_eol_type
210 here.
211 (check_utf_8): New function.
212 (adjust_coding_eol_type): Do nothing if already adjusted.
213 (detect_coding): Compare the return value of check_ascii with
214 coding->src_bytes. Call adjust_coding_eol_type if necessary.
215 (decode_coding_gap): Optimize for valid UTF-8.
216
217 2013-03-21 Kenichi Handa <handa@gnu.org>
218
219 * coding.c (syms_of_coding): Cancel previous change.
220
221 * insdel.c (insert_from_gap): Fix previous change.
222
223 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
224
225 Consistently use platform-specific function to detect window system.
226 * lisp.h (check_window_system): New prototype. This function is
227 going to replace check_x, check_w32 and check_ns.
228 (have_menus_p): Mention msdos.c in comment.
229 * fontset.c (check_window_system_func): Remove. Adjust all users.
230 * fontset.h (check_window_system_func): Remove prototype.
231 * nsterm.h (check_ns):
232 * xterm.h (check_x):
233 * w32term.h (check_w32): Likewise.
234 * menu.c (Fx_popup_menu): Use check_window_system.
235 * msdos.c (check_window_system): Define for MS-DOS.
236 * nsfns.m (check_window_system): Define for NS. Adjust all users.
237 * w32fns.c (check_window_system): Likewise for MS-Windows.
238 * xfns.c (check_window_system): Likewise for X.
239 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
240 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
241
242 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
243
244 Prefer < to > in range checks such as 0 <= i && i < N.
245 This makes it easier to visualize quantities on a number line.
246 This patch doesn't apply to all such range checks,
247 only to the range checks affected by the 2013-03-24 change.
248 This patch reverts most of the 2013-03-24 change.
249 * alloc.c (xpalloc, Fgarbage_collect):
250 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
251 * character.c (string_escape_byte8):
252 * charset.c (read_hex):
253 * data.c (cons_to_unsigned):
254 * dispnew.c (update_frame_1):
255 * doc.c (Fsubstitute_command_keys):
256 * doprnt.c (doprnt):
257 * editfns.c (hi_time, decode_time_components):
258 * fileio.c (file_offset):
259 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
260 * font.c (font_intern_prop):
261 * frame.c (x_set_alpha):
262 * gtkutil.c (get_utf8_string):
263 * indent.c (check_display_width):
264 * keymap.c (Fkey_description):
265 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
266 * lread.c (read1):
267 * minibuf.c (read_minibuf_noninteractive):
268 * process.c (wait_reading_process_output):
269 * search.c (Freplace_match):
270 * window.c (get_phys_cursor_glyph):
271 * xdisp.c (redisplay_internal):
272 * xsmfns.c (smc_save_yourself_CB):
273 Prefer < to > for range checks.
274 * dispnew.c (sit_for): Don't mishandle NaNs.
275 This fixes a bug introduced in the 2013-03-24 change.
276 * editfns.c (decode_time_components): Don't hoist comparison.
277 This fixes another bug introduced in the 2013-03-24 change.
278
279 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
280
281 * frame.h (struct frame): Drop scroll_bottom_vpos
282 member becaue all real users are dead long ago.
283 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
284 * xdisp.c (redisplay_internal): Adjust user.
285
286 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
287
288 * nsmenu.m (showAtX:Y:for:): setLevel to
289 NSPopUpMenuWindowLevel (Bug#13998).
290
291 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
292
293 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
294 (ns_check_pending_open_menu): Declare.
295
296 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
297 (x_activate_menubar): Update the menu with title that matches
298 ns_get_pending_menu_title, and call
299 ns_check_pending_openmenu (Bug#12698).
300 (menuWillOpen:): New method.
301 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
302
303 * nsterm.m (menu_will_open_state, menu_mouse_point)
304 (menu_pending_title): New varaibles.
305 (ns_get_pending_menu_title, ns_check_menu_open)
306 (ns_check_pending_open_menu): New functions.
307
308 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
309
310 * indent.c (current_column_bol_cache): Remove leftover which is not
311 used in Fmove_to_column any more.
312 (current_column, scan_for_column): Adjust users.
313 * keyboard.c (last_point_position_buffer, last_point_position_window):
314 Remove leftovers which are not used for recording undo any more.
315 (command_loop_1, syms_of_keyboard): Adjust users.
316 * xdisp.c (last_max_ascent): Remove leftover which is not used in
317 redisplay_window any more.
318 (move_it_to): Adjust user.
319
320 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
321
322 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
323 Update dependencies.
324
325 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
326
327 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
328 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
329 forward references.
330
331 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
332
333 * window.h (struct window): Replace hchild, vchild and buffer slots
334 with the only contents slot. This is possible because each valid
335 window may have either the child window (in vertical or horizontal
336 combination) or buffer to display (for the leaf window). Using that,
337 a lof of operations to traverse and/or change window hierarchies may
338 be simplified. New member horizontal is used to distinguish between
339 horizontal and vertical combinations of internal windows.
340 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
341 (WINDOW_VERTICAL_COMBINATION_P): New macros.
342 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
343 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
344 Use contents slot, not buffer, where appropriate.
345 (wset_combination): New function.
346 (wset_buffer): Add eassert.
347 (Fframe_first_window): Simplify the loop reaching first window.
348 (Fwindow_buffer): Use WINDOW_LEAF_P.
349 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
350 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
351 (unshow_buffer): Convert initial debugging check to eassert.
352 (replace_window, recombine_windows, Fdelete_other_windows_internal)
353 (make_parent_window, window_resize_check, window_resize_apply)
354 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
355 (Fset_window_configuration, delete_all_child_windows, save_window_save):
356 Adjust to match struct window changes.
357 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
358 (mark_window_cursors_off, count_windows, get_leaf_windows)
359 (foreach_window_1): Simplify the loop.
360 * alloc.c (mark_object): Do not check for the leaf window because
361 internal windows has no glyph matrices anyway.
362 * dispnew.c (clear_window_matrices, showing_window_margins_p)
363 (allocate_matrices_for_window_redisplay, fake_current_matrices)
364 (allocate_matrices_for_frame_redisplay, free_window_matrices)
365 (build_frame_matrix_from_window_tree, mirror_make_current)
366 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
367 (update_window_tree, set_window_update_flags): Simplify the loop.
368 (sync_window_with_frame_matrix_rows): Enforce live window.
369 Use contents slot, not buffer, where appropriate.
370 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
371 and WINDOW_HORIZONTAL_COMBINATION_P.
372 (make_frame_visible_1): Simplify the loop.
373 Use contents slot, not buffer, where appropriate.
374 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
375 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
376 (expose_window_tree): Likewise.
377 Use contents slot, not buffer, where appropriate.
378 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
379 to avoid deleted windows. Use contents slot instead of buffer.
380 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
381 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
382 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
383 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
384
385 2013-03-28 Eli Zaretskii <eliz@gnu.org>
386
387 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
388 identify the reasons for assertion violations in bug#14062 and
389 similar ones.
390 (Fx_show_tip): Fix compilation error under
391 "--enable-check-lisp-object-type". (Bug#14073)
392
393 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
394 Reported by <rzl24ozi@gmail.com>.
395
396 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
397
398 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
399 start marker...
400 (unwind_with_echo_area_buffer): ...to restore it here.
401 This is needed to ensure that...
402 (redisplay_window): ...both window markers are valid here,
403 which is verified by eassert.
404 * editfns.c (save_excursion_save): Do not assume that
405 selected_window always displays the buffer.
406 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
407 Fix comment.
408
409 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
410
411 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
412 the upcase table.
413
414 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
415
416 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
417
418 2013-03-27 Eli Zaretskii <eliz@gnu.org>
419
420 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
421 since MinGW's w32api headers do. This avoids compiler warnings.
422
423 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
424 if already defined.
425
426 2013-03-26 Eli Zaretskii <eliz@gnu.org>
427
428 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
429
430 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
431
432 * gtkutil.c (style_changed_cb): Check if frame is live and an
433 X frame (Bug#14038).
434
435 2013-03-26 Eli Zaretskii <eliz@gnu.org>
436
437 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
438 Define only for _WIN32_WINNT less than 0x0500.
439 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
440 MinGW64.
441 Move inclusion of time.h before sys/time.h, so that MinGW64 could
442 see its own definitions of 'struct timeval' and 'struct timezone'.
443
444 Fix incompatibilities between MinGW.org and MinGW64 headers.
445 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
446
447 * w32.c (REPARSE_DATA_BUFFER): Guard with
448 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
449
450 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
451
452 * xterm.c: Include X11/XKBlib.h
453 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
454
455 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
456
457 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
458 written backwards.
459 * blockinput.h (input_blocked_p): Likewise.
460 * bytecode.c (exec_byte_code): Likewise.
461 * callproc.c (call_process_kill, call_process_cleanup)
462 (Fcall_process): Likewise.
463 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
464 (Fccl_execute_on_string): Likewise.
465 * character.c (string_escape_byte8): Likewise.
466 * charset.c (read_hex): Likewise.
467 * cm.c (calccost): Likewise.
468 * data.c (cons_to_unsigned): Likewise.
469 * dired.c (directory_files_internal, file_name_completion):
470 Likewise.
471 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
472 (sit_for): Likewise.
473 * doc.c (Fsubstitute_command_keys): Likewise.
474 * doprnt.c (doprnt): Likewise.
475 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
476 * emacsgtkfixed.c: Likewise.
477 * fileio.c (file_offset, Fwrite_region): Likewise.
478 * floatfns.c (Fexpt, fmod_float): Likewise.
479 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
480 Likewise.
481 * font.c (font_intern_prop): Likewise.
482 * frame.c (x_set_alpha): Likewise.
483 * gtkutil.c (get_utf8_string): Likewise.
484 * indent.c (check_display_width): Likewise.
485 * intervals.c (create_root_interval, rotate_right, rotate_left)
486 (split_interval_right, split_interval_left)
487 (adjust_intervals_for_insertion, delete_node)
488 (interval_deletion_adjustment, adjust_intervals_for_deletion)
489 (merge_interval_right, merge_interval_left, copy_intervals)
490 (set_intervals_multibyte_1): Likewise.
491 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
492 * keymap.c (Fkey_description): Likewise.
493 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
494 * lread.c (openp, read_integer, read1, string_to_number):
495 Likewise.
496 * menu.c (ensure_menu_items): Likewise.
497 * minibuf.c (read_minibuf_noninteractive): Likewise.
498 * print.c (printchar, strout): Likewise.
499 * process.c (create_process, Faccept_process_output)
500 (wait_reading_process_output, read_process_output, send_process)
501 (wait_reading_process_output): Likewise.
502 * profiler.c (make_log, handle_profiler_signal): Likewise.
503 * regex.c (re_exec): Likewise.
504 * regex.h: Likewise.
505 * search.c (looking_at_1, Freplace_match): Likewise.
506 * sysdep.c (get_child_status, procfs_ttyname)
507 (procfs_get_total_memory): Likewise.
508 * systime.h (EMACS_TIME_VALID_P): Likewise.
509 * term.c (dissociate_if_controlling_tty): Likewise.
510 * window.c (get_phys_cursor_glyph): Likewise.
511 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
512 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
513 Likewise.
514 * xfns.c (Fx_window_property): Likewise.
515 * xmenu.c (set_frame_menubar): Likewise.
516 * xselect.c (x_get_window_property, x_handle_dnd_message):
517 Likewise.
518 * xsmfns.c (smc_save_yourself_CB): Likewise.
519 * xterm.c (x_scroll_bar_set_handle): Likewise.
520
521 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
522
523 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
524 to be optional or nil. Adjust comment and convert it to docstring.
525 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
526 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
527
528 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
529
530 Static checking by GCC 4.8-20130319.
531 * image.c (gif_load): Assume pass < 3 to pacify GCC.
532 * process.c (Fset_process_datagram_address)
533 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
534 * xdisp.c (get_char_face_and_encoding):
535 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
536 (get_glyph_face_and_encoding): Prepare face before possibly using it.
537 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
538
539 2013-03-24 Ken Brown <kbrown@cornell.edu>
540
541 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
542 fix compilation on 64-bit Cygwin, where underscores are not
543 automatically prepended.
544
545 * w32term.c (w32_initialize): Silence compiler warning.
546
547 2013-03-23 Eli Zaretskii <eliz@gnu.org>
548
549 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
550 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
551 variables, to save and restore frame dimensions.
552 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
553 after returning from a 'fullscreen' configuration.
554 use SendMessage instead of PostMessage to send the SC_RESTORE message,
555 to avoid races between the main thread and the input thread.
556
557 * w32term.h (struct w32_output): New members normal_width,
558 normal_height, normal_top, normal_left, and prev_fsmode.
559 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
560 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
561 members of a frame.
562
563 * w32term.c (w32fullscreen_hook): Record last value of the frame's
564 'fullscreen' parameter. Always record previous width and height
565 of the frame, except when switching out of maximized modes, so
566 that they could be restored correctly, instead of resetting to the
567 default frame dimensions. Send SC_RESTORE command to the frame,
568 unless we are going to send SC_MAXIMIZE, to restore the frame
569 resize hints in the mouse pointer shown by the window manager.
570 (Bug#14032)
571
572 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
573
574 * lisp.h (get_frame_param): Adjust conditions for prototype
575 declaration.
576
577 2013-03-22 Ken Brown <kbrown@cornell.edu>
578
579 * unexcw.c: Drop unneeded inclusion of w32common.h.
580 (report_sheap_usage): Declare.
581 (read_exe_header): Add magic numbers for x86_64.
582 (fixup_executable): Fix printf format specifier for unsigned long
583 argument.
584
585 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
586
587 * frame.h (struct frame): Put menu_bar_window under #ifdef
588 because this member is not needed when X toolkit is in use.
589 (fset_menu_bar_window):
590 * dispnew.c (clear_current_matrices, clear_desired_matrices)
591 (free_glyphs, update_frame):
592 * xdisp.c (expose_frame): Likewise.
593 (display_menu_bar): Likewise. Remove redundant eassert.
594 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
595 toolkit is in use.
596
597 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
598
599 Use functions and constants to manipulate Lisp_Save_Value objects.
600 This replaces code that used macros and strings and token-pasting.
601 The change makes the C source a bit easier to follow,
602 and shrinks the Emacs executable a bit.
603 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
604 (make_save_value): Change 1st arg from string to enum. All callers
605 changed.
606 (INTX): Remove.
607 (mark_object): Use if, not #if, for GC_MARK_STACK.
608 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
609 (XSAVE_OBJECT): Now functions, not macros.
610 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
611 the constant was never used.
612 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
613 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
614 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
615 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
616 New constants.
617 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
618 type3 with a single member save_type. All uses changed.
619 (save_type, set_save_pointer, set_save_integer): New functions.
620 * print.c (PRINTX): Remove.
621
622 * alloc.c: Remove redundant static declarations.
623
624 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
625
626 * window.h (struct window): Convert left_col, top_line, total_lines
627 and total_cols from Lisp_Objects to integers. Adjust comments.
628 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
629 Remove.
630 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
631 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
632 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
633 Adjust users where appropriate.
634
635 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
636
637 * frame.h (struct frame): Drop resx and resy because the same data is
638 available from window system-specific output context. Adjust users.
639 (default_pixels_per_inch_x, default_pixels_per_inch_y):
640 New functions to provide defaults when no window system available.
641 (FRAME_RES_X, FRAME_RES_Y): New macros.
642 (NUMVAL): Move from xdisp.c.
643 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
644 (Ffont_face_attributes, Fopen_font):
645 * image.c (gs_load):
646 * w32font.c (fill_in_logfont):
647 * xdisp.c (calc_pixel_width_or_height):
648 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
649 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
650
651 2013-03-20 Kenichi Handa <handa@gnu.org>
652
653 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
654 to 1 (temporary workaround until a bug related to ASCII
655 optimization is fixed).
656
657 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
658
659 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
660 Signal error if window is not internal. Adjust docstring.
661 (delete_all_child_windows): Use combination_limit to save the buffer.
662 (Fset_window_configuration): Adjust accordingly.
663 * print.c (syms_of_print): Initialize debugging output not here...
664 (init_print_once): ...but in a new function here.
665 * lisp.h (init_print_once): Add prototype.
666 * emacs.c (main): Add call to init_print_once. Adjust comments.
667
668 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
669
670 * window.c (window_resize_check, window_resize_apply)
671 (window_from_coordinates, recombine_windows, set_window_buffer)
672 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
673 (Fsplit_window_internal, Fdelete_window_internal)
674 (freeze_window_starts): Use bool for booleans.
675 * window.h (window_frame_coordinates, resize_frame_windows)
676 (freeze_window_starts, set_window_buffer): Adjust prototypes.
677
678 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
679
680 * dispnew.c (bitch_at_user): Use `user-error'.
681
682 2013-03-17 Ken Brown <kbrown@cornell.edu>
683
684 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
685 as return type of image_background. (Bug#13981)
686 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
687
688 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
689
690 * nsterm.m (updateFrameSize:): Change resize increments if needed.
691 (ns_select): Don't return with result uninitialized.
692
693 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
694 and getDirectory.
695
696 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
697 New functions.
698 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
699 directories. If filename is nil, get directory name (Bug#13932).
700 Use getFilename and getDirectory.
701 (getFilename, getDirectory): New methods for EmacsSavePanel and
702 EmacsOpenPanel.
703 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
704
705 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
706
707 * coding.c (decode_coding_gap): Fix typo caught by static checking.
708
709 2013-03-15 Kenichi Handa <handa@gnu.org>
710
711 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
712 (adjust_after_replace): Make it back to static. Delete the third
713 arg text_at_gap_tail. Cancel the code for handling it.
714
715 * coding.h (struct coding_system): New member eol_seen.
716
717 * coding.c (detect_ascii): New function.
718 (detect_coding): Set coding->head_ascii and coding->eol_seen only
719 when the source bytes are actually scanned. On detecting for
720 coding_category_utf_8_auto, call detect_ascii instead of scanning
721 source bytes directly.
722 (produce_chars): Call insert_from_gap with the new arg 0.
723 (encode_coding): Likewise.
724 (decode_coding_gap): Control ASCII optimization by the variable
725 disable_ascii_optimization instead of #ifndef .. #endif.
726 Deccode EOL format according to coding->eol_seen.
727 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
728 variable.
729
730 * lisp.h (adjust_after_replace): Cancel externing it.
731 (insert_from_gap): Adjust prototype.
732
733 2013-03-15 Eli Zaretskii <eliz@gnu.org>
734
735 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
736 FULLSCREEN_MAXIMIZED. (Bug#13935)
737
738 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
739
740 * region-cache.c (find_cache_boundary, move_cache_gap)
741 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
742 Simplify debugging check and convert to eassert. Adjust comment.
743 (pp_cache): Put under ENABLE_CHECKING.
744
745 2013-03-14 Eli Zaretskii <eliz@gnu.org>
746
747 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
748 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
749 and WM_ACTIVATEAPP.
750 (w32fullscreen_hook): If the frame is visible, reset
751 f->want_fullscreen flag after changing the frame size. If the
752 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
753 (Bug#13953)
754
755 2013-03-13 Daniel Colascione <dancol@dancol.org>
756
757 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
758 too so that these builds can use Cygwin's file conversion
759 functions. (We've been building and linking cygw32.o all along
760 and just not using it.)
761
762 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
763
764 File synchronization fixes (Bug#13944).
765 * Makefile.in (LIB_FDATASYNC): New macro.
766 (LIBES): Use it.
767 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
768 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
769 Don't worry about HAVE_FSYNC, since a substitute fsync is
770 available if the system lacks one.
771 (Fwrite_regin): Retry fsync if interrupted.
772
773 2013-03-13 Eli Zaretskii <eliz@gnu.org>
774
775 * w32term.c (w32_read_socket): If the Emacs frame is being
776 activated, call w32fullscreen_hook, to make sure the new frame
777 dimensions are in effect. (Bug#13937)
778
779 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
780
781 * xdisp.c (init_iterator): Simplify because both character and byte
782 positions are either specified or -1. Add eassert. Adjust comment.
783 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
784 character and byte positions can be obtained from marker.
785
786 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
787
788 Static checking by Sun C 5.12.
789 * alloc.c (buffer_memory_full) [REL_ALLOC]:
790 * bytecode.c (exec_byte_code):
791 * dispnew.c (init_display):
792 * eval.c (error):
793 * fileio.c (Fsubstitute_in_file_name):
794 * keyboard.c (Fevent_convert_list):
795 * keymap.c (Fsingle_key_description):
796 * term.c (maybe_fatal, fatal):
797 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
798 * xsmfns.c (Fhandle_save_session):
799 Omit unreachable code.
800 * keymap.c (map_keymap_char_table_item): Cast void * to
801 a function pointer type; the C Standard requires this.
802
803 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
804 Include <sys/param.h> unconditionally, as that works elsewhere and
805 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
806 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
807 and FreeBSD now.
808
809 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
810
811 * insdel.c (adjust_after_replace): Use bool for boolean.
812
813 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
814
815 * keyboard.c: Move keyboard decoding to read_key_sequence.
816 (decode_keyboard_code): Remove.
817 (tty_read_avail_input): Don't try to decode input.
818 (read_decoded_char): New function.
819 (read_key_sequence): Use it.
820
821 2013-03-10 Daniel Colascione <dancol@dancol.org>
822
823 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
824 (GUI_SDATA, guichar_t): Macros to abstract out differences between
825 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
826 w32fns.c.
827
828 * w32term.c (construct_drag_n_drop): Use the above macros to make
829 drag-and-drop work for non-ASCII filenames in cygw32 builds.
830
831 * w32fns.c (x_set_name, x_set_title): Use the above macros to
832 properly display non-ASCII frame titles in cygw32 builds.
833
834 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
835 call ShellExecute in cygw32 builds.
836
837 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
838 common file dialog code.
839
840 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
841 can just use du like other systems.
842
843 * coding.c (from_unicode_buffer): Declare.
844 * coding.c (from_unicode_buffer): Implement.
845
846 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
847
848 * lread.c: Minor cleanup.
849 (FROM_FILE_P): New macro.
850 (skip_dyn_bytes, unreadchar, read1): Use it.
851 (read_list): Consolidate duplicated code.
852
853 * bytecode.c (struct byte_stack): Remove `constants' when unused.
854
855 2013-03-10 Eli Zaretskii <eliz@gnu.org>
856
857 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
858 (redisplay_internal, set_cursor_from_row, try_window)
859 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
860 (display_line, notice_overwritten_cursor)
861 (mouse_face_from_buffer_pos, note_mouse_highlight):
862 Use MATRIX_ROW_DISPLAYS_TEXT_P.
863 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
864 (mouse_face_from_string_pos, fast_find_string_pos):
865 Use MATRIX_ROW_VPOS.
866
867 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
868
869 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
870
871 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
872 MATRIX_MODE_LINE_ROW.
873
874 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
875
876 2013-03-10 handa <handa@gnu.org>
877
878 * lisp.h (adjust_after_replace): Extern it.
879
880 * coding.c (detect_coding): Cound the heading ASCII bytes in the
881 case of detection for coding_category_utf_8_auto.
882 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
883 Skip decoding if all bytes are ASCII.
884
885 * insdel.c (adjust_after_replace): Make it public. New arg
886 text_at_gap_tail.
887 (adjust_after_insert): Call adjust_after_replace with the new arg
888 value 0.
889
890 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
891
892 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
893 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
894 from Elisp via unread-command-events.
895
896 * keyboard.c (access_keymap_keyremap): Accept nil return value from
897 functions to mean "no change".
898
899 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
900
901 region-cache.c, scroll.c, search.c: Use bool for booleans.
902 * lisp.h (compile_pattern):
903 * scroll.c (do_scrolling, do_direct_scrolling):
904 * search.c (struct regexp_cache, compile_pattern_1)
905 (compile_pattern, string_match_1, search_command)
906 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
907 (search_regs_saved, Fregexp_quote):
908 Use bool for boolean.
909 * region-cache.c (region_cache_forward, region_cache_backward):
910 Fix comments to match code: these functions return int, not boolean.
911
912 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
913
914 * search.c (find_newline): Accept start and end byte positions
915 as arguments and allow -1 if not known.
916 (find_newline_no_quit): Likewise for start position.
917 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
918 * bidi.c (bidi_find_paragraph_start): Pass byte position to
919 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
920 * editfns.c (Fconstrain_to_field): Break long line.
921 Adjust call to find_newline.
922 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
923 Use DEC_BOTH to start next search from the previous buffer
924 position, where appropriate.
925 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
926 (get_visually_first_element, move_it_vertically_backward): Likewise.
927 Obtain byte position from the display iterator, where appropriate.
928
929 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
930
931 print.c, process.c: Use bool for booleans.
932 * lisp.h (wait_reading_process_output):
933 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
934 (strout, debug_output_compilation_hack, float_to_string, print)
935 (print_object):
936 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
937 (decode_status, status_message, create_process, create_pty)
938 (Fmake_network_process, Fnetwork_interface_info)
939 (wait_reading_process_output, read_process_output)
940 (write_queue_push, write_queue_pop, process_send_signal)
941 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
942 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
943 Use bool for booleans.
944 * process.c (Fnetwork_interface_list): Remove unused local.
945 (connect_counter): Now EMACS_INT, not int.
946
947 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
948
949 * bidi.c (bidi_fetch_char): Swap first and second arguments
950 to match other functions accepting character and byte positions.
951 Adjust comment.
952 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
953 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
954 when you need just to move to the previous buffer position.
955 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
956
957 2013-03-07 Eli Zaretskii <eliz@gnu.org>
958
959 * .gdbinit (prowlims): Display the enabled_p flag of the row.
960
961 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
962
963 Avoid character to byte conversions in motion subroutines.
964 * indent.h (compute_motion, vmotion): Add byte position argument.
965 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
966 Add eassert.
967 (Fcompute_motion): Break long line. Adjust call to compute_motion.
968 Use list5 for return value.
969 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
970 Adjust comments, style and calls to compute_motion.
971 (Fvertical_motion): Adjust call to vmotion.
972 * window.c (Fdelete_other_windows_internal): Record window start
973 byte position and adjust call to vmotion.
974 (window_scroll_line_based): Likewise with call to compute_motion.
975 Use SET_PT_BOTH.
976 (Frecenter): Adjust calls to vmotion.
977
978 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
979
980 * lisp.h (list2i, list3i): New functions.
981 (list4i): Move from window.c and make LISP_INLINE.
982 * editfns.c (make_lisp_time):
983 * fns.c (Flocale_info):
984 * keyboard.c (parse_modifiers):
985 * xterm.c (x_ewmh_activate_frame): Use list2i.
986 * instel.c (signal_after_change):
987 * nsfns.m (Fx_server_version, Fxw_color_values):
988 * w32fns.c (Fxw_color_values, Fx_server_version):
989 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
990 * fileio.c (Fvisited_file_modtime):
991 * nsfns.m (Fns_display_usable_bounds):
992 * w32.c (ltime): Use list4i.
993
994 2013-03-06 Eli Zaretskii <eliz@gnu.org>
995
996 * search.c (find_newline_no_quit): Rename from find_next_newline.
997 Add commentary.
998
999 * lisp.h (find_newline_no_quit): Rename prototype.
1000
1001 * xdisp.c (back_to_previous_line_start)
1002 (forward_to_next_line_start, get_visually_first_element)
1003 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1004 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1005 * bidi.c (bidi_find_paragraph_start): Callers of
1006 find_newline_no_quit changed.
1007
1008 * msdos.c: Change encoding to cp850. (Bug#13879)
1009 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1010
1011 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1012
1013 Coding system support cleanup and minor refactoring.
1014 * coding.h (enum coding_result_code): Remove
1015 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1016 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1017 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1018 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1019 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1020 (decode_coding_region, encode_coding_region, decode_coding_string):
1021 Remove unused compatibility macros.
1022 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1023 (record_conversion_result): Adjust user.
1024 (syms_of_coding): Likewise.
1025 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1026 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1027 (decode_coding_object): Simplify since xrealloc never returns NULL.
1028 Add eassert.
1029
1030 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1031
1032 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1033 * sysdep.c (list_system_processes)
1034 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1035 Make it a stub in this case; otherwise the build might fail,
1036 and this code hasn't been tested on such hosts anyway.
1037 Problem reported by Nelson H. F. Beebe in
1038 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1039 and analyzed by Jérémie Courrèges-Anglas in
1040 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1041
1042 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1043
1044 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1045 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1046 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1047 * bidi.c (bidi_find_paragraph_start): Likewise.
1048 * indent.c (vmotion): Likewise.
1049
1050 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1051
1052 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1053 * filelock.c: Include <c-ctype.h>.
1054 (MAX_LFINFO): New top-level constant.
1055 (lock_info_type): Remove members pid, boot_time. Add members at,
1056 dot, colon. Change user member to be the entire buffer, not a
1057 pointer. This allows us to handle the case where a foreign
1058 pid or boot time exceeds the local range. All uses changed.
1059 (LINKS_MIGHT_NOT_WORK): New constant.
1060 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1061 (defined_WINDOWSNT): Remove.
1062 (MAKE_LOCK_NAME, file_in_lock_file_name):
1063 Always use .#FILE (not .#-FILE) for the file lock,
1064 even if it is a regular file.
1065 (rename_lock_file): New function.
1066 (create_lock_file): Use it.
1067 (create_lock_file, read_lock_data):
1068 Prefer a symbolic link for the lock file, falling back on a
1069 regular file if symlinks don't work. Do not try to create
1070 symlinks on MS-Windows, due to security hassles. Stick with
1071 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1072 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1073 host may be using a Windowsish file system, and cannot use
1074 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1075 doesn't work. Don't fail merely because of a symlink-contents
1076 length limit in the current file system; fall back on regular
1077 files. Increase the symlink contents length limit to 8 KiB, this
1078 should be big enough for any real use and doesn't crunch the
1079 stack.
1080 (create_lock_file, lock_file_1, read_lock_data):
1081 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1082 (lock_file_1): Return error number, not bool. All callers changed.
1083 (ELOOP): New macro, if not already defined.
1084 (read_lock_data): Return size of lock file contents, not Lisp object.
1085 All callers changed. Handle a race condition if some other process
1086 replaces a regular-file lock with a symlink lock or vice versa,
1087 while we're trying to read the lock.
1088 (current_lock_owner): Parse contents more carefully, to help avoid
1089 confusing a regular-file lock with some other application's use
1090 of the file. Check for lock file contents being too long, or
1091 not parsing correctly.
1092 (current_lock_owner, lock_file):
1093 Allow foreign pid and boot times that exceed the local range.
1094 (current_lock_owner, lock_if_free, lock_file):
1095 Simplify allocation of lock file contents.
1096 * w32.c (sys_rename_replace): New function, containing most of
1097 the contents of the old sys_rename.
1098 (sys_rename): Use it.
1099 (fchmod): New dummy function.
1100 * w32.h (sys_rename_replace, fchmod): New decls.
1101
1102 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1103
1104 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1105 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1106 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1107 <dmantipov@yandex.ru>.
1108
1109 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1110
1111 * composite.c (get_composition_id, fill_gstring_header):
1112 Use make_uninit_vector where appropriate.
1113 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1114 * xselect.c (clean_local_selection_data): Likewise.
1115
1116 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1117
1118 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1119 * image.c (imagemagick_load_image): Calculate height and width
1120 after flattening the image, not before.
1121
1122 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1123
1124 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1125 * ftfont.c (ftfont_shape_by_flt): Likewise.
1126 * w32uniscribe.c (uniscribe_shape): Likewise.
1127
1128 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1129
1130 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1131 The old approach, which fell back on DIR/.#FILE.0 through
1132 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1133 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1134 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1135 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1136 because the locking mechanism was never reliable in that case).
1137 This patch fixes this and other bugs discovered by a code
1138 inspection that was prompted by
1139 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1140 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1141 to avoid interoperability problems between the MS-Windows and
1142 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1143 instances of Emacs now ignore each others' locks.
1144 * filelock.c (defined_WINDOWSNT): New constant.
1145 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1146 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1147 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1148 regular files on MS-Windows hosts.
1149 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1150 Use SAFE_ALLOCA to avoid problems with long file names.
1151 (MAX_LFINFO): Now a local constant, not a global macro.
1152 (IS_LOCK_FILE): Remove.
1153 (lock_file_1): Don't inspect errno if symlink call succeeds;
1154 that's not portable.
1155 (lock_file): Document that this function can return if lock
1156 creation fails.
1157 (lock_file): Don't access freed storage.
1158
1159 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1160
1161 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1162
1163 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1164
1165 * textprop.c: Use bool for booleans.
1166 (validate_interval_range, Fadd_text_properties)
1167 (Fremove_text_properties): Prefer bool to int when either works.
1168
1169 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1170
1171 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1172 If the interval tree changes as a side effect of calling
1173 modify_region, re-do processing starting from the call to
1174 validate_interval_range. (Bug#13743)
1175
1176 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1177
1178 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1179 (Bug#13546).
1180
1181 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1182
1183 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1184 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1185 access to the lock file until it is written and closed.
1186 (Bug#13807)
1187
1188 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1189
1190 * callint.c (Qcall_interactively):
1191 * macros.c (Qexecute_kbd_macro):
1192 Now static.
1193
1194 2013-02-26 Bastien Guerry <bzg@gnu.org>
1195
1196 * window.c (Frecenter): Tiny docstring enhancement.
1197
1198 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1199
1200 Minor textprop integer cleanup.
1201 * intervals.h, textprop.c (add_text_properties_from_list):
1202 Return void, not int, since nobody uses the return value.
1203 * textprop.c (validate_plist, add_properties, remove_properties)
1204 (Fadd_text_properties):
1205 Don't assume list length fits in int.
1206 (interval_has_all_properties, interval_has_some_properties)
1207 (interval_has_some_properties_list, add_properties, remove_properties)
1208 (Fadd_text_properties, Fremove_text_properties)
1209 (Fremove_list_of_text_properties, text_property_stickiness):
1210 Use bool for booleans.
1211 (Fadd_text_properties, Fremove_text_properties):
1212 (Fremove_list_of_text_properties):
1213 Reindent do-while as per GNU style.
1214
1215 2013-02-25 Eli Zaretskii <eliz@gnu.org>
1216
1217 Implement CLASH_DETECTION for MS-Windows.
1218
1219 * filelock.c [WINDOWSNT]: Include w32.h.
1220 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1221 function of that name. Up-case the macro arguments.
1222 (IS_LOCK_FILE): New macro.
1223 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1224 (create_lock_file): New function, with body extracted from
1225 lock_file_1.
1226 [WINDOWSNT]: Implement lock files by writing a regular file with
1227 the lock information as its contents.
1228 (read_lock_data): New function, on Posix platforms just calls
1229 emacs_readlinkat.
1230 [WINDOWSNT]: Read the lock info from the file.
1231 (current_lock_owner): Call read_lock_data instead of calling
1232 emacs_readlinkat directly.
1233 (lock_file) [WINDOWSNT]: Run the file name through
1234 dostounix_filename.
1235
1236 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1237 just check if the process by that PID exists.
1238
1239 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1240 also present, as doing so will fail to error out if the file
1241 already exists.
1242
1243 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1244
1245 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1246 (Fremove_list_of_text_properties): Skip all of the intervals in
1247 the region between START and END that already have resp. don't
1248 have the requested properties, not just the first one.
1249 Add assertions that the loop afterwards always modifies the
1250 properties. (Bug#13743)
1251
1252 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1253
1254 * callint.c (Fcall_interactively): Use the right lexical environment
1255 for `interactive' specs (bug#13811).
1256 * eval.c (Feval): Accept a lexical environment.
1257
1258 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1259
1260 Simplify data_start configuration (Bug#13783).
1261 This is a followon simplification to the fix for Bug#13650.
1262 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1263 (START_FILES): Remove. All uses removed.
1264 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1265 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1266 (buildobj.h): Use it.
1267 ($(ALLOBJS)): Depend on globals.h.
1268 (temacs$(EXEEXT)): Use $(ALLOBJS).
1269 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1270 * deps.mk (vm-limit.o):
1271 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1272 Do not depend on mem-limits.h.
1273 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1274 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1275 [__GNUC__ && !ORDINARY_LINK]: Remove.
1276 * mem-limits.h, pre-crt0.c: Remove.
1277 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1278 * unexcoff.c (etext): New decl.
1279 (make_hdr): Use DATA_START instead of start_of_data.
1280 * vm-limit.c: Move most of mem-limits.h's contents here.
1281 (data_start): New decl. It's OK if this is approximate,
1282 so simplify-away some unnecessary exactness.
1283 (POINTER): Remove; all uses removed.
1284 (data_space_start): Now char *, to avoid casts.
1285 (exceeds_lisp_ptr): New function, replacing the old
1286 EXCEEDS_LISP_PTR macro. All uses changed.
1287 (check_memory_limits): Simplify and remove casts.
1288 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1289 (memory_warnings): Use data_start instead of start_of_data.
1290
1291 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1292
1293 * xdisp.c (set_message): Only check for debug-on-message if STRING
1294 is a string. (Bug#13797)
1295
1296 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1297
1298 Fix regression introduced by July 10 filelock.c patch.
1299 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1300 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1301 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1302 and diagnosed by Andreas Schwab in
1303 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1304
1305 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1306
1307 Assume C89 or better.
1308 * ralloc.c (SIZE, POINTER, NIL):
1309 * vm-limit.c (POINTER):
1310 Remove, replacing all uses with C89 equivalents. These old
1311 symbols were present only for porting to pre-C89 platforms.
1312
1313 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
1314
1315 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1316 This avoids warning messages reported as part of Bug#13546.
1317
1318 2013-02-21 Ken Brown <kbrown@cornell.edu>
1319
1320 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1321
1322 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1323
1324 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1325
1326 * keyboard.c (Qcommand_execute): New var.
1327 (command_loop_1, read_char): Use it.
1328 (Fcommand_execute): Remove, replace by an Elisp implementation.
1329 (syms_of_keyboard): Adjust accordingly.
1330
1331 2013-02-19 Daniel Colascione <dancol@dancol.org>
1332
1333 * sheap.c (report_sheap_usage): Use message, not message1, so
1334 that we don't try to create a buffer while we're in the middle
1335 of dumping Emacs. Explain why.
1336
1337 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
1338
1339 * search.c (find_newline): Return byte position in bytepos.
1340 Adjust comment.
1341 (find_next_newline_no_quit, find_before_next_newline):
1342 Add bytepos argument.
1343 * lisp.h (find_newline, find_next_newline_no_quit)
1344 (find_before_next_newline): Adjust prototypes.
1345 * bidi.c (bidi_find_paragraph_start):
1346 * editfns.c (Fconstrain_to_field, Fline_end_position):
1347 * indent.c (compute_motion, vmotion):
1348 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1349 (get_visually_first_element, move_it_vertically_backward):
1350 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1351
1352 2013-02-19 Eli Zaretskii <eliz@gnu.org>
1353
1354 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1355 resources were not orderly released.
1356
1357 2013-02-17 Eli Zaretskii <eliz@gnu.org>
1358
1359 * xdisp.c (x_draw_vertical_border): For a window that is neither
1360 the leftmost nor the rightmost, redraw both the left and the right
1361 vertical borders. (Bug#13723)
1362
1363 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1364
1365 * xml.c (init_libxml2_functions):
1366 * sound.c (sound_warning):
1367 * sheap.c (report_sheap_usage):
1368 * process.c (wait_reading_process_output):
1369 * msdos.c (XMenuActivate):
1370 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1371 * keyboard.c (top_level_1):
1372 * editfns.c (Fmessage, Fmessage_box):
1373 * callint.c (Fcall_interactively):
1374 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1375
1376 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1377
1378 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
1379 * frame.c (syms_of_frame): ... to here.
1380
1381 2013-02-16 Eli Zaretskii <eliz@gnu.org>
1382
1383 * w32.c (sys_chown): Remove unused function.
1384
1385 * w32term.c <input_signal_count>: Declare 'volatile'
1386 unconditionally. (Bug#9066)
1387
1388 * w32.c (set_errno): Reset h_errno and don't set it to any other
1389 value. Set errno instead.
1390 (check_errno): Reset h_errno.
1391 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1392 (sys_gethostname, sys_getservbyname, sys_getpeername)
1393 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1394 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1395 h_errno.
1396 (sys_gethostbyname): Set h_errno only errors detected.
1397
1398 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1399
1400 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1401
1402 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1403
1404 * keyboard.c (read_char): Fix calculation of auto-save time out
1405 when auto-save-timeout is less than 4. (Bug#13720)
1406
1407 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
1408 time. Improve diagnostics in DebPrint. (Bug#13546)
1409
1410 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1411 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1412 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1413 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1414 make sure errno is set to an appropriate value. (Bug#13546)
1415 (socket_to_fd): Add assertion against indexing fd_info[] with a
1416 value that is out of bounds.
1417 (sys_accept): If fd is negative, do not set up the child_process
1418 structure for reading.
1419
1420 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1421
1422 * composite.c (fill_gstring_header): Remove useless prototype.
1423 Break long line.
1424 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1425 * print.c (PRINTDECLARE, print_object):
1426 * search.c (compile_pattern, fast_looking_at, search_buffer):
1427 (simple_search, boyer_moore, Freplace_match):
1428 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1429 (get_overlay_arrow_glyph_row, display_mode_element):
1430 (decode_mode_spec_coding, message3):
1431 * xfaces.c (face_at_string_position): Use bool for booleans.
1432 Adjust comments.
1433
1434 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1435
1436 Fix AIX port (Bug#13650).
1437 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1438 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1439 was #undeffed earlier, so it cannot be used as a macro here.
1440 Use the constant and not the macro.
1441
1442 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1443
1444 * w32proc.c (new_child): If no vacant slots are found in
1445 child_procs[], make another pass looking for slots whose process
1446 has exited or died. (Bug#13546)
1447
1448 * w32.c (sys_pipe): When failing due to file descriptors above
1449 MAXDESC, set errno to EMFILE.
1450 (_sys_read_ahead): Update cp->status when failing to read serial
1451 communications input, so that the status doesn't stay at
1452 STATUS_READ_IN_PROGRESS. (Bug#13546)
1453
1454 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1455
1456 * gtkutil.c (tb_size_cb): New function.
1457 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1458
1459 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1460
1461 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1462 an event.
1463
1464 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1465
1466 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1467
1468 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1469
1470 * font.c (font_range): Add pos_byte argument. Adjust comment
1471 and break long line.
1472 * font.h (font_range): Adjust prototype.
1473 * composite.c (autocmp_chars): Pass byte position to font_range.
1474 Break long line. Remove useless prototype and format comment.
1475
1476 2013-02-13 Glenn Morris <rgm@gnu.org>
1477
1478 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1479
1480 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1481
1482 Improve AIX port some more (Bug#13650).
1483 With this, it should be as good as it was in 23.3, though it's
1484 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1485 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1486 * unexaix.c (start_of_text): Remove.
1487 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1488 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1489 (orig_load_scnptr, orig_data_scnptr):
1490 Now off_t, not long, since they are file offsets.
1491 (make_hdr): Use _data, not start_of_data ().
1492 This is the key part of the fix.
1493 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1494 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1495
1496 * pre-crt0.c (data_start): Initialize to 1.
1497 This ports to compilers that optimize the external declaration
1498 'int x = 0;' as if it were 'int x;' to shrink the executable.
1499
1500 Improve AIX port (Bug#13650).
1501 This doesn't fix the bug, but it makes progress: Emacs builds now.
1502 * unexaix.c: Include inttypes.h, stdarg.h.
1503 (report_error, report_error_1): Mark as _Noreturn.
1504 (report_error): Don't report the wrong errno.
1505 (report_error_1): Now varargs. All callers changed.
1506 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1507 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1508 (write_ptr): Use %p to print address rather than %lx and a cast
1509 to unsigned long. Grow buffer a bit, to be safer.
1510
1511 2013-02-13 Eli Zaretskii <eliz@gnu.org>
1512
1513 * bidi.c (bidi_resolve_neutral): After finding the next
1514 non-neutral character, accept NEUTRAL_ON type as well, because
1515 directional control characters, such as LRE and RLE, have their
1516 type converted to that by bidi_resolve_weak. This avoids aborts
1517 when LRE/RLE follows a run of neutrals.
1518 (bidi_move_to_visually_next): Assert that return value of
1519 bidi_peek_at_next_level is non-negative. Negative values will
1520 cause an infloop.
1521
1522 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1523
1524 Minor getenv-related fixes.
1525 * callproc.c (Fcall_process_region) [!DOS_NT]:
1526 Avoid unnecessary duplicate call to getenv.
1527 * callproc.c (init_callproc):
1528 * dispnew.c (init_display):
1529 * sysdep.c (sys_subshell):
1530 Omit unnecessary cast of getenv or egetenv.
1531
1532 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
1533
1534 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1535 Update dependencies.
1536
1537 2013-02-12 Eli Zaretskii <eliz@gnu.org>
1538
1539 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1540 marker's position.
1541 (display_line): Set w->region_showing to the value of
1542 it->region_beg_charpos, not to -1. This fixes redisplay
1543 optimization when cursor is moved up after M->. (Bug#13623)
1544 (Bug#13626)
1545 (try_scrolling): Scroll text up more if point is too close to ZV
1546 and inside the scroll margin. This makes sure point is moved
1547 outside the scroll margin in these cases.
1548
1549 * window.h (struct window): region_showing can no longer be
1550 negative.
1551
1552 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1553
1554 Tune by using memchr and memrchr.
1555 * doc.c (Fsnarf_documentation):
1556 * fileio.c (Fsubstitute_in_file_name):
1557 * search.c (find_newline, scan_newline):
1558 * xdisp.c (pos_visible_p, display_count_lines):
1559 Use memchr and memrchr rather than scanning byte-by-byte.
1560 * search.c (find_newline): Rename from scan_buffer.
1561 Omit first arg TARGET, as it's always '\n'. All callers changed.
1562
1563 Clean up read_key_sequence a tiny bit more.
1564 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1565 (read_key_sequence): Remove unused locals.
1566
1567 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1568
1569 Clean up read_key_sequence a bit; reread active keymaps after first event.
1570 * keyboard.c (read_char, read_char_x_menu_prompt)
1571 (read_char_minibuf_menu_prompt):
1572 Replace nmaps+maps with a single `map' arg.
1573 (follow_key): Operate on a single map.
1574 (active_maps): New function.
1575 (test_undefined): Also return true for nil bindings.
1576 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1577 a single (composed) keymap. Remember `first_event' to choose the right
1578 set of active keymaps. Recompute the set of keymaps after receiving
1579 the first event. Remove GOBBLE_FIRST_EVENT.
1580 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1581 * keyboard.h (read_char): Update declaration.
1582 * lread.c (read_filtered_event): Adjust call to read_char.
1583
1584 2013-02-11 Eli Zaretskii <eliz@gnu.org>
1585
1586 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1587 Don't use the limitation on backwards movement when lines are truncated
1588 in the window. (Bug#13675)
1589
1590 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1591
1592 * marker.c (set_marker_internal): If desired position is passed
1593 as a marker, avoid call to buf_charpos_to_bytepos.
1594 * window.c (Fset_window_point): Omit redundant type checking.
1595 (Fset_window_start): Likewise. Format comment.
1596 (window_scroll_pixel_based): Use set_marker_restricted_both
1597 with character and byte positions obtained from an iterator.
1598 (Fset_window_configuration): Use set_marker_restricted_both.
1599 * xdisp.c (message_dolog): Likewise.
1600
1601 2013-02-10 Eli Zaretskii <eliz@gnu.org>
1602
1603 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1604 When text lines are longer than window's screen lines, don't move back
1605 too far. This speeds up some redisplay operations. (Bug#13675)
1606
1607 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1608
1609 * syntax.c (scan_sexps_forward): Fix byte position calculation
1610 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1611
1612 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1613
1614 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1615 that was not needed.
1616
1617 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1618
1619 Minor hashing refactoring.
1620 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1621 (sxhash_float): Return EMACS_UINT, for consistency with the other
1622 hash functions.
1623 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1624 non-static inline function and therefore can't use static vars.
1625 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1626 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1627 with the other hash functions.
1628
1629 2013-02-09 Eli Zaretskii <eliz@gnu.org>
1630
1631 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1632 XXXXXX part of the temporary file pattern is not downcased even
1633 when w32-downcase-file-names is non-nil. (Bug#13661)
1634
1635 * xdisp.c (decode_mode_spec): Remove handling of %t.
1636
1637 * msdos.c (careadlinkatcwd): Remove.
1638
1639 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1640
1641 * lread.c (skip_dyn_bytes): New function (bug#12598).
1642 (read1): Use it. Use getc instead of READCHAR to read bytes.
1643 (load_each_byte): Remove. Update users.
1644
1645 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1646
1647 * search.c (scan_buffer): Calculate end byte position just once.
1648 (scan_newline): Do not recalculate start_byte.
1649 (search_command): Use eassert.
1650 * syntax.c (struct lisp_parse_state): New member location_byte.
1651 (scan_sexps_forward): Record from_byte and avoid redundant
1652 character to byte position calculation ...
1653 (Fparse_partial_sexp): ... here. Break too long line.
1654
1655 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1656
1657 * lisp.h (make_uninit_vector): New function.
1658 * alloc.c (Fvector, Fmake_byte_code):
1659 * ccl.c (Fregister_ccl_program):
1660 * charset.c (Fdefine_charset_internal, define_charset_internal):
1661 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1662 * composite.c (syms_of_composite):
1663 * font.c (Fquery_font, Ffont_info, syms_of_font):
1664 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1665 * ftfont.c (ftfont_shape_by_flt):
1666 * indent.c (recompute_width_table):
1667 * nsselect.m (clean_local_selection_data):
1668 * syntax.c (init_syntax_once):
1669 * w32unsubscribe.c (uniscribe_shape):
1670 * window.c (Fcurrent_window_configuration):
1671 * xfaces.c (Fx_family_fonts):
1672 * xselect.c (selection_data_to_lisp_data): Use it.
1673
1674 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1675
1676 * coding.c (Fdefine_coding_system_internal): Use AREF where
1677 argument is known to be a vector.
1678 * fns.c (Flocale_info): Likewise for ASET.
1679 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1680 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1681
1682 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1683
1684 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1685 height.
1686
1687 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1688 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1689 updateCollectionBehaviour.
1690
1691 * nsterm.m (NEW_STYLE_FS): Remove.
1692 (ns_last_use_native_fullscreen): New variable.
1693 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1694 (x_set_window_size): Do not take title bar and tool bar into account
1695 if isFullscreen returns YES.
1696 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1697 (check_native_fs): New function.
1698 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1699 (ns_term_init): Remove NEW_STYLE_FS.
1700 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1701 and tool bar if isFullscreen returns NO.
1702 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1703 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1704 with HAVE_NATIVE_FS.
1705 (window:willUseFullScreenPresentationOptions:): New method.
1706 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1707 Hide toolbar if not enabled (Bug#13444).
1708 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1709 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1710 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1711 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1712 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1713 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1714 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1715 (syms_of_nsterm): Add ns-use-native-fullscreen.
1716
1717 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1718
1719 * fileio.c (Qchoose_write_coding_system): Now static.
1720
1721 2013-02-04 Eli Zaretskii <eliz@gnu.org>
1722
1723 * xdisp.c (window_buffer_changed): region_showing can be negative,
1724 which still means region is being displayed.
1725 (redisplay_internal): Resurrect code that forced redisplay of the
1726 whole window when showing region and the mark has changed.
1727 Record the new mark position to allow redisplay optimizations.
1728 (display_line): If it->region_beg_charpos is non-zero, set the
1729 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1730
1731 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1732 not bitfield of 1 bit.
1733
1734 2013-02-03 Daniel Colascione <dancol@dancol.org>
1735
1736 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1737 daemon mode works on cygw32 when Emacs is installed and not just
1738 during development.
1739
1740 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1741
1742 Avoid file time stamp bug on MS-Windows (Bug#13149).
1743 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1744 as FAT32 doesn't update time stamps when truncating them.
1745 Also, check that a file time stamp is not a multiple of 100 ns;
1746 this should catch all instances of the problem on MS-Windows,
1747 as its native file system resolution is 100 ns or worse, and
1748 checking for a non-multiple of 100 ns should impose only a small
1749 overhead on systems with ns resolution.
1750
1751 2013-02-02 Eli Zaretskii <eliz@gnu.org>
1752
1753 Avoid encoding file names on MS-Windows when they need to be run
1754 through dostounix_filename.
1755 * w32.c (normalize_filename): Accept an additional argument
1756 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1757 downcase it even if w32-downcase-file-names is non-nil.
1758 (dostounix_filename): Accept an additional argument MULTIBYTE and
1759 pass it to normalize_filename.
1760 (emacs_root_dir): Adjust.
1761
1762 * msdos.h (dostounix_filename): Adjust prototype.
1763
1764 * w32.h (dostounix_filename): Adjust prototype.
1765
1766 * msdos.c (dostounix_filename): Accept an additional argument and
1767 ignore it.
1768 (init_environment): Adjust callers of dostounix_filename.
1769
1770 * fileio.c (Ffile_name_directory, file_name_as_directory)
1771 (directory_file_name, Fexpand_file_name)
1772 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1773 dostounix_filename.
1774 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1775 non-nil.
1776 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1777 variables, as egetenv is case-insensitive for DOS_NT.
1778
1779 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1780 with an encoded file name.
1781
1782 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1783 Adjust calls to dostounix_filename.
1784
1785 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1786
1787 * unexw32.c (unexec): Adjust call to dostounix_filename.
1788
1789 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1790
1791 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1792 dostounix_filename.
1793
1794 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1795 dostounix_filename.
1796
1797 * callproc.c (Fcall_process): Make sure program name in PATH and
1798 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1799 is passed to exec/spawnve, which fails unless the file-name
1800 encoding is UTF-8.
1801
1802 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1803 even if w32-quote-process-args is nil.
1804
1805 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1806
1807 Fix timestamp bug when write-region appends nothing (Bug#13149).
1808 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1809 the file's time stamp doesn't change if Emacs happens to write nothing
1810 to the file, and on a buggy file system this could cause Emacs to
1811 incorrectly infer that the file system doesn't have the bug.
1812 Avoid this problem by inhibiting the inference in this case.
1813
1814 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1815
1816 * window.h (struct window): Convert base_line_number, base_line_pos
1817 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1818 Convert region_showing member from Lisp_Object to bitfield.
1819 Remove sequence_number member. Adjust comments.
1820 * window.c (sequence_number): Remove.
1821 (make_window): Initialize column_number_displayed.
1822 * print.c (print_object): Follow the printed representation of
1823 frames and print window pointer to distinguish between windows.
1824 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1825 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1826 (wset_column_number_displayed, wset_region_showing): Remove.
1827 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1828 (try_scrolling, try_cursor_movement, redisplay_window)
1829 (try_window_reusing_current_matrix, try_window_id, display_line)
1830 (display_mode_lines, decode_mode_spec): Adjust users.
1831 * .gdbinit (pwinx): Do not print sequence_number.
1832
1833 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1834
1835 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1836 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1837 * dired.c: Include <fcntl.h>.
1838 (open_directory): New function, which uses open and fdopendir
1839 rather than opendir. DOS_NT platforms still use opendir, though.
1840 (directory_files_internal, file_name_completion): Use it.
1841 (file_attributes): New function, with most of the old Ffile_attributes.
1842 (directory_files_internal, Ffile_attributes): Use it.
1843 (file_attributes, file_name_completion_stat): First arg is now fd,
1844 not dir name. All uses changed. Use fstatat rather than lstat +
1845 stat.
1846 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1847 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1848 (emacs_readlinkat): New function, with much of the old
1849 Ffile_symlink_p, but with an fd argument for speed.
1850 It uses readlinkat rather than careadlinkatcwd, so that it
1851 need not assume the working directory.
1852 (Ffile_symlink_p): Use it.
1853 * filelock.c (current_lock_owner): Use emacs_readlinkat
1854 rather than emacs_readlink.
1855 * lisp.h (emacs_readlinkat): New decl.
1856 (READLINK_BUFSIZE, emacs_readlink): Remove.
1857 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1858 (emacs_norealloc_allocator, emacs_readlink): Remove.
1859 This stuff is moved to fileio.c.
1860 * w32.c (fstatat, readlinkat): New functions.
1861 (careadlinkat): Don't check that fd == AT_FDCWD.
1862 (careadlinkatcwd): Remove; no longer needed.
1863
1864 2013-01-31 Glenn Morris <rgm@gnu.org>
1865
1866 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
1867 (Fwrite_region): Update for new choose_write_coding_system args.
1868 Move the last piece of choose_write_coding_system here. (Bug#13522)
1869 (syms_of_fileio): Add choose-write-coding-system.
1870
1871 2013-01-30 Eli Zaretskii <eliz@gnu.org>
1872
1873 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1874 (sys_close): Zero out the flags for the file descriptor before
1875 closing it. (Bug#13546)
1876
1877 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
1878 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1879 Use CharNextExA and CharPrevExA to iterate over file names encoded in
1880 DBCS. (Bug#13553)
1881
1882 * w32.c (w32_get_long_filename, init_environment, readlink):
1883 Support file names encoded in DBCS codepages.
1884 (readlink): Use the current file-name-coding-system, not the ANSI
1885 codepage, to decode and handle targets of symlinks.
1886
1887 2013-01-28 Eli Zaretskii <eliz@gnu.org>
1888
1889 * w32.c (opendir): Now accepts a 'const char *'.
1890
1891 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1892
1893 Remove obsolete redisplay code. See the discussion at
1894 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1895 * dispnew.c (preemption_period, preemption_next_check): Remove.
1896 (Vredisplay_preemption_period): Likewise.
1897 (update_frame, update_single_window, update_window, update_frame_1):
1898 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1899 used, following the 2012-06-22 change.
1900
1901 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1902
1903 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1904
1905 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1906
1907 * font.c (num_fonts): Remove the leftover from old
1908 debugging code. Adjust comment style here and there.
1909 * insdel.c (insert_1): Remove.
1910 * lisp.h (insert_1): Remove prototype.
1911 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
1912
1913 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1914
1915 * w32.c (max_filename_mbslen): New function.
1916 (normalize_filename, readdir): Use it to detect locales where ANSI
1917 encoding of file names uses a double-byte character set (DBCS).
1918 If a DBCS encoding is used, advance by characters using
1919 CharNextExA, instead of incrementing a 'char *' pointer.
1920 Use _mbslwr instead of _strlwr. (Bug#13515)
1921
1922 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1923 request of memory reservation to 1.7GB. (Bug#13065)
1924
1925 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
1926
1927 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1928 at check_extra_latin label. (Bug#13505)
1929
1930 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1931
1932 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1933 Avoid redundant calls to strlen.
1934
1935 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1936
1937 Drop async_visible and async_iconified fields of struct frame.
1938 This is possible because async input is gone; for details, see
1939 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1940 * frame.h (struct frame): Remove async_visible and async_iconified
1941 members, convert garbaged to unsigned bitfield. Adjust comments.
1942 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1943 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1944 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1945 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1946 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1947 * w32term.c: Ditto.
1948 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1949 properly. Likewise for obscured.
1950 * xterm.c: Ditto.
1951 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
1952 properly.
1953 * nsterm.m: Ditto.
1954 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1955
1956 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1957
1958 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1959 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1960
1961 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1962
1963 * xdisp.c (message2, message2_nolog): Remove functions.
1964 (message3, message3_nolog): Extract nbytes and multibyteness directly
1965 from the string. Change all callers.
1966 (message3_nolog): Don't set message_enable_multibyte since set_message
1967 will reset it anyway.
1968 (message1, message1_nolog): Use message3.
1969 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1970 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1971 (set_message): Drop all but the second arg, which has to be a string.
1972 (set_message_1): Simplify now that we know that a1 is NULL and the
1973 second arg is a string.
1974 * frame.h (struct frame): Remove `message_buf' field.
1975 Use glyphs_initialized_p instead.
1976 (FRAME_MESSAGE_BUF): Remove macro.
1977 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1978 * lisp.h (message2, message2_nolog): Remove declarations.
1979 (message3, message3_nolog): Update declarations.
1980 * keyboard.c (read_char_minibuf_menu_text)
1981 (read_char_minibuf_menu_width): Remove vars.
1982 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1983 to correctly handle multibyte strings.
1984 * frame.c (delete_frame): Don't free message_buf any more.
1985 * editfns.c (message_text, message_length): Remove vars.
1986 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1987 * fileio.c (auto_save_error): Use message3 instead of message2.
1988 * dispnew.c (adjust_frame_message_buffer): Remove function.
1989
1990 2013-01-23 Eli Zaretskii <eliz@gnu.org>
1991
1992 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1993 real estate used for the tool bar and the menu bar.
1994
1995 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1996
1997 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1998 hidden buffer is prepared to modification (Bug#13164).
1999
2000 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2001
2002 * window.h (struct window): Change window_end_valid member from
2003 Lisp_Object to a bitfield. Adjust comments.
2004 (wset_window_end_valid): Remove.
2005 * window.c (adjust_window_count): Clear window_end_valid.
2006 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2007 (Fwindow_line_height, set_window_buffer, Frecenter)
2008 (Fsplit_window_internal, Fdelete_other_windows_internal)
2009 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2010 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2011 * xdisp.c (check_window_end, reconsider_clip_changes)
2012 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2013 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2014 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2015
2016 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2017
2018 * xdisp.c (mark_window_display_accurate): Simplify the loop
2019 assuming that the only one of vchild, hchild or buffer window
2020 slots is non-nil. Call mark_window_display_accurate_1 for
2021 the leaf windows only.
2022 (mark_window_display_accurate_1): Always assume leaf window.
2023 Adjust comment.
2024
2025 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2026
2027 * emacs.c (Qkill_emacs_hook): Now static.
2028
2029 * fileio.c (Finsert_file_contents): Simplify.
2030 Remove unnecessary assignments and tests.
2031
2032 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2033
2034 * w32.c (acl_set_file): Don't test for errors unless
2035 set_file_security returns FALSE. Avoids spurious errors when
2036 saving files.
2037
2038 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2039
2040 * fileio.c (Finsert_file_contents): Revert code introduced at
2041 2013-01-18 in favor of the simpler and generally better fix.
2042 Save stack space by removing 'buffer' and reusing 'read_buf'
2043 where appropriate.
2044
2045 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2046
2047 * lisp.h (eabs): Define unconditionally (Bug#13419).
2048 The old "#if !defined (eabs)" was an unnecessary revenant of back
2049 when this macro was called "abs". Document 'eabs' better.
2050
2051 2013-01-19 Glenn Morris <rgm@gnu.org>
2052
2053 * fns.c (Frandom): Doc fix.
2054
2055 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2056
2057 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2058 segfault when there are lots of overlays.
2059
2060 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2061 when there are lots of overlays.
2062 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2063 for the details and a way to reproduce.
2064
2065 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2066
2067 * fileio.c: Use O_APPEND to append.
2068 This corresponds better to the natural interpretation of "append",
2069 and avoids the need to open the output file twice, or to invoke
2070 lseek when APPEND is neither nil nor a number.
2071 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2072 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2073 file possibly twice, and lseeking to its end; this avoids the
2074 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2075 at the same time: the combination is never needed and apparently
2076 it doesn't work with DOS_NT.
2077
2078 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2079 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2080
2081 Allow floating-point file offsets.
2082 Problem reported by Vitalie Spinu in
2083 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2084 * fileio.c (emacs_lseek): Remove.
2085 (file_offset): New function.
2086 (Finsert_file_contents, Fwrite_region): Use it.
2087
2088 2013-01-19 Chong Yidong <cyd@gnu.org>
2089
2090 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2091 aborting on Fsignal (Bug#13289).
2092
2093 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2094
2095 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2096 set_file_security as failure due to insufficient privileges.
2097 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2098 (fstat): Return owner and group like 'stat' and 'lstat' do.
2099
2100 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2101
2102 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2103 The bug was observed on Ubuntu operating inside a virtual machine,
2104 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2105 The workaround introduces a race condition on non-buggy hosts,
2106 but it's an unlikely race and anyway there's a nearly identical
2107 nearby race that can't be fixed.
2108 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2109 New static vars.
2110 (Fwrite_region): Test for file system time stamp bug.
2111 (init_fileio): New function.
2112 * lisp.h (init_fileio): Declare it.
2113 * emacs.c (main): Call it.
2114
2115 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2116 and make it more consistent with other stat-failure diagnostics.
2117
2118 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2119
2120 Fix crash when inserting data from non-regular files.
2121 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2122 for the error description produced by valgrind.
2123 * fileio.c (read_non_regular): Rename to read_contents.
2124 Free Lisp_Save_Value object used to pass parameters.
2125 (read_non_regular_quit): Rename to read_contents_quit.
2126 (Finsert_file_contents): Redesign internal file reading loop to adjust
2127 gap and end positions after each read and so help make_gap to work
2128 properly. Do not signal an I/O error too early and so do not leave
2129 not yet decoded characters in a buffer, which was the reason of
2130 redisplay crash. Use list2 to build return value. Adjust comments.
2131
2132 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2133
2134 Close a race when statting and reading files (Bug#13149).
2135 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2136 This avoids a race if the file is renamed between stat and open.
2137 This race is not the problem originally noted in Bug#13149;
2138 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2139
2140 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2141
2142 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2143 objects, related functions and macros.
2144 (make_save_value): Adjust prototype.
2145 (make_save_pointer): New prototype.
2146 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2147 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2148 * alloc.c (format_save_value): Rename to make_save_value.
2149 (make_save_pointer): New function.
2150 (record_xmalloc): Use make_save_pointer.
2151 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2152 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2153 Change users of make_save_value to make_save_pointer.
2154 Likewise for format_save_value and make_save_value.
2155
2156 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2157
2158 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2159 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2160 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2161 debugging stubs.
2162
2163 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2164
2165 * alloc.c (free_save_value): Now static.
2166
2167 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2168
2169 * keymap.c (map_keymap_internal): Use format_save_value.
2170 (map_keymap_char_table_item): Adjust accordingly.
2171 * fileio.c (non_regular_fd, non_regular_inserted)
2172 (non_regular_nbytes): Remove.
2173 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2174 Use format_save_value to pass parameters to read_non_regular.
2175 (read_non_regular): Use XSAVE_ macros to extract parameters.
2176 Adjust comment.
2177 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2178 format_save_value.
2179 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2180
2181 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2182
2183 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2184 extraction from any Lisp_Save_Value slot. Add type checking.
2185 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2186 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2187 * xselect.c: All users changed.
2188
2189 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2190
2191 Some convenient bits to deal with Lisp_Save_Values.
2192 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2193 (allocate_misc): Remove prototype.
2194 (format_save_value): New prototype.
2195 * alloc.c (allocate_misc): Revert back to static.
2196 (format_save_value): New function to build Lisp_Save_Value
2197 object with the specified internal structure.
2198 (make_save_value): Reimplement using format_save_value.
2199 * editfns.c (save_excursion_save): Use format_save_value.
2200 (save_excursion_restore): Use XSAVE_OBJECT.
2201
2202 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2203
2204 Avoid needless casts with XSAVE_POINTER.
2205 * alloc.c (mark_object) [GC_MARK_STACK]:
2206 * dired.c (directory_files_internal_unwind):
2207 * fileio.c (do_auto_save_unwind):
2208 * gtkutil.c (pop_down_dialog):
2209 * keymap.c (map_keymap_char_table_item):
2210 * lread.c (load_unwind):
2211 * nsmenu.m (pop_down_menu):
2212 * print.c (print_object) [GC_MARK_STACK]:
2213 * xfns.c (clean_up_file_dialog):
2214 * xmenu.c (cleanup_widget_value_tree):
2215 Omit casts between XSAVE_POINTER and a pointer type.
2216
2217 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2218
2219 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2220 * eval.c (eval_sub): Protect `form' from being GCed before its
2221 car and cdr becomes protected with the backtrace entry.
2222
2223 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2224
2225 Make Lisp_Save_Value more versatile storage for up to four objects.
2226 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2227 (struct Lisp_Save_Value): New layout. Adjust comments.
2228 (XSAVE_POINTER): New macro.
2229 (XSAVE_INTEGER): Likewise.
2230 (allocate_misc): Add prototype.
2231 (free_misc): Likewise.
2232 * alloc.c (allocate_misc): Now global.
2233 (free_misc): Likewise. Adjust comment.
2234 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2235 (free_save_value): Likewise.
2236 (mark_object): Likewise.
2237 * editfns.c (save_excursion_save): Pack everything within
2238 Lisp_Save_Value and so avoid xmalloc.
2239 (save_excursion_restore): Adjust to match new layout. Use free_misc
2240 because we do not allocate extra memory any more. Add eassert.
2241 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2242 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2243 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2244 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2245 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2246
2247 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2248
2249 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2250 (nsfont_draw): Remove disabling of LCD smoothing.
2251 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2252 Bug#11484 with LCD smoothing on.
2253
2254 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
2255
2256 Fix SIGDANGER handlers, for AIX (Bug#13408).
2257 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2258 Move handlers here from emacs.c; they were out of place.
2259
2260 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2261
2262 * xterm.c (syms_of_xterm): Adjust documentation for
2263 scroll-bar-adjust-thumb-portion.
2264
2265 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2266
2267 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2268 determine whether scroll bar thumb size should be adjusted or
2269 not. Use variable for MOTIF.
2270
2271 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2272 GTK.
2273
2274 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2275
2276 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2277 event is generated.
2278 (doCommandBySelector:): Set processingCompose to NO.
2279
2280 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2281 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2282 (nsfont_list_family): Add block/unblock_input calls.
2283 (nsfont_open): Move block_input earlier. Add unblock_input before early
2284 return.
2285 (nsfont_draw): Add block/unblock_input calls.
2286
2287 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2288
2289 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2290 for old_charpos and old_bytepos.
2291
2292 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2293
2294 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2295 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2296 Clear tzvalbuf_in_environ if this workaround is in effect.
2297 Problem and fix reported by Kazuhiro Ito.
2298
2299 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2300
2301 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2302 Fix ambiguous doc string cross-reference(s).
2303
2304 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2305 doc string cross-reference(s).
2306
2307 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2308 string cross-reference(s).
2309
2310 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2311
2312 Avoid unnecessary byte position calculation for the gap movement.
2313 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2314 anyway, all of them should use move_gap_both instead.
2315 * lisp.h (move_gap): Remove prototype.
2316 * insdel.c (move_gap): Remove.
2317 (move_gap_both): Add eassert.
2318 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2319 * xml.c (parse_region): Likewise.
2320
2321 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2322
2323 emacsclient -t should not suspend Emacs server (Bug#13387)
2324 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2325 New functions.
2326 * term.c (init_tty): Use them instead of rolling our own code.
2327 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2328 switches from 'signal' to 'pthread_sigmask', which is safer in
2329 multithreaded applications.
2330 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2331 which has already arranged for that.
2332 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2333 This is the main part of the bug fix.
2334
2335 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
2336
2337 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2338 x_last_font_name (Bug#13403).
2339
2340 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2341
2342 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2343 the type of per-buffer values where appropriate.
2344 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2345 predicate, which is how it's really used now. Adjust comment.
2346 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2347 * buffer.c (buffer_slot_type_mismatch): Remove.
2348 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2349 predicate. Adjust comment.
2350 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2351 fill-column, left-margin, tab-width, buffer-saved-size,
2352 left-margin-width, right-margin-width, left-fringe-width,
2353 right-fringe-width, scroll-bar-width and buffer-display-count.
2354 Use Qstringp for default-directory, buffer-file-name,
2355 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2356 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2357 line-spacing.
2358 * data.c (store_symval_forwarding): Adjust to call the predicate.
2359
2360 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
2361
2362 * w32.c (get_name_and_id, acl_set_file):
2363 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2364
2365 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2366
2367 * lisp.h (make_gap_1): New prototype.
2368 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2369 gap size values.
2370 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2371 naming convention.
2372 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2373 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
2374 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2375 (make_gap_1): New function to adjust the gap of any buffer.
2376 * coding.c (coding_alloc_by_making_gap): Use it.
2377 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2378 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2379
2380 2013-01-08 Juri Linkov <juri@jurta.org>
2381
2382 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2383 of (supports :underline (:style wave)). (Bug#13000)
2384
2385 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2386
2387 * undo.c (Fprimitive_undo): Move to simple.el.
2388 (syms_of_undo): Remove declarations for Sprimitive_undo.
2389
2390 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2391
2392 * keyboard.c (echo_add_key): Rename from echo_add_char.
2393
2394 2013-01-06 Chong Yidong <cyd@gnu.org>
2395
2396 * keyboard.c (echo_add_char): New function, factored out from
2397 echo_char. Don't add a space if the previous echo string was
2398 empty (Bug#13255).
2399 (echo_char): Use it.
2400 (read_key_sequence): When echoing mock input, ensure that the
2401 trailing dash is properly added.
2402
2403 2013-01-05 Eli Zaretskii <eliz@gnu.org>
2404
2405 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2406 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
2407 digits for buffer positions, before misalignment starts.
2408 Display "0" for integer "object" field.
2409 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2410 Display the newline glyph more unambiguously.
2411
2412 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2413
2414 * nsterm.m (ns_draw_underwave):
2415 * w32term.c (w32_draw_underwave):
2416 * xterm.c (x_draw_underwave): Make underwave look more triangular
2417 and also degrade gracefully for small fonts. (Bug#13000)
2418
2419 * nsterm.m (ns_draw_text_decoration):
2420 * w32term.c (x_draw_glyph_string):
2421 * xterm.c (x_draw_glyph_string): Don't use previous underline
2422 thickness and position if previous underline type is underwave.
2423
2424 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2425
2426 * fileio.c (Ffile_acl): Undocument return format.
2427
2428 2013-01-02 Glenn Morris <rgm@gnu.org>
2429
2430 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2431
2432 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2433
2434 Simplify via eabs.
2435 * dired.c (file_name_completion):
2436 * doc.c (get_doc_string):
2437 * floatfns.c (round2):
2438 * font.c (font_score, font_delete_unmatched):
2439 * fringe.c (compute_fringe_widths):
2440 * lread.c (read_list):
2441 * minibuf.c (Ftry_completion):
2442 * term.c (tty_ins_del_lines):
2443 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2444 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2445
2446 2012-12-31 Eli Zaretskii <eliz@gnu.org>
2447
2448 * w32.c (unsetenv): Set up the string passed to _putenv
2449 correctly.
2450 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
2451 for the bug this caused.
2452
2453 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2454
2455 * coding.c (Qmac): Now static.
2456
2457 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2458
2459 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2460 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2461 handlebox_widget. Set toolbar_in_hbox to false/true, set
2462 toolbar_is_packed to true.
2463 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2464 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2465 Show all on TOOLBAR_TOP_WIDGET.
2466 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2467 by TOOLBAR_TOP_WIDGET.
2468 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2469 Check toolbar_is_packed.
2470 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2471 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2472 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2473 false.
2474 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2475 (xg_update_menubar): Update title only if
2476 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2477 (xg_update_submenu): Skip tearoff only if
2478 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2479 (xg_initialize): Initialize xg_detached_menus only if
2480 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2481
2482 * xterm.h (struct x_output): Surround handlebox_widget with
2483 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2484 toolbar_in_hbox is bool.
2485
2486 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2487
2488 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2489 (LIBS_GNUSTEP): Define.
2490 (LIBES): Add $(LIBS_GNUSTEP).
2491 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2492
2493 2012-12-30 Eli Zaretskii <eliz@gnu.org>
2494
2495 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2496 continuation glyph on a TTY with an indication of an empty line.
2497 (Bug#13277)
2498
2499 2012-12-29 Eli Zaretskii <eliz@gnu.org>
2500
2501 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2502 file's SELinux context or ACLs successfully set, nil otherwise.
2503 (Bug#13298)
2504 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
2505
2506 * w32proc.c (reader_thread): Avoid passing NULL handles to
2507 SetEvent and WaitForSingleObject.
2508
2509 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2510
2511 Port EXTERNALLY_VISIBLE to Clang 3.2.
2512 * conf_post.h (__has_attribute): New macro.
2513 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2514
2515 2012-12-27 Glenn Morris <rgm@gnu.org>
2516
2517 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2518 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2519
2520 2012-12-27 Eli Zaretskii <eliz@gnu.org>
2521
2522 * fileio.c (file_name_as_directory, directory_file_name):
2523 Accept an additional argument MULTIBYTE to indicate whether the input C
2524 came from a multibyte or a unibyte Lisp string; all callers
2525 adjusted. Don't assume the input string is always multibyte.
2526 (Bug#13262)
2527 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2528 don't ENCODE_FILE them, and return a unibyte string if the input
2529 was unibyte.
2530 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2531 don't assume the input strings will always be multibyte. If the
2532 input strings are multibyte, decode strings obtained from C
2533 library functions.
2534
2535 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2536
2537 * lisp.h (toplevel): Add two notices to the comment about
2538 defining a new Lisp data type.
2539 * print.c (print_object): If Lisp_Save_Value object's pointer
2540 is the address of a memory area containing Lisp_Objects, try
2541 to print them.
2542 * alloc.c (valid_lisp_object_p): Adjust comment.
2543
2544 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2545
2546 * keyboard.c (record_asynch_buffer_change): Initialize an event
2547 only if it's really needed.
2548 * frame.h (enum output_method): Remove output_mac member since
2549 it's a leftover from the deleted code.
2550 * frame.c (Fframep): Adjust user here ...
2551 * terminal.c (Fterminal_live_p): ... and here.
2552 * coding.c (Qmac): Now here because it's only used to denote
2553 end-of-line encoding type.
2554 (syms_of_coding): DEFSYM it.
2555 * frame.h (Qmac): Remove duplicated declaration.
2556
2557 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2558
2559 * window.c (select_window_1): Now static, since it's used only here.
2560
2561 2012-12-25 Eli Zaretskii <eliz@gnu.org>
2562
2563 * window.c (window_body_cols): Subtract display margins from the
2564 window body width on TTYs as well. See
2565 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2566 for the original report.
2567
2568 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2569
2570 * xdisp.c (redisplay_window): Remove inner local variable
2571 because the outer shadowed one has the same meaning.
2572 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2573 set but never used.
2574 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2575 (xg_create_tool_bar): Adjust users.
2576
2577 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2578
2579 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2580 * buffer.c (Fget_buffer_create): Use it to set compact field of
2581 struct buffer_text to avoid accessing an uninitialized value
2582 when compact_buffer is called for the first time.
2583 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2584 (Fset_buffer_modified_p): Use buffer_window_count to check
2585 whether the buffer is displayed in some window.
2586 * xdisp.c (message_dolog): Likewise.
2587
2588 2012-12-23 Eli Zaretskii <eliz@gnu.org>
2589
2590 * w32.c (acl_set_file): If setting the file security descriptor
2591 fails, and the new DACL is identical to the existing one, silently
2592 return success. This fixes problems for users backing up their
2593 own files without having the necessary privileges for setting
2594 security descriptors.
2595
2596 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2597 values.
2598 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2599 after WaitForSingleObject returns normally. This expedites reader
2600 thread shutdown when delete_child triggers it.
2601 (reap_subprocess): More accurate commentary for why we call
2602 delete_child only when cp->fd is negative.
2603
2604 * w32.c (sys_close): Do not call delete_child on a subprocess
2605 whose handle is not yet closed. Instead, set its file descriptor
2606 to a negative value, so that reap_subprocess will call
2607 delete_child on that subprocess when its SIGCHLD arrives.
2608 This avoids closing handles used for communications between sys_select
2609 and reader_thread, which doesn't give sys_select a chance to
2610 notice that the process exited and invoke the SIGCHLD handler for
2611 it.
2612
2613 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2614
2615 * nsfns.m (Fns_do_applescript): Run event loop until script has
2616 been executed (Bug#12969).
2617 (ns_run_ascript): Chech as_script for nil, set to nil after
2618 executing script.
2619
2620 2012-12-22 Martin Rudalics <rudalics@gmx.at>
2621
2622 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2623
2624 2012-12-22 Eli Zaretskii <eliz@gnu.org>
2625
2626 * w32term.c (w32fullscreen_hook): New function.
2627 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2628
2629 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2630
2631 * fileio.c (Finsert_file_contents): Doc fix.
2632
2633 * w32proc.c (new_child, delete_child, find_child_pid): For a
2634 subprocess, consider its slot being in use as long as its process
2635 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2636 slot when a new process is started immediately after killing
2637 another one, without waiting enough time for the first process to
2638 be reaped and resources allocated for it be orderly freed.
2639 (Bug#13086)
2640 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2641
2642 2012-12-21 Chong Yidong <cyd@gnu.org>
2643
2644 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2645
2646 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2647
2648 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2649
2650 * w32.c (get_name_and_id): Always pass NULL as the first argument
2651 of lookup_account_sid. Avoids crashes with UNC file names that
2652 refer to DFS domains, not to specific machine names. (Bug#12621)
2653 Remove now unused argument FNAME; all callers changed.
2654 (get_file_owner_and_group): Remove now unused argument FNAME; all
2655 callers changed.
2656
2657 2012-12-21 Chong Yidong <cyd@gnu.org>
2658
2659 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2660 error for invalid chars, don't check for a nil return value.
2661
2662 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2663
2664 Avoid calls to CHAR_TO_BYTE if byte position is known.
2665 * editfns.c (make_buffer_string_both): Use move_gap_both.
2666 (Fbuffer_string): Use make_buffer_string_both.
2667 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2668 Adjust comment.
2669 (buf_bytepos_to_charpos): Likewise.
2670 (charpos_to_bytepos): Remove.
2671 * fileio.c (Finsert_file_contents): Use move_gap_both.
2672 * search.c (Freplace_match): Likewise.
2673 * process.c (process_send_region): Likewise. Use convenient
2674 names for byte positions.
2675 * lisp.h (charpos_to_bytepos): Remove prototype.
2676 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2677 * insdel.c (move_gap): Likewise.
2678
2679 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2680
2681 * xdisp.c (redisplay_internal): Remove now-unused local.
2682
2683 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2684
2685 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2686 (redisplay_internal): Don't bother selecting the frame to get the
2687 proper value of frame-local variables (bug#13225).
2688
2689 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2690
2691 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2692 Rename 4th argument since it may be buffer or string. Adjust comment.
2693 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2694
2695 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2696
2697 * coding.c (Fdetect_coding_region): Do not check start and end with
2698 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2699 (code_convert_region): Likewise.
2700
2701 2012-12-18 Eli Zaretskii <eliz@gnu.org>
2702
2703 * w32.c (acl_get_file, acl_set_file): Run the file name through
2704 map_w32_filename, and resolve any symlinks in the file name, like
2705 Posix platforms do.
2706 (acl_set_file): Call revert_to_self, if any privileges were
2707 enabled.
2708
2709 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
2710
2711 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2712 ($(BLD)/w32.$(O)): Update dependencies.
2713
2714 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2715
2716 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2717 propagate redisplay's scrolling (if any) to the right window.
2718 (redisplay_internal): Use ensure_selected_frame.
2719 (display_mode_lines): Complete last fix.
2720 * window.c (select_window_1): New func, extracted from select_window.
2721 (select_window): Use it.
2722 * window.h (select_window_1): Declare.
2723
2724 2012-12-17 Eli Zaretskii <eliz@gnu.org>
2725
2726 Emulate Posix ACL APIs on MS-Windows.
2727 * w32.c: Include sddl.h and sys/acl.h.
2728 (SDDL_REVISION_1): Define if not already defined.
2729 (g_b_init_get_security_descriptor_dacl)
2730 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2731 (g_b_init_is_valid_security_descriptor)
2732 (g_b_init_set_file_security): New static flags.
2733 (globals_of_w32): Initialize them to zero.
2734 (SetFileSecurity_Name): New string constant.
2735 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2736 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2737 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2738 (IsValidSecurityDescriptor_Proc): New typedefs.
2739 (get_file_security, get_security_descriptor_owner)
2740 (get_security_descriptor_group): Set errno to ENOTSUP.
2741 (set_file_security, get_security_descriptor_dacl)
2742 (is_valid_security_descriptor, convert_sd_to_sddl)
2743 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2744 (acl_free, acl_get_file, acl_set_file): New functions.
2745
2746 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2747
2748 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2749
2750 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2751 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2752 for some of that bug's symptoms can now cause Emacs to abort.
2753 Remove the workaround.
2754 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2755 The bug that caused SIGCHLD to get lost has been fixed, and the
2756 workaround for it can now cause Emacs to abort.
2757
2758 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2759
2760 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2761 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2762 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2763
2764 2012-12-16 Romain Francoise <romain@orebokech.com>
2765
2766 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2767 (Fcopy_file): Change last arg to `preserve_extended_attributes'
2768 and copy ACL entries of file in addition to SELinux context if set.
2769 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2770
2771 * Makefile.in (LIBACL_LIBS): New macro.
2772 (LIBES): Use it.
2773
2774 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2775
2776 * fileio.c (internal_delete_file): Use bool for boolean.
2777
2778 2012-12-15 Eli Zaretskii <eliz@gnu.org>
2779
2780 Fix bug #13079 on MS-Windows with temp files not being deleted.
2781 * w32.h (_child_process): New members input_file and
2782 pending_deletion.
2783 (register_child): First argument is now pid_t.
2784 (record_infile, record_pending_deletion): New prototypes.
2785
2786 * w32proc.c (new_child): Initialize input_file and
2787 pending_deletion members of the child.
2788 (delete_child): Delete the child's temporary input file, if any,
2789 that is pending deletion.
2790 (register_child): First argument is now pid_t.
2791 (record_infile, record_pending_deletion): New functions.
2792 (reap_subprocess): Fix a typo in DebPrint string.
2793 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2794
2795 * fileio.c (internal_delete_file): Return an int again: non-zero
2796 if delete-file succeeds, zero otherwise.
2797
2798 * lisp.h (internal_delete_file): Adjust prototype.
2799
2800 * callproc.c (Fcall_process): Don't overwrite infile with result
2801 of DECODE_FILE.
2802 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2803 asynchronous subprocess, record the name of the input file name,
2804 if any.
2805 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2806 delete the file, record it as pending deletion when the subprocess
2807 exits.
2808
2809 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2810
2811 * editfns.c [HAVE_PWD_H]: Include grp.h.
2812
2813 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2814
2815 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2816
2817 Fix permissions bugs with setgid directories etc. (Bug#13125)
2818 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2819 to mark it as a placeholder. The old value was often wrong.
2820 The only user of this attribute has been changed to use
2821 file-ownership-preserved-p instead, with its new group arg.
2822 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2823
2824 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2825
2826 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2827 Keep selected_window and selected_frame in sync.
2828
2829 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2830
2831 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2832 try to get accurate owner and group information from NT file
2833 security APIs. This is to make most callers of 'stat' and
2834 'lstat', which don't need that information, much faster.
2835
2836 * dired.c (Ffile_attributes) [WINDOWSNT]:
2837 Set w32_stat_get_owner_group to a non-zero value, to request accurate
2838 owner and group information from 'lstat'.
2839
2840 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2841
2842 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2843 as that confuses set-auto-coding, so insist on the head-read
2844 returning the full 1024 bytes. Let lseek compute the tail offset;
2845 less work for us. Do not ignore I/O errors when reading the tail.
2846
2847 * xdisp.c: Minor style fixes.
2848 (init_iterator): Hoist assignment out of if-expression.
2849 (markpos_of_region): Callers now test for sign, not for -1.
2850
2851 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2852
2853 Minor redisplay optimization when the region length is zero.
2854 * xdisp.c (markpos_of_region): New function.
2855 (init_iterator): Do not highlight the region of zero length.
2856 (redisplay_window): Check whether the region is of non-zero length.
2857 (try_cursor_movement): Allow if the region length is zero.
2858 (try_window_reusing_current_matrix, try_window_id): Likewise.
2859
2860 2012-12-13 Eli Zaretskii <eliz@gnu.org>
2861
2862 * search.c (search_buffer): Check the inverse translations of each
2863 character in pattern when the buffer being searched is unibyte.
2864 (Bug#13084)
2865
2866 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2867
2868 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2869 files, fixing a regression from 24.2.
2870 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
2871
2872 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2873
2874 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2875 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2876 Remove unnecessary S_ISLNK test, as (contra the comments) this
2877 function can't copy symlinks. Improve quality of error message
2878 when attempting to copy files that are neither regular files nor
2879 directories.
2880
2881 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2882
2883 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2884 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2885 * window.c (Frecenter):
2886 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2887 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2888
2889 2012-12-12 Daniel Colascione <dancol@dancol.org>
2890
2891 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
2892 the dumped Emacs is not a sparse file, greatly improving Cygwin
2893 "make bootstrap" performance.
2894
2895 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
2896
2897 * inotify.c (inotify_callback): Generate an Emacs event for every
2898 incoming inotify event.
2899
2900 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2901
2902 * xdisp.c (handle_face_prop): Fix logic of computing
2903 it->start_of_box_run_p.
2904 (append_space_for_newline): If the glyph row is R2L, reset the
2905 iterator's end_of_box_run_p flag before prepending the space glyph.
2906 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2907 iterator's start_of_box_run_p flag before prepending the stretch.
2908 (append_glyph, produce_image_glyph, append_composite_glyph)
2909 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2910 left_box_line_p and right_box_line_p flags of the glyph for R2L
2911 glyph rows. (Bug#13011)
2912
2913 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2914
2915 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2916 if changed buffer is not shown in a window.
2917 * insdel.c (prepare_to_modify_buffer): Likewise.
2918 * window.c (replace_buffer_in_windows_safely): Do nothing
2919 if buffer is not shown in a window.
2920 (Fforce_window_update): Likewise if string or buffer argument
2921 is passed.
2922
2923 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2924
2925 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2926 encoded_file_name, which is what it is.
2927
2928 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2929
2930 Consistently use marker_position and marker_byte_position.
2931 * fringe.c (Ffringe_bitmaps_at_pos):
2932 * indent.c (Fvertical_motion):
2933 * insdel.c (prepare_to_modify_buffer):
2934 * keyboard.c (make_lispy_position):
2935 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2936 (window_scroll_pixel_based, displayed_window_lines)
2937 (Fset_window_configuration):
2938 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2939 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2940 Replace direct access to marker fields with calls
2941 to marker_position and/or marker_byte_position.
2942
2943 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
2944
2945 * makefile.w32-in (SIG2STR_H): New macro.
2946 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2947 ($(BLD)/w32notify.$(O)): Update dependencies.
2948
2949 2012-12-10 Daniel Colascione <dancol@dancol.org>
2950
2951 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2952 Windows file notification functionality unless WINDOWSNT.
2953
2954 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2955 declarations.
2956
2957 * w32fns.c (cache_system_info): Initialize the global hinst
2958 variable here so various initialization calls DTRT.
2959
2960 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
2961 (hinst): Remove unneeded extern declaration.
2962 (_start): Remove initialization of above variables; remove
2963 initialization of hinst, as cache_system_info now does that.
2964
2965 * emacs.c (main): Call cache_system_info early in startup; we
2966 previously weren't calling it in Cygwin builds.
2967
2968 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2969 Teach the autoconf build system how to compile a Windows resource file
2970 and link it to Emacs.
2971
2972 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2973
2974 Per-buffer window counters.
2975 * buffer.h (struct buffer): New member window_count.
2976 (buffer_window_count): New function.
2977 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2978 Initialize window_count.
2979 (Fkill_buffer): Verify window_count for the buffer being killed.
2980 (modify_overlay): Do not force redisplay if buffer is not shown
2981 in any window.
2982 (init_buffer_once): Initialize window_count for buffer_defaults
2983 and buffer_local_symbols.
2984 * window.h (buffer_shared): Remove declaration.
2985 (wset_buffer): Convert from inline ...
2986 * window.c (wset_buffer): ... to an ordinary function.
2987 (adjust_window_count): New function.
2988 (make_parent_window): Use it.
2989 * xdisp.c (buffer_shared): Remove.
2990 (redisplay_internal, redisplay_window): Adjust users.
2991 (buffer_shared_and_changed): Use per-buffer window counter.
2992
2993 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2994
2995 Support for filesystem notifications on MS-Windows.
2996 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2997 and this is a TTY frame, signal the caller that keyboard input is
2998 available.
2999
3000 * w32xfns.c (drain_message_queue): Now returns an int: an
3001 indication whether any WM_EMACS_FILENOTIFY messages were found in
3002 the queue.
3003
3004 * w32inevt.c (handle_file_notifications): New function.
3005 (w32_console_read_socket): Call it to process file notifications.
3006
3007 * w32console.c (initialize_w32_display): Record the main thread ID
3008 in dwMainThreadId.
3009
3010 * deps.mk (inotify.o): New dependency list.
3011
3012 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3013
3014 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3015 (WM_EMACS_END): Bump value by 1.
3016 (notification_buffer_in_use, file_notifications)
3017 (notifications_size, notifications_desc): Declare.
3018 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3019 Add prototypes.
3020
3021 * w32term.c (lispy_file_action, queue_notifications): New functions.
3022 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3023 <Qrenamed_to>: New symbols.
3024 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3025
3026 * w32notify.c: New file, implements file event notifications for
3027 MS-Windows.
3028
3029 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3030 by posting it to the w32_read_socket queue.
3031
3032 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3033
3034 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3035 (GLOBAL_SOURCES): Add w32notify.c
3036 ($(BLD)/w32notify.$(O)): New set of dependencies.
3037
3038 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3039
3040 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3041 Handle FILE_NOTIFY_EVENT.
3042 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3043 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3044 w32notify-handle-event by default.
3045
3046 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3047 syms_of_w32notify.
3048
3049 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3050
3051 Support for filesystem notifications on GNU/Linux via inotify.
3052 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3053
3054 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3055
3056 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3057 (syms_of_keyboard): DEFSYM it.
3058 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3059 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3060 Qfile_inotify events.
3061 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3062 special-event-map to inotify-handle-event.
3063
3064 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3065
3066 * Makefile.in (base_obj): Add inotify.o.
3067
3068 * inotify.c: New file.
3069
3070 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3071
3072 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3073
3074 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3075
3076 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3077 DWORD_PTR, for compatibility with 64-bit builds.
3078
3079 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3080 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3081 (system_process_attributes): Use SIZE_T rather than DWORD, for
3082 compatibility with 64-bit builds.
3083
3084 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3085
3086 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3087
3088 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3089
3090 * indent.c (Fvertical_motion): If a display string will be
3091 displayed on the left or the right margin, don't consider it as a
3092 factor in cursor positioning. (Bug#13108)
3093
3094 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3095
3096 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3097
3098 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3099
3100 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3101 for string length.
3102
3103 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3104
3105 * w32.c (unsetenv): Return 0 if the input string is too long.
3106
3107 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3108
3109 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3110 * alloc.c (xputenv): New function.
3111 * dbusbind.c (Fdbus_init_bus):
3112 * emacs.c (main):
3113 * xterm.c (x_term_init):
3114 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3115 * editfns.c (initial_tz): Move static var decl up.
3116 (tzvalbuf_in_environ): New static var.
3117 (init_editfns): Initialize these two static vars.
3118 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3119 Save old TZ value on stack, if it's small.
3120 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3121 instead, use xputenv+unsetenv to set and restore TZ.
3122 (environbuf): Remove static var. All uses removed.
3123 (Fset_time_zone_rule): Do not save TZ and environ;
3124 no longer needed here.
3125 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3126 Move to inside set_time_zone_rule; they don't need file scope any more.
3127 (set_time_zone_rule): Maintain the TZ=value string separately.
3128 (syms_of_editfns): Don't initialize initial_tz;
3129 init_editfns now does it.
3130 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3131 * lisp.h (xputenv): New decl.
3132
3133 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3134
3135 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3136
3137 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3138
3139 * w32.c (unsetenv, sys_putenv): New functions.
3140
3141 2012-12-08 Chong Yidong <cyd@gnu.org>
3142
3143 * editfns.c (Finsert_char): Make the error message more
3144 informative (Bug#12992).
3145
3146 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3147
3148 Simplify get_lim_data.
3149 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3150 Remove USG and vlimit methods; no longer used these days.
3151 Add #error catchall just in case.
3152
3153 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3154 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3155 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3156 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3157 (deleted_pid_list, Fdelete_process, create_process)
3158 (record_child_status_change, handle_child_signal, deliver_child_signal)
3159 (init_process_emacs, syms_of_process):
3160 Assume SIGCHLD is defined.
3161 (parse_signal): Remove. All uses removed.
3162 (abbr_to_signal): New static function.
3163 (Fsignal_process): Use it to convert signal names to ints.
3164 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3165 kill (getpgrp (), ...).
3166 (emacs_sigaction_init): Assume SIGCHLD is defined.
3167 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3168 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3169 * syssignal.h (EMACS_KILLPG): Remove.
3170 All uses replaced by 'kill' with a negative pid.
3171 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3172 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3173
3174 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3175
3176 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3177 This will cause a production Emacs to dump core instead of
3178 infinite-looping.
3179
3180 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3181
3182 * frame.c (make_frame): Do not set window's buffer to t.
3183 * window.c (Fsplit_window_internal): Likewise. Previously it was
3184 used to indicate that the window is being set up. Now we use
3185 set_window_buffer for all new windows, so the condition in ...
3186 (Fset_window_buffer): ... is always true and can be removed.
3187
3188 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3189
3190 Convenient macro to check whether the buffer is hidden.
3191 * buffer.h (BUFFER_HIDDEN_P): New macro.
3192 * frame.c (make_frame): Use it. Adjust comment.
3193 * buffer.c (candidate_buffer): New function.
3194 (Fother_buffer, other_buffer_safely): Use it.
3195
3196 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3197
3198 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3199 if the child process is still running. Instead, exit the wait
3200 loop and return zero. (Bug#13086)
3201
3202 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3203
3204 * frame.h (x_char_width, x_char_height): Remove prototypes.
3205 * w32term.h (x_char_width, x_char_height): Likewise.
3206 * xfns.c (x_char_width, x_char_height): Remove.
3207 * w32fns.c (x_char_width, x_char_height): Likewise.
3208 * nsfns.c (x_char_width, x_char_height): Likewise.
3209 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3210 all window frames.
3211 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3212 * keyboard.c (command_loop_1): Remove prototype.
3213 (command_loop_2, top_level_1): Add static to match prototype.
3214
3215 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3216
3217 Fix a recently-introduced delete-process race condition.
3218 * callproc.c, process.h (record_kill_process):
3219 New function, containing part of the old call_process_kill.
3220 (call_process_kill): Use it.
3221 This does not change call_process_kill's behavior.
3222 * process.c (Fdelete_process): Use record_kill_process to fix a
3223 race condition that could cause Emacs to lose track of a child.
3224
3225 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3226
3227 Avoid code duplication between prev_frame and next_frame.
3228 * frame.c (candidate_frame): New function. Add comment.
3229 (prev_frame, next_frame): Use it. Adjust comment.
3230
3231 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3232
3233 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3234 fails, signal an error instead of continuing with an empty
3235 string. (Bug#13079)
3236 Encode expanded temp file pattern before passing it to mkstemp or
3237 mktemp.
3238
3239 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3240 Encode the file name before passing it to dostounix_filename, in
3241 case it will downcase it (under w32-downcase-file-names).
3242 (Bug#12933)
3243
3244 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3245
3246 Minor call-process cleanups.
3247 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3248 at the same time as other platforms, to simplify analysis.
3249 No need for fd0_volatile since we have synch_process_fd.
3250 Avoid needless emacs_close; arg is always negative.
3251
3252 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3253
3254 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3255 processes.
3256
3257 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3258
3259 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3260 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3261 and mouse_face_hidden members to a bitfields.
3262 * frame.h (struct frame): Remove set-but-not-used space_width member.
3263 (FRAME_SPACE_WIDTH): Remove.
3264 * nsterm.m, w32term.c, xterm.c: Adjust users.
3265 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3266 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3267 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3268 members to a bitfields.
3269
3270 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3271
3272 Don't let call-process be a zombie factory (Bug#12980).
3273 Fixing this bug required some cleanup of the signal-handling code.
3274 As a side effect, this change also fixes a longstanding rare race
3275 condition whereby Emacs could mistakenly kill unrelated processes,
3276 and it fixes a bug where a second C-g does not kill a recalcitrant
3277 synchronous process in GNU/Linux and similar platforms.
3278 The patch should also fix the last vestiges of Bug#9488,
3279 a bug which has mostly been fixed on the trunk by other changes.
3280 * callproc.c, process.h (synch_process_alive, synch_process_death)
3281 (synch_process_termsig, sync_process_retcode):
3282 Remove. All uses removed, to simplify analysis and so that
3283 less consing is done inside critical sections.
3284 * callproc.c (call_process_exited): Remove. All uses replaced
3285 with !synch_process_pid.
3286 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3287 These take the role of what used to be in unwind-protect arg.
3288 All uses changed.
3289 (block_child_signal, unblock_child_signal):
3290 New functions, to avoid races that could kill innocent-victim processes.
3291 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3292 (call_process_kill): Record killed processes as deleted, so that
3293 zombies do not clutter up the system. Do this inside a critical
3294 section, to avoid a race that would allow the clutter.
3295 (call_process_cleanup): Fix code so that the second C-g works again
3296 on common platforms such as GNU/Linux.
3297 (Fcall_process): Create the child process in a critical section,
3298 to fix a race condition. If creating an asynchronous process,
3299 record it as deleted so that zombies do not clutter up the system.
3300 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3301 light of these changes. Omit unnecessary call to emacs_close
3302 before failure, as the unwind-protect code does that.
3303 * callproc.c (call_process_cleanup):
3304 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3305 * process.c (record_deleted_pid): New function, containing
3306 code refactored out of Fdelete_process.
3307 (Fdelete_process): Use it.
3308 (process_status_retrieved): Remove. All callers changed to use
3309 child_status_change.
3310 (record_child_status_change): Remove, folding its contents into ...
3311 (handle_child_signal): ... this signal handler. Now, this
3312 function is purely a handler for SIGCHLD, and is not called after
3313 a synchronous waitpid returns; the synchronous code is moved to
3314 wait_for_termination. There is no need to worry about reaping
3315 more than one child now.
3316 * sysdep.c (get_child_status, child_status_changed): New functions.
3317 (wait_for_termination): Now takes int * status and bool
3318 interruptible arguments, too. Do not record child status change;
3319 that's now the caller's responsibility. All callers changed.
3320 Reimplement in terms of get_child_status.
3321 (wait_for_termination_1, interruptible_wait_for_termination):
3322 Remove. All callers changed to use wait_for_termination.
3323 * syswait.h: Include <stdbool.h>, for bool.
3324 (record_child_status_change, interruptible_wait_for_termination):
3325 Remove decls.
3326 (record_deleted_pid, child_status_changed): New decls.
3327 (wait_for_termination): Adjust to API changes noted above.
3328
3329 * bytecode.c, lisp.h (Qbytecode): Remove.
3330 No longer needed after 2012-11-20 interactive-p changes.
3331
3332 2012-12-03 Eli Zaretskii <eliz@gnu.org>
3333
3334 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3335 the scroll margin, move point outside the margin. (Bug#13055)
3336
3337 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3338
3339 * gtkutil.c (my_log_handler): New function.
3340 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3341
3342 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3343
3344 * lisp.h (modify_region): Rename to...
3345 (modify_region_1): ...new prototype.
3346 * textprop.c (modify_region): Now static. Adjust users.
3347 * insdel.c (modify_region): Rename to...
3348 (modify_region_1): ...new function to work with current buffer.
3349 Adjust comment and users. Use true and false for booleans.
3350
3351 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3352
3353 * alloc.c (free_save_value): New function.
3354 (safe_alloca_unwind): Use it.
3355 * lisp.h (free_save_value): New prototype.
3356 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3357 Add comment.
3358 (save_excursion_restore): Adjust to match saved data structure.
3359 Use free_save_value to offload some work from GC. Drop obsolete
3360 #if 0 code.
3361
3362 2012-12-03 Chong Yidong <cyd@gnu.org>
3363
3364 * fileio.c (Vauto_save_list_file_name): Doc fix.
3365
3366 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
3367
3368 * w32fns.c: Remove prototype of atof.
3369 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
3370 builds.
3371 (file_dialog_callback): Make it UINT_PTR.
3372
3373 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3374 with 64-bit builds.
3375
3376 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3377 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3378 defined.
3379
3380 2012-12-03 Glenn Morris <rgm@gnu.org>
3381
3382 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
3383
3384 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3385
3386 Fix xpalloc confusion after memory is exhausted.
3387 * alloc.c (xpalloc): Comment fix.
3388 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3389 and signals an error, do not clear charset_table_size, as
3390 charset_table is still valid.
3391 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3392
3393 Use execve to avoid need to munge environ (Bug#13054).
3394 * callproc.c (Fcall_process):
3395 * process.c (create_process):
3396 Don't save and restore environ; no longer needed.
3397 * callproc.c (child_setup):
3398 Use execve, not execvp, to preserve environ.
3399
3400 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3403
3404 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3405
3406 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3407 display for sliced images (Bug#10500).
3408
3409 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3410
3411 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
3412
3413 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3414 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3415
3416 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3417
3418 * xdisp.c (window_outdated): Remove eassert since it hits
3419 some suspicious corner cases (see Bug#13007 and Bug#13012).
3420 (mode_line_update_needed): New function.
3421 (redisplay_internal, redisplay_window): Use it.
3422 (ensure_selected_frame): New function.
3423 (redisplay_internal, unwind_redisplay): Use it.
3424 (redisplay_internal): Move comment about buffer_shared...
3425 (buffer_shared_and_changed): ...near to its real use.
3426
3427 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3428
3429 * callproc.c (Fcall_process): Don't misreport vfork failure.
3430
3431 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3432
3433 * callproc.c (Fcall_process): Fix vfork portability problems.
3434 Do not assume that fd[0], count, filefd, and save_environ survive
3435 vfork. Fix bug whereby wrong errno value could be reported for
3436 pipe failure. Some minor cleanups, too, as follows. Move buf and
3437 bufsize to the context where they're needed. Change new_argv to
3438 be of type char **, as this is more convenient and avoids casts.
3439 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3440 Now local constants, not macros.
3441
3442 2012-11-18 Kenichi Handa <handa@gnu.org>
3443
3444 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3445 for the variable "f".
3446
3447 2012-11-13 Kenichi Handa <handa@gnu.org>
3448
3449 * font.c (font_unparse_xlfd): Exclude special characters from the
3450 generating XLFD name.
3451
3452 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3453
3454 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3455 * dired.c (stat_uname, stat_gname):
3456 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3457
3458 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3459 * dired.c (directory_files_internal, file_name_completion):
3460 Assume EAGAIN and EINTR are defined.
3461
3462 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3463 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3464 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3465 * lread.c (readbyte_from_file): Assume EINTR is defined.
3466 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3467 Assume EIO and EAGAIN are defined.
3468 * unexcoff.c (write_segment): Assume EFAULT is defined.
3469
3470 2012-11-27 Eli Zaretskii <eliz@gnu.org>
3471
3472 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3473 (Bug#11964)
3474
3475 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3476 highlighting on the frame was cleared. Prevents assertion
3477 violations when repeatedly clicking on the "Top" link of the
3478 "bread-crumbs" in Info buffers.
3479
3480 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3481
3482 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3483
3484 2012-11-24 Ken Brown <kbrown@cornell.edu>
3485
3486 * keyboard.c (HAVE_MOUSE):
3487 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3488 were always defined.
3489
3490 2012-11-24 Eli Zaretskii <eliz@gnu.org>
3491
3492 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3493 between bpos_covered and bpos_max. This fixes cursor display when
3494 several display strings follow each other.
3495
3496 * .gdbinit (pgx): If the glyph's object is a string, display the
3497 pointer to string data, rather than the value of the string object
3498 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3499
3500 * indent.c (Fvertical_motion): If the starting position is covered
3501 by a display string, return to one position before that, to avoid
3502 overshooting it inside move_it_to. (Bug#12930)
3503
3504 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3505
3506 * frame.h (struct frame): Remove display_preempted member
3507 since all users are dead long ago.
3508 * nsterm.h (struct x_output): Use the only dummy member.
3509 * w32menu.c (pending_menu_activation): Remove since not
3510 really used.
3511 (set_frame_menubar): Adjust user.
3512 * w32term.h (struct x_output): Drop outdated #if 0 code.
3513 (struct w32_output): Use bitfields for explicit_parent,
3514 asked_for_visible and menubar_active members.
3515 Drop unused pending_menu_activation member.
3516 * xterm.h (struct x_output): Drop outdated #if 0 code.
3517 Use bitfields for explicit_parent, asked_for_visible,
3518 has_been_visible and net_wm_state_hidden_seen members.
3519
3520 2012-11-23 Eli Zaretskii <eliz@gnu.org>
3521
3522 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3523 of a literal "/". (Bug#12955)
3524 (gl-stamp): Invoke fc.exe directly, not through cmd.
3525
3526 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3527
3528 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3529 * dired.c: Assume HAVE_DIRENT_H.
3530 (NAMLEN): Remove, replacing with ...
3531 (dirent_namelen): New function. All uses changed. Use the GNU macro
3532 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3533 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3534 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3535 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3536 $(NT_INC)/dirent.h.
3537 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3538 * ndir.h: Rename to ../nt/inc/dirent.h.
3539 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3540 Do not include <dirent.h>; no longer needed.
3541 * w32.c: Include <dirent.h> rather than "ndir.h".
3542
3543 2012-11-23 Chong Yidong <cyd@gnu.org>
3544
3545 * xftfont.c (xftfont_open): Remove duplicate assignment.
3546
3547 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3548
3549 * alloc.c (Fgarbage_collect): Unblock input after clearing
3550 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3551 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3552 * msdos.c (IT_frame_up_to_date): Use it here...
3553 * w32term.c (w32_frame_up_to_date): ...here...
3554 * xterm.c (XTframe_up_to_date): ...and here...
3555 * nsterm.m (ns_frame_up_to_date): ...but not here.
3556 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3557 Adjust users.
3558 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3559 Do not check whether GC is in progress.
3560
3561 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3562
3563 * xdisp.c (window_buffer_changed): New function.
3564 (update_menu_bar, update_tool_bar): Use it to
3565 simplify large 'if' statements.
3566 (redisplay_internal): Generalize commonly used
3567 'tail' and 'frame' local variables.
3568
3569 2012-11-22 Eli Zaretskii <eliz@gnu.org>
3570
3571 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3572 with Windows system header.
3573
3574 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3575
3576 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3577 * alloc.c: Assume unistd.h exists.
3578 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3579 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3580 (getwd) [USG]: Remove; no longer needed.
3581 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3582 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3583 * w32.h (getcwd): Remove decl.
3584
3585 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3586
3587 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3588 Make it set selected_window as well.
3589 (update_tool_bar): Use it.
3590
3591 2012-11-21 Ken Brown <kbrown@cornell.edu>
3592
3593 * emacs.c (main): Set the G_SLICE environment variable for all
3594 Cygwin builds, not just GTK builds. See
3595 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3596
3597 2012-11-21 Eli Zaretskii <eliz@gnu.org>
3598
3599 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3600 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3601 Define for the MSVC compiler.
3602
3603 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
3604
3605 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3606 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3607 dostounix_filename. Prevents crashes down the road, because
3608 dostounix_filename assumes it gets a unibyte string.
3609 Reported by Michel de Ruiter <michel@sentient.nl>, see
3610 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3611
3612 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3613
3614 Conflate Qnil and Qunbound for `symbol-function'.
3615 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3616 * lread.c (init_obarray): Set `function' fields to Qnil.
3617 * eval.c (Fcommandp): Ignore Qunbound.
3618 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3619 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3620 Test NILP rather than Qunbound.
3621 (Ffmakunbound): Set to Qnil.
3622 (Fsymbol_function): Never signal an error.
3623 (Finteractive_form): Ignore Qunbound.
3624
3625 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3626
3627 * eval.c (interactive_p): Remove no-longer-used decl.
3628
3629 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3630
3631 * xdisp.c (buffer_shared): Adjust comment.
3632 (buffer_shared_and_changed): New function.
3633 (prepare_menu_bars, redisplay_internal): Use it to
3634 decide whether all windows or frames should be updated.
3635 (window_outdated): New function.
3636 (text_outside_line_unchanged_p, redisplay_window): Use it.
3637 (redisplay_internal): Likewise. Fix indentation.
3638
3639 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3640
3641 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3642 (syms_of_eval): Remove corresponding defsubr.
3643 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3644
3645 2012-11-19 Daniel Colascione <dancol@dancol.org>
3646
3647 * w32fns.c (Fx_file_dialog):
3648 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3649 cygwin_convert_file_name*.
3650
3651 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3652 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3653
3654 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3655
3656 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3657
3658 2012-11-18 Eli Zaretskii <eliz@gnu.org>
3659
3660 * w32select.c: Include w32common.h before w32term.h, so that
3661 windows.h gets included before w32term.h uses some of its
3662 features, see below.
3663
3664 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3665 New typedefs.
3666 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3667 New prototypes.
3668 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3669
3670 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
3671
3672 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3673 (ns_select): Return at once if events are held (Bug#12834).
3674
3675 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
3676
3677 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3678 Needed following 2012-10-20 change. (Bug#12902)
3679
3680 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
3681
3682 * w32proc.c (waitpid): Remove unused label get_result.
3683
3684 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
3685
3686 * makefile.w32-in (SYSWAIT_H): New macro.
3687 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3688 ($(BLD)/sysdep.$(O)): Update dependencies.
3689
3690 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3691
3692 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3693 * callproc.c (relocate_fd): Assume F_DUPFD.
3694 * emacs.c, term.c (O_RDWR): Remove.
3695 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3696 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3697 * nsterm.m: Assume <fcntl.h> exists.
3698 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3699 (create_pty, Fmake_network_process, server_accept_connection)
3700 (wait_reading_process_output, init_process_emacs):
3701 Assume O_NONBLOCK.
3702 (wait_reading_process_output): Put in a special case for WINDOWSNT
3703 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3704 It's not clear this is needed, but it's a more-conservative change.
3705 (create_process): Assume FD_CLOEXEC.
3706 (create_process, create_pty): Assume O_NOCTTY.
3707 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3708 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3709 Omit if not DOS_NT, since F_GETFL is not defined there.
3710 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3711 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3712 (O_NOCTTY): Remove.
3713 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3714 lack it, since gnulib guarantees this.
3715 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3716
3717 2012-11-17 Eli Zaretskii <eliz@gnu.org>
3718
3719 * w32.c (faccessat): Pretend that directories have the execute bit
3720 set. Emacs expects that, e.g., in files.el:cd-absolute.
3721
3722 * w32proc.c (create_child): Don't clip the PID of the child
3723 process to fit into an Emacs integer, as this is no longer a
3724 restriction.
3725 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3726 reaping only the process specified by PID argument, if that is
3727 positive. Use PID instead of dead_child to know which process to
3728 reap. Wait for the child to die only if WNOHANG is not in
3729 OPTIONS.
3730 (sys_select): Don't set dead_child.
3731
3732 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3733 as it is no longer needed.
3734
3735 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3736 no longer needed.
3737 (record_child_status_change): Remove the setting of
3738 record_at_most_one_child for the !WNOHANG case.
3739
3740 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3741
3742 Fix problems in ns port found by static checking.
3743 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3744 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3745 not to process group.
3746 (ns_select): Use emacs_write, not write, as that's more robust
3747 in the presence of signals.
3748 (fd_handler:): Check for read errors.
3749
3750 2012-11-16 Glenn Morris <rgm@gnu.org>
3751
3752 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3753
3754 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
3755
3756 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3757
3758 2012-11-16 Eli Zaretskii <eliz@gnu.org>
3759
3760 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3761 use the same value of thread handle.
3762 (start_timer_thread): If the timer thread exited (due to error),
3763 clean up by closing the two handles it used. Duplicate the caller
3764 thread's handle here, so it gets duplicated only once, when
3765 launching the timer thread. Set priority of the timer thread, not
3766 the caller thread.
3767 (getitimer): Don't duplicate the caller thread's handle here.
3768 (Bug#12832)
3769
3770 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
3771
3772 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3773 called (Bug#12834).
3774
3775 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3776
3777 Remove no-longer-used pty_max_bytes variable.
3778 * process.c (pty_max_bytes): Remove; unused.
3779 (send_process): Do not set it.
3780
3781 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
3782
3783 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3784 Update dependencies.
3785
3786 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3787
3788 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3789 This follows up on the 2012-09-29 patch that removed indirection
3790 for the 'function' field. Reported by Sergey Vinokurov in
3791 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3792
3793 2012-11-14 Eli Zaretskii <eliz@gnu.org>
3794
3795 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3796 different name, as the MS runtime does not have such a function,
3797 and probably never will.) All callers changed. Ignore DIRFD
3798 value if PATH is an absolute file name, to match Posix spec
3799 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3800 symlinks.
3801
3802 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3803
3804 * xdisp.c (echo_area_display, redisplay_internal):
3805 Omit redundant check whether frame_garbaged is set.
3806
3807 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3808
3809 Use faccessat, not access, when checking file permissions (Bug#12632).
3810 This fixes a bug that has been present in Emacs since its creation.
3811 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3812 which must set some sort of record. (Torek's bug report was against
3813 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3814 same common flaw.) See Torek's Usenet posting
3815 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3816 Posted: Fri Apr 8 14:18:56 1983.
3817 * Makefile.in (LIB_EACCESS): New macro.
3818 (LIBES): Use it.
3819 * callproc.c (init_callproc):
3820 * charset.c (init_charset):
3821 * fileio.c (check_existing, check_executable, check_writable)
3822 (Ffile_readable_p):
3823 * lread.c (openp, load_path_check):
3824 * process.c (allocate_pty):
3825 * xrdb.c (file_p):
3826 Use effective UID when checking permissions, not real UID.
3827 * callproc.c (init_callproc):
3828 * charset.c (init_charset):
3829 * lread.c (load_path_check, init_lread):
3830 Test whether directories are accessible, not merely whether they exist.
3831 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3832 * fileio.c (check_existing, check_executable, check_writable)
3833 (Ffile_readable_p):
3834 Use symbolic names instead of integers for the flags, as they're
3835 portable now.
3836 (check_writable): New arg AMODE. All uses changed.
3837 Set errno on failure.
3838 (Ffile_readable_p): Use faccessat, not stat + open + close.
3839 (Ffile_writable_p): No need to call check_existing + check_writable.
3840 Just call check_writable and then look at errno. This saves a syscall.
3841 dir should never be nil; replace an unnecessary runtime check
3842 with an eassert. When checking the parent directory of a nonexistent
3843 file, check that the directory is searchable as well as writable, as
3844 we can't create files in unsearchable directories.
3845 (file_directory_p): New function, which uses 'stat' on most platforms
3846 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3847 (Ffile_directory_p, Fset_file_times): Use it.
3848 (file_accessible_directory_p): New function, which uses a single
3849 syscall for efficiency.
3850 (Ffile_accessible_directory_p): Use it.
3851 * xrdb.c (file_p): Use file_directory_p.
3852 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3853 * lread.c (openp): When opening a file, use fstat rather than
3854 stat, as that avoids a permissions race. When not opening a file,
3855 use file_directory_p rather than stat.
3856 (dir_warning): First arg is now a usage string, not a format.
3857 Use errno. All uses changed.
3858 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3859 that merely introduced a race.
3860 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3861 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3862 and similarly for the other O_* flags.
3863 * w32.c (sys_faccessat): Rename from sys_access and switch to
3864 faccessat's API. All uses changed.
3865 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3866 (magic_db): Rename from magic_file_p.
3867 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3868 char *, so that we don't have to test for file existence
3869 separately from opening the file for reading. This removes a race
3870 fixes a permission-checking problem, and simplifies the code.
3871 All uses changed.
3872 (file_p): Remove; no longer needed.
3873
3874 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3875
3876 Omit glyphs initialization at startup.
3877 * dispnew.c (glyphs_initialized_initially_p): Remove.
3878 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3879 (Fredraw_frame): Move actual code from here...
3880 (redraw_frame): ...to here. Add eassert. Adjust comment.
3881 (Fredraw_display): Use redraw_frame.
3882 * xdisp.c (clear_garbaged_frames): Likewise.
3883
3884 2012-11-13 Eli Zaretskii <eliz@gnu.org>
3885
3886 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3887 passed to pint2str and pint2hrstr to be at most the size of the
3888 frame's decode_mode_spec_buffer. This avoids crashes with very
3889 large values of FIELD_WIDTH argument to decode_mode_spec.
3890 (Bug#12867)
3891
3892 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3893
3894 Fix a race with verify-visited-file-modtime (Bug#12863).
3895 Since at least 1991 Emacs has ignored an mtime difference of no
3896 more than one second, but my guess is that this was to work around
3897 file system bugs that were fixed long ago. Since the race is
3898 causing problems now, let's remove that code.
3899 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3900 whose time stamp is off by no more than a second. Insist that the
3901 file time stamps match exactly.
3902
3903 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3904
3905 * frame.h (struct frame): Convert external_tool_bar member to
3906 1-bit unsigned bitfield.
3907 * termhooks.h (struct terminal): Remove mouse_moved member since
3908 all users are long dead. Adjust comment on mouse_position_hook.
3909
3910 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3911
3912 Simplify by using FOR_EACH_FRAME here and there.
3913 * frame.c (next_frame, prev_frame, other_visible_frames)
3914 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3915 * w32term.c (x_window_to_scroll_bar): Likewise.
3916 * window.c (window_list): Likewise.
3917 * xdisp.c (x_consider_frame_title): Likewise.
3918 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3919 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3920 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3921 * xmenu.c (menubar_id_to_frame): Likewise.
3922 * xselect.c (frame_for_x_selection): Likewise.
3923 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3924 (x_window_to_menu_bar): Likewise.
3925 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3926
3927 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3928
3929 * data.c (Qdefalias_fset_function): Now static.
3930
3931 Another tweak to vectorlike_header change.
3932 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3933 Remove, and replace all uses with ...
3934 (next_in_free_list, set_next_in_free_list):
3935 New functions, which respect C's aliasing rules better.
3936
3937 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3938
3939 * window.c (list4i): Rename from 'quad'. All uses changed.
3940 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3941
3942 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
3943
3944 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3945 warning about mixing declarations and code in ISO C90.
3946
3947 2012-11-10 Martin Rudalics <rudalics@gmx.at>
3948
3949 * window.c (Fsplit_window_internal): Set combination limit of
3950 new parent window to t iff Vwindow_combination_limit is t;
3951 fixing a regression introduced with the change from 2012-09-22.
3952 (Fset_window_combination_limit): Fix doc-string.
3953
3954 2012-11-10 Eli Zaretskii <eliz@gnu.org>
3955
3956 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3957 amount when the scroll margins are too large. When scrolling
3958 backwards in the buffer, give up if cannot reach point or the
3959 scroll margin within a reasonable number of screen lines.
3960 Fixes point position in window under scroll-up/down-aggressively when
3961 point is positioned many lines beyond the window top/bottom.
3962 (Bug#12811)
3963
3964 * ralloc.c (relinquish): If real_morecore fails to return memory
3965 to the system, don't crash; instead, leave the last heap
3966 unchanged and return. (Bug#12774)
3967
3968 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3969
3970 * lisp.h (AUTOLOADP): New macro.
3971 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3972 * data.c (Ffset): Remove special ad-advice-info handling.
3973 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3974 (Fsubr_arity): CSE.
3975 (Finteractive_form): Simplify.
3976 (Fquo): Don't insist on having at least 2 arguments.
3977 (Qdefalias_fset_function): New var.
3978
3979 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3980
3981 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3982
3983 * nsfont.m (Qcondensed, Qexpanded): New variables.
3984 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3985 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3986
3987 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3988
3989 Fix recently introduced crash on MS-Windows (Bug#12839).
3990 * w32term.h (struct scroll_bar): Use convenient header.
3991 (SCROLL_BAR_VEC_SIZE): Remove.
3992 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3993
3994 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3995
3996 Tweak last vectorlike_header change.
3997 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3998 vectorlike object on the free list. This is introduced to avoid
3999 some (but not all) pointer casting and aliasing problems, see
4000 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4001 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4002 objects.
4003 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4004
4005 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4006
4007 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4008 been removed, so remove them here also.
4009
4010 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4011
4012 * doc.c (Fdocumentation): Handle new property
4013 dynamic-docstring-function to replace the old ad-advice-info.
4014
4015 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4016
4017 * fns.c (Qeql, hashtest_eq): Now static.
4018
4019 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4020
4021 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4022 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4023 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4024 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4025
4026 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4027
4028 Use same hash function for hashfn_profiler as for hash_string etc.
4029 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4030 * lisp.h (sxhash_combine): New inline function, with the contents
4031 of the old SXHASH_COMBINE.
4032 * profiler.c (hashfn_profiler): Use it, instead of having a
4033 special hash function containing a comparison that always yields 1.
4034
4035 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4036
4037 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4038 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4039 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4040 Remove unused vars.
4041
4042 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4043
4044 * image.c (xpm_make_color_table_h): Fix compiler error because
4045 make_hash_table changed.
4046
4047 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4048
4049 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4050
4051 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4052
4053 Use ad-hoc comparison function for the profiler's hash-tables.
4054 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4055 (make_log): Use them.
4056 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4057 call Fequal any more.
4058 (Ffunction_equal): New function.
4059 (cmpfn_profiler, hashfn_profiler): New functions.
4060 (syms_of_profiler): Initialize them.
4061 * lisp.h (struct hash_table_test): New struct.
4062 (struct Lisp_Hash_Table): Use it.
4063 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4064 * fns.c (make_hash_table): Take a struct to describe the test.
4065 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4066 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4067 (hash_lookup, hash_remove_from_table): Move assertion checking of
4068 hashfn result here. Check hash-equality before calling cmpfn.
4069 (Fmake_hash_table): Adjust call to make_hash_table.
4070 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4071 (syms_of_fns): Initialize them.
4072 * emacs.c (main): Move syms_of_fns earlier.
4073 * xterm.c (syms_of_xterm):
4074 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4075 * print.c (print_object): Adjust to new hash-table struct.
4076 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4077
4078 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4079
4080 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4081 value of w32-scroll-lock-modifier is neither nil nor one of the
4082 known key modifiers. (Bug#12806)
4083
4084 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4085
4086 Shrink struct vectorlike_header to the only size field.
4087 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4088 Adjust comment.
4089 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4090 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4091 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4092 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4093 information from the vector header. Adjust comment.
4094 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4095 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4096 layout.
4097 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4098 (struct vectorlike_header): Remove next member. Adjust comment.
4099 (struct Lisp_Subr): Add convenient header. Adjust comment.
4100 (allocate_pseudovector): Adjust prototype.
4101 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4102 (sweep_string, lisp_malloc): Remove useless prototypes.
4103 (enum mem_type): Adjust comment.
4104 (NEXT_IN_FREE_LIST): New macro.
4105 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4106 (Fmake_bool_vector): Likewise.
4107 (struct large_vector): New type to represent allocation unit for
4108 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4109 (large_vectors): Change type to struct large_vector.
4110 (allocate_vector_from_block): Simplify.
4111 (PSEUDOVECTOR_NBYTES): Replace with...
4112 (vector_nbytes): ...new function. Adjust users.
4113 (sweep_vectors): Adjust processing of large vectors.
4114 (allocate_vectorlike): Likewise.
4115 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4116 Add easserts. Adjust XSETPVECTYPESIZE usage.
4117 (allocate_buffer): Use BUFFER_PVEC_INIT.
4118 (live_vector_p): Adjust to match large vector.
4119 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4120 * buffer.h (struct buffer): Add next member.
4121 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4122 New macros.
4123 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4124 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4125 (copy_hash_table): Adjust to match vector header change.
4126 * lread.c (defsubr): Use XSETPVECTYPE.
4127 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4128 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4129 (xvecsize): New command.
4130
4131 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4132
4133 * keyboard.c (event_to_kboard): Do not dereference
4134 frame_or_window field of SELECTION_REQUEST_EVENT
4135 and SELECTION_CLEAR_EVENT events (Bug#12814).
4136 * xterm.h (struct selection_input_event): Adjust comment.
4137
4138 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4139
4140 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4141 such as Scroll Lock, if the respective keys are treated as
4142 function keys, not as modifiers. This avoids destroying non-ASCII
4143 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4144
4145 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4146
4147 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4148
4149 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4150
4151 Restore some duplicate definitions (Bug#12814).
4152 This undoes part of the 2012-11-03 changes. Some people build
4153 with plain -g rather than with -g3, and they need the duplicate
4154 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4155 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4156 Define as macros, as well as as enums or as constants.
4157
4158 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4159
4160 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4161 to keypad keys (Bug#12816).
4162
4163 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4164
4165 Minor adjustments of recently-changed frame functions.
4166 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4167 known to be a frame (we're in the FRAMEP branch).
4168 * lisp.h (Qframep): Remove decl. frame.h declares this.
4169 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4170 since they're meant for Lisp fixnum values.
4171
4172 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4173
4174 * window.c (Fwindow_combination_limit): Revert to the only
4175 required argument and adjust docstring as suggested in
4176 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4177 by Martin Rudalics <rudalics@gmx.at>.
4178
4179 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4180
4181 Widely used frame validity and checking functions.
4182 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4183 * frame.c (decode_live_frame, decode_any_frame): New functions.
4184 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4185 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4186 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4187 (Fframe_pointer_visible_p): Use decode_any_frame.
4188 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4189 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4190 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4191 (Fframe_focus): Likewise. Allow zero number of arguments.
4192 Adjust docstring.
4193 (frame_buffer_list, frame_buffer_predicate): Remove.
4194 * lisp.h (frame_buffer_predicate): Remove prototype.
4195 * buffer.c (Fother_buffer): Use decode_any_frame.
4196 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4197 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4198 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4199 (Fclose_font, Ffont_info): Use decode_live_frame.
4200 * fontset.c (check_fontset_name): Likewise.
4201 * terminal.c (Fframe_terminal): Likewise.
4202 * w32fns.c (check_x_frame): Likewise.
4203 * window.c (Fminibuffer_window, Fwindow_at)
4204 (Fcurrent_window_configuration): Likewise.
4205 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4206 Likewise. Allow zero number of arguments. Adjust docstring.
4207 * dispnew.c (Fredraw_frame): Likewise.
4208 * xfaces.c (frame_or_selected_frame): Remove.
4209 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4210 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4211 (Fframe_face_alist): Use decode_live_frame.
4212 * xfns.c (check_x_frame): Likewise.
4213
4214 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4215
4216 * window.c (quad): New function.
4217 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4218 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4219 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4220 (Fwindow_line_height): Use it.
4221 (Fwindow_fringes): Use list3.
4222 (Fwindow_scroll_bars): Use list4.
4223 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4224 (Fwindow_combination_limit): Allow zero number of arguments.
4225
4226 2012-11-05 Eli Zaretskii <eliz@gnu.org>
4227
4228 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4229
4230 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
4231 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
4232 file descriptor 2 for standard error. (Bug#12805)
4233
4234 2012-11-05 Chong Yidong <cyd@gnu.org>
4235
4236 * process.c (wait_reading_process_output): Revert previous change.
4237
4238 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4239
4240 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4241 This removes code that has been obsolete since around 1990.
4242 * callproc.c (Fcall_process):
4243 * emacs.c (main):
4244 * process.c (create_process):
4245 * term.c (dissociate_if_controlling_tty):
4246 Assume setsid exists.
4247 * callproc.c (child_setup): Assume setpgid exists and behaves as
4248 per POSIX.1-1988 or later.
4249 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4250 * emacs.c (shut_down_emacs):
4251 * sysdep.c (sys_suspend, init_foreground_group):
4252 Assume getpgrp behaves as per POSIX.1-1998 or later.
4253 * msdos.c (setpgrp): Remove.
4254 (tcgetpgrp, setpgid, setsid): New functions.
4255 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4256 * term.c (no_controlling_tty): Remove; unused.
4257 * w32proc.c (setpgrp): Remove.
4258 (setsid, tcgetpgrp): New functions.
4259
4260 Simplify by assuming __fpending.
4261 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4262 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4263 Do not assume that __fpending's result fits in int.
4264
4265 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4266
4267 Remove EMACS_OUTQSIZE+sleep hack.
4268 * dispnew.c (update_frame_1): Remove hack for terminals slower
4269 than 2400 bps, which throttled Emacs by having it sleep.
4270 This code hasn't worked since at least 2007, when the multi-tty stuff
4271 was added, and anyway those old terminals are long dead.
4272 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4273 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4274
4275 Fix data-loss with --version (Bug#9574).
4276 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4277 as we can't assume that emacs_strerror is initialized, and strerror
4278 is good enough here.
4279 (main): Invoke atexit earlier, to catch earlier instances of
4280 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4281
4282 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4283
4284 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4285 (keyDown): Remap keypad keys to X11 virtual key codes.
4286
4287 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4288
4289 Fix data-loss with --batch (Bug#9574).
4290 * emacs.c: Include <close-stream.h>.
4291 (close_output_streams): New function.
4292 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4293 and handles errors appropriately.
4294 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4295 does that now.
4296
4297 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4298 The symptom is a diagnostic "GLib-WARNING **: In call to
4299 g_spawn_sync(), exit status of a child process was requested but
4300 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4301 waitpid(), so exit status can't be returned." The diagnostic
4302 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4303 The real bug is a race condition between Emacs and glib: Emacs
4304 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4305 so that glib can't find it. Work around the bug by invoking
4306 waitpid only on subprocesses that Emacs itself creates.
4307 * process.c (create_process, record_child_status_change):
4308 Don't use special value -1 in pid field, as the caller now must
4309 know the pid rather than having the callee infer it.
4310 The inference was sometimes incorrect anyway, due to another race.
4311 (create_process): Set new 'alive' member if child is created.
4312 (process_status_retrieved): New function.
4313 (record_child_status_change): Use it.
4314 Accept negative 1st argument, which means to wait for the
4315 processes that Emacs already knows about. Move special-case code
4316 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4317 processes that have already been waited for, by testing and
4318 clearing new 'alive' member.
4319 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4320 now does this internally.
4321 (handle_child_signal): Let record_child_status_change do all
4322 the work, since we do not want to reap all exited child processes,
4323 only the child processes that Emacs itself created.
4324 * process.h (Lisp_Process): New boolean member 'alive'.
4325
4326 Omit duplicate definitions no longer needed with gcc -g3.
4327 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4328 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4329 Define only as macros. There's no longer any need to also define
4330 these symbols as enums or as constants, since we now assume
4331 gcc -g3 when debugging.
4332
4333 2012-11-03 Eli Zaretskii <eliz@gnu.org>
4334
4335 * lisp.mk: Adjust comments to the fact that term/internal is now
4336 loaded from loadup.el.
4337
4338 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4339 (msdos_fatal_signal): New function.
4340 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4341 its argument list.
4342
4343 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4344 for GCC versions before 4.
4345 (emacs_raise): Define to call msdos_fatal_signal.
4346
4347 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4348 iterator when starting in the middle of a display or overlay
4349 string. (Bug#12745)
4350
4351 2012-11-03 Chong Yidong <cyd@gnu.org>
4352
4353 * process.c (wait_reading_process_output): Clean up the last
4354 change.
4355
4356 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4357
4358 * process.c (wait_reading_process_output): Avoid a race condition
4359 with SIGIO delivery (Bug#11536).
4360
4361 2012-11-03 Chong Yidong <cyd@gnu.org>
4362
4363 * buffer.c (cursor_type): Untabify docstring.
4364
4365 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4366
4367 * frame.h (struct frame): Drop can_have_scroll_bars member
4368 which is meaningless for a long time. Adjust comments.
4369 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4370 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4371
4372 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4373
4374 * window.c (decode_next_window_args): Update window arg after
4375 calling decode_live_window and so fix crash reported at
4376 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4377 by Juanma Barranquero <lekktu@gmail.com>.
4378 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4379 * font.c (Ffont_at): Likewise.
4380
4381 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4382
4383 * widget.c (resize_cb): New function.
4384 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4385 (EmacsFrameResize): Check if all is up to date before changing frame
4386 size.
4387
4388 2012-11-02 Eli Zaretskii <eliz@gnu.org>
4389
4390 Implement backtrace output for fatal errors on MS-Windows.
4391 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4392 (BACKTRACE_LIMIT_MAX): New macro.
4393 (w32_backtrace): New function.
4394 (emacs_abort): Use w32_backtrace when the user chooses not to
4395 attach a debugger. Update the text of the abort dialog.
4396
4397 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4398
4399 Window-related stuff cleanup here and there.
4400 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4401 Use decode_any_window.
4402 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4403 * xdisp.c (Fformat_mode_line): Likewise.
4404 * font.c (Ffont_at): Use decode_live_window.
4405 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4406 * window.c (decode_next_window_args): Likewise.
4407 (decode_any_window): Remove static.
4408 * window.h (decode_any_window): Add prototype.
4409 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4410 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4411 respectively.
4412
4413 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4414
4415 Remove pad from struct input_event.
4416 * termhooks.h (struct input_event): Remove padding field.
4417 Adjust comment.
4418 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4419 member is never cons for a long time. Adjust comment.
4420 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4421 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4422 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4423 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4424
4425 2012-11-01 Eli Zaretskii <eliz@gnu.org>
4426
4427 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4428
4429 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4430
4431 Fix crash when using Emacs as commit editor for git (Bug#12697).
4432 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4433 and it is configured in conf_post.h.
4434 (Fcall_process): Don't invoke both setsid and setpgid; the former
4435 is enough, if it exists.
4436 * callproc.c (Fcall_process, child_setup):
4437 * process.c (create_process): Use setpgid.
4438 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4439 for the real thing.
4440 * dispnew.c (init_display): Initialize the foreground group
4441 if we are running a tty display.
4442 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4443 * lisp.h (init_foreground_group): New decl.
4444 * sysdep.c (inherited_pgroup): New static var.
4445 (init_foreground_group, tcsetpgrp_without_stopping)
4446 (narrow_foreground_group, widen_foreground_group): New functions.
4447 (init_sys_modes): Narrow foreground group.
4448 (reset_sys_modes): Widen foreground group.
4449
4450 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
4451
4452 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4453
4454 2012-10-31 Martin Rudalics <rudalics@gmx.at>
4455
4456 * minibuf.c (read_minibuf): Restore current buffer since
4457 choose_minibuf_frame calling Fset_frame_selected_window may
4458 change it (Bug#12766).
4459
4460 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4461
4462 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4463
4464 2012-10-30 Kenichi Handa <handa@gnu.org>
4465
4466 * font.c (Ffont_at): If WINDOW is specified and it is not
4467 displaying the current buffer, signal an error.
4468
4469 2012-10-29 Daniel Colascione <dancol@dancol.org>
4470
4471 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4472 In preparation for fixing bug#12739, move these functions from
4473 here...
4474
4475 * coding.h, coding.c: ... to here, and compile them only when
4476 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4477 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
4478
4479 2012-10-28 Eli Zaretskii <eliz@gnu.org>
4480
4481 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4482 (timer_loop, getitimer, setitimer): Use it instead of
4483 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4484 'clock'.
4485 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4486 literal 10000.
4487
4488 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4489
4490 * nsterm.m (NO_APPDEFINED_DATA): New define.
4491 (last_appdefined_event_data): New variable
4492 (last_appdefined_event): Remove.
4493 (ns_select): Initialize t from last_appdefined_event_data instead
4494 of [last_appdefined_event data1].
4495 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4496 remove last_appdefined_event (Bug#12698).
4497
4498 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4499
4500 * frame.c (x_set_font): Catch internal error.
4501
4502 2012-10-27 Eli Zaretskii <eliz@gnu.org>
4503
4504 Avoid overflow in w32 implementation of interval timers.
4505 When possible, for ITIMER_PROF count only times the main thread
4506 actually executes.
4507 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
4508 'volatile ULONGLONG' types. All the other data which was
4509 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
4510 (GetThreadTimes_Proc): New typedef.
4511 (w32_get_timer_time): New function, returns a suitable time value
4512 for the timer.
4513 (timer_loop): Enter critical section when accessing ULONGLONG
4514 values of the itimer_data struct, as these accesses are no longer
4515 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4516 Remove unused variable.
4517 (init_timers): Initialize s_pfn_Get_Thread_Times.
4518 (start_timer_thread): Don't assign itimer->caller_thread here.
4519 (getitimer): Assign itimer->caller_thread here.
4520 (setitimer): Always call getitimer to get the value of ticks_now.
4521 (sys_spawnve): Avoid compiler warning about format mismatch.
4522
4523 2012-10-26 Eli Zaretskii <eliz@gnu.org>
4524
4525 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4526 mouse movement events if the menu bar is active. This avoids
4527 producing a busy "hour-glass" cursor by Windows if the mouse
4528 pointer is positioned over a tooltip shown for some menu item.
4529
4530 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4531
4532 Don't assume process IDs fit in int.
4533 * emacs.c (shut_down_emacs) [!DOS_NT]:
4534 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4535 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4536 Use pid_t, not int, to store process IDs, as 'int'
4537 is not wide enough on a few platforms (e.g., AIX and IRIX).
4538
4539 2012-10-23 Kenichi Handa <handa@gnu.org>
4540
4541 The following change is to make face-font-rescale-alist work
4542 correctly for non-ASCII fonts.
4543
4544 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4545 (font_open_for_lface): Handle Vface_font_rescale_alist.
4546
4547 2012-10-23 Chong Yidong <cyd@gnu.org>
4548
4549 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4550
4551 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4552
4553 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4554 for screen font.
4555 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4556
4557 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4558 event (Bug#12681).
4559
4560 2012-10-21 Glenn Morris <rgm@gnu.org>
4561
4562 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4563
4564 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4565
4566 Port to OpenBSD 5.1.
4567 * frame.c (Fmouse_position, Fmouse_pixel_position):
4568 * xdisp.c (produce_stretch_glyph):
4569 Declare local vars only when they're needed.
4570 This is clearer and avoids a warning on OpenBSD about unused vars.
4571 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4572 This is safer, and avoids OpenBSD warnings about unused vars.
4573 * keyboard.c (record_menu_key): Remove unnecessary decl.
4574 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4575 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4576 as our definition clashes with OpenBSD's.
4577 * xfaces.c (load_face_colors, check_lface_attrs)
4578 (get_lface_attributes_no_remap, get_lface_attributes)
4579 (lface_fully_specified_p, x_supports_face_attributes_p)
4580 (tty_supports_face_attributes_p, face_fontset, realize_face)
4581 (realize_x_face, realize_tty_face):
4582 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4583 merely Lisp_Object *. This is more informative and avoids
4584 a warning on OpenBSD about accessing beyond an object's size.
4585
4586 2012-10-20 Chong Yidong <cyd@gnu.org>
4587
4588 * lread.c (Fload): Doc fix (Bug#12592).
4589
4590 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4591
4592 * font.c (Ffont_at): Fix previous change.
4593
4594 2012-10-19 Eli Zaretskii <eliz@gnu.org>
4595
4596 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4597 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
4598 for the reasons.
4599
4600 * alloc.c (NSTATICS): Decrease to 0x800.
4601
4602 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4603
4604 * fns.c (Fnreverse): Include the problem element when signaling an
4605 error (bug#12677).
4606
4607 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4608
4609 * nsterm.m (ns_select): Check writefds before call to
4610 FD_ISSET (Bug#12668).
4611
4612 2012-10-18 Daniel Colascione <dancol@dancol.org>
4613
4614 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4615 (staticpro): If we run out of staticpro slots, die with an
4616 informative error instead of just calling emacs_abort.
4617
4618 2012-10-18 Martin Rudalics <rudalics@gmx.at>
4619
4620 Fix two flaws reported by Dmitry Antipov.
4621 * window.c (Ftemp_output_buffer_show): Remove.
4622 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4623 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4624
4625 2012-10-17 Eli Zaretskii <eliz@gnu.org>
4626
4627 * makefile.w32-in ($(BLD)/w32.$(O)):
4628 ($(BLD)/vm-limit.$(O)):
4629 ($(BLD)/term.$(O)):
4630 ($(BLD)/unexw32.$(O)):
4631 ($(BLD)/fileio.$(O)):
4632 ($(BLD)/dispnew.$(O)): Update dependencies.
4633
4634 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4635 Add prototypes.
4636
4637 * w32proc.c: Include ctype.h.
4638
4639 * w32.h (init_environment, check_windows_init_file)
4640 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4641 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4642 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4643 (sys_link): Add prototypes.
4644
4645 * w32.c: Include w32select.h.
4646 (sys_access, e_malloc, sys_select): Add prototypes.
4647 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4648
4649 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4650
4651 * unexw32.c: Include lisp.h and w32.h.
4652
4653 * term.c [WINDOWSNT]: Include w32term.h.
4654
4655 * process.c [WINDOWSNT]: Add prototype of sys_select.
4656
4657 * fileio.c [WINDOWSNT]: Include w32.h.
4658
4659 * dispnew.c [WINDOWSNT]: Include w32.h.
4660
4661 * cygw32.c (Fcygwin_convert_path_to_windows)
4662 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4663 Lisp_Object values. (Bug#12661)
4664
4665 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4666 to Lisp_Object. (Bug#12661)
4667
4668 2012-10-17 Kenichi Handa <handa@gnu.org>
4669
4670 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4671 invalidate.
4672
4673 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4674
4675 * buffer.c (Fkill_buffer): When unchaining the marker,
4676 reset its buffer pointer to NULL (Bug#12652).
4677
4678 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4679
4680 Do not verify indirection counters of killed buffers (Bug#12579).
4681 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4682 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4683
4684 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4685
4686 * alloc.c (Fmake_byte_code): Fix typo in comment.
4687 * print.c (print_interval): Define as static to match prototype.
4688 * indent.c (disptab_matches_widthtab, recompute_width_table):
4689 Convert to eassert.
4690
4691 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4692
4693 * editfns.c (get_system_name): Remove.
4694 * lisp.h (get_system_name): Remove prototype.
4695 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4696 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4697
4698 2012-10-15 Daniel Colascione <dancol@dancol.org>
4699
4700 * dbusbind.c: Add comment explaining reason for previous change.
4701
4702 2012-10-15 Martin Rudalics <rudalics@gmx.at>
4703
4704 * window.c (Fwindow_end): Rewrite check whether cached position
4705 can be used (Bug#12600).
4706 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4707 Set windows_or_buffers_changed.
4708
4709 2012-10-15 Daniel Colascione <dancol@dancol.org>
4710
4711 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4712 enabled by undefining the symbol "interface", which the platform
4713 headers define to something incompatible.
4714
4715 2012-10-14 Daniel Colascione <dancol@dancol.org>
4716
4717 * image.c (init_tiff_functions, init_imagemagick_functions)
4718 (init_svg_functions): Fix cygw32 build break by using these
4719 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4720
4721 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4722
4723 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4724
4725 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4726
4727 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4728
4729 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4730
4731 * coding.c (detect_coding): Set coding->id before calling
4732 this->detector.
4733
4734 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4735
4736 * fileio.c: Formatting fixes.
4737
4738 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4739
4740 Fix some stat-related races.
4741 * fileio.c (Fwrite_region): Avoid race condition if a file is
4742 removed or renamed by some other process immediately after Emacs
4743 writes it but before Emacs stats it. Do not assume that stat (or
4744 fstat) succeeds.
4745 * image.c (slurp_file): Resolve the file name with fopen + fstat
4746 rather than stat + fopen.
4747 (pbm_read_file) [0]: Remove unused code with stat race.
4748 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4749 Remove ineffective code with stat race.
4750
4751 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4752
4753 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4754
4755 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4756
4757 * nsterm.m (hold_event_q): New static variable.
4758 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4759 ! q_event_ptr.
4760 (hold_event): New function.
4761 (ns_read_socket): If hold_event_q have events, store them and
4762 return (Bug#12384).
4763 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4764 is zero (Bug#12384).
4765
4766 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
4767
4768 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4769
4770 2012-10-12 Eli Zaretskii <eliz@gnu.org>
4771
4772 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4773
4774 * fileio.c (check_existing): New function.
4775 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4776 instead of calling 'stat', when what's needed is to check whether
4777 a file exists. This avoids expensive system calls on MS-Windows.
4778 (Bug#12587)
4779
4780 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
4781
4782 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4783 determine whether a file exists and is not a directory.
4784
4785 * lisp.h (check_existing): Add prototype.
4786
4787 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4788
4789 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4790
4791 2012-10-12 Glenn Morris <rgm@gnu.org>
4792
4793 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4794
4795 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4796
4797 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4798
4799 * eval.c (Fautoload): Remember previous autoload status in load-history.
4800
4801 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4802
4803 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4804 * lread.c (load_each_byte, new_backquote_flag, readchar)
4805 (read_filtered_event, lisp_file_lexically_bound_p)
4806 (safe_to_load_version, Fload, complete_filename_p, openp)
4807 (build_load_history, readevalloop, read_escape, read1)
4808 (string_to_number, read_vector, read_list):
4809 * macros.c (Fstart_kbd_macro):
4810 * marker.c (CONSIDER):
4811 * menu.c (parse_single_submenu, digest_single_submenu)
4812 (find_and_return_menu_selection, Fx_popup_menu):
4813 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4814 (Ftry_completion):
4815 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4816 (ns_menu_show):
4817 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4818 (xmenu_show, xdialog_show):
4819 Use bool for booleans.
4820 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4821 as it's not a predicate. All uses changed. Omit unnecessary
4822 buffer termination.
4823
4824 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4825
4826 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4827 (save_excursion_restore): Do not restore mark if it was not saved.
4828
4829 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4830
4831 * marker.c (cached_modiff): EMACS_INT, not int.
4832
4833 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4834 instead of having a wrong decl.
4835 * nsmenu.m (waiting_for_input): Remove wrong decl.
4836
4837 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4838
4839 keyboard.c, keymap.c: Use bool for booleans.
4840 * dispnew.c (sit_for): Distinguish between 3-way display_option
4841 and boolean do_display.
4842 * keyboard.c (single_kboard, this_command_key_count_reset)
4843 (waiting_for_input, echoing, immediate_quit, input_pending)
4844 (interrupt_input, interrupts_deferred, pop_kboard)
4845 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4846 (command_loop_1, adjust_point_for_property)
4847 (safe_run_hooks_error, input_polling_used, read_char):
4848 (help_char_p, readable_events, kbd_buffer_events_waiting)
4849 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4850 (lucid_event_type_list_p, get_input_pending):
4851 (gobble_input, menu_separator_name_p, menu_bar_item)
4852 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4853 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4854 (keyremap_step, test_undefined, read_key_sequence)
4855 (detect_input_pending, detect_input_pending_ignore_squeezables)
4856 (detect_input_pending_run_timers, requeued_events_pending_p)
4857 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4858 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4859 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4860 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4861 (accessible_keymaps_1, Fkey_description, push_key_description):
4862 (shadow_lookup, struct where_is_internal_data)
4863 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4864 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4865 (describe_map, describe_vector):
4866 * menu.c (single_menu_item):
4867 * nsmenu.m (ns_update_menubar):
4868 * process.c (wait_reading_process_output):
4869 * search.c (scan_buffer, scan_newline):
4870 Use bool for boolean.
4871 * keyboard.c (timers_run, swallow_events)
4872 (detect_input_pending_run_timers):
4873 * process.c (wait_reading_process_output):
4874 Use unsigned for counter where wraparound-on-overflow is desired,
4875 since unsigned is guaranteed to have that behavior and signed is not.
4876 (read_char): Use ptrdiff_t for string length.
4877 (get_input_pending): Remove first argument, since it was always
4878 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4879 and behave as if it had that value. Return new value of
4880 input_pending. All callers changed.
4881 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4882 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4883 a string length.
4884 * keymap.c (push_key_description): Omit last arg, which was always 1.
4885 All callers changed.
4886
4887 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4888
4889 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
4890
4891 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4892 ($(BLD)/term.$(O)): Update dependencies.
4893
4894 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4895
4896 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4897 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4898 initializer for PVEC_NORMAL_VECTOR.
4899
4900 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4901
4902 Clean out old termopts cruft.
4903 * termopts.h (flow_control, meta_key): Remove unused decls.
4904 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4905 Don't include termopts.h.
4906
4907 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4908
4909 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4910
4911 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4912
4913 * commands.h (immediate_quit): Remove duplicate decl.
4914
4915 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4916
4917 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4918 caching.
4919 (nsfont_open): Remove setting of Vfonts_in_cache.
4920 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
4921
4922 2012-10-09 Eli Zaretskii <eliz@gnu.org>
4923
4924 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4925 match what GetLastError returns. Explain why the function is
4926 needed.
4927
4928 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4929 'is_tooltip_frame', to avoid confusion with its global namesake.
4930
4931 2012-10-08 Daniel Colascione <dancol@dancol.org>
4932
4933 * xdisp.c (start_hourglass): Call w32_note_current_window when
4934 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4935 build that caused Emacs to display the hourglass cursor forever.
4936
4937 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4938 which is broken under remote desktop, calculate the number of
4939 colors available for a display based on the display's number of
4940 planes and number of bits per pixel per plane. (bug#10397).
4941
4942 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
4943
4944 * nsfont.m (Vfonts_in_cache): New variable.
4945 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4946 are used. Add cached fonts to Vfonts_in_cache.
4947 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4948
4949 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
4950
4951 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4952 in nt/config.nt.
4953 (FONT_H): Define after FRAME_H.
4954 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4955 Update dependencies.
4956
4957 * w32term.c: Remove leftover declaration of keyboard_codepage.
4958
4959 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4960
4961 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4962 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4963 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4964 (GLOBAL_SOURCES): Add cygw32.c.
4965 ($(BLD)/unexw32.$(O)):
4966 ($(BLD)/w32.$(O)):
4967 ($(BLD)/w32console.$(O)):
4968 ($(BLD)/w32fns.$(O)):
4969 ($(BLD)/w32heap.$(O)):
4970 ($(BLD)/w32menu.$(O)):
4971 ($(BLD)/w32proc.$(O)): Add w32common.h.
4972
4973 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4974 'const char *'.
4975 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4976
4977 2012-10-08 Daniel Colascione <dancol@dancol.org>
4978
4979 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4980 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4981 accidental message numbering hole. Change other messages to
4982 match.
4983
4984 * w32select.h (HAVE_W32SELECT): Remove.
4985
4986 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
4987 w32common.h instead of w32heap.h.
4988
4989 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4990 (get_allocation_unit, get_processor_type, get_w32_major_version)
4991 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4992 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4993 (OS_NT, os_subtype, cache_system_info): Move declarations to
4994 w32common.
4995
4996 * w32heap.c: Include w32common.h.
4997 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
4998 (w32_minor_version, w32_build_number, w32_subtype):
4999 Remove duplicate definitions.
5000
5001 * w32fns.c: Include w32common.h; include w32heap.h only in
5002 WINDOWSNT.
5003
5004 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5005 Use `report_file_error' instead of `error' in order to better
5006 inform users of what went wrong. Increase NTGUI_UNICODE file
5007 dialog box file name length to 32k, the maximum allowed by the NT
5008 kernel.
5009
5010 * w32common.h: New file.
5011 (ROUND_UP, ROUND_DOWN, get_page_size)
5012 (get_allocation_unit, get_processor_type, get_w32_major_version)
5013 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5014 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5015 (OS_NT, os_subtype, cache_system_info): Move here.
5016
5017 * unexw32.c, unexcw.c: Include w32common.h.
5018
5019 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5020 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5021 to call syms_of_w32select.
5022
5023 * cygw32.h: Remove obsolete EXFUN declarations.
5024
5025 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5026
5027 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5028 of w32inevt.o from SOME_MACHINE_OBJECTS.
5029
5030 2012-10-08 Daniel Colascione <dancol@dancol.org>
5031
5032 * image.c: Permanent fix for JPEG compilation issue --- limit
5033 jpeglib `boolean' redefinition to Cygwin builds.
5034
5035 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5036
5037 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5038
5039 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5040 Cygwin.
5041
5042 2012-10-08 Daniel Colascione <dancol@dancol.org>
5043
5044 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5045 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5046 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5047 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5048 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5049 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5050 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5051 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5052 now a supported configuration.
5053
5054 * Makefile.in: consolidate image variables into LIBIMAGE; add
5055 W32_OBJ and W32_LIBS. Compile new files.
5056
5057 * conf_post.h:
5058 (_DebPrint) declare tracing facility for W32 debugging. We need
5059 to unify tracing later.
5060
5061 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5062 unconditional use of W32 Unicode functions. Cygwin runs only on
5063 100% Unicode operating systems.
5064
5065 * cygw32.c: New file. Define Cygwin-specific facilities.
5066 (Fcygwin_convert_path_to_windows)
5067 (Fcygwin_convert_path_from_windows): New user functions for
5068 accessing Cygwin path-munging routines.
5069
5070 * cygw32.h: New file.
5071 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5072 UTF-16LE strings temporarily inside non-Lisp-visible string
5073 objects.
5074
5075 (w32_strerror): Just what it says on the tin.
5076
5077 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5078 also run for Cygwin; both systems have the same problem with using
5079 GUI facilities in a forked child. Also call syms_of_cygw32,
5080 syms_of_w32select in correct places.
5081
5082 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5083 needs fork-then-exec for daemon launching.
5084
5085 * font.h: Include frame.h.
5086
5087 * image.c: Use the image library cache machinery only when we're
5088 compiling for native WINDOWSNT; Cygwin can use shared libraries
5089 like any other Unixlike system.
5090
5091 * keyboard.c: Clarify a comment regarding the input loop.
5092
5093 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5094 functions directly instead of trying to detect at runtime that our
5095 host operating system supports them. We make this change for two
5096 reasons: Cygwin lacks support for the multibyte character
5097 conversion functions used by the legacy menu code, and Cygwin
5098 never needs to rely on non-Unicode APIs.
5099
5100 * unexw32.c (hinst): Declare extern.
5101
5102 * w32.c: Change header order;
5103 (w32_strerror): Move to w32fns.c because we need it for
5104 non-WINDOWSNT builds.
5105
5106 * w32.h: Add #error macro to make sure we don't include w32.h for
5107 Cygwin builds. Remove w32select declarations.
5108
5109 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5110 w32fns.c. w32console.c is WINDOWSNT-only.
5111
5112 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5113 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5114 POSIXy alternative.
5115 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5116 (w32_major_version, w32_minor_version, w32_build_number)
5117 (os_subtype, sound_type): Define here
5118 (w32_defined_color): Make color parameter const for consistency
5119 with other _defined_color functions.
5120 (w32_createwindow): Unconditionally call w32_init_class instead of
5121 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5122 through the code is complex and unnecessary because class
5123 registration is practically free.
5124 (w32_name_of_message): New EMACSDEBUG-only function.
5125 (Fset_message_beep): Move here
5126 (Fx_open_connection): Require that the display name for Windows be
5127 "w32" for consistency, emacsclient disambiguation, and maybe, one
5128 day, multi-window-system support.
5129 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5130 Cygwin files for W32 GUI facilities, since these clearly don't
5131 expect Cygwin names.
5132 (_DebPrint): Define.
5133 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5134 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5135 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5136 (w32_last_error): Remove.
5137
5138 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5139
5140 * w32heap.c (syspage_mask): Declare here.
5141 (cache_system_info): Remove.
5142
5143 * w32inevt.c (faked_key): Define globally, not statically.
5144 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5145 (w32_console_toggle_lock_key): Move to w32fns.c.
5146
5147 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5148
5149 * w32proc.c (_DebPrint): Move to w32fns.c.
5150 * w32select.c: Include string.h, stdio.h for Cygwin.
5151 * w32select.h: New File.
5152
5153 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5154 get_osfhandle.
5155 (w32_message_fd): New variable. Under Cygwin, holds the file
5156 descriptor the system used to tell us about pending thread
5157 messages.
5158
5159 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5160 that prevented compilation under non-WINDOWSNT systems.
5161
5162 (w32_initialize): Open /dev/windows and assign it to
5163 w32_message_fd. Provide w32 feature.
5164
5165 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5166 (WM_EMACS_INPUT_READY): add.
5167 (prepend_msg, w32_message_fd): Declare globally.
5168
5169 * w32xfns.c:
5170 (keyboard_handle): Use only when WINDOWSNT.
5171 (notify_msg_ready): New function. Posts a message to the main
5172 thread's message queue under CYGWIN, which wakes up the main
5173 thread from select(2) by making the /dev/windows file descriptor
5174 ready. Under WINDOWSNT, it sets an event the same way the old
5175 code did.
5176
5177 (post, prepend_msg): Actually call notify_msg_ready instead of
5178 setting the input event directly.
5179
5180 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5181
5182 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5183 but it still has blocs in it, don't return it to the system,
5184 instead of aborting. (Bug#12402)
5185
5186 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5187
5188 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5189
5190 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5191 MAC_OS_X_VERSION_10_6.
5192 (syms_of_nsterm): Remove comment about Panther and above for
5193 ns-antialias-text.
5194 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5195 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5196 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5197
5198 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5199 MAC_OS_X_VERSION_10_4.
5200
5201 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5202 MAC_OS_X_VERSION_10_2.
5203
5204 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5205
5206 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5207 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5208
5209 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5210 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
5211 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5212 Remove ns_in_resize check.
5213 (ns_clear_frame_area): Remove resize handle code.
5214
5215 * nsfns.m (ns_in_resize): Remove.
5216 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5217 Remove ns_in_resize check.
5218
5219 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5220
5221 Improve sys_siglist detection.
5222 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5223 defined as a macro, as is done in Solaris.
5224 (sys_siglist_entries): New macro.
5225 (save_strsignal): Use it.
5226 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5227 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5228
5229 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5230
5231 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5232 fullscreen/Fullscreen.
5233
5234 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5235 tobar_height is new.
5236
5237 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5238 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5239 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5240 (windowDidResize:): Check for correct window if old style fullscreen.
5241 Capitalize word in comment. Remove incorrect comment.
5242 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5243 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5244 error in drawing background.
5245 (toggleFullScreen:): Remove comment. Rearrange calls.
5246 Set toolbar values to zero, save old height in tobar_height.
5247 Restore tool bar height when leaving fullscreen.
5248 (canBecomeMainWindow): New function.
5249
5250 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5251
5252 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5253
5254 2012-10-05 Eli Zaretskii <eliz@gnu.org>
5255
5256 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5257
5258 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
5259 that time stamps of directories could also be changed.
5260 Don't request the too broad GENERIC_WRITE, only the more restrictive
5261 FILE_WRITE_ATTRIBUTES access rights.
5262
5263 * fileio.c (Fset_file_times): Special-case ignoring errors for
5264 directories only on MSDOS, not on MS-Windows.
5265
5266 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
5267
5268 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5269
5270 2012-10-04 Eli Zaretskii <eliz@gnu.org>
5271
5272 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5273 see whether CreateFile failed.
5274
5275 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5276
5277 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5278 to avoid similar races.
5279 * keyboard.c (pending_signals): Now bool, not int.
5280
5281 Port timers to OpenBSD, plus check for timer failures.
5282 OpenBSD problem reported by Han Boetes.
5283 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5284 and/or setitimer.
5285 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5286 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5287 like OpenBSD, which has timer_settime but does not declare it.
5288 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5289 whether to use itimerspec-related primitives. All uses of
5290 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5291
5292 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5293
5294 * profiler.c (handle_profiler_signal): Fix a malloc race
5295 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5296
5297 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5298
5299 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5300
5301 2012-10-02 Eli Zaretskii <eliz@gnu.org>
5302
5303 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5304 consistent with the change in return value of 'safe_strsignal'.
5305
5306 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5307
5308 Prefer plain 'static' to 'static inline' (Bug#12541).
5309 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5310 (bidi_set_sor_type, bidi_push_embedding_level)
5311 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5312 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5313 (bidi_cache_search, bidi_cache_ensure_space)
5314 (bidi_cache_iterator_state, bidi_cache_find)
5315 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5316 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5317 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5318 Now 'static', not 'static inline'.
5319
5320 Count overruns when profiling; change units to ns.
5321 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5322 Give extra weight to samples after overruns, to attempt to count
5323 the time more accurately.
5324 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5325 the underlying primitives nominally do ns.
5326 (Fprofiler_cpu_start): Document the change. Mention that
5327 the sampling intervals are only approximate.
5328
5329 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5330
5331 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5332
5333 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5334 case for the special 0 coding-system.
5335
5336 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5337 (Fmake_overlay): Remove redundant tests.
5338 (fix_start_end_in_overlays): Remove redundant recentering.
5339
5340 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
5341
5342 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5343 Update dependencies.
5344
5345 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5346
5347 Fix a malloc race condition involving strsignal.
5348 A signal can arrive in the middle of a malloc, and Emacs's signal
5349 handler can invoke strsignal, which can invoke malloc, which is
5350 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5351 Fix it by altering the signal handler so that it does not invoke
5352 strsignal.
5353 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5354 * process.c (status_message): Use const pointer, in case strsignal
5355 is #defined to safe_strsignal.
5356 * sysdep.c (sys_siglist, init_signals): Always define and
5357 initialize a substitute sys_siglist if the system does not define
5358 one, even if HAVE_STRSIGNAL.
5359 (safe_strsignal): Rename from strsignal. Always define,
5360 using sys_siglist. Return a const pointer.
5361 * syssignal.h (safe_strsignal): New decl.
5362 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5363
5364 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5365
5366 * w32proc.c (timer_loop): Fix code that waits for timer
5367 expiration, to avoid high CPU usage.
5368
5369 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5370
5371 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5372 (sweep_weak_table): Remove redundant prototypes.
5373
5374 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5375
5376 * emacs.c: Move the inclusion of TERM_HEADER after including
5377 windows.h on WINDOWSNT. This avoids compilation problems with
5378 MSVC.
5379
5380 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5381
5382 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5383 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5384 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5385 as the previous version used 'void *'.
5386
5387 * ralloc.c (ROUNDUP): Fix last change.
5388 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5389 'size_t'.
5390
5391 * w32proc.c <disable_itimers>: New static flag.
5392 (init_timers): Initialize it to zero, after creating the critical
5393 sections used by the timer threads.
5394 (term_timers): Set to 1 before deleting the critical sections.
5395 (getitimer, setitimer): If disable_itimers is non-zero, return an
5396 error indication without doing anything. Reported by Fabrice
5397 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
5398 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5399 return results.
5400 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5401 support timers.
5402
5403 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5404 term_ntproc after all the other bookkeeping, to get timers working
5405 as long as possible.
5406
5407 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5408
5409 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5410 Suggested by Juri Linkov in
5411 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5412
5413 Prefer plain 'static' to 'static inline' (Bug#12541).
5414 With static functions, modern compilers inline pretty well by
5415 themselves; advice from programmers often hurts as much as it helps.
5416 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5417 this change shrinks the text size of the Emacs executable by 1.1%
5418 without affecting CPU significantly in my benchmark.
5419 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5420 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5421 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5422 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5423 (bset_auto_fill_function, bset_auto_save_file_format)
5424 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5425 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5426 (bset_cache_long_line_scans, bset_case_fold_search)
5427 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5428 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5429 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5430 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5431 (bset_header_line_format, bset_indicate_buffer_boundaries)
5432 (bset_indicate_empty_lines, bset_invisibility_spec)
5433 (bset_left_fringe_width, bset_major_mode, bset_mark)
5434 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5435 (bset_name, bset_overwrite_mode, bset_pt_marker)
5436 (bset_right_fringe_width, bset_save_length)
5437 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5438 (bset_scroll_up_aggressively, bset_selective_display)
5439 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5440 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5441 (set_buffer_overlays_after):
5442 * category.c (bset_category_table):
5443 * charset.c (read_hex):
5444 * coding.c (produce_composition, produce_charset)
5445 (handle_composition_annotation, handle_charset_annotation)
5446 (char_encodable_p):
5447 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5448 (assign_row, set_frame_matrix_frame, make_current)
5449 (add_row_entry):
5450 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5451 * fns.c (maybe_resize_hash_table):
5452 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5453 * gmalloc.c (register_heapinfo):
5454 * image.c (lookup_image_type):
5455 * intervals.c (set_interval_object, set_interval_left)
5456 (set_interval_right, copy_interval_parent, rotate_right)
5457 (rotate_left, balance_possible_root_interval):
5458 * keyboard.c (kset_echo_string, kset_kbd_queue)
5459 (kset_keyboard_translate_table, kset_last_prefix_arg)
5460 (kset_last_repeatable_command, kset_local_function_key_map)
5461 (kset_overriding_terminal_local_map, kset_real_last_command)
5462 (kset_system_key_syms, clear_event, set_prop):
5463 * lread.c (digit_to_number):
5464 * marker.c (attach_marker, live_buffer, set_marker_internal):
5465 * nsterm.m (ns_compute_glyph_string_overhangs):
5466 * process.c (pset_buffer, pset_command)
5467 (pset_decode_coding_system, pset_decoding_buf)
5468 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5469 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5470 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5471 * syntax.c (bset_syntax_table, dec_bytepos):
5472 * terminal.c (tset_param_alist):
5473 * textprop.c (interval_has_some_properties)
5474 (interval_has_some_properties_list):
5475 * window.c (wset_combination_limit, wset_dedicated)
5476 (wset_display_table, wset_hchild, wset_left_fringe_width)
5477 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5478 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5479 (wset_right_fringe_width, wset_right_margin_cols)
5480 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5481 (wset_vertical_scroll_bar_type, wset_window_parameters):
5482 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5483 (wset_column_number_displayed, wset_region_showing)
5484 (window_box_edges, run_window_scroll_functions)
5485 (append_glyph_string_lists, prepend_glyph_string_lists)
5486 (append_glyph_string, set_glyph_string_background_width)
5487 (append_glyph, append_composite_glyph)
5488 (take_vertical_position_into_account):
5489 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5490 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5491 (lface_hash, lface_same_font_attributes_p, lookup_face):
5492 * xml.c (libxml2_loaded_p):
5493 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5494 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5495 Now 'static', not 'static inline'.
5496
5497 * bidi.c: Tune.
5498 (bidi_copy_it): Do the whole copy with a single memcpy.
5499 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5500
5501 Revert the FOLLOW-SYMLINKS change for file-attributes.
5502 Doing it right would require several changes to Tramp, and there's
5503 not enough time to get that tested before the freeze today.
5504 * dired.c (directory_files_internal, Ffile_attributes):
5505 Undo last change.
5506
5507 * frame.c (x_report_frame_params): Port better to wider ints.
5508 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5509 or that pointers can be printed in 15 decimal digits.
5510 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5511
5512 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5513
5514 Support x64 build on MS-Windows.
5515 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5516 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5517 compatibility with x64.
5518 (x_get_focus_frame): Add prototype.
5519
5520 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5521 defining an XRectangle structure.
5522
5523 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5524 arithmetics for compatibility with x64.
5525
5526 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5527 compatibility with x64.
5528
5529 * w32heap.h: Adjust prototypes and declarations.
5530
5531 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5532 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5533 DWORD, long, and unsigned long, for compatibility with x64.
5534 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5535 (sbrk): Argument is now of type ptrdiff_t.
5536
5537 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5538 less than 0x0500.
5539 (w32_msg_pump): Use WPARAM type for 'result'.
5540
5541 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5542 architecture.
5543 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5544 compatibility with x64.
5545
5546 * vm-limit.c (lim_data): Now size_t.
5547 (check_memory_limits): Adjust prototypes of real_morecore and
5548 __morecore to receive argument of type ptrdiff_t. Use size_t for
5549 five_percent and data_size.
5550
5551 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5552 variables, for compatibility with x64.
5553 (rva_to_section, offset_to_section, relocate_offset)
5554 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5555 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5556 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5557 for compatibility with x64.
5558
5559 * sysdep.c (STDERR_FILENO): Define if not already defined.
5560
5561 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5562 (__morecore): Argument type is now ptrdiff_t.
5563 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5564 (relinquish): Use ptrdiff_t type for 'excess'.
5565 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5566
5567 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5568 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5569 instead of a literal number.
5570
5571 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5572 (min): Define only if not already defined.
5573
5574 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5575 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5576 hosts.
5577
5578 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5579 'bitmaps' is a pointer.
5580
5581 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5582
5583 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5584
5585 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5586
5587 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5588 * dired.c (directory_files_internal, Ffile_attributes):
5589 New arg follow_symlinks. All uses changed.
5590
5591 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5592
5593 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5594
5595 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5596
5597 Support atimers and CPU profiler via profile.c on MS-Windows.
5598 * w32proc.c (sig_mask, crit_sig): New static variables.
5599 (sys_signal): Support SIGALRM and SIGPROF.
5600 (sigemptyset, sigaddset, sigfillset, sigprocmask)
5601 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
5602 sigfillset, and sigprocmask are no longer no-ops.
5603 (sigismember): New function.
5604 (struct itimer_data): New definition.
5605 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5606 (crit_prof): New static variables.
5607 (MAX_SINGLE_SLEEP): New definition.
5608 (timer_loop, stop_timer_thread, term_timers, init_timers)
5609 (start_timer_thread, getitimer, setitimer): New functions.
5610 (alarm): No longer a no-op, calls setitimer.
5611
5612 * w32.c (term_ntproc): Call term_timers.
5613 (init_ntproc): Make sure all signals are unblocked at startup, to
5614 erase any traces of dumping. Call init_timers.
5615
5616 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5617 Windows-specific code to display the hourglass mouse pointer is no
5618 longer used.
5619 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5620 to hourglass timer expiration.
5621 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5622 Remove, no longer used.
5623 (w32_note_current_window, show_hourglass, hide_hourglass):
5624 New functions, in support of hourglass cursor display similar to other
5625 window systems.
5626 (syms_of_w32fns): Don't initialize hourglass_timer.
5627
5628 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5629 WINDOWSNT as well.
5630 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5631
5632 * w32.h (init_timers, term_timers): Add prototypes.
5633
5634 2012-09-30 Kenichi Handa <handa@gnu.org>
5635
5636 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5637 to the buffer relocation which may be caused by ccl_driver.
5638
5639 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5640
5641 * xfns.c (Fx_file_dialog): Update comment.
5642
5643 * w32fns.c (Fx_file_dialog): Update comment.
5644
5645 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5646 Initialize panel name field if OSX >= 10.6.
5647
5648 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5649
5650 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5651
5652 * nsterm.m (NEW_STYLE_FS): New define.
5653 (ns_fullscreen_hook, windowWillEnterFullScreen)
5654 (windowDidEnterFullScreen, windowWillExitFullScreen)
5655 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5656 (setFSValue): New functions.
5657 (EmacsFSWindow): New implementation.
5658 (canBecomeKeyWindow): New function for EmacsFSWindow.
5659 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5660 (dealloc): Release nonfs_window if in fullscreen.
5661 (updateFrameSize:): Call windowDidMove to update top/left.
5662 (windowWillResize:toSize:): Check if frame is still maximized.
5663 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5664 next_maximized, maximized_width, maximized_height and nonfs_window.
5665 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5666 tbar_height.
5667 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
5668 fullscreen. Set maximized_width/height. Act on next_maximized.
5669
5670 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5671 (EmacsView): Add variables for fullscreen.
5672 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5673 (EmacsFSWindow): New interface for fullscreen.
5674
5675 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
5676
5677 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5678
5679 2012-09-30 Chong Yidong <cyd@gnu.org>
5680
5681 * fns.c (Frandom): Doc fix.
5682
5683 2012-09-30 Martin Rudalics <rudalics@gmx.at>
5684
5685 * window.c (Vwindow_combination_limit): New default value.
5686 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5687
5688 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5689
5690 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5691 Suggested by Eli Zaretskii in
5692 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5693
5694 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5695
5696 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5697 HAVE_TIMER_SETTIME is defined.
5698
5699 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5700
5701 Profiler improvements: more-accurate timers, overflow checks.
5702 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5703 signal.h, setjmp.h. Include systime.h instead.
5704 (saturated_add): New function.
5705 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5706 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5707 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5708 New static vars.
5709 (enum profiler_cpu_running): New enum.
5710 (profiler_cpu_running): Now of that enum type, not bool.
5711 All uses changed to store the new value.
5712 (handle_profiler_signal): Rename from sigprof_handler_1,
5713 for consistency with other handlers. Do not check whether
5714 cpu_log is a hash-table if garbage collecting, since it
5715 doesn't matter in that case.
5716 (deliver_profiler_signal): Rename from sigprof_handler,
5717 for consistency with other handlers.
5718 (setup_cpu_timer): New function, with much of what used to be in
5719 Fprofiler_cpu_start. Check for out-of-range argument.
5720 Prefer timer_settime if available, and prefer
5721 thread cputime clocks, then process cputime clocks, then
5722 monotonic clocks, to the old realtime clock. Use make_timeval
5723 to round more-correctly when falling back to setitimer.
5724 (Fprofiler_cpu_start): Use it.
5725 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5726 Don't assume that passing NULL as the 2nd argument of setitimer
5727 is the same as passing a pointer to all-zero storage.
5728 Ignore SIGPROF afterwards.
5729 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5730 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5731 non-fatal signal handlers. Ignore SIGPROF on startup.
5732 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5733 in profiler.c, since sysdep.c now uses it.
5734
5735 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5736 Suggested by Eli Zaretskii in
5737 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5738
5739 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
5740
5741 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5742
5743 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5744
5745 * lisp.h (struct backtrace): Remove indirection for `function' field.
5746 * xdisp.c (redisplay_internal):
5747 * profiler.c (record_backtrace, sigprof_handler_1):
5748 * alloc.c (Fgarbage_collect):
5749 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5750 (Fbacktrace_frame): Adjust accordingly.
5751
5752 2012-09-28 Glenn Morris <rgm@gnu.org>
5753
5754 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5755 (Frun_hook_with_args_until_failure): Doc fixes.
5756
5757 2012-09-28 Eli Zaretskii <eliz@gnu.org>
5758
5759 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5760 Qautomatic_redisplay and change the symbol name. All users changed.
5761
5762 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5763
5764 * profiler.c (sigprof_handler): Fix race condition.
5765
5766 2012-09-28 Glenn Morris <rgm@gnu.org>
5767
5768 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5769
5770 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5771
5772 Check more robustly for timer_settime.
5773 * Makefile.in (LIB_TIMER_TIME): New macro.
5774 (LIBES): Add it.
5775 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5776 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5777 call timer_settime.
5778
5779 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5780
5781 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5782
5783 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
5784
5785 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5786
5787 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5788
5789 * character.h (MAYBE_UNIFY_CHAR): Remove.
5790 * charset.c, charset.h (maybe_unify_char): Now static.
5791 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5792 Since this stuff is now private to charset.c, there's no need for
5793 a public macro and no need to inline by hand.
5794
5795 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5796 Stefan Monnier <monnier@iro.umontreal.ca>
5797 Juanma Barranquero <lekktu@gmail.com>
5798
5799 * profiler.c: New file.
5800 * Makefile.in (base_obj): Add profiler.o.
5801 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5802 ($(BLD)/profiler.$(O)): New target.
5803 * emacs.c (main): Call syms_of_profiler.
5804 * alloc.c (Qautomatic_gc): New constant.
5805 (MALLOC_PROBE): New macro.
5806 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5807 (total_bytes_of_live_objects): New function.
5808 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5809 Call malloc_probe for the memory profiler.
5810 (syms_of_alloc): Define Qautomatic_gc.
5811 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5812 race condition.
5813 (struct backtrace): Move definition...
5814 * lisp.h (struct backtrace): ..here.
5815 (Qautomatic_gc, profiler_memory_running): Declare vars.
5816 (malloc_probe, syms_of_profiler): Declare functions.
5817 * xdisp.c (Qautomatic_redisplay): New constant.
5818 (redisplay_internal): Record itself in backtrace_list.
5819 (syms_of_xdisp): Define Qautomatic_redisplay.
5820
5821 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5822 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5823
5824 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5825
5826 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5827
5828 Prefer POSIX timers if available.
5829 They avoid a race if the timer is too close to the current time.
5830 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5831 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
5832 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
5833
5834 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5835
5836 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5837 CHAR_STRING_ADVANCE.
5838 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5839 STRING_CHAR_ADVANCE.
5840
5841 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5842
5843 Move Vlibrary_cache to emacs.c and reset before dumping.
5844
5845 * lisp.h (reset_image_types): Declare.
5846 [WINDOWSNT] (Vlibrary_cache): Declare.
5847
5848 * image.c (reset_image_types): New function.
5849
5850 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5851 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5852 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5853
5854 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5855 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5856
5857 * w32.h (Vlibrary_cache): Do not declare.
5858
5859 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5860
5861 * w32proc.c (sys_signal): Handle all signals defined by the
5862 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5863 handlers for signals supported by Windows. Don't override
5864 term_ntproc as the handler for SIGABRT.
5865 (sigaction): Rewrite to call sys_signal instead of duplicating its
5866 code.
5867 (sys_kill): Improve commentary.
5868
5869 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5870 consistency with a signature of a signal handler. All callers
5871 changed.
5872 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5873 install term_ntproc as a signal handler for SIGABRT, as that
5874 should be done by the dumped Emacs.
5875
5876 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5877
5878 * w32select.c (term_w32select): Protect against repeated
5879 invocation by setting clipboard_owner to NULL after calling
5880 DestroyWindow.
5881
5882 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5883 and term_ntproc to their modified signatures.
5884
5885 * character.c (char_string, string_char): Remove calls to
5886 MAYBE_UNIFY_CHAR. See the discussion starting at
5887 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5888 for the details.
5889
5890 2012-09-25 Chong Yidong <cyd@gnu.org>
5891
5892 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5893
5894 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5895
5896 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5897 when encountering an unknown bytecode.
5898
5899 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5900
5901 image.c, indent.c: Use bool for booleans.
5902 * dispextern.h (struct image_type): Members valid_p, load, init
5903 now return bool, not int. All uses changed.
5904 * image.c: Omit unnecessary static decls.
5905 (x_create_bitmap_mask, x_build_heuristic_mask):
5906 Return void, not int, since callers don't care about the return value.
5907 (x_create_bitmap_mask, define_image_type, valid_image_p)
5908 (struct image_keyword, parse_image_spec, image_spec_value)
5909 (check_image_size, image_background)
5910 (image_background_transparent, x_clear_image_1)
5911 (postprocess_image, lookup_image, x_check_image_size)
5912 (x_create_x_image_and_pixmap, xbm_image_p)
5913 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5914 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5915 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5916 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5917 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5918 (png_image_p, init_png_functions, png_load_body, png_load)
5919 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5920 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5921 (init_gif_functions, gif_load, imagemagick_image_p)
5922 (imagemagick_load_image, imagemagick_load, svg_image_p)
5923 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5924 (gs_load):
5925 * nsimage.m (ns_load_image):
5926 * nsterm.m (ns_defined_color):
5927 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5928 * xfns.c (x_defined_color):
5929 * xterm.c (x_alloc_lighter_color_for_widget)
5930 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5931 (x_alloc_lighter_color):
5932 * indent.c (disptab_matches_widthtab, current_column)
5933 (scan_for_column, string_display_width, indented_beyond_p)
5934 (compute_motion, vmotion, Fvertical_motion):
5935 Use bool for booleans.
5936
5937 2012-09-24 Chong Yidong <cyd@gnu.org>
5938
5939 * chartab.c (Fset_char_table_default): Obsolete function removed.
5940
5941 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5942
5943 Move pid_t related decls out of lisp.h.
5944 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5945 (interruptible_wait_for_termination):
5946 Move these decls from lisp.h to syswait.h, since they use pid_t.
5947 Needed on FreeBSD; see Herbert J. Skuhra in
5948 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5949 * callproc.c: Include syswait.h.
5950
5951 gnutls.c, gtkutil.c: Use bool for boolean.
5952 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5953 (emacs_gnutls_handle_error):
5954 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5955 (xg_hide_tooltip, xg_create_frame_widgets)
5956 (create_dialog, xg_uses_old_file_dialog)
5957 (xg_get_file_with_chooser, xg_get_file_with_selection)
5958 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5959 (xg_item_label_same_p, xg_update_menubar)
5960 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5961 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5962 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5963 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5964 (update_frame_tool_bar, free_frame_tool_bar):
5965 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5966 * nsmenu.m (ns_update_menubar):
5967 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5968 * xfns.c (Fx_show_tip) [USE_GTK]:
5969 Use bool for boolean.
5970 * gtkutil.c (xg_update_frame_menubar):
5971 * xmenu.c (update_frame_menubar):
5972 Return void, not int, since caller ignores return value.
5973 * gtkutil.c (xg_change_toolbar_position):
5974 Return void, not 1.
5975
5976 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5977
5978 * makefile.w32-in (BLOCKINPUT_H): Remove.
5979 (SYSSIGNAL_H): New macro.
5980 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5981 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5982 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5983 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5984 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5985 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5986 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5987 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5988 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5989 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5990 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5991 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5992 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5993 ($(BLD)/w32xfns.$(O)): Update dependencies.
5994
5995 2012-09-23 Eli Zaretskii <eliz@gnu.org>
5996
5997 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5998 fatal_error_backtrace.
5999
6000 * w32proc.c (sys_kill): Undo last change: don't do anything when
6001 invoked to deliver SIGABRT to our own process. This is now
6002 handled by emacs_raise.
6003
6004 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6005
6006 * w32term.c (w32_read_socket): Remove leftover reference to
6007 interrupt_input_pending.
6008
6009 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6010
6011 Do not use SA_NODEFER.
6012 Problem reported by Dani Moncayo in
6013 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6014 * alloc.c (die):
6015 * sysdep.c (emacs_abort): Do not reset signal handler.
6016 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6017 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6018 wanted even on POSIXish hosts, and it doesn't work on Windows.
6019
6020 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6021
6022 * xterm.c (x_term_init): Call fixup_locale before and after calling
6023 gtk_init (Bug#12392).
6024
6025 2012-09-23 Chong Yidong <cyd@gnu.org>
6026
6027 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6028 Vdynamic_library_alist.
6029
6030 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6031 (Fgnutls_available_p): Caller changed.
6032
6033 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6034 (Flibxml_parse_xml_region): Likewise.
6035
6036 * dispextern.h (struct image_type): Remove arg from init function.
6037
6038 * image.c (Finit_image_library, lookup_image_type)
6039 (define_image_type): Remove now-unneeded second arg.
6040 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6041 (init_tiff_functions, init_gif_functions, init_svg_functions):
6042 Arglist and w32_delayed_load calling convention changed.
6043 (gs_type): Remove init_gs_functions; there is no such function.
6044 (valid_image_p, make_image): Fix caller to lookup_image_type.
6045
6046 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6047
6048 Simplify and avoid signal-handling races (Bug#12471).
6049 * alloc.c (die):
6050 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6051 Avoid recursive loop if there's a fatal error in the function itself.
6052 * atimer.c (pending_atimers):
6053 * blockinput.h: Don't include "atimer.h"; no longer needed.
6054 (interrupt_input_pending): Remove. All uses removed.
6055 pending_signals now counts both atimers and ordinary interrupts.
6056 This is less racy than having three separate pending-signal flags.
6057 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6058 (input_blocked_p):
6059 Rename from their upper-case counterparts BLOCK_INPUT,
6060 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6061 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6062 This makes it easier to access volatile variables more accurately.
6063 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6064 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6065 that's more reliable if the code is buggy and sets
6066 interrupt_input_blocked to a negative value. All uses changed.
6067 * atimer.c (deliver_alarm_signal):
6068 Remove. No need to deliver this to the parent; any thread can
6069 handle this signal now. All uses replaced by underlying handler.
6070 * atimer.c (turn_on_atimers):
6071 * dispnew.c (handle_window_change_signal):
6072 * emacs.c (handle_danger_signal):
6073 * keyboard.c (kbd_buffer_get_event):
6074 Don't reestablish signal handler; not needed with sigaction.
6075 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6076 (UNBLOCK_INPUT_TO):
6077 Rework to avoid unnecessary accesses to volatile variables.
6078 (UNBLOCK_INPUT_TO): Now a function.
6079 (totally_unblock_input, unblock_input): New decls.
6080 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6081 (init_data): Remove. Necessary stuff now done in init_signal.
6082 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6083 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6084 (fatal_error_code): Remove; no longer needed.
6085 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6086 it doesn't always backtrace. All uses changed. No need to reset
6087 signal to default, since sigaction and/or die does that for us now.
6088 Use emacs_raise (FOO), not kill (getpid (), FOO).
6089 (main): Check more-accurately whether we're dumping.
6090 Move fatal-error setup to sysdep.c
6091 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6092 * gtkutil.c (xg_get_file_name, xg_get_font):
6093 Remove no-longer-needed signal-mask manipulation.
6094 * keyboard.c, process.c (POLL_FOR_INPUT):
6095 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6096 * keyboard.c (read_avail_input): Remove.
6097 All uses replaced by gobble_input.
6098 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6099 (kbd_buffer_store_event_hold, gobble_input):
6100 (record_asynch_buffer_change) [USABLE_SIGIO]:
6101 (store_user_signal_events):
6102 No need to mess with signal mask.
6103 (gobble_input): If blocking input and there are terminals, simply
6104 set pending_signals to 1 and return. All hooks changed to not
6105 worry about whether input is blocked.
6106 (process_pending_signals): Clear pending_signals before processing
6107 them, in case a signal comes in while we're processing.
6108 By convention callers now test pending_signals before calling us.
6109 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6110 New functions, to support changes to blockinput.h.
6111 (handle_input_available_signal): Now extern.
6112 (reinvoke_input_signal): Remove. All uses replaced by
6113 handle_async_input.
6114 (quit_count): Now volatile, since a signal handler uses it.
6115 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6116 All callers changed. Block SIGINT only if not already blocked.
6117 Clear sigmask reliably, even if Fsignal returns, which it can.
6118 Omit unnecessary accesses to volatile var.
6119 (quit_throw_to_read_char): No need to restore sigmask.
6120 * keyboard.c (gobble_input, handle_user_signal):
6121 * process.c (wait_reading_process_output):
6122 Call signal-handling code rather than killing ourselves.
6123 * lisp.h: Include <float.h>, for...
6124 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6125 (pending_signals): Now volatile.
6126 (syms_of_data): Now const if IEEE floating point.
6127 (handle_input_available_signal) [USABLE_SIGIO]:
6128 (terminate_due_to_signal, record_child_status_change): New decls.
6129 * process.c (create_process): Avoid disaster if memory is exhausted
6130 while we're processing a vfork, by tightening the critical section
6131 around the vfork.
6132 (send_process_frame, process_sent_to, handle_pipe_signal)
6133 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6134 ignores SIGPIPE.
6135 (send_process): No need for setjmp/longjmp any more, since the
6136 SIGPIPE stuff is now gone. Instead, report an error if errno
6137 is EPIPE.
6138 (record_child_status_change): Now extern. PID and W are now args.
6139 Return void, not bool. All callers changed.
6140 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6141 Remove. All uses removed. This bug should be fixed now in a
6142 different way.
6143 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6144 and record the child status change directly. This avoids the
6145 need to futz with the signal mask.
6146 (process_fatal_action): Move here from emacs.c.
6147 (emacs_sigaction_flags): New function, containing
6148 much of what used to be in emacs_sigaction_init.
6149 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6150 caught by emacs, to make races less likely.
6151 (deliver_process_signal): Rename from handle_on_main_thread.
6152 All uses changed.
6153 (BACKTRACE_LIMIT_MAX): Now at top level.
6154 (thread_backtrace_buffer, threadback_backtrace_pointers):
6155 New static vars.
6156 (deliver_thread_signal, deliver_fatal_thread_signal):
6157 New functions, for more-accurate delivery of thread-specific signals.
6158 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6159 (deliver_arith_signal): Handle in this thread, not
6160 in the main thread, since it's triggered by this thread.
6161 (maybe_fatal_sig): New function.
6162 (init_signals): New arg DUMPING so that we can be more accurate
6163 about whether we're dumping. Caller changed.
6164 Treat thread-specific signals differently from process-general signals.
6165 Block all signals while handling fatal error; that's safer.
6166 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6167 on IEEE hosts.
6168 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6169 Ignore SIGPIPE unless batch.
6170 (emacs_backtrace): Output backtrace for the appropriate thread,
6171 which is not necessarily the main thread.
6172 * syssignal.h: Include <stdbool.h>.
6173 (emacs_raise): New macro.
6174 * xterm.c (x_connection_signal): Remove; no longer needed
6175 now that we use sigaction.
6176 (x_connection_closed): No need to mess with sigmask now.
6177 (x_initialize): No need to reset SIGPIPE handler here, since
6178 init_signals does this for us now.
6179
6180 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6181
6182 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6183 background rect may be larger (Bug#12245).
6184
6185 2012-09-23 Chong Yidong <cyd@gnu.org>
6186
6187 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6188
6189 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6190
6191 * .gdbinit: Just stop at fatal_error_backtrace.
6192 See Stefan Monnier's request in
6193 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6194 Remove no-longer-used query of system type.
6195
6196 2012-09-22 Chong Yidong <cyd@gnu.org>
6197
6198 * search.c (Freplace_match): Doc fix (Bug#12325).
6199
6200 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6201
6202 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6203 (Fline_end_position): Doc fix.
6204
6205 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6206
6207 2012-09-22 Chong Yidong <cyd@gnu.org>
6208
6209 * dispextern.h (struct image_type): Add new slot, storing a type
6210 initialization function.
6211
6212 * image.c (define_image_type): Call the image initializer function
6213 if it is defined. Arguments and return value changed.
6214 (valid_image_p, make_image): Callers changed.
6215 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
6216 (gif_type, imagemagick_type, svg_type, gs_type):
6217 Add initialization functions.
6218 (Finit_image_library): Call lookup_image_type.
6219 (CHECK_LIB_AVAILABLE): Macro deleted.
6220 (lookup_image_type): Call define_image_type here, rather than via
6221 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6222 (syms_of_image): Move define_image_type calls for xbm_type and
6223 pbm_type to lookup_image_type.
6224
6225 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6226
6227 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6228 'idle_timers' from here ...
6229 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6230 lists, to avoid infloops when the timer does something stupid,
6231 like reinvoke itself with the same or smaller time-out.
6232 (Bug#12447)
6233
6234 2012-09-22 Martin Rudalics <rudalics@gmx.at>
6235
6236 * window.c (Fsplit_window_internal): Handle only Qt value of
6237 Vwindow_combination_limit separately.
6238 (Qtemp_buffer_resize): New symbol.
6239 (Vwindow_combination_limit): New default value.
6240 Rewrite doc-string.
6241
6242 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6243
6244 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6245 the new overlay string. (Bug#10159)
6246
6247 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6248
6249 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6250 or that fprintf is async-signal-safe. POSIX doesn't require
6251 either assumption.
6252
6253 2012-09-22 Chong Yidong <cyd@gnu.org>
6254
6255 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6256 (Bug#8207).
6257
6258 2012-09-22 Kenichi Handa <handa@gnu.org>
6259
6260 * composite.c (composition_reseat_it): Handle the case that a
6261 grapheme cluster is not covered by a single font (Bug#12352).
6262
6263 2012-09-21 Chong Yidong <cyd@gnu.org>
6264
6265 * image.c (define_image_type): Avoid adding duplicate types to
6266 image_types (Bug#12463). Suggested by Jörg Walter.
6267
6268 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6269
6270 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6271 (print_load_command_name): Add case LC_DATA_IN_CODE.
6272 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6273
6274 2012-09-21 Glenn Morris <rgm@gnu.org>
6275
6276 * eval.c (Frun_hook_with_args_until_success)
6277 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6278
6279 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
6280
6281 * fileio.c (Ffile_selinux_context): Only call freecon when
6282 lgetfilecon succeeded.
6283 (Fset_file_selinux_context): Likewise. (Bug#12444)
6284
6285 2012-09-21 Eli Zaretskii <eliz@gnu.org>
6286
6287 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6288 reordering, locate the cursor by calling set_cursor_from_row; if
6289 that fails, clear the desired glyph matrix before returning a
6290 failure indication to the caller. Fixes leaving garbled display
6291 when fast scrolling with a down-key. (Bug#12403)
6292 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6293 scrolling through multibyte text.
6294
6295 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6296
6297 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6298 calling mark_vectorlike since that's the one that marks the window.
6299 (mark_discard_killed_buffers): Mark the final cdr.
6300 * window.h (struct window): Move prev/next_buffers to the
6301 non-standard fields.
6302 * window.c (make_window): Initialize prev/next_buffers manually.
6303
6304 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6305
6306 Omit unused arg EXPECTED from socket hooks.
6307 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6308 * nsterm.m (ns_term_init):
6309 * termhooks.h (struct terminal.read_socket_hook):
6310 * w32inevt.c (w32_console_read_socket):
6311 * w32term.c (w32_read_socket):
6312 * xterm.c (XTread_socket):
6313 Omit unused arg EXPECTED. All callers changed.
6314 (store_user_signal_events): Return void, not int, since callers no
6315 longer care about the return value. All uses changed.
6316
6317 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
6318
6319 * w32gui.h (XParseGeometry): Do not declare.
6320
6321 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6322
6323 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
6324 Ignore 'expected'. See Eli Zaretskii in
6325 <http://bugs.gnu.org/12471#8> (last line).
6326
6327 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6328 (XParseGeometry): Now static. Substitute extremal values for
6329 values that are out of range.
6330
6331 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6332
6333 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6334
6335 * nsfns.m (XParseGeometry): Remove.
6336 (Fx_create_frame): Call x_set_offset to correctly interpret
6337 top_pos in geometry.
6338
6339 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
6340 (Fx_parse_geometry): If there is a space in string, call
6341 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6342
6343 2012-09-17 Eli Zaretskii <eliz@gnu.org>
6344
6345 * search.c (scan_buffer): Use character positions in calls to
6346 region_cache_forward and region_cache_backward, not byte
6347 positions. (Bug#12196)
6348
6349 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6350 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6351
6352 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6353 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6354 emacs_blocked_malloc, now deleted.
6355
6356 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6357
6358 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6359 The workaround was for improving performance on Solaris 2.4, but
6360 is getting in the way now. Emacs will still work if someone is
6361 still running Solaris 2.4 in a museum somewhere; Sun dropped
6362 support for Solaris 2.4 in 2003.
6363 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6364 * process.c (create_process) [HAVE_WORKING_VFORK]:
6365 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6366 since Emacs no longer uses vfork on that platform.
6367
6368 2012-09-17 Glenn Morris <rgm@gnu.org>
6369
6370 * emacs.c: Use COPYRIGHT.
6371
6372 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6373
6374 Remove configure's --without-sync-input option (Bug#12450).
6375 When auditing signal-handling in preparation for cleaning it up,
6376 I found that SYNC_INPUT has race conditions and would be a real
6377 pain to fix. Since it's an undocumented and deprecated
6378 configure-time option, now seems like a good time to remove it.
6379 Also see <http://bugs.gnu.org/11080#16>.
6380 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6381 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6382 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6383 (malloc_hysteresis):
6384 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6385 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6386 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6387 (dont_register_blocks, bytes_used_when_reconsidered)
6388 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6389 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6390 [!SYSTEM_MALLOC && !SYNC_INPUT]:
6391 Remove. All uses removed.
6392 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6393 implementation, one that depends on whether the new macro
6394 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6395 is defined.
6396 * atimer.c (run_timers, handle_alarm_signal):
6397 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6398 (handle_async_input, process_pending_signals)
6399 (handle_input_available_signal, init_keyboard):
6400 * nsterm.m (ns_read_socket):
6401 * process.c (wait_reading_process_output):
6402 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6403 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6404 (emacs_write):
6405 * xterm.c (XTread_socket):
6406 Assume SYNC_INPUT.
6407 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6408 * eval.c (handling_signal): Remove. All uses removed.
6409 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6410 All uses replaced with the SYNC_INPUT version.
6411 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6412 Remove decls.
6413 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6414 Now static.
6415
6416 * font.c (Ffont_shape_gstring): Remove unused local.
6417
6418 2012-09-16 Glenn Morris <rgm@gnu.org>
6419
6420 * Makefile.in (clean): No longer run nextstep's clean.
6421
6422 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6423 (ns_frag): Remove.
6424 (ns-app): Move here from ns.mk, and simplify.
6425 (clean): Simplify nextstep entry.
6426 * ns.mk: Remove file.
6427
6428 2012-09-17 Kenichi Handa <handa@gnu.org>
6429
6430 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6431 not covert the last few charactes.
6432
6433 2012-09-16 Kenichi Handa <handa@gnu.org>
6434
6435 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6436 here, but just check the validity of glyphs in the glyph-string.
6437
6438 2012-09-16 Martin Rudalics <rudalics@gmx.at>
6439
6440 * window.c (Fwindow_parameter, Fset_window_parameter):
6441 Accept any window as argument (Bug#12452).
6442
6443 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6444
6445 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6446 to ns_term_init to avoid memory leak.
6447
6448 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6449 explicit retain/release.
6450 (ns_term_init): Only allow one display. Initialize outerpool and
6451 ns_*_types.
6452
6453 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6454
6455 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6456 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6457 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6458 the Microsoft problem in a different way, by altering ../nt/config.nt.
6459
6460 2012-09-15 Eli Zaretskii <eliz@gnu.org>
6461
6462 * w32xfns.c:
6463 * w32uniscribe.c:
6464 * w32term.c:
6465 * w32select.c:
6466 * w32reg.c:
6467 * w32proc.c:
6468 * w32menu.c:
6469 * w32inevt.c:
6470 * w32heap.c:
6471 * w32font.c:
6472 * w32fns.c:
6473 * w32console.c:
6474 * w32.c:
6475 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6476 by lisp.h. This completes removal of setjmp.h inclusion
6477 erroneously announced in the previous commit. (Bug#12446)
6478
6479 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6480 more accurate.
6481
6482 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6483 not defined as a macro. The latter happens on MS-Windows.
6484 (Bug#12446)
6485
6486 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6487
6488 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6489 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
6490 Some instances of '#include <setjmp.h>' removed, if the
6491 only reason for the instance was because "lisp.h" was included.
6492 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6493 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6494 and _longjmp with the new symbols. Emacs already uses _setjmp if
6495 available, so this change affects only POSIXish hosts that have
6496 sigsetjmp but not _setjmp, such as some versions of Solaris and
6497 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6498 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6499 (png_load_body) [HAVE_PNG]:
6500 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6501 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6502 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6503 since PNG requires jmp_buf. This is the only exception to the
6504 general rule that we now use sys_setjmp and sys_longjmp.
6505 This exception is OK since this code does not change the signal
6506 mask or longjmp out of a signal handler.
6507
6508 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6509
6510 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6511 Include "syssignal.h", for 'main_thread'.
6512
6513 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6514
6515 Avoid out-of-range marker position (Bug#12426).
6516 * insdel.c (replace_range, replace_range_2):
6517 Adjust markers before overlays, as suggested by comments.
6518 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6519 Remove redundant check before calling offset_intervals.
6520
6521 2012-09-14 Martin Rudalics <rudalics@gmx.at>
6522
6523 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6524 current buffer (Bug#12387).
6525
6526 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
6527
6528 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6529
6530 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6531
6532 Use a more backwards-compatible timer format (Bug#12430).
6533 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6534 vector element, not from the 4th, since PSECS is now at the end.
6535 (Fcurrent_idle_time): Doc fix.
6536
6537 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6538
6539 Function to mark objects and remove killed buffers at once.
6540 * alloc.c (discard_killed_buffers): Rename to ...
6541 (mark_discard_killed buffers) ... new name. Add marking
6542 of remaining objects. Fix comment. Adjust users.
6543 (mark_object): Do not touch frame buffer lists here.
6544 * frame.c (delete_frame): Reset frame buffer lists here.
6545
6546 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6547
6548 Better workaround for GNOME bug when --enable-gcc-warnings.
6549 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6550 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6551 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6552
6553 Simplify SIGIO usage (Bug#12408).
6554 The code that dealt with SIGIO was crufty and confusing, e.g., it
6555 played tricks like "#undef SIGIO" but these tricks were not used
6556 consistently. Simplify mostly by not #undeffing standard symbols,
6557 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6558 or not as we please) rather than "defined SIGIO" (standard symbol
6559 that we probably shouldn't #undef).
6560 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6561 Modules that need it can include it.
6562 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6563 * dispextern.h (ignore_sigio): New decl.
6564 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6565 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6566 * emacs.c (shut_down_emacs):
6567 * keyboard.c (kbd_buffer_store_event_hold):
6568 Use ignore_sigio rather than invoking 'signal' directly.
6569 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6570 for FIONREAD.
6571 (FIONREAD, SIGIO): Do not #undef.
6572 (tty_read_avail_input): Use #error rather than a syntax error.
6573 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6574 for I_PIPE, used by SETUP_SLAVE_PTY.
6575 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6576 * sysdep.c (croak): Remove; no longer needed. This bit of
6577 temporary code, with Fred N. Fish's comment that it's temporary,
6578 has been in Emacs since at least 1992!
6579 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6580 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6581 * syssignal.h (croak): Remove decl.
6582 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6583 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6584 now that we're termios-only.
6585 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6586 * term.c (dissociate_if_controlling_tty): Use #error rather than
6587 a run-time error.
6588
6589 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6590 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6591 to work around GNOME bug 683906.
6592 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6593 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6594 This works around GCC bug 54561.
6595
6596 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6597
6598 More fixes for 'volatile' and setjmp/longjmp.
6599 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6600 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6601 (png_load_body) [HAVE_PNG]:
6602 (jpeg_load_body) [HAVE_JPEG]:
6603 New function, with most of the old parent function's body.
6604 (png_load) [HAVE_PNG]:
6605 (jpeg_load) [HAVE_JPEG]:
6606 Invoke the new function, to avoid longjmp munging our locals.
6607 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6608 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6609 longjmp is passed 2, as the C standard doesn't guarantee this.
6610 Instead, store the failure code into mgr->failure_code.
6611
6612 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6613
6614 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6615 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6616 (syms_of_keyboard): Remove support for unread-command-char.
6617
6618 2012-09-12 Eli Zaretskii <eliz@gnu.org>
6619
6620 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6621 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6622 violation. (Bug#12426)
6623
6624 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6625
6626 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6627
6628 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6629
6630 * eval.c: Add `inhibit-debugger'.
6631 (Qinhibit_debugger): New symbol.
6632 (call_debugger): Bind it instead of Qdebug_on_error.
6633 (maybe_call_debugger): Test Vinhibit_debugger.
6634 (syms_of_eval): Define inhibit-debugger.
6635 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6636 (syms_of_xdisp): Remove inhibit-debug-on-message.
6637
6638 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6639
6640 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6641 If a nonvolatile local variable is written before a _longjmp to
6642 the frame containing the variable, and is read after the _longjmp,
6643 the value read is indeterminate. Some local variables of type
6644 'struct handler' and 'struct catchtag' are used in this way, so
6645 mark each of their slots as volatile if the slot can be set before
6646 _longjmp and read afterwards.
6647 * lisp.h (struct handler): var and chosen_clause are now volatile.
6648 (struct catchtag): val, next, and pdlcount are now volatile.
6649
6650 * bidi.c (bidi_push_it, bidi_pop_it):
6651 * fns.c (copy_hash_table):
6652 * image.c (define_image_type):
6653 * keyboard.c (kbd_buffer_store_event_hold):
6654 * process.c (Fprocess_send_eof):
6655 * xfaces.c (x_create_gc) [HAVE_NS]:
6656 * xgselect.c (xg_select):
6657 Prefer assignment to memcpy when either will do.
6658
6659 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6660 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6661 time an item is removed. No need to mark this function 'inline';
6662 the compiler knows better than we do.
6663
6664 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6665
6666 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6667 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6668 to change_frame_size (Bug#12388).
6669 (windowDidResize:): Pass YES to updateFrameSize.
6670
6671 * nsterm.h: Add delay parameter to updateFrameSize.
6672
6673 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6674
6675 Discard killed buffers from deleted window and frame objects.
6676 This reduces an amount of references to killed buffers and
6677 helps GC to reclaim them faster.
6678 * alloc.c (discard_killed_buffers): New function.
6679 (mark_object): Use it for deleted windows and frames.
6680 (mark_object): If symbol's value is set up for a killed buffer
6681 or deleted frame, restore its global binding.
6682 * data.c (swap_in_global_binding): Add GC notice.
6683 (swap_in_symval_forwarding): Use convenient set_blv_where.
6684 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6685 * window.h: ... to here.
6686
6687 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6688
6689 Convenient macro to check whether the buffer is live.
6690 * buffer.h (BUFFER_LIVE_P): New macro.
6691 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6692 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6693
6694 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6695
6696 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6697 composition cases (Bug#12364).
6698
6699 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6700 overhang of succeeding glyphs overlapping box cursor.
6701
6702 * w32term.c (x_draw_glyph_string): Likewise.
6703
6704 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 Simplify, document, and port floating-point (Bug#12381).
6707 The porting part of this patch fixes bugs on non-IEEE platforms
6708 with frexp, ldexp, logb.
6709 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6710 Now static.
6711 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6712 support, by removing commented-out code and briefly listing the
6713 C89 functions excluded. The commented-out stuff was confusing
6714 maintenance, e.g., we thought we needed cbrt but it was commented out.
6715 (logb): Remove decl; no longer needed.
6716 (isfinite): New macro, if not already supplied.
6717 (isnan): Don't replace any existing macro.
6718 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6719 are present on all C89 platforms.
6720 (Ffrexp): Do not special-case zero, as frexp does the right thing
6721 for that case.
6722 (Flogb): Do not use logb, as it doesn't have the desired meaning
6723 on hosts that use non-base-2 floating point. Instead, stick with
6724 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6725 frexp, to avoid getting an unspecified result.
6726
6727 * xdisp.c (Qinhibit_debug_on_message): Now static.
6728
6729 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6730
6731 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6732 NSBezierPath (Bug#12131).
6733
6734 2012-09-10 Chong Yidong <cyd@gnu.org>
6735
6736 * fns.c (Fdelq, Fdelete): Doc fix.
6737
6738 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6739
6740 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6741 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6742
6743 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6744
6745 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6746 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6747 Use it.
6748
6749 2012-09-09 Eli Zaretskii <eliz@gnu.org>
6750
6751 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6752 left fringe if the window has a left margin. This avoids leaving
6753 traces of the cursor because its leftmost pixel is not drawn over.
6754
6755 * dispnew.c (update_window_line): When the left margin area of a
6756 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6757 that screen line. (Bug#12277)
6758
6759 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6760
6761 Assume C89 or later for math functions (Bug#12381).
6762 This simplifies the code, and makes it a bit smaller and faster,
6763 and (most important) makes it easier to clean up signal handling
6764 since we can stop worring about floating-point exceptions in
6765 library code. That was a problem before C89, but the problem
6766 went away many years ago on all practical Emacs targets.
6767 * data.c, image.c, lread.c, print.c:
6768 Don't include <math.h>; no longer needed.
6769 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6770 might be autoconfigured, as that never happens.
6771 * data.c (fmod):
6772 * doprnt.c (DBL_MAX_10_EXP):
6773 * print.c (DBL_DIG):
6774 Remove. C89 or later always defines these.
6775 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6776 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6777 (arith_error, domain_error, domain_error2):
6778 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6779 no longer needed -- we simply return what C returns. All uses removed.
6780 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6781 the wrapped code.
6782 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6783 Remove. All uses expanded, as these macros are no longer used
6784 more than once and are now more trouble than they're worth.
6785 (Ftan): Use tan, not sin / cos.
6786 (Flogb): Assume C89 frexp.
6787 (fmod_float): Assume C89 fmod.
6788 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6789 (init_floatfns): Remove. All uses removed.
6790
6791 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6792
6793 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6794 compositeToPoint for OSX < 10.6 (Bug#12390).
6795
6796 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6797
6798 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6799 This produces more-accurate results.
6800
6801 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6802
6803 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6804 changes (Bug#12088).
6805
6806 2012-09-08 Chong Yidong <cyd@gnu.org>
6807
6808 * syntax.c (Fstring_to_syntax): Doc fix.
6809
6810 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6811
6812 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6813 in the internal border.
6814 (x_set_window_size): Remove static variables and their usage.
6815 (ns_redraw_scroll_bars): Fix NSTRACE arg.
6816 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6817 Remove fringe/internal border adjustment (Bug#11052).
6818 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6819 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6820 (ns_fix_rect_ibw): Remove.
6821 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6822 (ns_dumpglyphs_box_or_relief): Ditto.
6823 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6824 adjustment.
6825 (ns_dumpglyphs_image): Ditto.
6826 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
6827 border adjustment.
6828 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6829 their usage. Add fringe_extended_p and its use as in other terms.
6830 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6831 scroll bar was removed.
6832 (updateFrameSize): New function.
6833 (windowDidResize): Move code to updateFrameSize and call it.
6834
6835 * nsterm.h (EmacsView): Add updateFrameSize.
6836
6837 2012-09-07 Chong Yidong <cyd@gnu.org>
6838
6839 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6840
6841 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6842
6843 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6844
6845 More signal-handler cleanup (Bug#12327).
6846 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6847 Problem introduced when merging patches. Noted by Eli Zaretskii in
6848 <http://bugs.gnu.org/12327#67>.
6849 * floatfns.c: Comment fix.
6850 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6851 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6852 and anyway the declaration is harmless even if SIGDANGER is not defined.
6853 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6854 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6855 source files not surprisingly expected syssignal.h to define, or
6856 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6857 Include <sys/ioctl.h>, for FIONREAD.
6858 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6859 This eliminates a problem whereby other files mysteriously had
6860 to include "syssignal.h" before including "systty.h" if they
6861 wanted to use "#ifdef SIGIO".
6862
6863 2012-09-07 Eli Zaretskii <eliz@gnu.org>
6864
6865 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6866
6867 * w32.c (sigemptyset): Empty the set.
6868 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6869
6870 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6871
6872 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6873
6874 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6875 (mark_object): Likewise for frame objects.
6876
6877 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6878
6879 * syssignal.h (handle_on_main_thread): Always declare,
6880 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6881 This ports to platforms without HAVE_PTHREAD.
6882
6883 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6884
6885 Signal-handler cleanup (Bug#12327).
6886 Emacs's signal handlers were written in the old 4.2BSD style with
6887 sigblock and sigmask and so forth, and this led to some
6888 inefficiencies and confusion. Rewrite these to use
6889 pthread_sigmask etc. without copying signal sets around. Also,
6890 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6891 'signal', and instead use functions that do not attempt to take
6892 over the system name space. This patch causes Emacs's text
6893 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6894 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6895 Do not include <signal.h> or "syssignal.h", as these
6896 modules do not use signals.
6897 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6898 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6899 Do not include <signal.h>, as "syssignal.h" does that for us now.
6900 * atimer.c (sigmask_atimers): New function.
6901 (block_atimers, unblock_atimers): New functions,
6902 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6903 All uses replaced.
6904 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6905 no longer needed here.
6906 * emacs.c (main): Inspect existing signal handler with sigaction,
6907 so that there's no need to block and unblock SIGHUP.
6908 * sysdep.c (struct save_signal): New member 'action', replacing
6909 old member 'handler'.
6910 (save_signal_handlers, restore_signal_handlers):
6911 Use sigaction instead of 'signal' to save and restore.
6912 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6913 New function. All users of 'signal' modified to use set_sighandler
6914 if they're writeonly, and to use sys_signal if they're read+write.
6915 (emacs_sigaction_init, forwarded_signal): New functions.
6916 (sys_signal): Remove. All uses replaced by calls to sigaction
6917 and emacs_sigaction_init, or by direct calls to 'signal'.
6918 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6919 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6920 all uses replaced by pthread_sigmask etc. calls.
6921 * syssignal.h: Include <signal.h>.
6922 (emacs_sigaction_init, forwarded_signal): New decls.
6923 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6924 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6925 (sigmask, sys_sigmask): Remove; no longer needed.
6926 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6927 (sigblock, sigunblock, sigfree):
6928 (sigsetmask) [!defined sigsetmask]:
6929 Remove. All uses replaced by pthread_sigmask.
6930 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6931 no longer need to be replaced, and its typical old uses
6932 are now done via emacs_sigaction_init and sigaction.
6933 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6934 (sys_sigdel): Remove; unused.
6935 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6936
6937 2012-09-06 Eli Zaretskii <eliz@gnu.org>
6938
6939 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6940 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6941
6942 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6943
6944 Explicitly mark buffer_defaults and buffer_local_symbols.
6945 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6946 mark_local_symbols here.
6947 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6948 since special buffers aren't marked here any more.
6949 (allocate_buffer): Chain new buffer with all_buffers here...
6950 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6951 not here.
6952 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6953 (syms_of_buffer): Remove staticpro of the above.
6954 (init_buffer_once): Set names for buffer_defaults and
6955 buffer_local_symbols.
6956
6957 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6958
6959 Use bool for booleans in font-related modules.
6960 * font.c (font_intern_prop, font_style_to_value)
6961 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6962 (generate_otf_features, font_check_otf_features, font_check_otf)
6963 (font_match_p, font_list_entities, font_at):
6964 * fontset.c (fontset_id_valid_p, reorder_font_vector
6965 (fontset_find_font, Fset_fontset_font)
6966 (face_suitable_for_char_p) [0]:
6967 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6968 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6969 (m17n_flt_initialized, ftfont_shape_by_flt):
6970 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6971 * nsfont.m (nsfont_draw):
6972 * w32font.c (w32font_draw):
6973 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6974 Use bool for booleans.
6975 * font.h: Adjust to above API changes.
6976 (struct font, struct font_driver, struct font_driver_list):
6977 Use bool for booleans.
6978 (struct font): Remove useless member encoding_type.
6979 All users removed.
6980 * fontset.c, xftfont.c: Omit unnecessary static decls.
6981
6982 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6983
6984 * alloc.c (mark_object): Revert window marking code
6985 since it's unsafe for the Fset_window_configuration.
6986
6987 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6988
6989 Fix race conditions with signal handlers and errno (Bug#12327).
6990 Be more systematic about preserving errno whenever a signal
6991 handler returns, even if it's not in the main thread. Do this by
6992 renaming signal handlers to distinguish between signal delivery
6993 and signal handling. All uses changed.
6994 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6995 * data.c (deliver_arith_signal): Rename from arith_error.
6996 * dispnew.c (deliver_window_change_signal): Rename from
6997 window_change_signal.
6998 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6999 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7000 * keyboard.c (deliver_input_available_signal): Rename from
7001 input_available_signal.
7002 (deliver_user_signal): Rename from handle_user_signal.
7003 (deliver_interrupt_signal): Rename from interrupt_signal.
7004 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7005 (deliver_child_signal): Rename from sigchld_handler.
7006 * atimer.c (handle_alarm_signal):
7007 * data.c (handle_arith_signal):
7008 * dispnew.c (handle_window_change_signal):
7009 * emacs.c (handle_fatal_signal, handle_danger_signal):
7010 * keyboard.c (handle_input_available_signal):
7011 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7012 * process.c (handle_pipe_signal, handle_child_signal):
7013 New functions, with the actual signal-handling code taken from the
7014 original respective signal handlers, sans the sporadic attempts to
7015 preserve errno, since that's now done by handle_on_main_thread.
7016 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7017 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7018 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7019 Move to sysdep.c.
7020 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7021 Move initialization of main_thread to sysdep.c's init_signals.
7022 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7023 our usage, and simplifies the mainline code.
7024 (record_child_status_change): New static function, as a helper
7025 for handle_child_signal, and with most of the old child handler's
7026 contents.
7027 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7028 (handle_child_signal): Use the above.
7029 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7030 Moved here from emacs.c.
7031 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7032 code moved here from emacs.c's main function.
7033 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7034 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7035 This lets callers save and restore errno properly.
7036
7037 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7038
7039 Remove redundant or unused things here and there.
7040 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7041 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7042 * editfns.c (Fcompare_buffer_substrings): Likewise.
7043 * frame.h (struct terminal, struct font_driver_list):
7044 Remove redundant declarations.
7045 * window.h (Qleft, Qright): Likewise.
7046
7047 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7048
7049 Do not mark objects from deleted buffers, windows and frames.
7050 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7051 (mark_object): Likewise for windows and frames.
7052
7053 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7054
7055 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7056 buffer_defaults and buffer_local_symbols as valid objects.
7057 Return special value to denote them.
7058
7059 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7060
7061 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7062 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7063 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7064 (file_name_absolute_p, Fsubstitute_in_file_name):
7065 (check_executable, check_writable, Ffile_accessible_directory_p)
7066 (Fset_file_selinux_context, Fdefault_file_modes)
7067 (Finsert_file_contents, choose_write_coding_system)
7068 (Fwrite_region, build_annotations, a_write, e_write)
7069 (Fdo_auto_save):
7070 * filelock.c (boot_time_initialized, get_boot_time)
7071 (get_boot_time_1, lock_file_1, within_one_second):
7072 * floatfns.c (in_float):
7073 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7074 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7075 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7076 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7077 * window.c (compare_window_configurations):
7078 Use bool for booleans.
7079 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7080 (Fdefault_file_modes): Now mode_t, not int, for modes.
7081 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7082 (internal_delete_file): Now returns void, not a (boolean) int,
7083 since nobody was looking at the return value.
7084 * lisp.h, window.h: Adjust to above API changes.
7085
7086 * xdisp.c (set_message): Simplify and reindent last change.
7087
7088 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7089
7090 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7091
7092 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7093
7094 * eval.c (call_debugger): Make the function non-static so that we
7095 can call it from set_message.
7096
7097 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7098 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7099
7100 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7101
7102 Give more-useful info on a fatal error (Bug#12328).
7103 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7104 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7105 of doing the work ourselves.
7106 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7107 do most of the work.
7108 (fatal_error_backtrace): New function, taken from the guts
7109 of the old fatal_error_signal, but with a new option to output
7110 a backtrace.
7111 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7112 info about the signal than just its number.
7113 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7114 * sysdep.c: Include <execinfo.h>
7115 (emacs_backtrace): New function, taken partly from the previous
7116 code of the 'die' function.
7117 (emacs_abort): Call fatal_error_backtrace rather than abort.
7118
7119 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7120
7121 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7122 eager (load-time) macro-expansion.
7123 * lisp.mk (lisp): Add macroexp.
7124
7125 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7126
7127 Simplify redefinition of 'abort' (Bug#12316).
7128 Do not try to redefine the 'abort' function. Instead, redo
7129 the code so that it calls 'emacs_abort' rather than 'abort'.
7130 This removes the need for the NO_ABORT configure-time macro
7131 and makes it easier to change the abort code to do a backtrace.
7132 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7133 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7134 Remove; sysdep.c's emacs_abort now takes its place.
7135 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7136 'abort' changed to use 'emacs_abort'.
7137 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7138 (abort) [!defined abort]: Rename to ...
7139 (emacs_abort): ... new name.
7140 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7141 the place of the old 'abort' in emacs.c.
7142 * w32.c, w32fns.c (abort): Do not #undef.
7143 * w32.c (emacs_abort): Rename from w32_abort.
7144
7145 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7146
7147 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7148 offsets[j].dv, since the y axis of the screen coordinates points
7149 down, while the y axis of the font definition coordinates points
7150 up. This fixes display of Arabic diacritics such as KASRA and
7151 KASRATAN. (Bug#11860)
7152
7153 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7154
7155 Be more systematic about _setjmp vs setjmp.
7156 * alloc.c (test_setjmp, mark_stack):
7157 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7158 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7159 (png_load, my_error_exit, jpeg_load):
7160 * process.c (send_process_trap, send_process):
7161 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7162 The underscored versions are up to 30x faster on some hosts.
7163 Formerly, the code used setjmp+longjmp sometimes and
7164 _setjmp+_longjmp at other times, with no particular reason to
7165 prefer setjmp+longjmp.
7166
7167 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7168
7169 Fix minor problem found by static checking.
7170 * buffer.c (Fdelete_all_overlays): Return nil.
7171
7172 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7173
7174 * buffer.c (Fdelete_all_overlays): New function.
7175
7176 2012-09-03 Chong Yidong <cyd@gnu.org>
7177
7178 * gtkutil.c: Add extern decl for Qxft.
7179
7180 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7181
7182 * emacs.c, eval.c: Use bool for boolean.
7183 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7184 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7185 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7186 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7187 (main, decode_env_path, Fdaemon_initialized):
7188 * eval.c (call_debugger, Finteractive_p, interactive_p):
7189 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7190 (maybe_call_debugger, Fbacktrace):
7191 * process.c (read_process_output, exec_sentinel):
7192 Use bool for booleans.
7193 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7194 All callers changed.
7195 * eval.c (interactive_p): Omit always-true boolean argument
7196 EXCLUDE_SUBRS_P. All callers changed.
7197 * dispextern.h, lisp.h: Reflect above API changes.
7198 * firstfile.c (dummy): Use the address of 'main', whose signature
7199 won't change, instead of the address of 'initialize', whose
7200 signature just changed from int to bool.
7201 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7202 * msdos.c (fatal_error_in_progress): ... from here.
7203 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7204 of incrementing it.
7205 (redisplay_internal, unwind_redisplay): Simply clear
7206 REDISPLAYING_P when unwinding, instead of saving its previous,
7207 always-false value and then restoring it.
7208
7209 Clean up some extern decls.
7210 Mostly, this hoists extern decls out of .c files and into .h files.
7211 That way, we're more likely to catch errors if the interfaces change.
7212 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7213 declare xg_mark_data.
7214 * dispextern.h (x_frame_parm_handlers):
7215 * font.h (Qxft):
7216 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7217 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7218 (Qultra_bold, Qoblique, Qitalic):
7219 Move extern decl here from .c file.
7220 * alloc.c (xg_mark_data) [USE_GTK]:
7221 * doc.c (Qclosure):
7222 * eval.c (Qlexical_binding):
7223 * fns.c (time) [!HAVE_UNISTD_H]:
7224 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7225 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7226 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7227 * lread.c (Qinternal_interpreter_environment):
7228 * minibuf.c (Qbuffer):
7229 * process.c (QCfamily, QCfilter):
7230 * widget.c (free_frame_faces):
7231 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7232 * xfont.c (x_clear_errors):
7233 * xterm.c (x_frame_parm_handlers):
7234 Remove now-redundant extern decls.
7235 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7236 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7237 Now static.
7238 * xfaces.c: Remove unnecessary static decls.
7239 * xterm.c (updating_frame): Remove decl of nonexistent object.
7240
7241 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7242 when building globals.h, as the objects that are not built on
7243 this host are not needed to compile C files on this host.
7244
7245 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7246
7247 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7248
7249 * frame.h: Add missing prototype for x_wm_set_size_hint.
7250
7251 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7252
7253 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7254 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7255 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7256 (Fsubstitute_command_keys):
7257 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7258 (save_excursion_save, save_excursion_restore)
7259 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7260 (format_time_string, general_insert_function)
7261 (make_buffer_string, make_buffer_string_both)
7262 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7263 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7264 (copy_text, insert_1, insert_1_both, insert_from_string)
7265 (insert_from_string_before_markers, insert_from_string_1)
7266 (insert_from_buffer, insert_from_buffer_1, replace_range)
7267 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7268 (del_range_2, modify_region):
7269 * intervals.c (intervals_equal, balance_possible_root_interval)
7270 (adjust_intervals_for_insertion, merge_properties_sticky)
7271 (graft_intervals_into_buffer, lookup_char_property)
7272 (adjust_for_invis_intang, set_point_both)
7273 (get_property_and_range, compare_string_intervals)
7274 (set_intervals_multibyte_1, set_intervals_multibyte):
7275 * keyboard.c (decode_timer):
7276 Use bool for boolean.
7277 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7278 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7279
7280 2012-09-02 Chong Yidong <cyd@gnu.org>
7281
7282 * keymap.c (push_key_description): Print M-TAB as C-M-i
7283 (Bug#11758).
7284
7285 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
7286
7287 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7288 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7289 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7290 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7291 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7292 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7293 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7294
7295 2012-09-01 Eli Zaretskii <eliz@gnu.org>
7296
7297 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7298 more than one grapheme cluster passed to the shaper: compute the
7299 offset adjustment values separately for each cluster. (Bug#11860)
7300
7301 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7302 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7303 about implicit conversions from integer to pointer.
7304
7305 2012-09-01 Daniel Colascione <dancol@dancol.org>
7306
7307 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7308 system used too early.
7309
7310 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7311
7312 Better seed support for (random).
7313 * emacs.c (main): Call init_random.
7314 * fns.c (Frandom): Set the seed from a string argument, if given.
7315 Remove long-obsolete Gentzel cruft.
7316 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7317 (init_random): New function.
7318
7319 2012-09-01 Daniel Colascione <dancol@dancol.org>
7320
7321 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7322 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7323 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7324 x_wm_set_size_hint, x_query_colors, x_real_positions,
7325 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7326 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7327 all of which have been moved to common code.
7328
7329 * xfaces.c: Include TERM_HEADER instead of listing all possible
7330 window-system headers.
7331
7332 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7333 to match header.
7334
7335 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7336 directly accessing frame internals.
7337
7338 * w32font.h: Include font.h. Define syms_of_w32font and
7339 globals_of_w32font.
7340
7341 * process.c: Include TERM_HEADER instead of listing all possible
7342 window-system headers.
7343
7344 * nsterm.h: Remove declarations now in frame.h.
7345 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
7346
7347 * menu.c: Include TERM_HEADER instead of listing all possible
7348 window-system headers.
7349
7350 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7351 window system.
7352
7353 * keyboard.c: Include TERM_HEADER instead of listing all possible
7354 window-system headers.
7355
7356 * image.c: Include TERM_HEADER instead of listing all possible
7357 window-system headers. Declare Vlibrary_cache when compiling for
7358 Windows.
7359
7360 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7361 window system declarations.
7362
7363 * frame.h: Move common functions here: set_frame_menubar,
7364 x_set_window_size, x_sync, x_get_focus_frame,
7365 x_set_mouse_position, x_set_mouse_pixel_position,
7366 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7367 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7368 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7369 x_activate_menubar, x_real_positions, x_bitmap_icon,
7370 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7371 and x_query_colors.
7372
7373 * frame.c: Include TERM_HEADER instead of listing all possible
7374 window-system headers.
7375
7376 * font.c: Include TERM_HEADER instead of listing all possible
7377 window-system headers.
7378
7379 * emacs.c: Include TERM_HEADER.
7380
7381 * dispnew.c: Include TERM_HEADER instead of listing all possible
7382 window-system headers.
7383
7384 * ccl.h: Include character.h.
7385
7386 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7387 the current window system; include in list of objects to link into
7388 Emacs.
7389
7390 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7391
7392 Remove mark_ttys function and fix tty_display_info initialization.
7393 * lisp.h (mark_ttys): Remove prototype.
7394 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7395 to mark_ttys because all possible values of 'top_frame' slot are
7396 the frames which are reachable from Vframe_list.
7397 * term.c (mark_ttys): Remove.
7398 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7399
7400 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7401
7402 Change struct frame bitfields from unsigned char to unsigned.
7403 * frame.h (struct frame): Change type of 'display_preempted',
7404 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7405 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7406 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7407 bitfields from unsigned char to unsigned.
7408
7409 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7410
7411 Remove unused member of struct x_output and struct w32_output.
7412 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7413 * w32term.h (struct w32_output): Likewise.
7414
7415 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7416
7417 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7418 does not become zero (Bug#12234).
7419
7420 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7421
7422 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7423 for GCC 4.7.1 x86-64.
7424
7425 2012-08-30 Glenn Morris <rgm@gnu.org>
7426
7427 * lread.c (init_lread): For out-of-tree builds, only add the
7428 source directory's site-lisp dir to the load-path if it exists,
7429 consistent with in-tree builds. (Bug#12302)
7430
7431 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7432
7433 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
7434 button_values to NULL. Call setStykeMask so dialogs get a close button.
7435 (windowShouldClose:): Set window_closed.
7436 (dealloc): New member, free button_values.
7437 (process_dialog:): Make member function. Remove window argument,
7438 replace window with self. Count buttons and allocate and store values
7439 in button_values.
7440 (addButton:value:row:): value is int with the name tag. Call setTag
7441 with tag. Remove return self, declare return value as void.
7442 (addString:row:): Remove return self, declare return value as void.
7443 (addSplit): Remove return self, declare return value as void.
7444 (clicked:): Remove return self, declare return value as void.
7445 Set dialog_return to button_values[seltag]. Code formatting change.
7446 (initFromContents:isQuestion:): Adjust call to process_dialog.
7447 Code formatting change.
7448 (timeout_handler:): Set timer_fired to YES.
7449 (runDialogAt:): Set timer_fired to NO.
7450 Handle click on close button as quit.
7451
7452 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7453 Add window_closed and button_values. Add void as return value for
7454 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7455 Add process_dialog as new member.
7456
7457 2012-08-28 Eli Zaretskii <eliz@gnu.org>
7458
7459 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7460 is not one of the heaps we manage. (Bug#12242)
7461
7462 2012-08-28 Glenn Morris <rgm@gnu.org>
7463
7464 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7465
7466 2012-08-28 Martin Rudalics <rudalics@gmx.at>
7467
7468 * window.c (Fset_window_configuration): Remove handling of
7469 auto-buffer-name window parameter. Install revision of reverted
7470 fix.
7471
7472 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7473
7474 Do not allow to set major mode for a dead buffer.
7475 * buffer.c (Fset_buffer_major_mode): Signal an error
7476 if the buffer is dead.
7477 (Fother_buffer, other_buffer_safely): Remove redundant
7478 nested declaration.
7479
7480 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7481
7482 Always use set_buffer_if_live to restore original buffer at unwind.
7483 * buffer.h (record_unwind_current_buffer): New function.
7484 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7485 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7486 * undo.c, window.c: Adjust users.
7487 * buffer.c (set_buffer_if_live): Fix comment.
7488
7489 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7490
7491 Fix usage of set_buffer_internal.
7492 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7493 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7494 * coding.c (decode_coding): Omit redundant test.
7495 * fileio.c (decide_coding_unwind): Likewise.
7496 * fns.c (secure_hash): Likewise.
7497 * insdel.c (modify_region): Likewise.
7498 * keyboard.c (command_loop_1): Likewise.
7499 * print.c (PRINTFINISH): Likewise.
7500 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7501
7502 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 * dispnew.c: Use bool for boolean.
7505 (frame_garbaged, display_completed, delayed_size_change)
7506 (fonts_changed_p, add_window_display_history)
7507 (add_frame_display_history, verify_row_hash)
7508 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7509 (row_equal_p, realloc_glyph_pool)
7510 (allocate_matrices_for_frame_redisplay)
7511 (showing_window_margins_p)
7512 (adjust_frame_glyphs_for_frame_redisplay)
7513 (build_frame_matrix_from_leaf_window, make_current)
7514 (mirrored_line_dance, mirror_line_dance, update_frame)
7515 (update_window_tree, update_single_window)
7516 (check_current_matrix_flags, update_window, update_text_area)
7517 (update_window_line, set_window_update_flags, scrolling_window)
7518 (update_frame_1, scrolling, buffer_posn_from_coords)
7519 (do_pending_window_change, change_frame_size)
7520 (change_frame_size_1, sit_for):
7521 Use bool for boolean.
7522 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7523 and remove last int (actually boolean) argument, which was always 0.
7524 All callers changed.
7525 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7526 * dispextern.h (struct composition_it): Use bool for boolean.
7527 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7528 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7529 * dired.c (file_name_completion):
7530 Use bool for boolean. (This was missed in an earlier change.)
7531
7532 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7533
7534 * window.c (Fset_window_configuration): Revert first part of
7535 last change.
7536
7537 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7538
7539 * nsterm.h (NSPanel): New class variable dialog_return.
7540
7541 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7542 Initialize dialog_return.
7543 (windowShouldClose:): Use stop instead of stopModalWithCode.
7544 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7545 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7546 event.
7547 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7548 modal loop returns.
7549
7550 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7551
7552 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7553 * composite.c (find_composition, composition_gstring_p)
7554 (composition_reseat_it, find_automatic_composition):
7555 * data.c (let_shadows_buffer_binding_p)
7556 (let_shadows_global_binding_p, set_internal, make_blv)
7557 (Fmake_variable_buffer_local, Fmake_local_variable)
7558 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7559 (cons_to_signed, arith_driver):
7560 * dbusbind.c (xd_in_read_queued_messages):
7561 * dired.c (directory_files_internal, file_name_completion):
7562 Use bool for booleans.
7563 * dired.c (file_name_completion):
7564 * process.h (fd_callback):
7565 Omit int (actually boolean) argument. It wasn't being used.
7566 All uses changed.
7567 * composite.h, lisp.h: Reflect above API changes.
7568
7569 * cmds.c, coding.c: Use bool for booleans.
7570 * cmds.c (move_point, Fself_insert_command):
7571 * coding.h (struct composition status, struct coding_system):
7572 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7573 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7574 (emacs_mule_char, decode_coding_emacs_mule)
7575 (encode_coding_emacs_mule, detect_coding_iso_2022)
7576 (decode_coding_iso_2022, encode_invocation_designation)
7577 (encode_designation_at_bol, encode_coding_iso_2022)
7578 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7579 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7580 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7581 (encode_coding_raw_text, detect_coding_charset)
7582 (decode_coding_charset, encode_coding_charset, detect_eol)
7583 (detect_coding, get_translation_table, produce_chars)
7584 (consume_chars, reused_workbuf_in_use)
7585 (make_conversion_work_buffer, code_conversion_save)
7586 (decode_coding_object, encode_coding_object)
7587 (detect_coding_system, char_encodable_p)
7588 (Funencodable_char_position, code_convert_region)
7589 (code_convert_string, code_convert_string_norecord)
7590 (Fset_coding_system_priority):
7591 * fileio.c (Finsert_file_contents):
7592 Use bool for booleans.
7593 * coding.h, lisp.h: Reflect above API changes.
7594 * coding.c: Remove unnecessary static function decls.
7595 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7596 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7597 not a boolean 'int', since callers never look at the return value.
7598 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7599 * coding.h (decoding_buffer_size, encoding_buffer_size)
7600 (emacs_mule_string_char): Remove unused extern decls.
7601 (struct iso_2022_spec, struct coding_system):
7602 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7603 (struct emacs_mule_spec): Remove unused field 'full_support'.
7604 All initializations removed.
7605 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7606
7607 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7608
7609 Fix spare memory change (Bug#12286).
7610 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7611 (valid_lisp_object_p): Likewise.
7612
7613 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7614
7615 * window.c (Fset_window_configuration): Record any window's old
7616 buffer if it's replaced (see Bug#8789). If the new current
7617 buffer doesn't appear in the selected window, go to its old
7618 point (Bug#12208).
7619
7620 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7621
7622 Special MEM_TYPE_SPARE to denote reserved memory.
7623 * alloc.c (enum mem_type): New memory type.
7624 (refill_memory_reserve): Use new type for spare memory.
7625 This prevents live_cons_p and live_string_p from incorrect
7626 detection of uninitialized objects from spare memory as live.
7627
7628 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7629
7630 Spelling fixes.
7631 * Makefile.in (.PHONY): versioclean -> versionclean.
7632
7633 Remove unused external symbols.
7634 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7635 * window.c (Qwindow_valid_p, decode_valid_window):
7636 Now static, not extern.
7637 * data.c (Qinterval): Remove; unused.
7638 (syms_of_data): Do not define 'interval'.
7639 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7640 * window.h (decode_valid_window):
7641 Remove decls.
7642
7643 * character.c, charset.c, chartab.c: Use bool for booleans.
7644 * character.c (lisp_string_width, string_count_byte8)
7645 (string_escape_byte8):
7646 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7647 (load_charset_map_from_file, map_charset_chars)
7648 (Fdefine_charset_internal, define_charset_internal)
7649 (Fdeclare_equiv_charset, find_charsets_in_text)
7650 (Ffind_charset_region, char_charset, Fiso_charset):
7651 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7652 (sub_char_table_set, sub_char_table_set_range)
7653 (char_table_set_range, optimize_sub_char_table)
7654 (map_sub_char_table):
7655 Use bool for boolean.
7656 * character.c (str_to_unibyte): Omit last boolean argument; it was
7657 always 0. All callers changed.
7658 * character.h, charset.h: Adjust to match previous changes.
7659 * character.h (char_printable_p): Remove decl of nonexistent function.
7660 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7661 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7662 are all boolean, so make them single-bit bitfields.
7663
7664 * lisp.h (ASET): Remove attempt to detect side effects.
7665 It was meant to be temporary and it often doesn't work,
7666 because when IDX has side effects the behavior of IDX==IDX
7667 is undefined. See Stefan Monnier in
7668 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7669
7670 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7671
7672 * lisp.h (functionp): New function (extracted from Ffunctionp).
7673 (FUNCTIONP): Use it.
7674 * eval.c (Ffunctionp): Use it.
7675
7676 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7677
7678 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7679 as that's faster and simpler than static storage. Don't bother
7680 with the g_main_context_query overhead if g_main_context_pending
7681 says no events are pending.
7682 (gfds, gfds_size): Remove these static vars.
7683 (xgselect_initialize): Remove; no longer needed.
7684 All uses and decls removed.
7685
7686 * emacs.c (fatal_error_signal_hook): Remove.
7687 All uses removed. This leftover from old code was always 0.
7688
7689 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7690 * casefiddle.c (casify_object, casify_region):
7691 * casetab.c (set_case_table):
7692 * category.c, category.h (word_boundary_p):
7693 * category.h (CHAR_HAS_CATEGORY):
7694 Use bool for booleans, instead of int.
7695
7696 2012-08-25 Eli Zaretskii <eliz@gnu.org>
7697
7698 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7699
7700 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7701
7702 On assertion failure, print backtrace if available.
7703 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7704 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7705 * Makefile.in (LIB_EXECINFO): New macro.
7706 (LIBES): Use it.
7707
7708 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7709 * bytecode.c (exec_byte_code):
7710 * callint.c (check_mark, Fcall_interactively):
7711 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7712 (getenv_internal, sync_process_alive, call_process_exited):
7713 * lisp.h (USE_SAFE_ALLOCA):
7714 Use bool for booleans, instead of int.
7715 * lisp.h, process.h: Adjust prototypes to match above changes.
7716 * callint.c (Fcall_interactively): Don't assume the mark's
7717 offset fits in 'int'.
7718
7719 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7720
7721 * buffer.c, buffer.h: Use bool for boolean.
7722 * buffer.c (reset_buffer_local_variables)
7723 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7724 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7725 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7726 (overlay_touches_p, overlay_strings, Foverlay_put)
7727 (report_overlay_modification, call_overlay_mod_hooks):
7728 (mmap_enlarge, mmap_set_vars):
7729 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7730 Use bool for booleans, instead of int.
7731 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7732 since the 1-or-0 return value is always ignored anyway.
7733 (mmap_initialized_p):
7734 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7735 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7736
7737 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7738
7739 * bidi.c: Use bool for boolean.
7740 This is a bit more readable, and makes the text segment of bidi.o
7741 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7742 Presumably it's faster too.
7743 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7744 Now bool.
7745 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7746 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7747 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7748 (bidi_explicit_dir_char, bidi_level_of_next_char)
7749 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7750 Use bool for booleans, instead of int.
7751 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7752 (bidi_unshelve_cache): Adjust decls to match code.
7753
7754 2012-08-23 Martin Rudalics <rudalics@gmx.at>
7755
7756 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7757 argument.
7758
7759 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7760
7761 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7762 * atimer.h: Include <stdbool.h>.
7763
7764 2012-08-22 Dan Nicolaescu <dann@gnu.org>
7765
7766 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7767 compile time tests instead of run time tests on systems that do
7768 not use them.
7769 (FRAME_MAC_P): Remove leftover from deleted code.
7770 * frame.c (syms_of_frame): Remove leftover from deleted code.
7771
7772 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7773
7774 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7775
7776 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7777
7778 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7779 Otherwise, the compiler complains about (A?B:C) where B is void
7780 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
7781 (fontset_add): Return void, for FONTSET_ADD.
7782
7783 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7784
7785 * alloc.c: Use bool for booleans.
7786 (gc_in_progress, abort_on_gc)
7787 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7788 (dont_register_blocks) [GC_MALLOC_CHECK]:
7789 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7790 (check_string_bytes, make_specified_string, memory_full)
7791 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7792 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7793 (mark_stack, valid_pointer_p, make_pure_string)
7794 (Fgarbage_collect, survives_gc_p, gc_sweep):
7795 Use bool for booleans, instead of int.
7796 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7797 Remove unused local.
7798 * alloc.c (PURE_POINTER_P):
7799 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7800 * editfns.c (Fformat):
7801 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7802 (Fdo_auto_save):
7803 * fns.c (sweep_weak_table):
7804 * lisp.h (suppress_checking, push_message, survives_gc_p)
7805 (make_pure_string, gc_in_progress, abort_on_gc):
7806 * lread.c (readchar, read1):
7807 * print.c (Fprin1_to_string):
7808 * xdisp.c (push_message):
7809 Use bool for booleans affected directly or indirectly by
7810 alloc.c's changes.
7811
7812 Make recently-introduced setters macros.
7813 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7814 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7815 (set_fontset_default, set_fontset_fallback): Rename from their
7816 upper-case counterparts, and make them functions rather than macros.
7817 This is more consistent with the other recently-introduced setters.
7818 These don't need to be inline, since they're local.
7819
7820 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7821
7822 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7823 the loop (Bug#12247).
7824
7825 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7826
7827 * lisp.h (vcopy): Use memcpy rather than our own loop.
7828 This fixes a performance regression introduced by the recent
7829 addition of vcopy. This means 'vcopy' will need to be modified
7830 for a copying collector, but that's OK. Also, tighten the
7831 checking in the assertion.
7832
7833 2012-08-21 Eli Zaretskii <eliz@gnu.org>
7834
7835 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7836 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7837 non-base glyph for the width of the base character, according to
7838 what x_draw_composite_glyph_string_foreground expects.
7839 Generate WADJUST value according to composition_gstring_width's
7840 expectations, to produce correct width of the composed character.
7841 Reverse the sign of the DU offset produced by ScriptPlace.
7842
7843 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7844
7845 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7846
7847 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7848
7849 Avoid direct writes to contents member of struct Lisp_Vector.
7850 * lisp.h (vcopy): New function to copy data into vector.
7851 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7852 * fns.c (Ffillarray): Use ASET.
7853 * keyboard.c (timer_check_2): Use AREF and ASET.
7854 (append_tool_bar_item, Frecent_keys): Use vcopy.
7855 * lread.c (read_vector): Use ASET.
7856 * msdos.c (Frecent_doskeys): Use vcopy.
7857 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7858 (Finternal_merge_in_global_face): Use ASET and vcopy.
7859 * xfont.c (xfont_list_pattern): Likewise.
7860
7861 2012-08-21 Martin Rudalics <rudalics@gmx.at>
7862
7863 * window.c (Fwindow_point): For the selected window always return
7864 the position of its buffer's point.
7865 (Fset_window_point): For the selected window always go in its
7866 buffer to the specified position.
7867
7868 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7869
7870 Setter macros for fontsets.
7871 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7872 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7873 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7874 Adjust users.
7875
7876 2012-08-20 Glenn Morris <rgm@gnu.org>
7877
7878 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7879 Don't assume that `ln -f' works.
7880
7881 2012-08-20 Eli Zaretskii <eliz@gnu.org>
7882
7883 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7884 and later about non-assignments with no effect. See discussion at
7885 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7886 details.
7887
7888 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7889
7890 Inline setter functions for Lisp_Objects slots of struct specbinding.
7891 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7892 Adjust users.
7893
7894 2012-08-20 Martin Rudalics <rudalics@gmx.at>
7895
7896 * window.c (select_window): Always make selected window's buffer
7897 current.
7898
7899 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7900
7901 Use AREF and ASET for docstrings of category tables.
7902 * category.h (CATEGORY_DOCSTRING): Use AREF.
7903 (SET_CATEGORY_DOCSTRING): Use ASET.
7904 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7905
7906 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7907
7908 Inline setter functions for hash table members.
7909 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7910 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7911 (set_hash_key_and_value, set_hash_index, set_hash_next)
7912 (set_hash_hash): New functions.
7913 * charset.c, fns.c: Adjust users.
7914
7915 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7916
7917 Inline getter and setter functions for per-buffer values.
7918 * buffer.h (per_buffer_default, set_per_buffer_default)
7919 (per_buffer_value, set_per_buffer_value): New functions.
7920 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7921 * buffer.c, data.c: Adjust users.
7922
7923 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
7924
7925 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7926
7927 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7928
7929 Rely on <config.h> + <unistd.h> to declare 'environ',
7930 as gnulib does this if the system doesn't.
7931 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
7932 Remove declaration. MS-Windows declares it on stdlib.h which is
7933 included by conf_post.h.
7934 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7935 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7936 * vm-limit.c: Include <unistd.h>, for 'environ'.
7937
7938 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7939 (start_of_data): Remove decl; mem-limits.h provides it.
7940
7941 * xdisp.c (handle_invisible_prop): Make it a bit faster
7942 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7943
7944 2012-08-19 Chong Yidong <cyd@gnu.org>
7945
7946 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7947 ends (Bug#3874).
7948
7949 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7950
7951 * .gdbinit: Use call instead of set when calling a function in the
7952 inferior.
7953
7954 * data.c (set_internal): Don't use set_blv_found.
7955 (Fkill_local_variable): Likewise.
7956
7957 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7958
7959 * nsfont.m (ns_ascii_average_width): Ensure the string
7960 ascii_printable is initialized with a null-terminated character
7961 array. Otherwise, it can contain undesired extra characters.
7962
7963 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7964
7965 port new setting code to Sun C 5.8 2005/10/13
7966 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7967 Return void, not Lisp_Object. Otherwise, the compiler
7968 complains about (A?B:C) where B is void and C is Lisp_Object
7969 when compiling CHAR_TABLE_SET, due to the recent change to
7970 the API of sub_char_table_set_contents.
7971
7972 2012-08-18 Chong Yidong <cyd@gnu.org>
7973
7974 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7975 for the string case (Bug#3874).
7976
7977 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 * buffer.h (BSET): Remove (Bug#12215).
7980 Replace all uses with calls to new setter functions.
7981 (bset_bidi_paragraph_direction, bset_case_canon_table)
7982 (bset_case_eqv_table, bset_directory, bset_display_count)
7983 (bset_display_time, bset_downcase_table)
7984 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7985 (bset_last_selected_window, bset_local_var_alist)
7986 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7987 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7988 (bset_width_table):
7989 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7990 (bset_auto_fill_function, bset_auto_save_file_format)
7991 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7992 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7993 (bset_cache_long_line_scans, bset_case_fold_search)
7994 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7995 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7996 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7997 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7998 (bset_header_line_format, bset_indicate_buffer_boundaries)
7999 (bset_indicate_empty_lines, bset_invisibility_spec)
8000 (bset_left_fringe_width, bset_major_mode, bset_mark)
8001 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8002 (bset_name, bset_overwrite_mode, bset_pt_marker)
8003 (bset_right_fringe_width, bset_save_length)
8004 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8005 (bset_scroll_up_aggressively, bset_selective_display)
8006 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8007 (bset_word_wrap, bset_zv_marker):
8008 * category.c (bset_category_table):
8009 * syntax.c (bset_syntax_table):
8010 New setter functions.
8011
8012 * process.h (PSET): Remove (Bug#12215).
8013 Replace all uses with calls to new setter functions.
8014 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8015 (PROCESS_INLINE): New macro.
8016 (pset_childp): New setter function.
8017 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8018 * process.c (PROCESS_INLINE):
8019 Define to EXTERN_INLINE, so that the corresponding functions
8020 are compiled into code.
8021 (pset_buffer, pset_command, pset_decode_coding_system)
8022 (pset_decoding_buf, pset_encode_coding_system)
8023 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8024 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8025 (pset_type, pset_write_queue): New setter functions.
8026
8027 * window.h (WSET): Remove (Bug#12215).
8028 Replace all uses with calls to new setter functions.
8029 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8030 (WINDOW_INLINE): New macro.
8031 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8032 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8033 (wset_total_lines, wset_vertical_scroll_bar)
8034 (wset_window_end_pos, wset_window_end_valid)
8035 (wset_window_end_vpos): New setter functions.
8036 * window.c (WINDOW_INLINE):
8037 Define to EXTERN_INLINE, so that the corresponding functions
8038 are compiled into code.
8039 (wset_combination_limit, wset_dedicated, wset_display_table)
8040 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8041 (wset_new_normal, wset_new_total, wset_next_buffers)
8042 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8043 (wset_prev_buffers, wset_right_fringe_width)
8044 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8045 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8046 (wset_window_parameters):
8047 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8048 (wset_column_number_displayed, wset_region_showing):
8049 New setter functions.
8050
8051 * termhooks.h (TSET): Remove (Bug#12215).
8052 Replace all uses with calls to new setter functions.
8053 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8054 (TERMHOOKS_INLINE): New macro.
8055 (tset_charset_list, tset_selection_alist): New setter functions.
8056 * terminal.c (TERMHOOKS_INLINE):
8057 Define to EXTERN_INLINE, so that the corresponding functions
8058 are compiled into code.
8059 (tset_param_alist): New setter function.
8060
8061 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8062
8063 * keyboard.h (KSET): Remove (Bug#12215).
8064 Replace all uses with calls to new setter functions.
8065 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8066 (KEYBOARD_INLINE): New macro.
8067 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8068 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8069 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8070 New setter functions.
8071 * keyboard.c (KEYBOARD_INLINE):
8072 Define to EXTERN_INLINE, so that the corresponding functions
8073 are compiled into code.
8074 (kset_echo_string, kset_kbd_queue)
8075 (kset_keyboard_translate_table, kset_last_prefix_arg)
8076 (kset_last_repeatable_command, kset_local_function_key_map)
8077 (kset_overriding_terminal_local_map, kset_real_last_command)
8078 (kset_system_key_syms): New setter functions.
8079
8080 * frame.h (FSET): Remove (Bug#12215).
8081 Replace all uses with calls to new setter functions.
8082 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8083 (FRAME_INLINE): New macro.
8084 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8085 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8086 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8087 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8088 (fset_param_alist, fset_root_window, fset_scroll_bars)
8089 (fset_selected_window, fset_title, fset_tool_bar_items)
8090 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8091 * frame.c (FRAME_INLINE):
8092 Define to EXTERN_INLINE, so that the corresponding functions
8093 are compiled into code.
8094 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8095
8096 A few more naming-convention fixes for getters and setters.
8097 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8098 and rename from buffer_overlays_set_before.
8099 (set_buffer_overlays_after): Move here from buffer.h, and rename
8100 from buffer_overlays_set_after.
8101 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8102 All uses changed.
8103 (set_buffer_intervals): Rename from buffer_set_intervals.
8104 * intervals.c (set_interval_object): Move here from intervals.h,
8105 and rename from interval_set_object.
8106 (set_interval_left): Move here from intervals.h, and rename from
8107 interval_set_left.
8108 (set_interval_right): Move here from intervals.h, and rename from
8109 interval_set_right.
8110 (copy_interval_parent): Move here from intervals.h, and rename from
8111 interval_copy_parent.
8112 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8113 (set_interval_plist): Rename from interval_set_plist.
8114 Return void, not Lisp_Object, since no caller uses the result.
8115 * lisp.h (string_intervals): Rename from string_get_intervals.
8116 (set_string_intervals): Rename from string_set_intervals.
8117
8118 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8119 (set_char_table_contents): Rename from char_table_set_contents.
8120 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8121 All uses changed. See the end of
8122 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8123
8124 * lisp.h (CSET): Remove (Bug#12215).
8125 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8126 (set_char_table_purpose): New functions,
8127 replacing CSET. All uses changed. For example, replace
8128 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8129 "set_char_table_parent (char_table, parent);".
8130 The old version was confusing because it used the same name
8131 'parent' for two different things.
8132
8133 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8134
8135 Functions to get and set Lisp_Object fields of buffer-local variables.
8136 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8137 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8138 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8139 * data.c, eval.c, frame.c: Adjust users.
8140
8141 2012-08-17 Chong Yidong <cyd@gnu.org>
8142
8143 * xfaces.c (merge_face_vectors): If the target font specfies a
8144 font spec, make the font's attributes take precedence over
8145 directly-specified attributes.
8146 (merge_face_ref): Recognize :font.
8147
8148 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8149
8150 Do not use memcpy for copying intervals.
8151 * intervals.c (reproduce_interval): New function.
8152 (reproduce_tree, reproduce_tree_obj): Use it.
8153 (reproduce_tree_obj): Remove prototype.
8154
8155 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8156
8157 * lisp.h (duration_to_sec_usec): Remove unused decl.
8158
8159 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8160
8161 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8162 to an allocated instance of NSString, not to the class itself.
8163
8164 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8165
8166 * makefile.w32-in (C_CTYPE_H): New macro.
8167 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8168 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8169 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8170
8171 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8172
8173 Use ASCII tests for character types.
8174 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8175 * xfns.c, xterm.c:
8176 Don't include <ctype.h>; was not needed.
8177 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8178 * sysdep.c, xfaces.c:
8179 Include <c-ctype.h> instead of <ctype.h>.
8180 * nsterm.m: Include <c-ctype.h>.
8181 * charset.c (read_hex):
8182 * doc.c (Fsnarf_documentation):
8183 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8184 (DRIVE_LETTER) [DOS_NT]:
8185 (Ffile_name_directory, Fexpand_file_name)
8186 (Fsubstitute_in_file_name):
8187 * font.c (font_parse_xlfd, font_parse_fcname):
8188 * frame.c (x_set_font_backend):
8189 * gtkutil.c (xg_get_font):
8190 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8191 * nsimage.m (hexchar):
8192 * nsterm.m (ns_xlfd_to_fontname):
8193 * sysdep.c (system_process_attributes):
8194 * xfaces.c (hash_string_case_insensitive):
8195 Use C-locale tests instead of locale-specific tests for character
8196 types, since we want the ASCII interpretation here, not the
8197 interpretation suitable for whatever happens to be the current locale.
8198
8199 2012-08-16 Martin Rudalics <rudalics@gmx.at>
8200
8201 Consistently check windows for validity/liveness
8202 (Bug#11984, Bug#12025, Bug#12026).
8203 * lisp.h (CHECK_VALID_WINDOW): New macro.
8204 * window.c (decode_window): Rename to decode_live_window.
8205 (decode_valid_window, Fwindow_valid_p): New functions.
8206 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8207 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8208 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8209 (Fwindow_prev_sibling, Fwindow_combination_limit)
8210 (Fset_window_combination_limit, Fwindow_use_time)
8211 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8212 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8213 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8214 (Fwindow_hscroll, Fset_window_hscroll)
8215 (Fwindow_redisplay_end_trigger)
8216 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8217 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8218 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8219 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8220 (Fwindow_end, Fset_window_point, Fset_window_start)
8221 (Fpos_visible_in_window_p, Fwindow_line_height)
8222 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8223 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8224 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8225 (Fset_window_parameter, Fwindow_display_table)
8226 (Fset_window_display_table, Fdelete_other_windows_internal)
8227 (Fset_window_buffer, Fset_window_new_total)
8228 (Fset_window_new_normal, Fdelete_window_internal)
8229 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8230 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8231 (Fwindow_scroll_bars): Check whether argument window is a valid or
8232 live window. Update doc-strings.
8233 (syms_of_window): New symbol Qwindow_valid_p.
8234 * keyboard.c (Fposn_at_x_y): Check whether argument
8235 frame_or_window denotes a valid window.
8236
8237 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8238
8239 Fix previous char table change.
8240 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8241 * chartab.c (optimize_sub_char_table): Likewise.
8242
8243 2012-08-16 Chong Yidong <cyd@gnu.org>
8244
8245 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8246
8247 * xfont.c (xfont_open):
8248 * xftfont.c (xftfont_open): Set the font's max_width field.
8249
8250 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8251 min_width to space_width and average_width to the average over
8252 printable ASCII characters.
8253 (ns_char_width): Code cleanup.
8254 (ns_ascii_average_width): New utility function.
8255
8256 * font.h (struct font): Update comments.
8257
8258 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8259
8260 Simple interface to set Lisp_Object fields of character tables.
8261 * lisp.h (CSET): New macro.
8262 (char_table_set_extras, char_table_set_contents)
8263 (sub_char_table_set_contents): New function.
8264 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8265 * syntax.c: Adjust users.
8266
8267 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8268
8269 * eval.c (eval_sub): Bind lexical-binding.
8270 * lread.c (Qlexical_binding): Make non-static.
8271
8272 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8273
8274 * nsmenu.m (popupSession): Remove.
8275 (pop_down_menu): Remove endModalSession.
8276 (timeout_handler:): New method.
8277 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8278 Call runModalForWindow. Check timer_fired when it returns.
8279 If not set, cancel timer and break out of loop.
8280 Otherwise loop again, with a new timeout.
8281
8282 * nsterm.m: Include fcntl.h if present.
8283 (fd_entry, t_readfds, inNsSelect): Remove.
8284 (select_writefds, select_valid, select_timeout, selfds)
8285 (select_mutex, apploopnr): Add.
8286 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8287 Otherwise call kbd_buffer_store_event.
8288 (ns_send_appdefined): Remove release of fd_entry.
8289 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8290 Increment and decrement apploopnr.
8291 (ns_select): If no file descriptors, just do a NSTimer.
8292 Otherwise copy read/write masks and start select thread (fd_handler).
8293 Start main loop and wait for application defined event.
8294 Inform select thread to stop selecting after main loop is exited.
8295 (ns_term_init): Create selfds pipe and set non-blocking.
8296 Initialize select_mutex. Start the select thread (fd_handler).
8297 (fd_handler:): Loop forever, wait for info from the main thread
8298 to either start or stop selecting. When select returns, send
8299 and appdefined event.
8300 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8301 If not call kbd_buffer_store_event.
8302
8303 * nsterm.h (EmacsApp): fd_handler takes id argument.
8304 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8305
8306 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8307
8308 2012-08-15 Eli Zaretskii <eliz@gnu.org>
8309
8310 * region-cache.c (move_cache_gap): Update gap_len using the actual
8311 growth of the boundaries array. Do not change cache_len.
8312 (Bug#12196)
8313
8314 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8315
8316 Generalize and cleanup font subsystem checks.
8317 * font.h (FONT_DEBUG, font_assert): Remove.
8318 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8319 Change font_assert to eassert. Use eassert where appropriate.
8320
8321 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8322
8323 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8324
8325 2012-08-15 Chong Yidong <cyd@gnu.org>
8326
8327 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8328 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8329 extract the font descriptor instead of just the font name.
8330 In that case, return a font spec instead of a string.
8331 (x_last_font_name): Move to this file from xfns.c.
8332
8333 * xfns.c (Fx_select_font): The return value can also be a font
8334 spec. Move x_last_font_name management to gtkutil.c.
8335
8336 * xfaces.c: Make font weight and style symbols non-static.
8337
8338 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8339
8340 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8341 (bug#12117).
8342
8343 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8344
8345 * alloc.c (Fgarbage_collect): Use plural form consistently.
8346
8347 2012-08-14 Eli Zaretskii <eliz@gnu.org>
8348
8349 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8350 iteration through the command loop. Fixes a problem whereby mouse
8351 movements are ignored until the first mouse click.
8352
8353 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8354
8355 Use bool, not int, for Lisp booleans.
8356 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8357 makes Emacs a bit smaller and presumably a bit faster.
8358 * lisp.h: Include <stdbool.h>.
8359 (struct Lisp_Boolfwd, defvar_bool):
8360 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8361 * regex.c [!emacs]: Include <stdbool.h>.
8362 (false, true): Remove; <stdbool.h> does this for us now.
8363
8364 2012-08-14 Chong Yidong <cyd@gnu.org>
8365
8366 * character.c (Fcharacterp): Doc fix (Bug#12076).
8367
8368 * data.c (Findirect_variable): Doc fix (Bug#11040).
8369
8370 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8371
8372 * editfns.c (Fformat): Doc fix (Bug#12059).
8373 (Fsave_current_buffer): Doc fix (Bug#11542).
8374
8375 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8376
8377 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8378 (bug#12022).
8379
8380 2012-08-14 Martin Rudalics <rudalics@gmx.at>
8381
8382 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8383 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8384 * minibuf.c (choose_minibuf_frame, read_minibuf):
8385 * w32fns.c (x_create_tip_frame):
8386 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8387 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8388
8389 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8390
8391 * intervals.c (offset_intervals): Remove obsolete comment.
8392
8393 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8394
8395 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8396
8397 2012-08-14 Gergely Risko <gergely@risko.hu>
8398
8399 * coding.c (decode_coding): Record buffer modification before
8400 disabling undo_list (Bug#11773).
8401
8402 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8403
8404 Revert and cleanup some recent overlay changes.
8405 * buffer.h (enum overlay_type): Remove.
8406 (buffer_get_overlays, buffer_set_overlays): Likewise.
8407 (buffer_set_overlays_before, buffer_set_overlays_after):
8408 New function. Adjust users.
8409 (unchain_both): Add eassert.
8410
8411 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8412
8413 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8414
8415 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8416
8417 * gtkutil.c (xg_mark_data): Don't assume C99.
8418
8419 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8420
8421 * gtkutil.c (xg_frame_tb_info): New struct.
8422 (TB_INFO_KEY): New define.
8423 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8424 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8425 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8426 if not present.
8427 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
8428 is up to date. Otherwise store new data.
8429 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8430
8431 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8432
8433 Use KSET for write access to Lisp_Object members of struct kboard.
8434 * keyboard.h (KSET): New macro.
8435 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8436 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8437 * xterm.c: Adjust users.
8438
8439 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8440
8441 Use BSET for write access to Lisp_Object members of struct buffer.
8442 * buffer.h (BSET): New macro.
8443 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8444 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8445 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8446 * window.c, xdisp.c, xfns.c: Adjust users.
8447
8448 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8449
8450 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8451
8452 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8453
8454 * nsterm.m (not_in_argv): New function.
8455 (application:openFile, application:openTempFile:):
8456 (application:openFileWithoutUI:, application:openFiles:): Open file
8457 if not_in_argv returns non-zero (bug#12171).
8458
8459 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
8460 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8461 Define for Gtk+ versions less than 3.2.
8462 (xg_get_font_name): Use those functions/macros here.
8463 Reported by Frans Oilinki <moilinki@gmail.com>.
8464
8465 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8466
8467 * unexmacosx.c (copy_data_segment): Copy initialized data in
8468 statically linked libraries from input file rather than memory.
8469
8470 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8471 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8472 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8473
8474 2012-08-10 Glenn Morris <rgm@gnu.org>
8475
8476 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8477 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8478
8479 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8480
8481 Fix last change to allow compilation with low optimization levels.
8482 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8483 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8484
8485 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8486
8487 Use common inline syntax in intervals.h.
8488 * intervals.h (INTERVALS_INLINE): New macro.
8489 Change all users from LISP_INLINE.
8490
8491 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8492
8493 Define Qnone once for all platforms.
8494 * frame.c (Qnone): Define here.
8495 (syms_of_frame): DEFSYM it.
8496 * lisp.h (Qnone): New declaration.
8497 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8498 * xfns.c: Remove duplication. Adjust users.
8499
8500 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8501
8502 Remove unused macros from intervals.h.
8503 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8504 * intervals.c: Adjust comment.
8505
8506 2012-08-10 Eli Zaretskii <eliz@gnu.org>
8507
8508 * w32fns.c <w32_unicode_gui>: New static variable.
8509 (globals_of_w32fns): Initialize it according to os_subtype.
8510 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8511 testing os_subtype.
8512
8513 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
8514 Eli Zaretskii <eliz@gnu.org>
8515
8516 Fix bug #10299 with Unicode characters sent by customized
8517 keyboards created by MSKLC.
8518 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8519 (w32_init_class): Use it to initialize the Emacs class with either
8520 ANSI or Unicode API calls.
8521 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8522 later.
8523 (w32_wnd_proc): If the character code sent by WM_CHAR or
8524 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8525 original message. Call DefWindowProcW on NT and later.
8526
8527 2012-08-10 Glenn Morris <rgm@gnu.org>
8528
8529 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8530
8531 * lisp.h (DIRECTORY_SEP): Let configure set it.
8532
8533 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8534
8535 Use TSET for write access to Lisp_Object slots of struct terminal.
8536 * termhooks.h (TSET): New macro.
8537 * coding.c, terminal.c, xselect.c: Adjust users.
8538
8539 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8540
8541 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8542 the failing expression, include them in the error message.
8543 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8544 * lisp.h (internal_condition_case_n): Update declaration.
8545
8546 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8547
8548 Inline functions to examine and change buffer overlays.
8549 * buffer.c (unchain_both): New function.
8550 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8551 (buffer_has_overlays): New function.
8552 (enum overlay_type): New enum.
8553 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8554 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8555
8556 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8557
8558 Inline functions to examine and change buffer intervals.
8559 * alloc.c (mark_interval_tree): Remove.
8560 (MARK_INTERVAL_TREE): Simplify.
8561 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8562 * intervals.c (buffer_balance_intervals): New function.
8563 (graft_intervals_into_buffer): Adjust indentation.
8564 (set_intervals_multibyte): Simplify.
8565 * buffer.h (BUF_INTERVALS): Remove.
8566 (buffer_get_intervals, buffer_set_intervals): New function.
8567 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8568 * intervals.c, textprop.c: Adjust users.
8569
8570 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8571
8572 Inline functions to examine and change string intervals.
8573 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8574 (string_get_intervals, string_set_intervals): New function.
8575 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8576 * lread.c, print.c, textprop.c: Adjust users.
8577
8578 2012-08-08 Glenn Morris <rgm@gnu.org>
8579
8580 * lisp.mk (lisp): Remove language/persian.elc.
8581
8582 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8583
8584 Cleanup intervals.
8585 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8586 (NULL_INTERVAL_P): Likewise. Adjust users.
8587 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8588 Adjust comment. Move under #if 0.
8589 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8590 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8591
8592 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8593
8594 Check total length of intervals with eassert.
8595 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8596 * intervals.c: Change all users to eassert.
8597
8598 2012-08-07 Eli Zaretskii <eliz@gnu.org>
8599
8600 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8601 Rename fields to match removal of FGET and WGET and disuse of
8602 INTERNAL_FIELD in Lisp_Cons.
8603
8604 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8605
8606 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8607 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8608 name since all xname users are fixed long time ago. Do not
8609 use INTERNAL_FIELD.
8610 (set_symbol_name, set_symbol_function, set_symbol_plist):
8611 (set_symbol_next, set_overlay_plist): New function.
8612 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8613 (struct Lisp_Overlay): Likewise.
8614 (CVAR, MVAR, SVAR): Remove.
8615 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8616 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8617 * xterm.c: Adjust users.
8618 * .gdbinit: Change to use name field of struct Lisp_Symbol
8619 where appropriate.
8620
8621 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8622
8623 Basic functions to set Lisp_Object and pointer slots of intervals.
8624 * intervals.h (interval_set_parent, interval_set_object):
8625 (interval_set_left, interval_set_right, interval_set_plist):
8626 (interval_copy_parent): New function.
8627 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
8628 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8629 Adjust indentation.
8630 (INTERVAL_SIZE): Remove. Adjust users.
8631 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8632
8633 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8634
8635 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8636 * process.h (PGET): Remove.
8637 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8638 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8639
8640 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8641
8642 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8643 * window.h (WGET): Remove.
8644 (struct window): Do not use INTERNAL_FIELD.
8645 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8646 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8647 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8648 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8649 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8650 Adjust users.
8651
8652 2012-08-07 Chong Yidong <cyd@gnu.org>
8653
8654 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8655 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8656 (Fdelete_window_internal): Signal an error if the window is not on
8657 a live frame (Bug#12025).
8658
8659 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8660
8661 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8662 * frame.h (FGET): Remove.
8663 (struct frame): Do not use INTERNAL_FIELD.
8664 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8665 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8666 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8667 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8668
8669 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
8670
8671 * w32.c: Silence compiler warnings.
8672 (map_w32_filename): Remove unused variable `is_fat'.
8673 (chase_symlinks): Add parentheses around expression.
8674
8675 2012-08-06 Glenn Morris <rgm@gnu.org>
8676
8677 * sysdep.c: Respect BROKEN_GETWD.
8678
8679 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8680 Let configure handle it.
8681 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8682
8683 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8684
8685 Use GCALIGNMENT where appropriate.
8686 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8687 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8688 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8689
8690 2012-08-06 Eli Zaretskii <eliz@gnu.org>
8691
8692 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8693 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
8694
8695 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8696
8697 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8698 that should be sufficient for everyone.
8699
8700 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8701
8702 * keyboard.c (timer_check_2): Add break so timer_check returns next
8703 timeout.
8704
8705 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8706
8707 Fix Windows build errors introduced after converting to WGET and WSET.
8708 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8709 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8710
8711 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8712
8713 * nsterm.m (ns_frame_rehighlight): Use FSET.
8714
8715 * nsmenu.m (ns_update_menubar): Use FSET.
8716
8717 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8718
8719 Separate read and write access to Lisp_Object slots of Lisp_Process.
8720 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8721 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8722
8723 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8724
8725 Separate read and write access to Lisp_Object slots of struct window.
8726 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8727 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8728 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8729 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8730 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8731 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8732 Adjust users.
8733
8734 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8735
8736 Fix Windows build errors introduced after converting to FGET and FSET.
8737 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8738 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8739 (w32_judge_scroll_bars): Change to use FSET.
8740 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8741
8742 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8743
8744 Fix replacement typo.
8745 * window.c (replace_window): Set root_window instead of
8746 selected_window. This fixes a total window subsystem
8747 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8748
8749 2012-08-06 Glenn Morris <rgm@gnu.org>
8750
8751 * lisp.mk (lisp): Add language/persian.elc.
8752
8753 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8754
8755 Separate read and write access to Lisp_Object slots of struct frame.
8756 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8757 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8758 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8759 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8760 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8761
8762 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8763
8764 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8765
8766 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8767
8768 Generalize common compile-time constants.
8769 * lisp.h (header_size, bool_header_size, word_size): Now here.
8770 (struct Lisp_Vector): Add comment.
8771 (struct Lisp_Bool_Vector): Move up to define handy constants.
8772 (VECSIZE, PSEUDOVECSIZE): Simplify.
8773 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8774 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8775 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8776 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8777 * xfont.c, xmenu.c: Use word_size where appropriate.
8778
8779 2012-08-05 Lawrence Mitchell <wence@gmx.li>
8780
8781 * search.c (Freplace_match): Treat \? in the replacement text
8782 literally (Bug#8161).
8783
8784 2012-08-05 Chong Yidong <cyd@gnu.org>
8785
8786 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8787 * frame.c (Vdelete_frame_functions):
8788 * emacs.c (Vkill_emacs_hook): Doc fix.
8789
8790 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8791
8792 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8793 --with-x-toolkit=no builds.
8794 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8795
8796 2012-08-04 Chong Yidong <cyd@gnu.org>
8797
8798 * syntax.c (Fmodify_syntax_entry): Doc fix.
8799
8800 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8801
8802 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8803 * w32.c (init_environment): Change the default values of many
8804 environment variables in dflt_envvars[] to NULL, to avoid pushing
8805 them into environment when they were not already defined.
8806 Remove the code that deletes site-lisp subdirectories from the default
8807 value of EMACSLOADPATH, as it is no longer needed.
8808 (check_windows_init_file): Now external, not static.
8809 Use Vload_path as is, without adding anything, as this function is now
8810 called when Vload_path is already set up.
8811
8812 * w32.h (check_windows_init_file): Add prototype.
8813
8814 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8815 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8816 compatibility with Posix platforms.
8817 (main): Move the call to check_windows_init_file to here from
8818 w32.c.
8819 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8820 any, in the DEFALT argument into the root of the Emacs build or
8821 installation tree, as appropriate.
8822
8823 * callproc.c (init_callproc_1): Call decode_env_path instead of
8824 doing its equivalent by hand.
8825 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8826 the code that sets Vexec_path run on MS-Windows.
8827
8828 * lread.c (init_lread): Add comments to #ifdef's.
8829
8830 * msdos.c (dos_set_window_size, IT_update_begin)
8831 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8832 instead of direct references.
8833
8834 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8835
8836 Export DEFAULT_REHASH_* to GDB.
8837 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8838 Now constants, not macros.
8839
8840 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8841
8842 Remove unnecessary casts involving pointers.
8843 These casts are no longer needed now that we assume C89 or later,
8844 since they involve casting to or from void *.
8845 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8846 (make_pure_float, make_pure_vector):
8847 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8848 * macros.c (Fstart_kbd_macro):
8849 * menu.c (find_and_return_menu_selection):
8850 * minibuf.c (read_minibuf_noninteractive):
8851 * sysdep.c (closedir):
8852 * xdisp.c (x_produce_glyphs):
8853 * xfaces.c (compare_fonts_by_sort_order):
8854 * xfns.c (x_real_positions, select_visual):
8855 * xselect.c (x_stop_queuing_selection_requests)
8856 (x_get_window_property, x_get_window_property_as_lisp_data):
8857 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8858 Remove unnecessary pointer casts.
8859 * alloc.c (record_xmalloc): New function.
8860 * lisp.h (record_xmalloc): New decl.
8861 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8862 more like a function. This is because the pointer cast is not
8863 needed. All uses changed.
8864 * print.c (print_string, print_error_message): Avoid length recalc.
8865
8866 Improve fix for macroexp crash with debugging (Bug#12118).
8867 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8868 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8869 not supposed to be invoked from the garbage collector.
8870 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8871 (gc_aset): New function, which is like ASET but can be
8872 used in the garbage collector.
8873 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8874 (set_hash_index): Use it instead of ASET.
8875
8876 2012-08-03 Eli Zaretskii <eliz@gnu.org>
8877
8878 Support symlinks on latest versions of MS-Windows.
8879 * w32.c: Include winioctl.h and aclapi.h.
8880 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8881 (revert_to_self): Forward declarations of static functions.
8882 <static BOOL g_b_init_get_security_info>:
8883 <g_b_init_create_symbolic_link>: New static flags.
8884 (globals_of_w32): Initialize them to zero.
8885 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8886 (map_w32_filename): Improve commentary. Simplify switch.
8887 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8888 headers (most versions of MinGW w32api don't).
8889 (get_security_info, create_symbolic_link)
8890 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8891 New functions.
8892 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8893 in the argument file name.
8894 (sys_access): Call unc_volume_file_attributes only if
8895 GetFileAttributes fails with network-related error codes.
8896 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8897 have the required privileges.
8898 (get_file_security_desc_by_name): Rename from
8899 get_file_security_desc.
8900 (stat_worker): New function, with most of the guts of 'stat', and
8901 with addition of handling of symlinks and support for 'lstat'.
8902 If possible, get file's attributes and security information by
8903 handle, not by name. Produce S_IFLNK bit for symlinks, when
8904 called from 'lstat'.
8905 (stat, lstat): New functions, call 'stat_worker'.
8906 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8907 symlinks when the underlying filesystem supports them.
8908
8909 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8910
8911 Fix macroexp crash on Windows with debugging (Bug#12118).
8912 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8913 checking subscripts; problem introduced with the recent
8914 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8915 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8916 since it's used in non-static inline functions now.
8917
8918 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8919 Don't assume buffer size fits in 'int'. Remove unused local.
8920
8921 Use C99-style 'extern inline' if available.
8922 * buffer.h (BUFFER_INLINE):
8923 * category.h (CATEGORY_INLINE):
8924 * character.h (CHARACTER_INLINE):
8925 * charset.h (CHARSET_INLINE):
8926 * composite.h (COMPOSITE_INLINE):
8927 * dispextern.h (DISPEXTERN_INLINE):
8928 * lisp.h (LISP_INLINE):
8929 * systime.h (SYSTIME_INLINE):
8930 New macro, replacing 'static inline' in this header.
8931 * buffer.h, category.h, character.h, charset.h, composite.h:
8932 * dispextern.h, lisp.h, systime.h:
8933 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8934 * alloc.c (LISP_INLINE):
8935 * buffer.c (BUFFER_INLINE):
8936 * category.c (CATEGORY_INLINE):
8937 * character.c (CHARACTER_INLINE):
8938 * charset.c (CHARSET_INLINE):
8939 * composite.c (COMPOSITE_INLINE):
8940 * dispnew.c (DISPEXTERN_INLINE):
8941 * sysdep.c (SYSTIME_INLINE):
8942 Define to EXTERN_INLINE, so that the corresponding functions
8943 are compiled into code.
8944 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8945 (INLINE_HEADER_END): New macros.
8946 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8947 since it's used in non-static inline functions now.
8948 (VALMASK) [!USE_LSB_TAG]: Likewise.
8949
8950 2012-08-02 Glenn Morris <rgm@gnu.org>
8951
8952 * s/: Remove empty directory.
8953
8954 * s/ms-w32.h: Move to ../nt/inc.
8955 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8956 Update for new ms-w32.h location.
8957
8958 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8959
8960 Port to Solaris 8.
8961 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8962
8963 2012-08-02 Glenn Morris <rgm@gnu.org>
8964
8965 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8966 hard-coding the path separator.
8967
8968 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8969
8970 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8971 This how ASET and AREF are supposed to work, and makes
8972 it easier to think about future improvements. See
8973 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8974 * charset.h (set_charset_attr): New function.
8975 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8976 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8977 (aref_addr): New function. All uses of &AREF(...) changed.
8978 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8979 (set_hash_index): New functions. All lvalue-style uses of
8980 HASH_KEY etc. changed.
8981 * keyboard.c (set_prop): New function. All lvalue-style uses
8982 of PROP changed.
8983
8984 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8985
8986 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8987 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
8988 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
8989 * nsfns.m (ns_set_name_as_filename): Likewise.
8990 * nsmenu.m (ns_update_menubar): Likewise.
8991 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8992
8993 2012-08-01 Eli Zaretskii <eliz@gnu.org>
8994
8995 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8996 Adapt to latest changes in field names of the corresponding Lisp
8997 objects.
8998
8999 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9000
9001 2012-08-01 Glenn Morris <rgm@gnu.org>
9002
9003 * s/msdos.h: Remove file.
9004 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9005 * Makefile.in (S_FILE): Remove.
9006 (config_h): Remove S_FILE.
9007
9008 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9009
9010 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9011 Remove; moved to nt/config.nt.
9012
9013 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9014
9015 Use INTERNAL_FIELD for conses and overlays.
9016 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9017 Remove obsolete comment.
9018 (MVAR): New macro.
9019 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9020 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9021
9022 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9023
9024 Use INTERNAL_FIELD for symbols.
9025 * lisp.h (SVAR): New macro. Adjust users.
9026 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9027 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9028
9029 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9030
9031 Use INTERNAL_FIELD for processes.
9032 * process.h (PVAR): New macro. Adjust style.
9033 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9034 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9035
9036 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9037
9038 Use INTERNAL_FIELD for windows.
9039 * window.h (WVAR): New macro.
9040 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9041 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9042 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9043 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9044 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9045 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9046
9047 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9048
9049 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9050
9051 2012-08-01 Glenn Morris <rgm@gnu.org>
9052
9053 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9054 Move to configure.ac.
9055
9056 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9057
9058 * makefile.w32-in (CONFIG_H): Update dependencies.
9059 (CONF_POST_H): New macro.
9060
9061 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9062
9063 2012-07-31 Glenn Morris <rgm@gnu.org>
9064
9065 * Makefile.in (S_FILE): No longer set by configure.
9066
9067 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9068 is available.
9069 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9070
9071 * process.h (NULL_DEVICE):
9072 * emacs.c (SEPCHAR):
9073 * editfns.c (USER_FULL_NAME): Let configure set them.
9074
9075 * s/README, s/template.h: Remove files.
9076
9077 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9078
9079 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9080 Move to configure.ac.
9081
9082 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9083
9084 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9085 resulting renaming of 'struct frame' members.
9086
9087 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9088
9089 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9090 after introduction of FVAR.
9091
9092 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9093
9094 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9095
9096 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9097 instead of compositeToPoint.
9098 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9099
9100 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9101
9102 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9103
9104 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9105 * lisp.h (INTERNAL_FIELD): New macro.
9106 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9107 (BVAR): Change to use INTERNAL_FIELD.
9108 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9109 (KVAR): Change to use INTERNAL_FIELD.
9110 * frame.h (FVAR): New macro.
9111 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9112 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9113 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9114 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9115 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9116
9117 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9118
9119 Miscellaneous fixes for non-default X toolkits.
9120 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9121 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9122 Move under #ifdef USE_LUCID.
9123 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9124 definition and usage to avoid warnings.
9125
9126 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9127
9128 * nsterm.m (openFiles): Fix previous checkin.
9129
9130 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9131
9132 * indent.c (compute_motion): Remove unused local.
9133
9134 2012-07-31 Glenn Morris <rgm@gnu.org>
9135
9136 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9137
9138 * conf_post.h [USG5_4]:
9139 Move remaining contents of s/usg5-4-common.h here.
9140 * s/usg5-4-common.h: Remove file.
9141
9142 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9143 * s/irix6-5.h: Remove file.
9144
9145 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9146 * s/darwin.h: Remove file.
9147
9148 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9149 * s/hpux10-20.h: Remove file, which is now empty.
9150
9151 2012-07-30 Glenn Morris <rgm@gnu.org>
9152
9153 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9154 * Makefile.in (config_h): Add conf_post.h.
9155 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9156
9157 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9158
9159 * nsterm.m (ns_do_open_file): New variable.
9160 (ns_term_init): Set ns_do_open_file to YES after run returns.
9161 (openFile, openTempFile, openFileWithoutUI, openFiles):
9162 Open files only if ns_do_open_file.
9163
9164 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9165
9166 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9167 This no-op macro hasn't been needed for many years.
9168 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9169
9170 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9171 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9172 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9173 gdb_make_enums_visible.
9174 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9175 (DIRECTORY_SEP): Now a constant, not a macro.
9176
9177 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9178
9179 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9180 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9181
9182 * w32term.c <w32_keyboard_codepage>: Renamed from
9183 keyboard_codepage and now external. All users changed.
9184
9185 * w32term.h: Add declaration of w32_keyboard_codepage.
9186
9187 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9188 the codepage to translate keys to Unicode. If this argument is
9189 -1, use the value returned by GetConsoleCP. All callers changed.
9190
9191 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9192
9193 Update .PHONY listings in makefiles.
9194 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9195 bootstrap-clean, distclean, maintainer-clean, versioclean,
9196 extraclean, frc.
9197
9198 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9199 This is a bit clearer. Fix some commentary typos.
9200
9201 2012-07-30 Glenn Morris <rgm@gnu.org>
9202
9203 * s/netbsd.h: Let configure include signal.h if needed.
9204 Remove file, which is now empty.
9205
9206 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9207 Let configure set them.
9208 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9209 No more need to undefine.
9210
9211 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9212
9213 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9214 non-single-byte char when adding meta modifier. (Bug#12090)
9215
9216 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9217
9218 Convert safe_call to use variable number of arguments.
9219 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9220 (safe_call2): Fix comment.
9221 * lisp.h (safe_call): Adjust prototype.
9222 * coding.c (encode_coding_object): Change to use safe_call2.
9223 * xfaces.c (merge_face_heights): Change to use safe_call1.
9224
9225 2012-07-30 Glenn Morris <rgm@gnu.org>
9226
9227 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
9228 does that unconditionally. Remove file, which is now empty.
9229
9230 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9231 Remove empty files.
9232
9233 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9234
9235 Export to GDB most of lisp.h's remaining object-like macros.
9236 * lisp.h (min, max): Move earlier, because they're used earlier now.
9237 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9238 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9239 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9240 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9241 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9242 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9243 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9244 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9245 Now constants, for GDB. They need not be macros.
9246 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9247 Now constants, for GDB, as well as macros, for static initializers.
9248 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9249 Move to after the definition of struct Lisp_Char_Table,
9250 since the former now needs that type defined.
9251 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9252 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9253 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9254 New enums, for gdb_make_enums_visible.
9255 (GLYPH_MODE_LINE_FACE): Remove; unused.
9256 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
9257 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9258 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9259 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9260 enum maxargs, enum MAX_ALLOCA.
9261 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9262 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9263 no longer needed, now that they are done in lisp.h.
9264
9265 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9266
9267 Cleanup string bytes checking.
9268 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9269 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9270 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9271 (check_sblock, compact_small_strings): Simplify.
9272
9273 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9274
9275 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9276 These macros are confusing and no longer need to be defined, as
9277 the enum values now suffice. All uses replaced with definiens.
9278 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9279
9280 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
9281
9282 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9283 ($(BLD)/w32console.$(O)): Update dependencies.
9284
9285 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9286
9287 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9288 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9289 time. Adjust users.
9290 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9291
9292 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9293
9294 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9295 setting sitelisp (Bug#12010).
9296
9297 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9298
9299 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
9300
9301 * w32heap.c (cache_system_info):
9302 * w32.c (sys_rename):
9303 * w32proc.c (find_child_console, sys_kill): All users changed.
9304
9305 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9306
9307 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9308
9309 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9310
9311 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9312
9313 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9314
9315 Cleanup statistics calculation in Fgarbage_collect.
9316 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9317 Fix zombies percentage calculation. Simplify elapsed time calculation.
9318
9319 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9320
9321 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9322 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9323 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9324 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9325 (replace_range, replace_range_2, del_range_2): Change to eassert.
9326 * marker.c (byte_char_debug_check): Adjust style.
9327
9328 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9329
9330 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9331 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9332 long-ago-commented-out code that talks about "WIN32".
9333 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9334 All uses changed.
9335
9336 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9337
9338 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9339 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9340 Simplify by using alignof.
9341 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9342 * lisp.h: Include <stdalign.h>.
9343 (GCALIGNMENT): New macro and constant.
9344 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9345 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9346 (stdalign): New macro, if not already defined.
9347
9348 2012-07-28 Eli Zaretskii <eliz@gnu.org>
9349
9350 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9351 * w32inevt.c: Include w32inevt.h.
9352 (w32_read_console_input): New inline function, calls either
9353 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9354 w32_console_unicode_input.
9355 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9356 (w32_kbd_patch_key, key_event): Use the codepage returned by
9357 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9358 (key_event): use uChar.UnicodeChar only if
9359 w32_console_unicode_input is non-zero.
9360
9361 * w32console.c: Include w32heap.h.
9362 <w32_console_unicode_input>: New global variable.
9363 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9364 family of Windows, zero otherwise.
9365
9366 * w32inevt.h: Declare w32_console_unicode_input.
9367
9368 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9369 --without-x. (Bug#11742)
9370
9371 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9372
9373 Adjust GDB to reflect pvec_type changes (Bug#12036).
9374 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
9375 2012-07-04 changes to pseudovector representation.
9376 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
9377
9378 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
9379
9380 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9381 bus address.
9382 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9383
9384 2012-07-27 Eli Zaretskii <eliz@gnu.org>
9385
9386 * alloc.c (listn): Fix the order the arguments are consed onto the
9387 list.
9388
9389 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9390 enumeration constants, as PURE and HEAP are too general, and clash
9391 with other headers and sources, such as gmalloc.c and the
9392 MS-Windows system headers. All users changed.
9393
9394 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9395
9396 Revert last save_excursion_save and save_excursion_restore changes.
9397 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9398 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9399
9400 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9401
9402 Fix recently-introduced typos in Windows port.
9403 Reported by Martin Rudalics <rudalics@gmx.at>.
9404 * w32.c (init_environment): Replace comma with semicolon.
9405 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
9406
9407 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9408
9409 Improve GDB symbol export (Bug#12036).
9410 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9411 arms of an 'if', not using conditional expressions; otherwise GDB
9412 complains about the types in the unevaluated arm when the argument
9413 is an integer literal.
9414 (xgetint): Simplify expression.
9415 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9416 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9417 Zaretskii in <http://bugs.gnu.org/12036#13>.
9418 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9419 needed now that we have gdb_make_enums_visible.
9420 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9421 (enum enum_USE_LSB_TAG):
9422 New enum types, packaging up enums that need to be exported to GDB.
9423
9424 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9425
9426 Utility function to make a list from specified amount of objects.
9427 * lisp.h (enum constype): New datatype.
9428 (listn): New prototype.
9429 * alloc.c (listn): New function.
9430 (Fmemory_use_count, syms_of_alloc): Use it.
9431 * buffer.c (syms_of_buffer): Likewise.
9432 * callint.c (syms_of_callint): Likewise.
9433 * charset.c (define_charset_internal): Likewise.
9434 * coding.c (syms_of_coding): Likewise.
9435 * keymap.c (syms_of_keymap): Likewise.
9436 * search.c (syms_of_search): Likewise.
9437 * syntax.c (syms_of_syntax): Likewise.
9438 * w32.c (init_environment): Likewise.
9439 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9440 * xdisp.c (syms_of_xdisp): Likewise.
9441 * xfns.c (syms_of_xfns): Likewise.
9442
9443 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9444
9445 Fast save_excursion_save and save_excursion_restore.
9446 * lisp.h (struct Lisp_Excursion): New data type.
9447 (PVEC_EXCURSION): New pseudovector type.
9448 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9449 to deal with it. Adjust comments.
9450 (init_marker, attach_marker): New prototype.
9451 (unchain_marker): Adjust prototype.
9452 * marker.c (attach_marker): Change to global.
9453 (init_marker): New function.
9454 * alloc.c (Fmake_marker, build_marker): Use it.
9455 (build_marker): More easserts.
9456 (mark_object): Handle struct Lisp_Excursion.
9457 * editfns.c (save_excursion_save, save_excursion_restore):
9458 Reimplement to use struct Lisp_Excursion. Add comments.
9459
9460 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9461
9462 Fix export of symbols to GDB (Bug#12036).
9463 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9464 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9465 emacs.c, as this is a more-suitable home. Had this been done earlier
9466 the fix for 12036 would have avoided some of the problems noted in
9467 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9468 would have been more obvious.
9469 * emacs.c: Do not include <verify.h>; no longer needed.
9470 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
9471 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9472 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9473 Remove; now done in lisp.h.
9474 * lisp.h (PUBLISH_TO_GDB): New macro.
9475 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9476 (DATA_SEG_BITS): Use it.
9477 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9478 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9479 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9480 not be usable in #if. This simplifies things.
9481
9482 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
9483
9484 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9485
9486 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9487
9488 Simplify export of symbols to GDB (Bug#12036).
9489 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9490 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9491 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9492 Adjust to changes in lisp.h and emacs.c, by using
9493 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9494 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9495 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9496 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9497 instead of gdb_valbits.
9498 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9499 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9500 instead of gdb_array_mark_flag.
9501 (xboolvector): Get size from $->size, not $->header.size.
9502 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9503 (xreload, hook-run, hookpost-run): Remove.
9504 * emacs.c: Include <verify.h>.
9505 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9506 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9507 Remove.
9508 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9509 (gdb_USE_LSB_TAG): New enum constants.
9510 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9511 Also define these as enum constants, so they're visible to GDB.
9512 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9513 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9514 as constants, so they're visible to GDB.
9515 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9516 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9517 Now enum constants, not macros, so they're visible to GDB.
9518 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9519 more convenient now. All uses changed.
9520 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9521 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9522
9523 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9524
9525 Explicitly free restriction data that are not needed anymore.
9526 * editfns.c (save_restriction_restore): Free restriction data.
9527
9528 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9529
9530 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9531 add argument, tune behavior, and adjust all callers.
9532
9533 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9534
9535 Use typedef for EMACS_INT, EMACS_UINT.
9536 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9537 than macros. This simplifies debugging in the usual case, since
9538 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9539 and it allows expressions involving EMACS_INT casts.
9540 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9541
9542 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9543
9544 * nsterm.m (ns_read_socket): Return early if there is a modal
9545 window (Bug#12043).
9546
9547 2012-07-25 Martin Rudalics <rudalics@gmx.at>
9548
9549 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9550 that FOCUS-FRAME can be omitted.
9551
9552 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9553
9554 Adjust buffer text indirection counters at the end of Fkill_buffer.
9555 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9556 buffer is definitely dead. This should really fix an issue reported
9557 by Christoph Scholtes again. (Bug#12007).
9558 (init_buffer_once): Initialize indirection counters of
9559 buffer_defaults and buffer_local_symbols (for sanity and safety).
9560
9561 2012-07-24 Eli Zaretskii <eliz@gnu.org>
9562
9563 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9564 and continuation glyphs on tooltip frames, leave them at zero.
9565 Avoids continued lines in tooltips. (Bug#11832)
9566
9567 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9568
9569 Simplify copy_overlay.
9570 * buffer.c (copy_overlay): Simplify. Use build_marker.
9571 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9572
9573 2012-07-23 Eli Zaretskii <eliz@gnu.org>
9574
9575 * print.c (print_object): Don't crash when a frame's name is nil
9576 or invalid. (Bug#12025)
9577
9578 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9579 it signals an error when a tooltip frame is being created.
9580
9581 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9582
9583 Cleanup miscellaneous objects allocation and initialization.
9584 * alloc.c (allocate_misc): Change to static. Add argument to
9585 specify the subtype. Adjust comment and users.
9586 (build_overlay): New function.
9587 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9588 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9589 (allocate_misc): Remove prototype.
9590 (build_overlay): Add prototype.
9591
9592 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9593
9594 Swap buffer text indirection counters in Fbuffer_swap_text.
9595 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9596 This avoids crash reported by Christoph Scholtes at
9597 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9598
9599 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9600
9601 * nsmenu.m (Popdown_data): New struct.
9602 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9603 free Popdown_data.
9604 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9605 (initWithContentRect): Make imgView and contentView non-static
9606 and autorelease them. Also autorelease img and matrix (Bug#12005).
9607 (dealloc): Remove (Bug#12005).
9608
9609 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9610
9611 Adjust consing_since_gc when objects are explicitly freed.
9612 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9613 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9614 (free_cons, free_misc): Subtract object size from consing_since_gc.
9615
9616 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9617
9618 Simplify and cleanup markers positioning code.
9619 * marker.c (attach_marker): More useful eassert.
9620 (live_buffer, set_marker_internal): New function.
9621 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9622 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9623
9624 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9625
9626 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9627 as it's limited by the amount of memory, not by INT_MAX.
9628
9629 2012-07-21 Eli Zaretskii <eliz@gnu.org>
9630
9631 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9632 in special-event-map. See the discussion at
9633 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9634 for the reasons.
9635
9636 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
9637 info.dwItemData. Fixes crashes on 64-bit Windows.
9638 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
9639
9640 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9641
9642 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
9643 (conversationIdentifier): Return value is NSInteger.
9644 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
9645
9646 2012-07-21 Chong Yidong <cyd@gnu.org>
9647
9648 * window.c (decode_any_window): Signal an error if the window is
9649 on a dead frame (Bug#11984).
9650
9651 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9652
9653 Add indirection counting to speed up Fkill_buffer.
9654 * buffer.h (struct buffer): New member.
9655 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9656 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9657 base buffer indirection counter.
9658 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9659 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9660 through buffer list if indirection counter is 0.
9661
9662 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9663
9664 Extend the value returned by Fgarbage_collect with heap statistics.
9665 * alloc.c (Qheap): New symbol.
9666 (syms_of_alloc): DEFSYM it.
9667 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9668 (Fmemory_free): Remove.
9669 (syms_of_alloc): Don't defsubr it.
9670 * buffer.c (Fcompact_buffer): Remove.
9671 (syms_of_buffer): Don't defsubr it.
9672
9673 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9674
9675 Make maybe_gc inline.
9676 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9677 * lisp.h (consing_since_gc, gc_relative_threshold)
9678 (memory_full_cons_threshold): Revert declaration.
9679 (maybe_gc): Remove prototype, define as inline.
9680 * alloc.c: Remove old commented-out code.
9681 (consing_since_gc, gc_relative_threshold)
9682 (memory_full_cons_threshold): Revert to global.
9683 (maybe_gc): Remove.
9684
9685 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9686
9687 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9688 * lisp.h (build_unibyte_string): New function.
9689 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9690 * sysdep.c, w32fns.c, xfns.c: Use it.
9691 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9692 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9693 Adjust users accordingly.
9694 * font.h (font_open_by_name): Adjust prototype.
9695
9696 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9697
9698 Cleanup calls to Fgarbage_collect.
9699 * lisp.h (maybe_gc): New prototype.
9700 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9701 Remove declarations.
9702 * alloc.c (maybe_gc): New function.
9703 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9704 Make them static.
9705 * bytecode.c (MAYBE_GC): Use maybe_gc.
9706 * eval.c (eval_sub, Ffuncall): Likewise.
9707 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9708 to avoid dependency from auto-save feature.
9709
9710 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9711
9712 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9713 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9714 'for_each_per_buffer_object_at'.
9715 All uses changed. It's better to use upper-case for macros that
9716 cannot be implemented as functions, to give the reader a clue
9717 that they're special.
9718
9719 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9720
9721 * alloc.c (Fgarbage_collect): Tweak docstring.
9722
9723 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9724
9725 Tweak the value returned from Fgarbage_collect again.
9726 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9727 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9728 Adjust documentation.
9729 (total_vector_bytes): Rename to total_vector_slots, adjust
9730 accounting.
9731 (total_free_vector_bytes): Rename to total_free_vector_slots,
9732 adjust accounting.
9733 (Qstring_bytes, Qvector_slots): New symbols.
9734 (syms_of_alloc): DEFSYM them.
9735
9736 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9737
9738 Buffer compaction primitive which may be used from Lisp.
9739 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9740 (syms_of_buffer): Register Fcompact_buffer.
9741 * alloc.c (Fgarbage_collect): Use compact_buffer.
9742 * buffer.h (compact_buffer): New prototype.
9743 (struct buffer_text): New member.
9744
9745 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9746
9747 New macro to iterate over all buffers, miscellaneous cleanups.
9748 * lisp.h (all_buffers): Remove declaration.
9749 * buffer.h (all_buffers): Add declaration, with comment.
9750 (for_each_buffer): New macro.
9751 * alloc.c (Fgarbage_collect, mark_object): Use it.
9752 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9753 (init_buffer): Likewise.
9754 * data.c (Fset_default): Likewise.
9755 * coding.c (code_conversion_restore): Remove redundant check
9756 for dead buffer.
9757 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9758
9759 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9760
9761 Fix bug that created negative-length intervals.
9762 * intervals.c (merge_interval_right, merge_interval_left):
9763 Do not zero out this interval if it is absorbed by its children,
9764 as this interval's total length doesn't change in that case. See
9765 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9766
9767 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9768
9769 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9770 when invoking (make-bool-vector N t) and N is a positive
9771 multiple of 8 -- the last 8 bits were mistakenly cleared.
9772
9773 Remove some struct layout assumptions in bool vectors.
9774 * alloc.c (bool_header_size): New constant.
9775 (header_size, word_size): Move earlier, as they're now used earlier.
9776 Use 'word_size' in a few more places, where it's appropriate.
9777 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9778 padding before the data member of a bool vector.
9779 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9780 than doing the check by hand with an abort ().
9781
9782 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9783
9784 * eval.c (Fdefvar): Don't check constants since we only set the var if
9785 it's not yet defined anyway (bug#11904).
9786
9787 * lisp.h (last_undo_boundary): Declare new var.
9788 * keyboard.c (command_loop_1): Set it.
9789 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9790 were auto-added by the command loop (bug#11774).
9791
9792 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9793
9794 * w32font.c (Qsymbol): Remove local definition.
9795 (syms_of_w32font): Don't DEFSYM it.
9796
9797 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9798
9799 Fix sweep_vectors to handle large bool vectors correctly.
9800 * alloc.c (sweep_vectors): Account total_vector_bytes for
9801 bool vectors larger than VBLOCK_BYTES_MAX.
9802
9803 2012-07-18 Chong Yidong <cyd@gnu.org>
9804
9805 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9806 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9807
9808 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9809
9810 Return more descriptive data from Fgarbage_collect.
9811 Suggested by Stefan Monnier in
9812 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9813 * alloc.c (bounded_number): New function.
9814 (total_buffers, total_vectors): New variable.
9815 (total_string_size): Rename to total_string_bytes, adjust users.
9816 (total_vector_size): Rename to total_vector_bytes, adjust users.
9817 (sweep_vectors): Account total_vectors and total_vector_bytes.
9818 (Fgarbage_collect): New return value. Adjust documentation.
9819 (gc_sweep): Account total_buffers.
9820 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9821 (VECTOR_SIZE): Remove.
9822 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9823 (Qinterval, Qmisc): New symbols.
9824 (syms_of_data): Initialize them.
9825 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9826 (Qcons, Qbuffer): New declarations.
9827
9828 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9829
9830 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9831 Round up, not down. Improve doc.
9832
9833 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9834
9835 Restore old code in allocate_string_data to avoid Faset breakage.
9836 Reported by Julien Danjou <julien@danjou.info> in
9837 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9838 * alloc.c (allocate_string_data): Restore old code with minor
9839 adjustments, fix comment to explain this subtle issue.
9840
9841 2012-07-17 Eli Zaretskii <eliz@gnu.org>
9842
9843 Remove FILE_SYSTEM_CASE.
9844 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9845
9846 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9847 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9848 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9849 call-process-region passes it through expand-file-name.
9850
9851 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9852
9853 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9854
9855 Fix crash when creating indirect buffer (Bug#11917)
9856 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9857 Don't handle unbound variables specially if non-zero.
9858 (Fbuffer_local_variables): Pass zero.
9859 (clone_per_buffer_values): Pass non-zero.
9860
9861 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9862
9863 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9864 to make the loop interruptible.
9865
9866 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9867
9868 * gnutls.c (emacs_gnutls_handshake): Only retry if
9869 GNUTLS_E_INTERRUPTED.
9870
9871 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9872
9873 Cleanup and convert miscellaneous checks to eassert.
9874 * alloc.c (mark_interval): Fix comment, partially rephrase
9875 old comment from intervals.h (see below).
9876 * intervals.c (find_interval, adjust_intervals_for_insertion)
9877 (delete_interval, adjust_intervals_for_deletion)
9878 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9879 Convert to eassert.
9880 (adjust_intervals_for_insertion, make_new_interval):
9881 Remove obsolete and unused code.
9882 * intervals.h (struct interval): Remove obsolete comment.
9883 * textprotp.c (erase_properties): Remove unused code.
9884 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9885 (Fremove_list_of_text_properties): Convert to eassert.
9886
9887 2012-07-17 Chong Yidong <cyd@gnu.org>
9888
9889 * editfns.c (Finsert_char): Doc fix.
9890
9891 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9892
9893 Fix previous change to make Fmemory_free always accurate.
9894 * alloc.c (make_interval): Update total_free_intervals.
9895 (make_float): Likewise for total_free_floats.
9896 (free_cons, Fcons): Likewise for total_free_conses.
9897 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9898 Likewise for total_free_vector_bytes.
9899 (Fmake_symbol): Likewise for total_free_symbols.
9900 (bytes_free): Remove.
9901
9902 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9903
9904 Simple free memory accounting feature.
9905 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9906 (sweep_vectors): Accumulate size of free vectors.
9907 (Fgarbage_collect): Setup bytes_free.
9908 (Fmemory_free): New function.
9909 (syms_of_alloc): Register it.
9910
9911 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9912
9913 Cleanup overlays checking.
9914 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9915 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9916 eassert and OVERLAYP.
9917 (sort_overlays): Change to use OVERLAYP.
9918
9919 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9920
9921 * editfns.c (Finsert_char): Make it interactive, and make the
9922 second arg optional. Copy interactive spec and docstring from
9923 ucs-insert.
9924
9925 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9926
9927 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9928 Unlike the other wrapped functions, fabs has an unspecified
9929 effect on errno.
9930
9931 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9932
9933 * nsterm.m (keyDown): Interpret flags without left/right bits
9934 as the left key (Bug#11670).
9935
9936 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9937
9938 Remove empty and useless init functions.
9939 * lisp.h (init_character_once, init_fns, init_image)
9940 (init_filelock, init_sound): Remove prototype.
9941 * character.c (init_character_once): Remove.
9942 * filelock.c (init_filelock): Likewise.
9943 * fns.c (init_fns): Likewise.
9944 * image.c (init_image): Likewise.
9945 * sound.c (init_sound): Likewise.
9946 * emacs.c (main): Adjust accordingly.
9947
9948 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9949
9950 * gtkutil.h: Tiny cleanups.
9951 (use_old_gtk_file_dialog): Remove useless declaration.
9952 (xg_uses_old_file_dialog): Add suggested const attribute.
9953
9954 2012-07-15 Eli Zaretskii <eliz@gnu.org>
9955
9956 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9957 (bidi_paragraph_init): Use it to limit search forward for a strong
9958 directional character in abnormally large paragraphs full of
9959 neutral or weak characters. (Bug#11943)
9960
9961 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9962
9963 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9964 the toolbar (Bug#9451).
9965 (xg_make_tool_item): Give the widget event box a transparent
9966 background.
9967
9968 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9969
9970 Cleanup basic allocation variables and functions.
9971 * alloc.c (ignore_warnings, init_intervals, init_float)
9972 (init_cons, init_symbol, init_marker): Remove.
9973 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9974 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9975 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9976 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9977 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9978 (staticidx, init_alloc_once, init_strings, free_ablock):
9979 Remove redundant initialization.
9980 * fns.c (init_weak_hash_tables): Remove.
9981 * lisp.h (init_weak_hash_tables): Remove prototype.
9982
9983 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9984
9985 Use zero_vector where appropriate.
9986 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9987 accordingly.
9988 * lisp.h (zero_vector): New declaration.
9989 * font.c (null_vector): Remove.
9990 (syms_of_font): Remove initialization and staticpro.
9991 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9992 * keymap.c (Faccessible_keymaps): Likewise.
9993
9994 2012-07-15 Leo Liu <sdl.web@gmail.com>
9995
9996 * fringe.c: Fix typo in comments.
9997
9998 2012-07-14 Leo Liu <sdl.web@gmail.com>
9999
10000 * fringe.c: Add a new bitmap exclamation-mark.
10001
10002 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10003
10004 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10005
10006 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10007 (HAVE_MENUS): Don't define, defined by editing config.in with
10008 msdos/sed2v2.inp.
10009 (GMALLOC_INHIBIT_VALLOC): Don't define.
10010 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10011
10012 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10013
10014 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10015
10016 2012-07-14 Glenn Morris <rgm@gnu.org>
10017
10018 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10019 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10020 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10021
10022 2012-07-13 Glenn Morris <rgm@gnu.org>
10023
10024 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10025
10026 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10027 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10028
10029 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10030
10031 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10032 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10033 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10034 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10035 where appropriate.
10036 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10037 as boolean expression.
10038 (x_set_window_size): Remove unused variable toolbar.
10039 (ns_get_color_default, ns_mod_to_lisp): Remove.
10040 (ns_mouse_position): Remove unused variables xchar and ychar.
10041 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10042 (ns_set_vertical_scroll_bar): Remove unused variable count.
10043 (ns_delete_terminal): Remove unused variable i.
10044 (ns_term_init): Remove unused variables r, g and b.
10045 (mouseDown): Remove unused variable window.
10046 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10047 (initFrameFromEmacs): Remove unused variable vbextra.
10048 (mouseEntered): Remove unused variables p and dpyinfo.
10049 (mouseExited): Remove unused variables p and r.
10050 (ns_define_frame_cursor, ns_clear_frame_area)
10051 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10052 (menuDown): Assign [sender tag] to variable and cast the variable.
10053
10054 * nsterm.h (menuDown): Add id as type to argument sender.
10055 (ns_display_info_for_name): Add Lisp_Object argument.
10056 (ns_term_init): Add Lisp_Object argument.
10057 (ns_map_event_to_object): Add void argument.
10058 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10059 prototype with arguments and only declare if __OBJC__.
10060 (nxatoms_of_nsselect): Add void argument.
10061 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10062 (ns_alloc_autorelease_pool): Add void argument.
10063 (ns_release_autorelease_pool): Add void* argument.
10064 (ns_get_defaults_value): Add const char* argument.
10065
10066 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10067 (initFromContents): Use SSDATA where appropriate.
10068 (ns_update_menubar): Add braces to ambigous if-else.
10069 (initWithTitle): Put () around assignment in if statement.
10070 (ns_menu_show): Remove unused variables window and keymap.
10071 (update_frame_tool_bar): Remove unused variable selected_p.
10072 (initWithContentRect): Remove unused variable this_cmd_name.
10073
10074 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10075 appropriate.
10076 (setXBMColor): Remove unused variable len.
10077 (setPixmapData): Put () around assignment in loop statement.
10078
10079 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10080 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10081 where appropriate.
10082 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10083 around assignment in loop statement.
10084 (nsfont_open): Remove unused variable i.
10085 (nsfont_open): Remove unused variable len.
10086 (nsfont_draw): Remove unused variable cs.
10087
10088 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10089 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10090 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10091 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10092 (Fns_font_name, Fns_perform_service)
10093 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10094 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10095 (ns_set_name): Remove unused variable view.
10096 (x_set_menu_bar_lines): Remove unused variable olines.
10097 (x_set_tool_bar_lines): Remove unused variable root_window.
10098 (Fns_list_colors): Put () around assignment in while statement.
10099 (Fns_perform_service): Remove unused variable len.
10100 (Fns_display_usable_bounds): Remove unused variable top.
10101 (syms_of_nsfns): Remove unused variable i.
10102
10103 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10104 memcpy (Bug#11907).
10105
10106 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10107
10108 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10109 and free it with DestroyExceptionInfo (Bug#11558).
10110
10111 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10112
10113 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10114 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10115 Set here, not in nt/config.nt.
10116
10117 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10118
10119 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10120 cursor overflow into the last glyph on display line when the right
10121 fringe is off. (Bug#11832)
10122
10123 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10124
10125 * xdisp.c (produce_special_glyphs): Now static.
10126 * dispextern.h (produce_special_glyphs): Remove decl.
10127
10128 2012-07-13 Glenn Morris <rgm@gnu.org>
10129
10130 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10131 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10132
10133 * s/usg5-4-common.h (USG, USG5):
10134 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10135 * s/sol2-6.h (SOLARIS2):
10136 * s/irix6-5.h (IRIX6_5):
10137 * s/hpux10-20.h (USG, USG5, HPUX):
10138 * s/gnu-linux.h (USG, GNU_LINUX):
10139 * s/freebsd.h (BSD_SYSTEM):
10140 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10141 * s/cygwin.h (CYGWIN):
10142 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10143 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10144
10145 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10146
10147 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10148
10149 2012-07-13 Glenn Morris <rgm@gnu.org>
10150
10151 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10152
10153 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10154
10155 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10156 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10157
10158 2012-07-12 Glenn Morris <rgm@gnu.org>
10159
10160 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10161
10162 * process.c (init_process_emacs): Rename from init_process.
10163 The old name is also the name of a Mach system call.
10164 * lisp.h, emacs.c: Update for this name change.
10165 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10166 longer needed.
10167
10168 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10169
10170 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10171 memmove call that removes glyphs covered by the left truncation
10172 glyph. Improve commentary.
10173 (display_line): Fix display of continuation glyphs on GUI frames
10174 when the right fringe is turned off and variable-size fonts are
10175 used in the window. Move the code that appends a stretch glyph to
10176 produce_special_glyphs, so that it could be used for truncation
10177 and continuation glyphs alike.
10178 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10179 glyph of a suitably computed width, to align the special glyphs at
10180 the window margin. Code moved from display_line. (Bug#11832)
10181
10182 2012-07-12 Glenn Morris <rgm@gnu.org>
10183
10184 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10185
10186 * s/gnu-linux.h, s/hpux10-20.h:
10187 Do not unconditionally define HAVE_XRMSETDATABASE.
10188
10189 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10190
10191 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10192
10193 Fix typos that broke OS X build.
10194 Reported by Randal L. Schwartz in
10195 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10196 * nsterm.m (ns_timeout): Add missing local decl.
10197 (ns_get_color): snprintf -> sprintf, to fix typo.
10198
10199 2012-07-12 Glenn Morris <rgm@gnu.org>
10200
10201 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10202 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10203 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10204 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10205
10206 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10207 Move PTY_OPEN to configure.
10208
10209 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10210 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10211 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10212
10213 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10214
10215 Use empty_unibyte_string where applicable.
10216 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10217 * lread.c (read1): Likewise.
10218 * xsettings.c (syms_of_xsettings): Likewise.
10219
10220 2012-07-12 Glenn Morris <rgm@gnu.org>
10221
10222 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10223 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
10224 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10225 * s/hpux10-20.h (RUN_TIME_REMAP):
10226 * s/bsd-common.h (TABDLY): Move to configure.
10227
10228 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10229
10230 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10231
10232 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10233 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
10234
10235 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
10236
10237 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10238 * s/template.h: Move NARROWPROTO to configure.
10239
10240 2012-07-11 Glenn Morris <rgm@gnu.org>
10241
10242 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10243 unused since 2011-01-17 change to systty.h.
10244
10245 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10246 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10247 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10248
10249 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10250
10251 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10252
10253 2012-07-11 Glenn Morris <rgm@gnu.org>
10254
10255 * s/darwin.h, s/gnu-linux.h, s/template.h:
10256 Move INTERRUPT_INPUT to configure.
10257
10258 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10259
10260 Minor adjustments to interning code.
10261 * lisp.h (intern, intern_c_string): Redefine as static inline
10262 wrappers for intern_1 and intern_c_string_1, respectively.
10263 (intern_1, intern_c_string_1): Rename prototypes.
10264 * lread.c (intern_1, intern_c_string_1, oblookup):
10265 Simplify Vobarray checking.
10266 * font.c (font_intern_prop): Likewise. Adjust comment.
10267 * w32font.c (intern_font_name): Likewise.
10268
10269 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10270
10271 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10272
10273 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10274 of Fcar/Fcdr if possible.
10275 * font.c (check_otf_features): Likewise.
10276 * fontset.c (Fnew_fontset): Likewise.
10277 * gnutls.c (Fgnutls_boot): Likewise.
10278 * minibuf.c (read_minibuf): Likewise.
10279 * msdos.c (IT_set_frame_parameters): Likewise.
10280 * xmenu.c (Fx_popup_dialog): Likewise.
10281 * w32menu.c (Fx_popup_dialog): Likewise.
10282
10283 2012-07-11 Glenn Morris <rgm@gnu.org>
10284
10285 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10286 since nothing has defined it on these platforms.
10287
10288 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10289 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10290
10291 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10292 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10293 Move CLASH_DETECTION to configure.
10294
10295 * s/gnu.h: Remove file, which is now empty.
10296
10297 * s/gnu.h, s/gnu-linux.h:
10298 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10299
10300 2012-07-11 John Wiegley <johnw@newartisans.com>
10301
10302 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10303 function attribute, so we only use it if it exists in the
10304 compiler.
10305
10306 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10307
10308 Avoid call to strlen in fast_c_string_match_ignore_case.
10309 * search.c (fast_c_string_match_ignore_case): Change to use
10310 length argument. Adjust users accordingly.
10311 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10312
10313 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10314
10315 Assume mkdir, rmdir.
10316 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10317 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10318
10319 Assume rename.
10320 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10321
10322 Assume perror.
10323 * s/hpux10-20.h (HAVE_PERROR): Remove.
10324 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10325 Remove dummy definition, as this problem was obsolete long ago.
10326
10327 Assume strerror.
10328 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10329
10330 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10331
10332 Avoid calls to strlen in font processing functions.
10333 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
10334 (font_open_by_name): Change to use length argument.
10335 Adjust users accordingly.
10336 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10337 Adjust prototypes.
10338 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10339 Change to return ptrdiff_t.
10340 (xfont_list_pattern, xfont_match): Use length returned by
10341 xfont_decode_coding_xlfd.
10342 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10343
10344 2012-07-11 Glenn Morris <rgm@gnu.org>
10345
10346 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10347 Move DONT_REOPEN_PTY to configure.
10348
10349 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10350 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10351
10352 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10353
10354 Remove "#define unix" that is no longer needed (Bug#11905).
10355 * s/aix4-2.h (unix): Remove; no longer needed.
10356
10357 EMACS_TIME simplification (Bug#11875).
10358 This replaces macros (which typically do not work in GDB)
10359 with functions, typedefs and enums, making the code easier to debug.
10360 The functional style also makes code easier to read and maintain.
10361 * systime.h: Include <sys/time.h> on all hosts, not just if
10362 WINDOWSNT, since 'struct timeval' is needed in general.
10363 (EMACS_TIME): Now a typedef, not a macro.
10364 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10365 not macros.
10366 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10367 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10368 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10369 (EMACS_TIME_LE): Now functions, not macros.
10370 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10371 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10372 which are not functions. All uses rewritten to use:
10373 (make_emacs_time): New function.
10374 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10375 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10376 not functions. All uses rewritten to use the following, respectively:
10377 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10378 (add_emacs_time, sub_emacs_time): New functions.
10379 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
10380 * fileio.c (Fcopy_file):
10381 * xterm.c (XTflash): Get the current time closer to when it's used.
10382 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10383
10384 * bytecode.c (targets): Suppress -Woverride-init warnings.
10385
10386 Simplify by avoiding confusing use of strncpy etc.
10387 * doc.c (Fsnarf_documentation):
10388 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10389 * frame.c (Fmake_terminal_frame):
10390 * gtkutil.c (get_utf8_string):
10391 * lread.c (openp):
10392 * nsmenu.m (ns_update_menubar):
10393 * regex.c (regerror):
10394 Prefer memcpy to strncpy and strncat when either will do.
10395 * fileio.c (Fsubstitute_in_file_name):
10396 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10397 (menu_separator_name_p):
10398 * nsmenu.m (ns_update_menubar):
10399 Prefer memcmp to strncmp when either will do.
10400 * nsterm.m: Include <ftoastr.h>.
10401 (ns_get_color):
10402 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10403 Prefer snprintf to strncpy.
10404 * nsterm.m (ns_term_init):
10405 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10406 * nsterm.m (ns_term_init):
10407 Avoid the need for strncpy, by using build_string or
10408 make_unibyte_string directly. Use dtoastr, not snprintf.
10409 * process.c (Fmake_network_process): Diagnose service names that
10410 are too long, rather than silently truncating them or creating
10411 non-null-terminated names.
10412 (Fnetwork_interface_info): Likewise, for interface names.
10413 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10414 Prefer sprintf to strncat.
10415 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10416 Prefer vsnprintf to vsprintf + strncpy.
10417
10418 2012-07-10 Glenn Morris <rgm@gnu.org>
10419
10420 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10421 Clarify fallback case.
10422
10423 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10424
10425 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10426 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10427 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
10428 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
10429 where argument type is known to be a Lisp_Cons.
10430
10431 2012-07-10 Tom Tromey <tromey@redhat.com>
10432
10433 * bytecode.c (BYTE_CODE_THREADED): New macro.
10434 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10435 (enum byte_code_op): New type.
10436 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10437 (exec_byte_code): Use them. Use token threading when applicable.
10438
10439 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10440
10441 Optimize pure C strings initialization.
10442 * lisp.h (make_pure_string): Fix prototype.
10443 (build_pure_c_string): New function, defined as static inline. This
10444 provides a better opportunity to optimize away calls to strlen when
10445 the function is called with compile-time constant argument.
10446 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10447 argument, adjust users accordingly. Use build_pure_c_string where
10448 appropriate.
10449 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10450 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10451 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10452
10453 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10454
10455 Avoid calls to strlen in miscellaneous functions.
10456 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10457 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10458 * lread.c (openp): Likewise.
10459
10460 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10461
10462 Avoid calls to strlen in path processing functions.
10463 * fileio.c (file_name_as_directory): Add comment. Change to add
10464 srclen argument and return the length of result. Adjust users
10465 accordingly.
10466 (directory_file_name): Fix comment. Change to add srclen argument,
10467 swap 1st and 2nd arguments to obey the common convention.
10468 Adjust users accordingly.
10469 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10470
10471 2012-07-10 Glenn Morris <rgm@gnu.org>
10472
10473 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10474 Move PENDING_OUTPUT_COUNT definition to configure.
10475
10476 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10477 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10478 * s/gnu.h (DATA_START): Move definitions to configure.
10479
10480 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10481 We include usg5-4-common.h, which defines them both.
10482
10483 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10484 O_RDONLY already includes it).
10485
10486 Stop ns builds setting the EMACSLOADPATH environment variable.
10487 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10488 Now it does not set EMACSLOADPATH, just returns the load-path string.
10489 * nsterm.h: Update accordingly.
10490 * lread.c [HAVE_NS]: Include nsterm.h.
10491 (init_lread) [HAVE_NS]: Use ns_load_path.
10492 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10493
10494 2012-07-09 Glenn Morris <rgm@gnu.org>
10495
10496 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10497 since the included bsd-common.h does so.
10498
10499 Stop ns builds setting the EMACSPATH environment variable.
10500 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10501 (ns_init_paths): Do not set EMACSPATH.
10502 * nsterm.h (ns_exec_path): Add it.
10503 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10504 Use ns_exec_path.
10505
10506 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10507
10508 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10509
10510 * process.c (wait_reading_process_output): 'waitchannels' was unset
10511 when read_kbd || !NILP (wait_for_cell); fix this.
10512
10513 Add GCC-style 'const' attribute to functions that can use it.
10514 * character.h (char_resolve_modifier_mask):
10515 * keyboard.h (make_ctrl_char):
10516 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10517 (init_character_once, next_almost_prime, init_fns, init_image)
10518 (flush_pending_output, init_sound):
10519 * mem-limits.h (start_of_data):
10520 * menu.h (finish_menu_items):
10521 Add ATTRIBUTE_CONST.
10522 * emacs.c (DEFINE_DUMMY_FUNCTION):
10523 Declare the dummy function with ATTRIBUTE_CONST.
10524 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10525 Add decls with ATTRIBUTE_CONST.
10526
10527 Minor improvements to make_formatted_string.
10528 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10529 where int is good enough, as vsprintf returns an int.
10530 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10531
10532 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10533
10534 Use make_formatted_string to avoid double length calculation.
10535 * lisp.h (make_formatted_string): New prototype.
10536 * alloc.c (make_formatted_string): New function.
10537 * buffer.c (Fgenerate_new_buffer_name): Use it.
10538 * dbusbind.c (syms_of_dbusbind): Likewise.
10539 * editfns.c (Fcurrent_time_zone): Likewise.
10540 * filelock.c (get_boot_time): Likewise.
10541 * frame.c (make_terminal_frame, set_term_frame_name)
10542 (x_report_frame_params): Likewise.
10543 * image.c (gs_load): Likewise.
10544 * minibuf.c (get_minibuffer): Likewise.
10545 * msdos.c (dos_set_window_size): Likewise.
10546 * process.c (make_process): Likewise.
10547 * xdisp.c (ensure_echo_area_buffers): Likewise.
10548 * xsettings.c (apply_xft_settings): Likewise.
10549
10550 2012-07-09 Glenn Morris <rgm@gnu.org>
10551
10552 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10553 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10554 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10555 * nsterm.h (ns_etc_directory): Add it.
10556 * callproc.c [HAVE_NS]: Include nsterm.h.
10557 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10558
10559 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10560
10561 Move marker debugging code under MARKER_DEBUG.
10562 * marker.c (MARKER_DEBUG): Move marker debugging code under
10563 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10564 for bootstrap with --enable-checking (~3x slowdown reported
10565 by Juanma Barranquero <lekktu@gmail.com>).
10566 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10567
10568 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10569
10570 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10571 See <http://bugs.gnu.org/11825#29>.
10572
10573 2012-07-08 Eli Zaretskii <eliz@gnu.org>
10574
10575 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10576 has no font, use the frame's font. (Bug#11813)
10577 (display_line): Add commentary about displaying truncation glyphs
10578 on GUI frames.
10579 (produce_special_glyphs): Move here from term.c.
10580
10581 * term.c (produce_special_glyphs): Move to xdisp.c.
10582
10583 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10584 section.
10585
10586 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10587
10588 * xdisp.c (display_line): Avoid warning about implicit declaration
10589 of FRAME_FONT.
10590
10591 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10592
10593 * lisp.h: Remove empty conditional.
10594
10595 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10596
10597 * lread.c (load_path_check): Now static.
10598
10599 Fix some minor --with-ns problems found by static checking.
10600 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10601 (x_set_font) [!HAVE_X_WINDOWS]:
10602 * image.c (xpm_load_image) [HAVE_NS]:
10603 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10604 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10605 Remove unused local.
10606 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10607 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10608 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10609 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10610 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10611 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10612 Fix pointer signedness problem.
10613 * xfaces.c (FRAME_X_FONT_TABLE):
10614 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10615
10616 2012-07-07 Glenn Morris <rgm@gnu.org>
10617
10618 * lread.c (load_path_check): New function, split from init_lread.
10619 (init_lread): Reorganize. Motivation:
10620 If EMACSLOADPATH is set, check/warn about that rather than the
10621 defaults, which we are not going to use. Hence we can remove
10622 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10623 Don't warn if site-lisp directories are missing.
10624 If not installed, start from a blank load-path, since
10625 PATH_LOADSEARCH refers to the eventual installation directories.
10626
10627 2012-07-07 Eli Zaretskii <eliz@gnu.org>
10628
10629 Support truncation and continuation glyphs on GUI frames, when
10630 fringes are disabled. (Bug#11832)
10631 * xdisp.c (init_iterator): Get dimensions of truncation and
10632 continuation glyphs even if on GUI frames.
10633 Adjust it->last_visible_x on GUI frames when the left or right fringes,
10634 or both, are absent.
10635 (start_display, move_it_in_display_line_to): Handle the case of a
10636 GUI frame without a fringe to display continuation or truncation
10637 glyphs.
10638 (insert_left_trunc_glyphs): Support GUI frames: make sure
10639 truncation glyphs overwrite enough glyphs from the current line to
10640 have sufficient space in pixels.
10641 (display_line): Support truncation and continuation glyphs on GUI
10642 frames. If some spare pixels are left on the line after inserting
10643 the truncation glyphs, fill that space with a stretch glyph of a
10644 suitably computed width.
10645
10646 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10647 produce_glyphs, to support GUI sessions.
10648
10649 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10650
10651 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10652
10653 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10654
10655 Do not require float-time's arg to fit in time_t (Bug#11825).
10656 This works better on hosts where time_t is unsigned, and where
10657 float-time is applied to the (negative) difference between two times.
10658 * editfns.c (decode_time_components): Last arg is now double *,
10659 not int *, and means to store all the result as a double, without
10660 worrying about whether the seconds part fits in time_t.
10661 All callers changed.
10662 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10663 All callers changed.
10664 (Ffloat_time): Do not fail merely because the specified time falls
10665 outside of time_t range.
10666
10667 2012-07-07 Glenn Morris <rgm@gnu.org>
10668
10669 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10670 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10671 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10672
10673 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
10674
10675 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10676 Update dependencies.
10677
10678 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10679
10680 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10681
10682 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10683 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10684 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10685 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10686 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10687 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10688
10689 * xfont.c (compare_font_names): Redo to omit the need for casts.
10690
10691 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10692
10693 * xfns.c (Fx_change_window_property): Doc fix.
10694 * w32fns.c (Fx_change_window_property): Doc fix.
10695
10696 * w32fns.c (Fx_window_property): Accept the same arguments as the
10697 X Windows version. Doc fix.
10698 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10699
10700 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
10701 Eli Zaretskii <eliz@gnu.org>
10702
10703 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10704 Windows-specific code from nt/config.nt moved here.
10705 Obsolete settings removed.
10706
10707 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10708
10709 * process.c: Avoid unnecessary calls to gettime.
10710 (wait_reading_process_output): Don't get the time of day
10711 when gobbling data immediately and not waiting, as there's no need
10712 for it in that case. This removes a FIXME.
10713
10714 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10715
10716 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10717 is defined (Bug#11768).
10718
10719 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10720
10721 Fix marker debugging code.
10722 * marker.c (byte_char_debug_check): Do not perform the check
10723 if buffer is not multibyte.
10724 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10725 Call byte_char_debug_check with correct arguments.
10726
10727 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10728
10729 Compile marker debugging code only if ENABLE_CHECKING is defined.
10730 * marker.c (byte_char_debug_check, count_markers):
10731 Use only if ENABLE_CHECKING is defined.
10732 (byte_debug_flag): Remove.
10733 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10734 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10735
10736 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10737
10738 Avoid code repetition in marker-related functions.
10739 * marker.c (attach_marker): New function.
10740 (Fset_marker, set_marker_restricted, set_marker_both)
10741 (set_marker_restricted_both): Use it.
10742 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10743 Consistently rename charno to charpos.
10744 (marker_position): Add eassert.
10745 (marker_byte_position): Convert to eassert.
10746
10747 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10748
10749 Simplify list operations in unchain_overlay and unchain_marker.
10750 * buffer.c (unchain_overlay): Simplify. Add comment.
10751 * marker.c (unchain_marker): Simplify. Fix comments.
10752
10753 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10754
10755 Introduce fast path for the widely used marker operation.
10756 * alloc.c (build_marker): New function.
10757 * lisp.h (build_marker): New prototype.
10758 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10759 * composite.c (autocmp_chars): Likewise.
10760 * editfns.c (buildmark): Remove.
10761 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10762 (save_restriction_save): Use build_marker.
10763 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10764 * window.c (save_window_save): Likewise.
10765
10766 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10767
10768 Do not use Fdelete_overlay in delete_all_overlays
10769 to avoid redundant calls to unchain_overlay.
10770 * buffer.c (drop_overlay): New function.
10771 (delete_all_overlays, Fdelete_overlay): Use it.
10772 * minibuf.c (get_minibuffer): Fix comment.
10773
10774 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10775
10776 Port to OpenBSD 5.1 amd64.
10777 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10778 This is needed for OpenBSD, and should be harmless on all BSD systems.
10779 Also, include <sys/sysctl.h>, as it should be available on all
10780 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10781 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10782 use p_pid member, not kp_proc.pid.
10783
10784 2012-07-06 Glenn Morris <rgm@gnu.org>
10785
10786 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10787
10788 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10789
10790 More xmalloc and related cleanup.
10791 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10792 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10793 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10794 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10795 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10796 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10797 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10798 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10799 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10800 * xterm.c:
10801 Omit needless casts involving void * pointers and allocation.
10802 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10803 as the former is more robust if P's type is changed.
10804 Prefer xzalloc to xmalloc + memset 0.
10805 Simplify malloc-or-realloc to realloc.
10806 Don't worry about xmalloc returning a null pointer.
10807 Prefer xstrdup to xmalloc + strcpy.
10808 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10809 growing it.
10810 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10811 alloca of a constant.
10812
10813 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10814
10815 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10816 hscroll is larger than the line width. Fixes long and futile
10817 looping inside extend_face_to_end_of_line (on a TTY) producing
10818 glyphs that are not needed and thrown away.
10819
10820 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10821
10822 * marker.c (set_marker_restricted_both): Simplify by using
10823 clip_to_bounds.
10824
10825 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10826
10827 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10828
10829 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10830
10831 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10832 not defined (Bug#11768).
10833 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10834 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10835 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10836 followed by gtk_box_set_homogeneous (Bug#11768).
10837 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
10838 (update_theme_scrollbar_width, xg_create_scroll_bar):
10839 Use gtk_scrollbar_new (Bug#11768).
10840 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10841 (is_box_type): New function (Bug#11768).
10842 (xg_tool_item_stale_p): Call is_box_type.
10843 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
10844 with default display (Bug#11768).
10845
10846 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10847
10848 * xdisp.c (window_hscroll_limited): New function.
10849 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10850 coordinates when window's hscroll is set to insanely large
10851 values. (Bug#11857)
10852
10853 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
10854
10855 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10856 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10857
10858 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10859
10860 Cleanup xmalloc.
10861 * lisp.h (xzalloc): New prototype. Omit needless casts.
10862 * alloc.c (xzalloc): New function. Omit needless casts.
10863 * charset.c: Omit needless casts. Convert all calls to
10864 xmalloc with following memset to xzalloc.
10865 * dispnew.c: Likewise.
10866 * fringe.c: Likewise.
10867 * image.c: Likewise.
10868 * sound.c: Likewise.
10869 * term.c: Likewise.
10870 * w32fns.c: Likewise.
10871 * w32font.c: Likewise.
10872 * w32term.c: Likewise.
10873 * xfaces.c: Likewise.
10874 * xfns.c: Likewise.
10875 * xterm.c: Likewise.
10876 * atimer.c: Omit needless casts.
10877 * buffer.c: Likewise.
10878 * callproc.c: Likewise.
10879 * ccl.c: Likewise.
10880 * coding.c: Likewise.
10881 * composite.c: Likewise.
10882 * doc.c: Likewise.
10883 * doprnt.c: Likewise.
10884 * editfns.c: Likewise.
10885 * emacs.c: Likewise.
10886 * eval.c: Likewise.
10887 * filelock.c: Likewise.
10888 * fns.c: Likewise.
10889 * gtkutil.c: Likewise.
10890 * keyboard.c: Likewise.
10891 * lisp.h: Likewise.
10892 * lread.c: Likewise.
10893 * minibuf.c: Likewise.
10894 * msdos.c: Likewise.
10895 * print.c: Likewise.
10896 * process.c: Likewise.
10897 * region-cache.c: Likewise.
10898 * search.c: Likewise.
10899 * sysdep.c: Likewise.
10900 * termcap.c: Likewise.
10901 * terminal.c: Likewise.
10902 * tparam.c: Likewise.
10903 * w16select.c: Likewise.
10904 * w32.c: Likewise.
10905 * w32reg.c: Likewise.
10906 * w32select.c: Likewise.
10907 * w32uniscribe.c: Likewise.
10908 * widget.c: Likewise.
10909 * xdisp.c: Likewise.
10910 * xmenu.c: Likewise.
10911 * xrdb.c: Likewise.
10912 * xselect.c: Likewise.
10913
10914 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10915
10916 * fileio.c (time_error_value): Check the right error number.
10917 Problem reported by Troels Nielsen in
10918 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10919
10920 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10921
10922 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10923 This should be fixed in a better way; see Eli Zaretskii in
10924 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10925 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10926
10927 * fileio.c (time_error_value): Rename from special_mtime.
10928 The old name's problems were noted by Eli Zaretskii in
10929 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10930
10931 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10932 This variable's comment says Emacs needs at least one GDB-visible
10933 symbol of type enum pvec_type, to work around GDB problems.
10934 The symbol's value doesn't matter.
10935
10936 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10937 that causes compilation to fail on pre-C99 compilers.
10938
10939 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
10940
10941 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10942 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10943
10944 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10945
10946 * buffer.c (init_buffer_once): Fix initialization of
10947 headers for buffer_defaults and buffer_local_symbols.
10948 Reported by Juanma Barranquero <lekktu@gmail.com>.
10949
10950 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10951
10952 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10953 * lisp.h (enum pvec_type): Use fewer bits.
10954 (PSEUDOVECTOR_SIZE_BITS): New constant.
10955 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10956 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10957 change in pvec_type.
10958 (PSEUDOVECTOR_TYPEP): New macro.
10959 (TYPED_PSEUDOVECTORP): Use it.
10960 * fns.c (internal_equal): Adapt code to extract pvectype.
10961 * emacs.c (gdb_pvec_type): Update type.
10962 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10963 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10964 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10965 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10966 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10967 abusing vector->header.next.nbytes.
10968 (live_vector_p): Use PVEC_TYPE.
10969 (mark_object): Adapt code to extract pvectype. Use switch.
10970
10971 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10972
10973 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10974 Tighten new eassert a bit.
10975
10976 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10977
10978 Fix compilation with --enable-gcc-warnings and -O1
10979 optimization level.
10980 * doprnt.c (doprnt): Change type of tem to int, initialize
10981 to avoid compiler warning. Add eassert.
10982 * search.c (simple_search): Initialize match_byte to avoid
10983 compiler warning. Add eassert.
10984
10985 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10986
10987 Avoid weird behavior with large horizontal scrolls.
10988 Without this change, for example, large hscroll values would
10989 mess up Emacs's display on Fedora 15 x86, presumably due to
10990 overflows in int calculations in the display code.
10991 Also, if buffers had long lines, Emacs would freeze.
10992 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10993 (set_window_hscroll): New function, containing the old guts of
10994 Fset_window_hscroll. Return the clipped value.
10995 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10996 This avoids the need to check against PTRDIFF_MAX.
10997
10998 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10999
11000 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11001
11002 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11003
11004 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11005
11006 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11007 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11008 since GCC 4.4.6 issues a bogus warning for them.
11009
11010 Fix bugs in file timestamp newness comparisons.
11011 * fileio.c (Ffile_newer_than_file_p):
11012 * lread.c (Fload): Use full timestamp resolution of files,
11013 not just the 1-second resolution, so that files that are only
11014 slightly newer still count as newer.
11015 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11016 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11017
11018 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11019
11020 * fileio.c: Improve handling of file time marker. (Bug#11852)
11021 (special_mtime): New function.
11022 (Finsert_file_contents, Fverify_visited_file_modtime):
11023 Use it to set special mtime values consistently.
11024
11025 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11026
11027 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11028 marker for non-existing file. (Bug#11852)
11029
11030 2012-07-03 Glenn Morris <rgm@gnu.org>
11031
11032 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11033 and did not make it into globals.h).
11034
11035 2012-07-03 Tom Tromey <tromey@redhat.com>
11036
11037 * window.c (Fset_window_margins, Fset_window_fringes)
11038 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11039 * textprop.c (Fprevious_property_change): No longer static.
11040 * syntax.c (Fsyntax_table_p): No longer static.
11041 * process.c (Fget_process, Fprocess_datagram_address): No longer
11042 static.
11043 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11044 * keyboard.c (Fcommand_execute): No longer static.
11045 Remove EXFUN.
11046 * insdel.c (Fcombine_after_change_execute): No longer static.
11047 * image.c (Finit_image_library): No longer static.
11048 * fileio.c (Fmake_symbolic_link): No longer static.
11049 * eval.c (Ffetch_bytecode): No longer static.
11050 * editfns.c (Fuser_full_name): No longer static.
11051 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11052 No longer static.
11053 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11054 static.
11055 * dired.c (Ffile_attributes): No longer static.
11056 * composite.c (Fcomposition_get_gstring): No longer static.
11057 * callproc.c (Fgetenv_internal): No longer static.
11058
11059 * ccl.h: Remove EXFUNs.
11060 * buffer.h: Remove EXFUNs.
11061 * dispextern.h: Remove EXFUNs.
11062 * intervals.h: Remove EXFUNs.
11063 * fontset.h: Remove EXFUN.
11064 * font.h: Remove EXFUNs.
11065 * dosfns.c (system_process_attributes): Remove EXFUN.
11066 * keymap.h: Remove EXFUNs.
11067 * lisp.h: Remove EXFUNs.
11068 * w32term.h: Remove EXFUNs.
11069 * window.h: Remove EXFUNs.
11070 * xsettings.h: Remove EXFUN.
11071 * xterm.h: Remove EXFUN.
11072
11073 2012-07-03 Glenn Morris <rgm@gnu.org>
11074
11075 * lisp.h (Frandom): Make it visible to C.
11076 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11077 buffer for invisible buffers. (Bug#1229)
11078
11079 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11080
11081 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11082 values which aren't power of 2.
11083 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11084 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11085 accordingly.
11086
11087 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11088
11089 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11090
11091 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11092
11093 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11094
11095 * alloc.c (allocate_vector_block): Remove redundant
11096 calls to mallopt if DOUG_LEA_MALLOC is defined.
11097 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11098 avoid calls to mallopt if zero_vector is returned.
11099
11100 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11101
11102 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11103 is enabled, avoid dereferencing NULL current_sblock if
11104 running undumped.
11105
11106 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11107
11108 Cleanup basic buffer management.
11109 * buffer.h (struct buffer): Change layout to use generic vector
11110 marking code. Fix some comments. Change type of 'clip_changed'
11111 to bitfield. Remove unused #ifndef old.
11112 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11113 (GET_OVERLAYS_AT): Fix indentation.
11114 (for_each_per_buffer_object_at): New macro.
11115 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11116 (Fbuffer_local_variables): Use it.
11117 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11118 * alloc.c (allocate_buffer): Adjust to match new layout of
11119 struct buffer. Fix comment.
11120 (mark_overlay): New function.
11121 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11122 Lisp area of struct buffer.
11123 (mark_object): Use it. Adjust marking of misc objects
11124 and related comments.
11125
11126 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11127
11128 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11129 wrapper that is not needed because the wrapped code is a no-op (zero
11130 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11131 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11132
11133 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11134
11135 * alloc.c (mark_buffer): Simplify. Remove prototype.
11136 (mark_object): Add comment. Reorganize marking of vector-like
11137 objects. Use CHECK_LIVE for all vector-like objects except buffers
11138 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11139 Avoid redundant calls to mark_vectorlike for bool vectors.
11140
11141 2012-06-30 Glenn Morris <rgm@gnu.org>
11142
11143 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11144
11145 * epaths.in (PATH_SITELOADSEARCH): New.
11146 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11147 This is rather than relying on --enable-locallisppath elements
11148 having "site-lisp" in their names. (Bug#10208#25, 11658)
11149
11150 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11151
11152 * w32proc.c (sys_select): Accept and ignore one more argument.
11153
11154 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11155
11156 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11157 (pselect) [!MS_DOS]: Redirect to sys_select.
11158
11159 * sysdep.c: Don't include dos.h and dosfns.h.
11160
11161 * process.c (sys_select):
11162 * msdos.c (sys_select): Accept one more argument and ignore it.
11163
11164 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11165 adapt data types and code to that.
11166
11167 * dosfns.c:
11168 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11169 which clashes with the gnulib function of the same name.
11170
11171 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11172
11173 * font.c (font_style_to_value, font_style_symbolic)
11174 (font_prop_validate_style): Add type checks for values in
11175 font_style_table.
11176
11177 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11178 argument.
11179 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11180 uses.
11181
11182 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11183
11184 * xdisp.c (try_window_id): Undo last change.
11185
11186 * w32.c (getwd): Adjust commentary about startup_dir.
11187 (init_environment): Always call sys_access, even in non-MSVC
11188 builds. Don't chdir to the directory of the Emacs executable.
11189 This undoes code from 1997 which was justified by the need to
11190 "avoid conflicts when removing and renaming directories". But its
11191 downside was that every relative file name was being interpreted
11192 relative to the directory of the Emacs executable, which can never
11193 be TRT. In particular, it broke sys_access when called with
11194 relative file names.
11195 (sys_access): Map GetLastError to errno.
11196
11197 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11198
11199 * window.h (struct window): Change type of 'fringes_outside_margins'
11200 to bitfield. Fix comment. Adjust users accordingly.
11201 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
11202 Adjust comment.
11203 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11204 to ptrdiff_t.
11205
11206 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
11207
11208 * gnutls.c (emacs_gnutls_handshake):
11209 Add QUIT to make the loop interruptible.
11210
11211 2012-06-29 Glenn Morris <rgm@gnu.org>
11212
11213 * charset.c (init_charset): Make lack of etc/charsets fatal.
11214
11215 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11216
11217 * editfns.c (region_limit): Fix type mismatch.
11218
11219 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11220
11221 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11222 undefined. Convert from xassert to eassert.
11223 * nsmenu.m: Convert from xassert to eassert.
11224 * nsterm.m: Likewise.
11225
11226 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11227
11228 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11229
11230 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11231
11232 Avoid integer overflow on scroll-left and scroll-right.
11233 * window.c (HSCROLL_MAX): New macro.
11234 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11235 overflow when requested scroll falls outside ptrdiff_t range.
11236
11237 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11238
11239 * window.h (struct window): Change type of 'hscroll',
11240 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11241 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11242 Adjust users accordingly.
11243 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11244 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11245 from EMACS_INT to ptrdiff_t.
11246 (make_window): Omit redundant initialization.
11247
11248 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
11249
11250 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11251
11252 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11253
11254 * window.h (struct window): Change type of 'use_time' and
11255 'sequence_number' from Lisp_Object to int.
11256 * frame.c (make_frame): Adjust users accordingly.
11257 * print.c (print_object): Likewise.
11258 * window.c (select_window, Fwindow_use_time, make_parent_window)
11259 (make_window): Likewise.
11260
11261 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11262
11263 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11264 enabled with --enable-checking=[all,glyphs] configure option.
11265 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11266 adjust comments accordingly.
11267 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11268 undefined, adjust comments accordingly.
11269 * image.c: Likewise.
11270 * scroll.c: Likewise.
11271 * w32fns.c: Likewise.
11272 * w32term.c: Likewise.
11273 * xdisp.c: Likewise.
11274 * xfaces.c: Likewise.
11275 * xfns.c: Likewise.
11276 * xterm.c: Likewise.
11277
11278 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11279
11280 Generalize run-time debugging checks.
11281 * dispextern.h (XASSERTS): Remove.
11282 * fontset.c (xassert): Remove.
11283 Convert from xassert to eassert.
11284 * alloc.c: Convert from xassert to eassert.
11285 * bidi.c: Likewise.
11286 * dispnew.c: Likewise.
11287 * fns.c: Likewise.
11288 * fringe.c: Likewise.
11289 * ftfont.c: Likewise.
11290 * gtkutil.c: Likewise.
11291 * image.c: Likewise.
11292 * keyboard.c: Likewise.
11293 * menu.c: Likewise.
11294 * process.c: Likewise.
11295 * scroll.c: Likewise.
11296 * sound.c: Likewise.
11297 * term.c: Likewise.
11298 * w32console.c: Likewise.
11299 * w32fns.c: Likewise.
11300 * w32term.c: Likewise.
11301 * window.c: Likewise.
11302 * xdisp.c: Likewise.
11303 * xfaces.c: Likewise.
11304 * xfns.c: Likewise.
11305 * xselect.c: Likewise.
11306 * xterm.c: Likewise.
11307
11308 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11309
11310 * fns.c (maybe_resize_hash_table): Output message when growing the
11311 purify-hashtable.
11312
11313 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11314
11315 * alloc.c (allocate_string_data): Remove dead code.
11316 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11317 avoid GCC warning about unused macro.
11318
11319 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11320
11321 * alloc.c (allocate_string): Omit intervals initialization.
11322 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11323 as in make_pure_string and make_pure_c_string.
11324
11325 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11326
11327 * alloc.c (allocate_string): Fix last change.
11328
11329 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11330
11331 * alloc.c (allocate_string): Remove two redundant calls
11332 to memset, add explicit initialization where appropriate.
11333
11334 2012-06-27 Glenn Morris <rgm@gnu.org>
11335
11336 * lisp.mk (lisp): Remove paths.elc.
11337
11338 2012-06-27 Chong Yidong <cyd@gnu.org>
11339
11340 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11341
11342 2012-06-26 John Wiegley <johnw@newartisans.com>
11343
11344 * unexmacosx.c (copy_data_segment): Add two section names used
11345 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11346
11347 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11348 when building with Clang.
11349
11350 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11351
11352 * eval.c (Fapply): Allow calling it with a single argument.
11353
11354 2012-06-26 Eli Zaretskii <eliz@gnu.org>
11355
11356 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11357 _stricmp and _strnicmp.
11358 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11359
11360 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11361
11362 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11363 allocated window.
11364 (allocate_process): Likewise for new process.
11365 (allocate_terminal): Change to use offsetof.
11366 (allocate_frame): Likewise.
11367 * frame.c (make_frame): Omit redundant initialization.
11368 * window.c (make_parent_window): Use memset.
11369 (make_window): Omit redundant initialization.
11370 * process.c (make_process): Omit redundant initialization.
11371 * terminal.c (create_terminal): Likewise.
11372
11373 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11374
11375 * term.c (delete_tty): Remove redundant call to memset.
11376
11377 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11378
11379 * alloc.c: Remove build_string.
11380 * lisp.h: Define build_string as static inline. This provides
11381 a better opportunity to optimize away calls to strlen when the
11382 function is called with compile-time constant argument.
11383 * image.c (imagemagick_error): Convert to build_string.
11384 * w32proc.c (sys_spawnve): Likewise.
11385 * xterm.c (x_term_init): Likewise.
11386
11387 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11388
11389 Use sprintf return value instead of invoking strlen on result.
11390 In the old days this wasn't portable, since some sprintf
11391 implementations returned char *. But they died out years ago and
11392 Emacs already assumes sprintf returns int.
11393 Similarly for float_to_string.
11394 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11395 * ccl.c (ccl_driver):
11396 * character.c (string_escape_byte8):
11397 * data.c (Fnumber_to_string):
11398 * doprnt.c (doprnt):
11399 * print.c (print_object):
11400 * xdisp.c (message_dolog):
11401 * xfns.c (syms_of_xfns):
11402 Use sprintf or float_to_string result to avoid need to call strlen.
11403 * data.c (Fnumber_to_string):
11404 Use make_unibyte_string, since the string must be ASCII.
11405 * lisp.h, print.c (float_to_string): Now returns int length.
11406 * term.c (produce_glyphless_glyph):
11407 Use sprintf result rather than recomputing it.
11408
11409 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11410 * Makefile.in (ALL_CFLAGS):
11411 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11412 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11413
11414 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11415
11416 * dispextern.h (xstrcasecmp): Define to library function
11417 strcasecmp if available.
11418 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11419
11420 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11421
11422 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11423 Avoid comma operator.
11424 * menu.c (push_submenu_start, push_submenu_end)
11425 (push_left_right_boundary, push_menu_pane): Likewise.
11426 * msdos.c (dos_rawgetc): Likewise.
11427
11428 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11429
11430 * xfns.c (xic_create_fontsetname): Remove redundant calls
11431 to memset.
11432
11433 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11434
11435 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11436 sprintf already null-terminates its output.
11437
11438 * xfns.c (x_window): Remove redundant cast.
11439
11440 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11441
11442 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11443 `const char *' to `char *' to avoid compiler warning.
11444
11445 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11446
11447 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11448 instead of truncating it to 63 (admittedly a generous limit).
11449
11450 * process.c: Fix spelling and caps in comments.
11451
11452 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11453
11454 * emacs.c (setpgrp): Remove definition, unused.
11455 * sysdep.c (setpgrp): Remove definition, not used in this file.
11456
11457 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
11458
11459 * makefile.w32-in: Update dependencies.
11460
11461 2012-06-24 Eli Zaretskii <eliz@gnu.org>
11462
11463 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11464 (SYSTIME_H): Add nt/inc/sys/time.h.
11465
11466 * systime.h [WINDOWSNT]: Include sys/time.h.
11467
11468 * s/ms-w32.h (struct timespec): Definition moved from
11469 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11470
11471 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11472
11473 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11474 * buffer.h (buffer_slot_type_mismatch):
11475 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11476 * eval.c (unwind_to_catch):
11477 * image.c (my_png_error, my_error_exit):
11478 * keyboard.c (quit_throw_to_read_char, user_error)
11479 (Fexit_recursive_edit, Fabort_recursive_edit):
11480 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11481 (wrong_type_argument, buffer_overflow, __executable_start)
11482 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11483 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11484 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11485 (fatal):
11486 (child_setup) [!DOS_NT]:
11487 * lread.c (end_of_file_error, invalid_syntax):
11488 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11489 * puresize.h (pure_write_error):
11490 * search.c (matcher_overflow):
11491 * sound.c (sound_perror, alsa_sound_perror):
11492 * sysdep.c, syssignal.h (croak):
11493 * term.c (maybe_fatal, vfatal):
11494 * textprop.c (text_read_only):
11495 * undo.c (user_error):
11496 * unexmacosx.c (unexec_error):
11497 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11498 Use _Noreturn rather than NO_RETURN.
11499 No need for separate decl merely because of _Noreturn.
11500 * sound.c (sound_warning, parse_sound):
11501 Remove unnecessary forward decls.
11502
11503 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11504
11505 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11506 * lisp.h (WAIT_READING_MAX): New macro.
11507 * dispnew.c (Fsleep_for, sit_for):
11508 * keyboard.c (kbd_buffer_get_event):
11509 * process.c (Faccept_process_output):
11510 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11511 This improves on the previous patch, which introduced a bug
11512 when time_t is unsigned and as wide as intmax_t.
11513 See <http://bugs.gnu.org/9000#51>.
11514
11515 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11516
11517 * dispnew.c (sit_for, Fsleep_for):
11518 * keyboard.c (kbd_buffer_get_event):
11519 * process.c (Faccept_process_output): Avoid compiler warnings when
11520 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11521
11522 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
11523
11524 * makefile.w32-in: Update dependencies.
11525
11526 * w32.c (ltime): Add return type and declare static.
11527 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11528
11529 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11530
11531 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11532 Privately reported by Herbert J. Skuhra.
11533 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11534 All uses changed.
11535 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11536 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11537
11538 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11539
11540 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11541 last argument of make_unibyte_string.
11542
11543 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11544 language ID in the event parameters.
11545
11546 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11547 event.code, not the obscure "character set ID".
11548
11549 2012-06-23 Chong Yidong <cyd@gnu.org>
11550
11551 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11552
11553 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11554
11555 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11556 * w32.c (fdutimens): New function.
11557
11558 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11559
11560 * s/ms-w32.h (pselect): Redirect to sys_select.
11561
11562 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11563
11564 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11565 in the logic of incrementing and decrementing the value of
11566 use_relocatable_buffers.
11567
11568 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11569
11570 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11571 Privately reported by Herbert J. Skuhra.
11572 [__FreeBSD__]: Remove "*/" typo after "#include".
11573 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11574 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11575 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11576 Don't assume EMACS_TIME and struct timeval are the same type.
11577
11578 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11579
11580 Support higher-resolution time stamps (Bug#9000).
11581 The time stamps are only nanosecond-resolution at the C level,
11582 since that's the best that any real-world system supports now.
11583 But they are picosecond-resolution at the Lisp level, as that's
11584 easy, and leaves room for future OS improvements.
11585
11586 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11587 (LIBES): Use it.
11588
11589 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11590 Don't get current time unless it's needed.
11591
11592 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11593 now provides it if it's absent.
11594 (start_atimer): Port to higher-res time stamps.
11595 Check for time stamp overflow. Don't get current time more
11596 often than is needed.
11597
11598 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11599 Include systime.h, not time.h.
11600 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11601
11602 * dired.c: Include stat-time.h.
11603 (Ffile-attributes): File times now have higher resolution.
11604
11605 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11606 (struct image): Timestamp now has higher resolution.
11607
11608 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11609 has at least microseconds now. All uses removed.
11610 (update_frame, update_single_window, update_window, update_frame_1)
11611 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
11612 (duration_to_sec_usec): Remove; no longer needed.
11613
11614 * editfns.c (time_overflow): Now extern.
11615 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11616 (float-time, Fformat_time_string, Fcurrent_time_string)
11617 (Fcurrent_time_zone): Accept and generate higher-resolution
11618 time stamps.
11619 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11620 (decode_time_components, lisp_seconds_argument): New functions.
11621 (make_time): Now static.
11622 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11623 Report an error if the time is invalid, rather than having the caller
11624 do that.
11625
11626 * fileio.c: Include <stat-time.h>
11627 (Fcopy_file): Copy higher-resolution time stamps.
11628 Prefer to set the time stamp via a file descriptor if that works.
11629 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11630 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11631 (Fvisited_file_modtime, Fset_visited_file_modtime):
11632 Support higher-resolution time stamps.
11633
11634 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11635
11636 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11637
11638 * image.c (prepare_image_for_display, clear_image_cache)
11639 (lookup_image): Port to higer-resolution time stamps.
11640
11641 * keyboard.c (start_polling, bind_polling_period):
11642 Check for time stamp overflow.
11643 (read_char, kbd_buffer_get_event, timer_start_idle)
11644 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11645 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11646 Port to higher-resolution time stamps. Do not assume time_t is signed.
11647 (decode_timer): New function. Timers are now vectors of length 9,
11648 not 8, to accommodate the picosecond component.
11649 (timer_check_2): Use it.
11650
11651 * nsterm.m (select_timeout, timeval_subtract): Remove.
11652 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11653 as they're a bit more accurate and handle overflow better.
11654 (ns_select): Change prototype to be compatible with pselect.
11655 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11656 * nsterm.h (ns_select): Adjust prototype.
11657
11658 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11659 us-resolution time stamps.
11660 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11661
11662 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11663
11664 * lisp.h (time_overflow): New decl.
11665 (wait_reading_process_output): First arg is now intmax_t, not int,
11666 to accommodate larger waits.
11667
11668 * process.h (struct Lisp_Process.read_output_delay):
11669 Now counts nanoseconds, not microseconds.
11670 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11671 EMACS_HAS_USECS.
11672 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11673 (wait_reading_process_output):
11674 Port to ns-resolution time stamps.
11675 (Faccept_process_output, wait_reading_process_output):
11676 Check for time stamp overflow. Do not assume time_t is signed.
11677 (select_wrapper): Remove; we now use pselect.
11678 (Fprocess_attributes): Now generates ns-resolution time stamps.
11679
11680 * sysdep.c: Include utimens.h. Don't include utime.h
11681 or worry about struct utimbuf; gnulib does that for us now.
11682 (gettimeofday): Remove; gnulib provides a substitute.
11683 (make_timeval): New function.
11684 (set_file_times): Now sets ns-resolution time stamps.
11685 New arg FD; all uses changed.
11686 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11687 (system_process_attributes):
11688 Now returns ns-resolution time stamp. All uses changed.
11689 Check for time stamp overflow.
11690
11691 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11692 provides a substitute now.
11693
11694 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11695 since it guarantees struct timespec.
11696 (EMACS_TIME): Now struct timespec, so that we can support
11697 ns-resolution time stamps.
11698 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11699 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11700 (EMACS_USECS): Remove.
11701 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11702 so multiply the arg by 1000 before storing it.
11703 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11704 New macros.
11705 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11706 Port to ns-resolution time stamps.
11707 (EMACS_TIME_NEG_P): Remove; replaced by....
11708 (EMACS_TIME_SIGN): New macro.
11709 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11710 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11711 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11712 (make_timeval, make_lisp_time, decode_time_components): New decls.
11713 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11714 that it mishandled time_t overflow. You can't compare by subtracting!
11715 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11716 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11717
11718 * term.c: Include <sys/time.h>.
11719 (timeval_to_Time): New function, for proper overflow wraparound.
11720 (term_mouse_position, term_mouse_click): Use it.
11721
11722 * undo.c (record_first_change): Support higher-resolution time stamps
11723 in the undo buffer.
11724 (Fprimitive_undo): Use them when restoring time stamps.
11725
11726 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11727 (w32_get_internal_run_time):
11728 Port to higher-resolution Emacs time stamps.
11729 (ltime): Now accepts single 64-bit integer, as that's more convenient
11730 for callers.
11731
11732 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11733
11734 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11735 for compatibility with pselect. Support ns-resolution time stamps.
11736
11737 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11738
11739 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11740 Check for time stamp overflow, and support ns-resolution time stamps.
11741
11742 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11743 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11744 (timeval_subtract): Remove; no longer needed.
11745 (XTflash, XTring_bell, x_wait_for_event):
11746 Port to ns-resolution time stamps. Don't assume time_t is signed.
11747
11748 2012-06-22 Chong Yidong <cyd@gnu.org>
11749
11750 * xdisp.c (x_consider_frame_title): Revert last change.
11751
11752 2012-06-22 Eli Zaretskii <eliz@gnu.org>
11753
11754 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11755 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11756 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11757 staticidx goes up to 1597 out of 1600 = 0x640.)
11758
11759 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11760
11761 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11762 Otherwise, the umask might be mistakenly 0 while handling input signals.
11763
11764 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11765
11766 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11767
11768 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11769
11770 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11771 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11772 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11773 access to `contents' member of Lisp_Vector objects with AREF and ASET
11774 where appropriate.
11775
11776 2012-06-19 Chong Yidong <cyd@gnu.org>
11777
11778 * frame.c (delete_frame): When selecting a frame on a different
11779 text terminal, do not alter the terminal's top-frame.
11780
11781 * xdisp.c (format_mode_line_unwind_data): Record the target
11782 frame's selected window and its terminal's top-frame.
11783 (unwind_format_mode_line): Restore them.
11784 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11785 Callers changed.
11786 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11787 since tty frames can be explicitly named.
11788 (prepare_menu_bars): Likewise.
11789
11790 * term.c (Ftty_top_frame): New function.
11791
11792 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11793
11794 Port byte-code-meter to modern targets.
11795 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11796 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
11797 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
11798 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11799 (METER_1, METER_2): Simplify.
11800
11801 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11802
11803 * data.c (Fdefalias): Return `symbol' (bug#11686).
11804
11805 2012-06-18 Martin Rudalics <rudalics@gmx.at>
11806
11807 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
11808 gets killed during executing of this function (Bug#11665).
11809 Try to always return Qt when the buffer has been actually killed.
11810 (Vkill_buffer_query_functions): In doc-string say that functions
11811 run by this hook should not change the current buffer.
11812
11813 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11814
11815 Fix recently-introduced process.c problems found by static checking.
11816 * process.c (write_queue_push, write_queue_pop, send_process):
11817 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11818 (write_queue_pop): Fix pointer signedness problem.
11819 (send_process): Remove unused local.
11820
11821 2012-06-17 Chong Yidong <cyd@gnu.org>
11822
11823 * xdisp.c (redisplay_internal): No need to redisplay terminal
11824 frames that are not on top.
11825
11826 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
11827
11828 * process.c (make_process): Initialize write_queue.
11829 (write_queue_push, write_queue_pop): New functions.
11830 (send_process): Use them to maintain correct ordering of process
11831 writes (Bug#10815).
11832
11833 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11834
11835 * lisp.h (eassert): Assume C89 or later.
11836 This removes the need for CHECK.
11837 (CHECK): Remove. Its comments about always evaluating its
11838 argument were confusing, as 'eassert' typically does not evaluate
11839 its argument.
11840
11841 * coding.c (produce_chars): Use ptrdiff_t, not int.
11842
11843 * xterm.c (x_draw_underwave): Check for integer overflow.
11844 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11845
11846 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
11847
11848 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11849 referenced (Bug#11583).
11850
11851 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11852
11853 Implement wave-style variant of underlining.
11854 * dispextern.h (face_underline_type): New enum.
11855 (face): Add field for underline type.
11856 * nsterm.m (ns_draw_underwave): New function.
11857 (ns_draw_text_decoration): Use it.
11858 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11859 New functions.
11860 (x_draw_glyph_string): Use them.
11861 * xfaces.c (Qline, Qwave): New Lisp objects.
11862 (check_lface_attrs, merge_face_ref)
11863 (Finternal_set_lisp_face_attribute, realize_x_face):
11864 Handle wave-style underline face attributes.
11865 * xterm.c (x_draw_underwave): New function.
11866 (x_draw_glyph_string): Use it.
11867
11868 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
11869
11870 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11871 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11872 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11873 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11874 ($(BLD)/w32select.$(O)): Update dependencies.
11875
11876 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11877
11878 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11879 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11880 * character.c (_fetch_multibyte_char_p): Remove.
11881 * alloc.c: Include "character.h" before "buffer.h".
11882 * bidi.c: Likewise.
11883 * buffer.c: Likewise.
11884 * bytecode.c: Likewise.
11885 * callint.c: Likewise.
11886 * callproc.c: Likewise.
11887 * casefiddle.c: Likewise.
11888 * casetab.c: Likewise.
11889 * category.c: Likewise.
11890 * cmds.c: Likewise.
11891 * coding.c: Likewise.
11892 * composite.c: Likewise.
11893 * dired.c: Likewise.
11894 * dispnew.c: Likewise.
11895 * doc.c: Likewise.
11896 * dosfns.c: Likewise.
11897 * editfns.c: Likewise.
11898 * emacs.c: Likewise.
11899 * fileio.c: Likewise.
11900 * filelock.c: Likewise.
11901 * font.c: Likewise.
11902 * fontset.c: Likewise.
11903 * fringe.c: Likewise.
11904 * indent.c: Likewise.
11905 * insdel.c: Likewise.
11906 * intervals.c: Likewise.
11907 * keyboard.c: Likewise.
11908 * keymap.c: Likewise.
11909 * lread.c: Likewise.
11910 * macros.c: Likewise.
11911 * marker.c: Likewise.
11912 * minibuf.c: Likewise.
11913 * nsfns.m: Likewise.
11914 * nsmenu.m: Likewise.
11915 * print.c: Likewise.
11916 * process.c: Likewise.
11917 * regex.c: Likewise.
11918 * region-cache.c: Likewise.
11919 * search.c: Likewise.
11920 * syntax.c: Likewise.
11921 * term.c: Likewise.
11922 * textprop.c: Likewise.
11923 * undo.c: Likewise.
11924 * unexsol.c: Likewise.
11925 * w16select.c: Likewise.
11926 * w32fns.c: Likewise.
11927 * w32menu.c: Likewise.
11928 * window.c: Likewise.
11929 * xdisp.c: Likewise.
11930 * xfns.c: Likewise.
11931 * xmenu.c: Likewise.
11932 * xml.c: Likewise.
11933 * xselect.c: Likewise.
11934
11935 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11936
11937 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11938 If all the glyphs of the glyph row came from strings, and we have no
11939 cursor positioning clues, put the cursor on the first glyph of the
11940 row.
11941 (handle_face_prop): Use chunk-relative overlay string index when
11942 indexing into it->string_overlays array. (Bug#11653)
11943 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11944 the rightmost. (Bug#11720)
11945
11946 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11947
11948 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11949 (CATEGORY_MEMBER): Enforce 1/0 value.
11950 * category.c (_temp_category_set): Remove.
11951
11952 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11953
11954 * window.c (Fdelete_other_windows_internal)
11955 (Fdelete_window_internal): Don't access frame's mouse highlight
11956 info of the initial frame. (Bug#11677)
11957
11958 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11959
11960 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11961 Assume USE_2_TAGS_FOR_INTS.
11962 (xreload): Adjust $tagmask width to match recent lisp.h change.
11963
11964 Simplify lisp.h in minor ways that should not affect code.
11965 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11966 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11967 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11968 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11969 (INTTYPEBITS): New macro, for clarity.
11970 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
11971 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11972 Simplify now that USE_LSB_TAG is always defined.
11973 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11974 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11975
11976 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
11977
11978 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11979
11980 2012-06-13 Glenn Morris <rgm@gnu.org>
11981
11982 * s/bsd-common.h (BSD4_3):
11983 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11984
11985 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11986
11987 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11988 instead of union.
11989 (XLI, XIL): Define.
11990 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11991 Use them.
11992 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
11993 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
11994 * alloc.c (widen_to_Lisp_Object): Remove.
11995 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11996 * frame.c (delete_frame): Remove outdated comment.
11997 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11998 USE_LISP_UNION_TYPE.
11999 (Fw32_unregister_hot_key): Likewise.
12000 (Fw32_toggle_lock_key): Likewise.
12001 * w32menu.c (add_menu_item): Likewise.
12002 (w32_menu_display_help): Use XIL instead of checking
12003 USE_LISP_UNION_TYPE.
12004 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12005 (init_heap): Likewise.
12006 * w32term.c (w32_read_socket): Update comment.
12007
12008 2012-06-13 Glenn Morris <rgm@gnu.org>
12009
12010 * s/usg5-4-common.h, src/s/unixware.h:
12011 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12012
12013 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12014
12015 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12016
12017 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12018 * alloc.c (make_number) [!defined make_number]:
12019 Remove, as lisp.h always defines this now.
12020 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12021 (roundup_size): Verify that it is a power of 2.
12022 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12023 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12024 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12025 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12026 USE_LSB_TAG now is always defined to be either 0 or 1.
12027 All uses changed.
12028 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12029 code works fine either way, and efficiency is not a concern here,
12030 as the union type is for debugging, not for production.
12031 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12032 Use an inline function on all platforms when using the union type,
12033 since this is simpler and 'static inline' can be used portably
12034 within Emacs now.
12035 (LISP_INITIALLY_ZERO): New macro.
12036 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12037 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12038
12039 2012-06-12 Glenn Morris <rgm@gnu.org>
12040
12041 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12042
12043 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12044
12045 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12046 Move BROKEN_SIGIO to configure.
12047
12048 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12049 Move NO_TERMIO to configure.
12050
12051 2012-06-12 Chong Yidong <cyd@gnu.org>
12052
12053 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12054 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12055 MagickExportImagePixels is undefined.
12056
12057 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12058
12059 * image.c (imagemagick_load_image): Remove unused label.
12060
12061 2012-06-11 Glenn Morris <rgm@gnu.org>
12062
12063 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12064 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12065 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12066 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12067
12068 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12069
12070 * alloc.c (make_byte_code): New function.
12071 (Fmake_byte_code): Use it. Don't purify here.
12072 * lread.c (read1): Use it as well to avoid extra allocation.
12073
12074 2012-06-11 Chong Yidong <cyd@gnu.org>
12075
12076 * image.c (imagemagick_load_image): Implement transparency.
12077
12078 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12079
12080 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12081 account for preceding backslashes. (Bug#11663)
12082
12083 2012-06-09 Chong Yidong <cyd@gnu.org>
12084
12085 * term.c: Support italics in capable terminals (Bug#9652).
12086 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12087 (turn_on_face): Output using TS_enter_italic_mode if available.
12088 Don't handle unused blinking and alt-charset cases.
12089 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12090 and tty_alt_charset_p cases.
12091 (tty_capable_p, init_tty): Support italics.
12092
12093 * termchar.h (struct tty_display_info): Add field for italics.
12094 Remove unused blink field.
12095
12096 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12097 Handle slant.
12098
12099 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12100 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12101 tty_alt_charset_p. Add tty_italic_p.
12102
12103 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12104
12105 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12106 dbus_type_is_basic if available.
12107 (xd_extract_signed, xd_extract_unsigned): Rename from
12108 extract_signed and extract_unsigned, respectively. Adapt callers.
12109
12110 2012-06-09 Chong Yidong <cyd@gnu.org>
12111
12112 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12113
12114 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12115 case (Bug#9752).
12116
12117 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12118
12119 * xdisp.c (vmessage): Treat frame message as multibyte.
12120 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12121 would generate the diagnostic "Making \302\247 buffer-local while
12122 let-bound!".
12123
12124 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12125
12126 * dispnew.c (showing_window_margins_p): Undo last change, which
12127 was done due to an inadvertent commit.
12128 (adjust_frame_glyphs_for_frame_redisplay): Do call
12129 showing_window_margins_p.
12130
12131 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12132
12133 * eval.c (Fmake_var_non_special): New primitive.
12134 (syms_of_eval): Defsubr it.
12135 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12136
12137 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12138
12139 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12140 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12141
12142 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12143
12144 * alloc.c (allocate_vectorlike): Fix last change.
12145
12146 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12147
12148 Block-based vector allocation of small vectors.
12149 * lisp.h (struct vectorlike_header): New field `nbytes',
12150 adjust comment accordingly.
12151 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12152 to denote vector blocks. Adjust users (live_vector_p,
12153 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12154 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12155 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12156 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12157 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12158 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12159 (roundup_size): New constant.
12160 (struct vector_block): New data type.
12161 (vector_blocks, vector_free_lists, zero_vector): New variables.
12162 (all_vectors): Rename to `large_vectors'.
12163 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12164 (sweep_vectors): New functions.
12165 (allocate_vectorlike): Return `zero_vector' as the only vector of
12166 0 items. Allocate new vector from block if vector size is less than
12167 or equal to VBLOCK_BYTES_MAX.
12168 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12169 (init_alloc_once): Add call to init_vectors.
12170
12171 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12172
12173 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12174
12175 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12176
12177 * doprnt.c (doprnt): Truncate multibyte char correctly.
12178 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12179 would mishandle a string argument "Xc" if X was a multibyte
12180 character of length 2: it would truncate after X's first byte
12181 rather than including all of X.
12182
12183 2012-06-06 Chong Yidong <cyd@gnu.org>
12184
12185 * buffer.c (word_wrap): Doc fix.
12186
12187 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12188
12189 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12190
12191 2012-06-03 Glenn Morris <rgm@gnu.org>
12192
12193 * xdisp.c (tool-bar-style): Doc fix.
12194
12195 2012-06-03 Ulrich Müller <ulm@gentoo.org>
12196
12197 * Makefile.in (PAXCTL): Define.
12198 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12199 binary via PaX flags if the paxctl utility is available.
12200 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12201 Restore PaX flags to their default. (Bug#11398)
12202
12203 2012-06-03 Chong Yidong <cyd@gnu.org>
12204
12205 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12206 buffer (Bug#11226).
12207
12208 2012-06-03 Chong Yidong <cyd@gnu.org>
12209
12210 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12211 (note_mode_line_or_margin_highlight): If there is no help echo,
12212 use mode-line-default-help-echo. Handle the case where the mouse
12213 position is past the end of the mode line string.
12214
12215 * buffer.c (buffer_local_value_1): New function, split from
12216 Fbuffer_local_value; can return Qunbound.
12217 (Fbuffer_local_value): Use it.
12218 (Vmode_line_format): Docstring tweaks.
12219
12220 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12221
12222 * sysdep.c (system_process_attributes): Improve comment.
12223
12224 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12225
12226 * keyboard.c: Export real-this-command to Elisp.
12227 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12228 and DEFVAR it. Update all users.
12229
12230 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12231
12232 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12233
12234 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12235 Convert pctcpu and pctmem to Lisp float properly.
12236 Let the compiler fold better, as 100.0/0x8000 is exact.
12237
12238 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12239
12240 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12241 cons_block.
12242
12243 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12244
12245 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12246
12247 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12248
12249 For a 'struct window', replace some Lisp_Object fields to
12250 bitfields where appropriate, remove unused fields.
12251 * window.h (struct window): Remove unused 'last_mark_x' and
12252 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
12253 change its type from Lisp_Object to bitfield.
12254 Change type of 'force_start', 'optional_new_start',
12255 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
12256 fields from Lisp_Object to bitfield. Adjust users accordingly.
12257
12258 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12259
12260 Pacify gcc -Wdouble-precision when using Xaw.
12261 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12262 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12263 Use 'float' consistently, rather than 'float' in most places
12264 and 'double' in a couple of places.
12265
12266 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12267
12268 * xdisp.c (handle_stop): Detect whether we have overlay strings
12269 loaded by testing it->current.overlay_string_index to be
12270 non-negative, instead of checking whether n_overlay_strings is
12271 positive. (Bug#11587)
12272
12273 2012-05-31 Chong Yidong <cyd@gnu.org>
12274
12275 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12276
12277 * doc.c (Fsubstitute_command_keys): Doc fix.
12278
12279 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12280
12281 * search.c (search_buffer): Remove calls to
12282 r_alloc_inhibit_buffer_relocation, as it is now called by
12283 maybe_unify_char, which was the cause of relocation of buffer text
12284 in bug#11519.
12285
12286 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12287
12288 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12289 for the duration of call to load_charset, to avoid problems with
12290 callers of maybe_unify_char that access buffer text through C
12291 pointers.
12292
12293 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12294 decrement the inhibition flag, instead of just setting or
12295 resetting it.
12296
12297 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12298
12299 Remove obsolete '#define static' cruft.
12300 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12301 This #undef was "temporary" in 2000; it is no longer needed
12302 now that '#define static' has gone away.
12303 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12304 (gray_bitmap_bits): Remove; no longer needed.
12305 All uses replaced with definiens.
12306 * xterm.c: Include "bitmaps/gray.xbm".
12307
12308 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12309
12310 Clean up __executable_start, monstartup when --enable-profiling.
12311 The following changes affect the code only when profiling.
12312 * dispnew.c (__executable_start): Rename from safe_bcopy.
12313 Define only on platforms that need it.
12314 * emacs.c: Include <sys/gmon.h> when profiling.
12315 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12316 (__executable_start): Remove decl, since lisp.h does it now.
12317 (safe_bcopy): Remove decl; no longer has that name.
12318 (main): Coalesce #if into single bit of code, for simplicity.
12319 Cast pointers to uintptr_t, since standard libraries want integers
12320 and not pointers.
12321 * lisp.h (__executable_start): New decl.
12322
12323 2012-05-31 Glenn Morris <rgm@gnu.org>
12324
12325 * image.c (Fimagemagick_types): Doc fix.
12326
12327 2012-05-30 Jim Meyering <meyering@redhat.com>
12328
12329 * callproc.c (Fcall_process_region): Include directory component
12330 in mkstemp error message (Bug#11586).
12331
12332 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12333
12334 * alloc.c, lisp.h (make_pure_vector): Now static.
12335
12336 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12337
12338 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12339 Move to byte-run.el.
12340 (Fautoload): Do the hash-doc more carefully.
12341 * data.c (Fdefalias): Purify definition, except for keymaps.
12342 (Qdefun): Move from eval.c.
12343 * lisp.h (Qdefun): Remove.
12344 * lread.c (read1): Tiny simplification.
12345
12346 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
12347
12348 Do not create empty overlays with the evaporate property (Bug#9642).
12349 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12350 Bug#9642, but explicitly check that the buffer the overlay would
12351 be moved to is live and rearrange lines to make sure that errors
12352 will not put the overlay in an inconsistent state.
12353 (Fdelete_overlay): Cosmetics.
12354
12355 2012-05-28 Eli Zaretskii <eliz@gnu.org>
12356
12357 * w32term.c (my_bring_window_to_top): New function.
12358 (x_raise_frame): Use handle returned by DeferWindowPos, which
12359 could be different from the original one.
12360 Call my_bring_window_to_top instead of my_set_foreground_window.
12361 (Bug#11513)
12362
12363 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12364 by calling BringWindowToTop.
12365
12366 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12367 (WM_EMACS_END): Increase by one.
12368
12369 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12370
12371 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12372 This avoids undefined behavior that might cause the eassert
12373 to not catch an out-of-range value.
12374
12375 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
12376
12377 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12378 Update dependencies.
12379
12380 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12381
12382 * bidi.c (bidi_mirror_char): Fix last change.
12383
12384 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12385
12386 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12387 when referring to sectname field in printf format.
12388
12389 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12390
12391 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12392 Only r_alloc_inhibit_buffer_relocation needed to be added;
12393 the others were already declared.
12394
12395 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12396 before checking whether it's out of range. Put the check inside
12397 eassert. See
12398 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12399
12400 2012-05-27 Ken Brown <kbrown@cornell.edu>
12401
12402 * callproc.c (Fcall_process): Restore a line that was accidentally
12403 commented out in the 2011-02-13 change (bug#11547).
12404
12405 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12406
12407 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12408 defined on ralloc.c.
12409
12410 * buffer.c [REL_ALLOC]: Remove prototypes of
12411 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12412 they are now on lisp.h.
12413
12414 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12415
12416 * search.c (search_buffer): Use it to inhibit relocation of buffer
12417 text while re_search_2 is doing its job, because re_search_2 is
12418 passed C pointers to buffer text. (Bug#11519)
12419
12420 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12421 Update value to 24.
12422
12423 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12424 state after an additional call to move_it_in_display_line_to, keep
12425 the values of it->max_ascent and it->max_descent found for the
12426 entire line.
12427 (pos_visible_p): Revert the comparison against bottom_y to what it
12428 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12429 (Bug#11464)
12430
12431 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12432
12433 Fix coding-related core dumps with gcc -ftrapv.
12434 The code was computing A - B, where A and B are pointers, and B is
12435 random garbage. This can lead to core dumps on platforms that
12436 have special pointer registers, and it also leads to core dumps on
12437 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12438 A - B only when B is initialized properly.
12439 * coding.c (coding_set_source, coding_set_destination): Return void.
12440 (coding_change_source, coding_change_destinations): New functions,
12441 with the old behaviors of coding_set_source and coding_set_destination.
12442 All callers that need an offset changed to use these new functions.
12443
12444 2012-05-26 Glenn Morris <rgm@gnu.org>
12445
12446 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12447
12448 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12449
12450 Extend mouse support on W32 text-mode console.
12451 * xdisp.c (draw_row_with_mouse_face):
12452 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
12453
12454 * w32console.c: Include window.h.
12455 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12456 New functions.
12457 (initialize_w32_display): Initialize mouse-highlight data.
12458
12459 * w32inevt.c: Include termchar.h and window.h.
12460 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12461 moves, call note_mouse_highlight. If help_echo changed, call
12462 gen_help_event to produce help-echo message in the echo area.
12463 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12464 highlight info.
12465
12466 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12467
12468 * lread.c (read1): Simplify slightly to avoid an overflow warning
12469 with GCC 4.7.0 on x86-64.
12470
12471 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12472
12473 * bidi.c (bidi_mirror_char): Revert last change: an int is
12474 definitely wide enough here.
12475
12476 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
12477
12478 Fix integer width and related bugs (Bug#9874).
12479 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
12480 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12481 (string_bytes, check_sblock, allocate_string_data):
12482 (compact_small_strings, Fmake_bool_vector, make_string)
12483 (make_unibyte_string, make_multibyte_string)
12484 (make_string_from_bytes, make_specified_string)
12485 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12486 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12487 (mark_vectorlike):
12488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12489 (allocate_pseudovector):
12490 Use int, not EMACS_INT, where int is wide enough.
12491 (inhibit_garbage_collection, Fgarbage_collect):
12492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12493 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12494 int might not be wide enough.
12495 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12496 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12497 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12498 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12499 (bidi_level_of_next_char, bidi_move_to_visually_next):
12500 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12501 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12502 (Fkill_buffer, Fset_buffer_major_mode)
12503 (advance_to_char_boundary, Fbuffer_swap_text)
12504 (Fset_buffer_multibyte, overlays_at, overlays_in)
12505 (overlay_touches_p, struct sortvec, record_overlay_string)
12506 (overlay_strings, recenter_overlay_lists)
12507 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12508 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12509 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12510 (Foverlay_recenter, last_overlay_modification_hooks_used)
12511 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12513 (validate_region): Omit unnecessary test for b <= e,
12514 since that's guaranteed by the previous test.
12515 (adjust_overlays_for_delete): Avoid pos + length overflow.
12516 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12517 (report_overlay_modification):
12518 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12519 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12520 Omit pointer cast, which isn't needed anyway, and doesn't work
12521 after the EMACS_INT -> ptrdiff_t change.
12522 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
12523 * buffer.h: Adjust decls to match defn changes elsewhere.
12524 (struct buffer_text, struct buffer):
12525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12526 Use EMACS_INT, not int, where int might not be wide enough.
12527 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12528 not int, to avoid needless 32-bit limit on 64-bit hosts.
12529 (exec_byte_code): Use tighter memory-full test, one that checks
12530 for alloca overflow. Don't compute the address of the object just
12531 before an array, as that's not portable. Use EMACS_INT, not
12532 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
12533 * callint.c (Fcall_interactively):
12534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12535 * callproc.c (call_process_kill, Fcall_process):
12536 Don't assume pid_t fits into an Emacs fixnum.
12537 (call_process_cleanup, Fcall_process, child_setup):
12538 Don't assume pid_t fits into int.
12539 (call_process_cleanup, Fcall_process, delete_temp_file)
12540 (Fcall_process_region):
12541 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12542 (Fcall_process): Simplify handling of volatile integers.
12543 Use int, not EMACS_INT, where int will do.
12544 * casefiddle.c (casify_object, casify_region, operate_on_word)
12545 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12546 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12547 (casify_object): Avoid integer overflow when overallocating buffer.
12548 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
12549 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
12550 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12551 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12552 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12553 integers are now checked earlier. All uses replaced with XINT.
12554 (ccl_driver):
12555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12556 For CCL_MapSingle, check that content and value are in int range.
12557 (ccl_driver, Fregister_code_conversion_map):
12558 Check that Vcode_version_map_vector is a vector.
12559 (resolve_symbol_ccl_program): Check that vector header is in range.
12560 Always copy the vector, so that we can check its contents reliably
12561 now rather than having to recheck each instruction as it's being
12562 executed. Check that vector words fit in 'int'.
12563 (ccl_get_compiled_code, Fregister_ccl_program)
12564 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12565 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12566 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12567 contents are in range.
12568 (Fccl_execute_on_string): Check that status is in range.
12569 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12570 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12571 Accept and return EMACS_INT, not int, because callers can pass values
12572 out of 'int' range.
12573 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12574 (multibyte_chars_in_text, parse_str_as_multibyte)
12575 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12576 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12577 (string_escape_byte8, Fget_byte):
12578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12579 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
12580 avoid mishandling large integers.
12581 * character.h: Adjust decls to match defn changes elsewhere.
12582 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12583 (Ffind_charset_region):
12584 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12585 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12586 (load_charset_map_from_vector, Fdefine_charset_internal):
12587 Don't assume fixnum fits in int.
12588 (load_charset_map_from_vector, Fmap_charset_chars):
12589 Remove now-unnecessary CHECK_NATNUMs.
12590 (Fdefine_charset_internal): Check ranges here, more carefully.
12591 Don't rely on undefined behavior with signed left shift overflow.
12592 Don't assume unsigned int fits into fixnum, or that fixnum fits
12593 into unsigned int. Don't require max_code to be a valid fixnum;
12594 that's not true for gb10830 4-byte on a 32-bit host. Allow
12595 invalid_code to be a cons, for the same reason. Require code_offset
12596 to be a character. Avoid int overflow if max_char is close
12597 to INT_MAX.
12598 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12599 this is intended anyway and avoids some undefined behavior.
12600 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12601 INDEX_TO_CODE_POINT, as that's what it expects.
12602 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
12603 * charset.h (DECODE_CHAR): Return int, not unsigned;
12604 this is what was intended anyway, and it avoids undefined behavior.
12605 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12606 integer-overflow issues.
12607 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12608 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12609 where the argument is EMACS_INT, and this behavior is not intended.
12610 * chartab.c (Fmake_char_table, Fset_char_table_range)
12611 (uniprop_get_decoder, uniprop_get_encoder):
12612 Don't assume fixnum fits in int.
12613 * cmds.c (move_point): New function, that does the gist of
12614 Fforward_char and Fbackward_char, but does so while checking
12615 for integer overflow more accurately.
12616 (Fforward_char, Fbackward_char): Use it.
12617 (Fforward_line, Fend_of_line, internal_self_insert)
12618 (internal_self_insert):
12619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12620 Fix a FIXME, by checking for integer overflow when calculating
12621 target_clm and actual_clm.
12622 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
12623 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
12624 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12625 (coding_alloc_by_making_gap, alloc_destination)
12626 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12627 (encode_coding_utf_16, detect_coding_emacs_mule)
12628 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12629 (detect_coding_iso_2022, decode_coding_iso_2022)
12630 (encode_invocation_designation, encode_designation_at_bol)
12631 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12632 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12633 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12634 (encode_coding_ccl, encode_coding_raw_text)
12635 (detect_coding_charset, decode_coding_charset)
12636 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12637 (produce_composition, produce_charset, produce_annotation)
12638 (decode_coding, handle_composition_annotation)
12639 (handle_charset_annotation, consume_chars, decode_coding_gap)
12640 (decode_coding_object, encode_coding_object, detect_coding_system)
12641 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12642 (code_convert_region, code_convert_string)
12643 (Fdefine_coding_system_internal)
12644 (coding_set_source, coding_set_destination):
12645 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12646 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12647 (Fdefine_coding_system_internal):
12648 Don't assume fixnums fit in int.
12649 (decode_coding_gap, decode_coding_object, encode_coding_object)
12650 (Fread_coding_system, Fdetect_coding_region)
12651 (Funencodable_char_position, Fcheck_coding_systems_region)
12652 (get_translation, handle_composition_annotation, consume_chars):
12653 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12654 (consume_chars): Rewrite to not calculate an address outside buffer.
12655 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
12656 Don't access memory outside of the args array.
12657 (Fdefine_coding_system_internal): Check for charset-id overflow.
12658 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12659 result of ENCODE_CHAR.
12660 * coding.h: Adjust decls to match defn changes elsewhere.
12661 (struct coding_system):
12662 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12663 * composite.c (get_composition_id, find_composition)
12664 (run_composition_function, update_compositions)
12665 (compose_text, composition_gstring_put_cache)
12666 (composition_gstring_p, composition_gstring_width)
12667 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12668 (composition_compute_stop_pos, composition_reseat_it)
12669 (composition_update_it, struct position_record)
12670 (find_automatic_composition, composition_adjust_point)
12671 (Fcomposition_get_gstring, Ffind_composition_internal):
12672 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12673 (update_compositions):
12674 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12675 * composite.h: Adjust decls to match defn changes elsewhere.
12676 (struct composition):
12677 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12678 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12679 Do not attempt to compute the address of the object just before a
12680 buffer; this is not portable.
12681 (Faref, Faset):
12682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12683 (Faset): Use int, not EMACS_INT, where int is wide enough.
12684 (Fstring_to_number): Don't assume fixnums fit in int.
12685 (Frem): Don't assume arg is nonnegative.
12686 * dbusbind.c (xd_append_arg): Check for integers out of range.
12687 (Fdbus_call_method): Don't overflow the timeout int.
12688 (extract_signed, extract_unsigned): New functions.
12689 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12690 (xd_get_connection_references): Return ptrdiff_t, not int.
12691 All uses changed.
12692 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12693 (xd_read_message_1):
12694 Use int, not unsigned, where the dbus API uses int.
12695 (Fdbus_message_internal): Don't overflow mtype.
12696 (syms_of_dbusbind): Allocate right-sized buffer for integers.
12697 * dired.c (directory_files_internal, file_name_completion, scmp)
12698 (file_name_completion_stat):
12699 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12700 (file_name_completion): Don't overflow matchcount.
12701 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12702 * dispextern.h: Adjust decls to match defn changes elsewhere.
12703 (struct text_pos, struct glyph, struct bidi_saved_info)
12704 (struct bidi_string_data, struct bidi_it, struct composition_it)
12705 (struct it):
12706 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12707 (struct display_pos, struct composition_it, struct it):
12708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12709 * dispnew.c (increment_matrix_positions)
12710 (increment_row_positions, mode_line_string)
12711 (marginal_area_string):
12712 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12713 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
12714 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12715 (duration_to_sec_usec): New function, to check for overflow better.
12716 (Fsleep_for, sit_for): Use it.
12717 * doc.c (get_doc_string, store_function_docstring):
12718 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12719 (get_doc_string, Fsnarf_documentation):
12720 Use int, not EMACS_INT, where int is wide enough.
12721 (get_doc_string):
12722 Use SAFE_ALLOCA, not alloca.
12723 Check for overflow when converting EMACS_INT to off_t.
12724 * doprnt.c (doprnt):
12725 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12726 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12727 Don't assume uid_t fits into fixnum.
12728 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12729 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12730 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12731 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12732 (general_insert_function)
12733 (Finsert_char, make_buffer_string, make_buffer_string_both)
12734 (update_buffer_properties, Fbuffer_substring)
12735 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12736 (Fsubst_char_in_region, check_translation)
12737 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12738 (transpose_markers, Ftranspose_regions):
12739 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12740 (clip_to_bounds): Move to lisp.h as an inline function).
12741 (Fconstrain_to_field): Don't assume integers are nonnegative.
12742 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12743 (Fsubst_char_in_region, Fsave_restriction):
12744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12745 (Femacs_pid): Don't assume pid_t fits into fixnum.
12746 (lo_time): Use int, not EMACS_INT, when int suffices.
12747 (lisp_time_argument): Check for usec out of range.
12748 (Fencode_time): Don't assume fixnum fits in int.
12749 (Fuser_login_name, Fuser_full_name): Signal an error
12750 if a uid argument is out of range, rather than relying on
12751 undefined behavior.
12752 (Fformat_time_string): Remove now-unnecessary check.
12753 lisp_time_argument checks for out-of-range usec now.
12754 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
12755 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12756 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12757 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12758 (init_cmdargs, Fdump_emacs):
12759 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12760 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12761 the bottom (typically) 32 bits of the fixnum.
12762 * eval.c (specpdl_size, call_debugger):
12763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12764 (when_entered_debugger, Fbacktrace_debug):
12765 Don't assume fixnum can fit in int.
12766 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12767 the object just before a buffer; this is not portable.
12768 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12769 (grow_specpdl, unbind_to):
12770 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12771 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12772 (grow_specpdl): Simplify allocation by using xpalloc.
12773 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
12774 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12775 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12776 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12777 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12778 (a_write, e_write):
12779 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12780 (Fcopy_file, non_regular_nbytes, read_non_regular)
12781 (Finsert_file_contents):
12782 Use int, not EMACS_INT, where int is wide enough.
12783 (READ_BUF_SIZE): Verify that it fits in int.
12784 (Finsert_file_contents): Check that counts are in proper range,
12785 rather than assuming fixnums fit into ptrdiff_t etc.
12786 Don't assume fixnums fit into int.
12787 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
12788 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12789 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
12790 (string_char_to_byte, string_byte_to_char)
12791 (string_make_multibyte, string_to_multibyte)
12792 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12793 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12794 (substring_both, Fdelete, internal_equal, Ffillarray)
12795 (Fclear_string, mapcar1)
12796 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12797 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12798 (larger_vector, make_hash_table, maybe_resize_hash_table)
12799 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12800 (Fmaphash, secure_hash):
12801 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12802 (concat): Check for string index and length overflow.
12803 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12804 (Frequire):
12805 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12806 (larger_vector): New API (vec, incr_min, size_max) replaces old
12807 one (vec, new_size, init). This catches size overflow.
12808 INIT was removed because it was always Qnil.
12809 All callers changed.
12810 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12811 the upper bound on a hash table index size.
12812 (make_hash_table, maybe_resize_hash_table): Use it.
12813 (secure_hash): Computer start_byte and end_byte only after
12814 they're known to be in ptrdiff_t range.
12815 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12816 (Ffont_get_glyphs, Ffont_at):
12817 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12818 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12819 (Flist_fonts, Fopen_font):
12820 Don't assume fixnum can fit in int.
12821 (check_gstring): Don't assume index can fit in int.
12822 (font_match_p): Check that fixnum is a character, not a nonnegative
12823 fixnum, since the later code needs to stuff it into an int.
12824 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12825 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12826 conversion overflow issues.
12827 (Fopen_font): Check for integer out of range.
12828 (Ffont_get_glyphs): Don't assume index can fit in int.
12829 * font.h: Adjust decls to match defn changes elsewhere.
12830 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12831 integer overflow.
12832 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12833 printmax_t, where ptrdiff_t is wide enough.
12834 (Finternal_char_font):
12835 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12836 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12837 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12838 (Fset_frame_position, x_set_frame_parameters)
12839 (x_set_line_spacing, x_set_border_width)
12840 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12841 Check that fixnums are in proper range for system types.
12842 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12843 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12844 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12845 Use SAFE_ALLOCA_LISP, not alloca.
12846 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12847 intptr_t is wide enough.
12848 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12849 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12850 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12851 Check for fixnum out of range.
12852 * ftfont.c (ftfont_list): Don't assume index fits in int.
12853 Check that fixnums are in proper range for system types.
12854 (ftfont_shape_by_flt):
12855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12856 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12857 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12858 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12859 Check that fixnums are in proper range for system types.
12860 * gnutls.h: Adjust decls to match defn changes elsewhere.
12861 * gtkutil.c (xg_dialog_run):
12862 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12863 (update_frame_tool_bar):
12864 Check that fixnums are in proper range for system types.
12865 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
12866 (lookup_image): Check that fixnums are in range for system types.
12867 * indent.c (last_known_column, last_known_column_point):
12868 (current_column_bol_cache):
12869 (skip_invisible, current_column, check_display_width):
12870 (check_display_width, scan_for_column, current_column_1)
12871 (Findent_to, Fcurrent_indentation, position_indentation)
12872 (indented_beyond_p, Fmove_to_column, compute_motion):
12873 (Fcompute_motion, Fvertical_motion):
12874 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12875 (last_known_column_modified): Use EMACS_INT, not int.
12876 (check_display_width):
12877 (Fcompute_motion):
12878 Check that fixnums and floats are in proper range for system types.
12879 (compute_motion): Don't assume index or fixnum fits in int.
12880 (compute_motion, Fcompute_motion):
12881 Use int, not EMACS_INT, when it is wide enough.
12882 (vmotion): Omit local var start_hpos that is always 0; that way
12883 we don't need to worry about overflow in expressions involving it.
12884 * indent.h: Adjust decls to match defn changes elsewhere.
12885 (struct position):
12886 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12887 Use int, not EMACS_INT, where int is wide enough.
12888 Remove unused members ovstring_chars_done and tab_offset;
12889 all uses removed.
12890 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12891 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12892 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12893 (make_gap, copy_text, insert, insert_and_inherit)
12894 (insert_before_markers, insert_before_markers_and_inherit)
12895 (insert_1, count_combining_before, count_combining_after)
12896 (insert_1_both, insert_from_string)
12897 (insert_from_string_before_markers, insert_from_string_1)
12898 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12899 (adjust_after_replace, adjust_after_insert, replace_range)
12900 (replace_range_2, del_range, del_range_1, del_range_byte)
12901 (del_range_both, del_range_2, modify_region)
12902 (prepare_to_modify_buffer, signal_before_change)
12903 (signal_after_change, Fcombine_after_change_execute):
12904 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12905 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12906 (balance_an_interval, split_interval_right, split_interval_left)
12907 (find_interval, next_interval, update_interval)
12908 (adjust_intervals_for_insertion, delete_node, delete_interval)
12909 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12910 (static_offset_intervals, offset_intervals)
12911 (merge_interval_right, merge_interval_left, make_new_interval)
12912 (graft_intervals_into_buffer, temp_set_point_both)
12913 (temp_set_point, set_point, adjust_for_invis_intang)
12914 (set_point_both, move_if_not_intangible, get_property_and_range)
12915 (get_local_map, copy_intervals, copy_intervals_to_string)
12916 (compare_string_intervals, set_intervals_multibyte_1):
12917 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12918 * intervals.h: Adjust decls to match defn changes elsewhere.
12919 (struct interval):
12920 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12921 * keyboard.c (this_command_key_count, this_single_command_key_start)
12922 (before_command_key_count, before_command_echo_length, echo_now)
12923 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12924 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12925 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12926 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12927 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12928 (last_non_minibuf_size, last_point_position, echo_truncate)
12929 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12930 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12931 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12932 (stuff_buffered_input):
12933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12934 (last_auto_save, command_loop_1, read_char):
12935 Use EMACS_INT, not int, to avoid integer overflow.
12936 (record_char): Avoid overflow in total_keys computation.
12937 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12938 * keyboard.h: Adjust decls to match defn changes elsewhere.
12939 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12940 (Fkey_description, Fdescribe_vector, Flookup_key):
12941 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12942 (click_position): New function, to check that positions are in range.
12943 (Fcurrent_active_maps):
12944 (describe_command):
12945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12946 (Faccessible_keymaps, Fkey_description):
12947 (preferred_sequence_p):
12948 Don't assume fixnum can fit into int.
12949 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12950 Check for integer overflow in size calculations.
12951 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12952 avoid mishandling large integers.
12953 * lisp.h: Adjust decls to match defn changes elsewhere.
12954 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12955 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12956 (struct Lisp_Marker):
12957 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12958 (clip_to_bounds): Now an inline function, moved here from editfns.c.
12959 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12960 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12961 All callers changed.
12962 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12963 Assume the arg has valid form, since it always does.
12964 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12965 unsigned integer system type.
12966 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12967 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12968 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12969 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12970 (duration_to_sec_usec): New decl.
12971 * lread.c (read_from_string_index, read_from_string_index_byte)
12972 (read_from_string_limit, readchar, unreadchar, openp)
12973 (read_internal_start, read1, oblookup):
12974 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12975 (Fload, readevalloop, Feval_buffer, Feval_region):
12976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12977 (openp): Check for out-of-range argument to 'access'.
12978 (read1): Use int, not EMACS_INT, where int is wide enough.
12979 Don't assume fixnum fits into int.
12980 Fix off-by-one error that can read outside a buffer.
12981 (read_filtered_event): Use duration_to_sec_usec
12982 to do proper overflow checking on durations.
12983 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12984 in size calculation.
12985 (Fexecute_kbd_macro):
12986 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12987 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12988 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12989 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12990 (set_marker_both, set_marker_restricted_both, marker_position)
12991 (marker_byte_position, Fbuffer_has_markers_at):
12992 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12993 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
12994 * menu.c (ensure_menu_items): Rename from grow_menu_items.
12995 It now merely ensures that the menu is large enough, without
12996 necessarily growing it, as this avoids some integer overflow issues.
12997 All callers changed.
12998 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12999 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13000 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13001 Use SAFE_ALLOCA_LISP, not alloca.
13002 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13003 to EMACS_INT. Check that fixnums are in proper range for system types.
13004 * minibuf.c (minibuf_prompt_width, string_to_object)
13005 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13006 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13007 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13008 (get_minibuffer, read_minibuf_unwind):
13009 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13010 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13011 this simplifies overflow checking. All callers changed.
13012 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13013 (Ftest_completion):
13014 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13015 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13016 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13017 Check that fixnums are in proper range for system types.
13018 (Fx_create_frame, Fx_show_tip):
13019 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13020 * nsfont.m (ns_findfonts, nsfont_list_family):
13021 Don't assume fixnum fits in long.
13022 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13023 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13024 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13025 wide enough.
13026 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13027 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13028 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13029 (PRINTDECLARE, PRINTPREPARE):
13030 (strout, print_string):
13031 (print, print_preprocess, print_check_string_charset_prop)
13032 (print_object):
13033 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13034 (PRINTDECLARE):
13035 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13036 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13037 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13038 (printchar, strout): Use xpalloc to catch size calculation overflow.
13039 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13040 (print_error_message): Use SAFE_ALLOCA, not alloca.
13041 (print_object): Use int, not EMACS_INT, where int is wide enough.
13042 (print_depth, new_backquote_output, print_number_index):
13043 Use ptrdiff_t, not int, where int might not be wide enough.
13044 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13045 (Fset_process_window_size, Fformat_network_address)
13046 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13047 (sigchld_handler):
13048 Check that fixnums are in proper range for system types.
13049 (Fsignal_process): Simplify by avoiding a goto.
13050 Check for process-ids out of pid_t range rather than relying on
13051 undefined behavior.
13052 (process_tick, update_tick): Use EMACS_INT, not int.
13053 (Fformat_network_address, read_process_output, send_process)
13054 (Fprocess_send_region, status_notify):
13055 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13056 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13057 (wait_reading_process_output, read_process_output, exec_sentinel):
13058 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13059 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13060 (Faccept_process_output): Use duration_to_sec_usec to do proper
13061 overflow checking on durations.
13062 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13063 Don't assume pid_t fits in int.
13064 * process.h (struct Lisp_Process): Members tick and update_tick
13065 are now of type EMACS_INT, not int.
13066 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13067 configured --with-wide-int.
13068 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13069 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13070 * search.c (looking_at_1, string_match_1):
13071 (fast_string_match, fast_c_string_match_ignore_case)
13072 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13073 (scan_newline, find_before_next_newline, search_command)
13074 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13075 (set_search_regs, wordify):
13076 (Freplace_match):
13077 (Fmatch_data):
13078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13079 (string_match_1, search_buffer, set_search_regs):
13080 (Fmatch_data):
13081 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13082 (wordify): Check for overflow in size calculation.
13083 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13084 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13085 Check that fixnums are in proper range for system types.
13086 * sound.c (struct sound_device)
13087 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13088 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13089 (Fplay_sound_internal):
13090 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13091 * syntax.c (struct lisp_parse_state, find_start_modiff)
13092 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13093 (Fparse_partial_sexp):
13094 Don't assume fixnums can fit in int.
13095 (struct lisp_parse_state, find_start_pos, find_start_value)
13096 (find_start_value_byte, find_start_begv)
13097 (update_syntax_table, char_quoted, dec_bytepos)
13098 (find_defun_start, prev_char_comend_first, back_comment):
13099 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13100 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13101 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13102 (Finternal_describe_syntax_value): Check that match_lisp is a
13103 character, not an integer, since the code stuffs it into int.
13104 (scan_words, scan_sexps_forward):
13105 Check that fixnums are in proper range for system types.
13106 (Fforward_word):
13107 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13108 (scan_sexps_forward):
13109 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13110 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13111 * syntax.h: Adjust decls to match defn changes elsewhere.
13112 (struct gl_state_s):
13113 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13114 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13115 MOST_POSITIVE_FIXNUM.
13116 * sysdep.c (wait_for_termination_1, wait_for_termination)
13117 (interruptible_wait_for_termination, mkdir):
13118 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13119 (emacs_read, emacs_write):
13120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13121 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13122 and double all fit in int.
13123 * term.c (set_tty_color_mode):
13124 Check that fixnums are in proper range for system types.
13125 * termhooks.h (struct input_event):
13126 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13127 * textprop.c (validate_interval_range, interval_of)
13128 (Fadd_text_properties, set_text_properties_1)
13129 (Fremove_text_properties, Fremove_list_of_text_properties)
13130 (Ftext_property_any, Ftext_property_not_all)
13131 (copy_text_properties, text_property_list, extend_property_ranges)
13132 (verify_interval_modification):
13133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13134 (Fnext_single_char_property_change)
13135 (Fprevious_single_char_property_change):
13136 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13137 (copy_text_properties):
13138 Check for integer overflow in index calculation.
13139 * undo.c (last_boundary_position, record_point, record_insert)
13140 (record_delete, record_marker_adjustment, record_change)
13141 (record_property_change):
13142 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13143 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13144 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13145 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13146 (Fx_hide_tip, Fx_file_dialog):
13147 * w32menu.c (set_frame_menubar):
13148 Use ptrdiff_t, not int, for consistency with rest of code.
13149 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13150 (select_window, Fdelete_other_windows_internal)
13151 (window_scroll_pixel_based, window_scroll_line_based)
13152 (Frecenter, Fset_window_configuration):
13153 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13154 (Fset_window_hscroll, run_window_configuration_change_hook)
13155 (set_window_buffer, temp_output_buffer_show, scroll_command)
13156 (Fscroll_other_window, Frecenter):
13157 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13158 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13159 Don't assume fixnum fits in int.
13160 (Fset_window_scroll_bars):
13161 Check that fixnums are in proper range for system types.
13162 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13163 (string_pos, c_string_pos, number_of_chars, init_iterator)
13164 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13165 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13166 (compute_display_string_end, handle_face_prop)
13167 (face_before_or_after_it_pos, handle_invisible_prop)
13168 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13169 (display_prop_intangible_p, string_buffer_position_lim)
13170 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13171 (get_overlay_strings_1, get_overlay_strings)
13172 (iterate_out_of_display_property, forward_to_next_line_start)
13173 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13174 (get_next_display_element, set_iterator_to_next)
13175 (get_visually_first_element, compute_stop_pos_backwards)
13176 (handle_stop_backwards, next_element_from_buffer)
13177 (move_it_in_display_line_to, move_it_in_display_line)
13178 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13179 (add_to_log, message_dolog, message_log_check_duplicate)
13180 (message2, message2_nolog, message3, message3_nolog
13181 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13182 (current_message_1, truncate_echo_area, truncate_message_1)
13183 (set_message, set_message_1, store_mode_line_noprop)
13184 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13185 (text_outside_line_unchanged_p, check_point_in_composition)
13186 (reconsider_clip_changes)
13187 (redisplay_internal, set_cursor_from_row, try_scrolling)
13188 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13189 (redisplay_window, find_last_unchanged_at_beg_row)
13190 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13191 (trailing_whitespace_p, find_row_edges, display_line)
13192 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13193 (display_mode_element, store_mode_line_string)
13194 (pint2str, pint2hrstr, decode_mode_spec)
13195 (display_count_lines, display_string, draw_glyphs)
13196 (x_produce_glyphs, x_insert_glyphs)
13197 (rows_from_pos_range, mouse_face_from_buffer_pos)
13198 (fast_find_string_pos, mouse_face_from_string_pos)
13199 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13200 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13201 (safe_call, init_from_display_pos, handle_fontified_prop)
13202 (handle_single_display_spec, load_overlay_strings)
13203 (with_echo_area_buffer, setup_echo_area_for_printing)
13204 (display_echo_area, echo_area_display)
13205 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13206 (update_tool_bar, hscroll_window_tree, redisplay_internal)
13207 (redisplay_window, dump_glyph_row, display_mode_line)
13208 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
13209 (handle_display_spec, display_prop_string_p):
13210 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13211 (handle_single_display_spec, build_desired_tool_bar_string)
13212 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13213 (get_specified_cursor_type):
13214 Check that fixnums are in proper range for system types.
13215 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13216 (Flookup_image_map):
13217 Don't assume fixnums fit in int.
13218 (compare_overlay_entries):
13219 Avoid mishandling comparisons due to subtraction overflow.
13220 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13221 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13222 (handle_tool_bar_click):
13223 Use int, not unsigned, since we prefer signed and the signedness
13224 doesn't matter here.
13225 (get_next_display_element, next_element_from_display_vector):
13226 Use int, not EMACS_INT, when int is wide enough.
13227 (start_hourglass): Use duration_to_sec_usec to do proper
13228 overflow checking on durations.
13229 * xfaces.c (Fbitmap_spec_p):
13230 Check that fixnums are in proper range for system types.
13231 (compare_fonts_by_sort_order):
13232 Avoid mishandling comparisons due to subtraction overflow.
13233 (Fx_family_fonts, realize_basic_faces):
13234 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13235 (Fx_family_fonts):
13236 Don't assume fixnum fits in int.
13237 Use SAFE_ALLOCA_LISP, not alloca.
13238 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13239 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13240 (face_at_buffer_position, face_for_overlay_string)
13241 (face_at_string_position):
13242 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13243 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13244 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13245 (Fx_show_tip):
13246 Check that fixnums are in proper range for system types.
13247 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13248 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13249 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13250 (Fx_change_window_property): Don't assume fixnums fit in int.
13251 * xfont.c (xfont_chars_supported):
13252 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13253 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13254 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13255 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13256 * xml.c (parse_region):
13257 * xrdb.c (magic_file_p):
13258 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13259 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13260 (x_get_local_selection, x_reply_selection_request)
13261 (x_handle_selection_request, wait_for_property_change):
13262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13263 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13264 short is wide enough.
13265 (x_send_client_event): Don't assume fixnum fits in int.
13266 * xterm.c (x_x_to_emacs_modifiers):
13267 Don't assume EMACS_INT overflows nicely into int.
13268 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13269 may come from Lisp.
13270 (handle_one_xevent): NATNUMP can eval its arg twice.
13271 (x_connection_closed):
13272 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13273 * xterm.h: Adjust decls to match defn changes elsewhere.
13274 (struct scroll_bar): Use struct vectorlike_header
13275 rather than rolling our own approximation.
13276 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13277
13278 2012-05-25 Glenn Morris <rgm@gnu.org>
13279
13280 * lisp.mk (lisp): Update for more files being compiled now.
13281
13282 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13283
13284 * lread.c: Remove `read_pure' which makes no difference.
13285 (read_pure): Remove var.
13286 (unreadpure): Remove function.
13287 (readevalloop): Don't call read_list with -1 flag.
13288 (read1, read_vector): Don't test read_pure any more.
13289 (read_list): Simplify.
13290
13291 * fileio.c, character.h: Minor style tweaks.
13292
13293 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13294
13295 * window.h (clip_changed): Remove useless declaration.
13296
13297 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
13298
13299 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13300 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13301
13302 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13303
13304 Remove src/m/*.
13305 This directory predates autoconf and is no longer needed nowadays.
13306 Move its few remaining bits of functionality to where they're needed.
13307 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13308 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13309 * m/template.h: Remove.
13310 * Makefile.in (M_FILE): Remove. All uses removed.
13311 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13312 * lisp.h (USE_LSB_TAG):
13313 * mem-limits.h (EXCEEDS_LISP_PTR):
13314 Use VAL_MAX, not VALBITS, in #if.
13315 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13316 (EMACS_UINT): Define unconditionally now.
13317 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13318 (BITS_PER_EMACS_INT): New constants, replacing
13319 what used to be in config.h, but not useful in #if.
13320 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13321 define them any more.
13322 (VAL_MAX): New macro.
13323 (VALMASK): Use it.
13324 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13325 BITS_PER_EMACS_INT, in #if.
13326 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13327 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13328 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13329 * s/ms-w32.h (DATA_START):
13330 Move here from removed file m/intel386.h.
13331 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13332 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13333
13334 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13335
13336 Assume C89 or later.
13337 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13338 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13339 (xrealloc):
13340 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13341 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13342 * textprop.c, tparam.c (NULL): Remove.
13343 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13344 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13345 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13346 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13347 * xterm.c (input_signal_count): Assume volatile works.
13348
13349 2012-05-21 Ken Brown <kbrown@cornell.edu>
13350
13351 * xgselect.c (xg_select): Fix first argument in call to 'select'
13352 (bug#11508).
13353
13354 2012-05-20 Ken Brown <kbrown@cornell.edu>
13355
13356 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
13357 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
13358
13359 2012-05-19 Ken Brown <kbrown@cornell.edu>
13360
13361 * xfns.c (x_in_use): Remove `static' qualifier.
13362 * xterm.h (x_in_use): Declare.
13363 * xgselect.c: Include xterm.h.
13364 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13365 and `display_arg' (bug#9754).
13366
13367 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13368
13369 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13370
13371 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13372 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13373
13374 2012-05-18 Eli Zaretskii <eliz@gnu.org>
13375
13376 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13377
13378 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
13379 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
13380
13381 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13382 reference to image_cache->refcount.
13383 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13384
13385 2012-05-17 Juri Linkov <juri@jurta.org>
13386
13387 * search.c (Fword_search_regexp, Fword_search_backward)
13388 (Fword_search_forward, Fword_search_backward_lax)
13389 (Fword_search_forward_lax): Move functions to isearch.el
13390 (bug#10145, bug#11381).
13391
13392 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13393
13394 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13395
13396 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13397
13398 * lread.c (init_obarray): Declare Qt and Qnil as special.
13399
13400 2012-05-14 Glenn Morris <rgm@gnu.org>
13401
13402 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
13403 Put "libexec" before "bin", for the sake of init_callproc_1.
13404
13405 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13406
13407 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13408
13409 * unexaix.c: Port to more-recent AIX compilers.
13410 (report_error, report_error_1, make_hdr, copy_sym)
13411 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13412 Make arguments const char *, not char *, to avoid violations of C
13413 standard and to fix some AIX warnings reported by Gilles Pion.
13414
13415 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13416
13417 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13418 already have overlays loaded.
13419 (handle_single_display_spec): Before returning without displaying
13420 fringe bitmap, synchronize the bidi iterator with the main display
13421 iterator, by calling iterate_out_of_display_property.
13422 (iterate_out_of_display_property): Detect buffer iteration by
13423 testing that it->string is a Lisp string.
13424 (get_next_display_element): When the current object is exhausted,
13425 and there's something on it->stack, call set_iterator_to_next to
13426 proceed with what's on the stack, instead of returning zero.
13427 (set_iterator_to_next): If called at the end of a Lisp string,
13428 proceed to consider_string_end without incrementing string
13429 position. Don't increment display vector index past the end of
13430 the display vector. (Bug#11417)
13431 (pos_visible_p): Don't report a position visible when move_it_to
13432 stopped at the last line of window, which happens to be scanned
13433 backwards by the bidi iteration. (Bug#11464)
13434
13435 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13436
13437 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13438 and right-margin display specs even if the spec is invalid or we
13439 are on a TTY, and thus unable to display on the fringes.
13440 That's because the text with the property will not be displayed anyway,
13441 so we need to signal to the caller that this is a "replacing"
13442 display spec. This fixes display when the spec is invalid or we
13443 are on a TTY.
13444
13445 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13446
13447 * unexaix.c (make_hdr): Fix typo in prototype.
13448 This bug broke the build on AIX. Problem reported by Gilles Pion.
13449
13450 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
13451
13452 * keyboard.c (kbd_buffer_get_event): Read special events also in
13453 batch mode. (Bug#11415)
13454
13455 2012-05-12 Glenn Morris <rgm@gnu.org>
13456
13457 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13458
13459 2012-05-12 Eli Zaretskii <eliz@gnu.org>
13460
13461 * lisp.mk (lisp): Add newcomment.elc.
13462
13463 2012-05-12 Glenn Morris <rgm@gnu.org>
13464
13465 * Makefile.in (MKDIR_P): New, set by configure.
13466 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13467
13468 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13469
13470 Remove unused function hourglass_started.
13471 * dispextern.h (hourglass_started):
13472 * w32fns.c (hourglass_started):
13473 * xdisp.c (hourglass_started): Remove.
13474
13475 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
13476
13477 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13478 Update dependencies.
13479
13480 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13481
13482 * xgselect.c (xg_select): Put maxfds+1 into a var.
13483 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13484
13485 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13486
13487 2012-05-10 Dave Abrahams <dave@boostpro.com>
13488
13489 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13490 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13491
13492 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
13493
13494 * dbusbind.c (xd_registered_buses): New internal Lisp object.
13495 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
13496 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13497 Initialize xd_registered_buses.
13498
13499 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13500
13501 Untag more efficiently if USE_LSB_TAG.
13502 This is based on a proposal by YAMAMOTO Mitsuharu in
13503 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13504 For an admittedly artificial (nth 8000 longlist) benchmark on
13505 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13506 Emacs's overall text size by 1%.
13507 * lisp.h (XUNTAG): New macro.
13508 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13509 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13510 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13511 * eval.c (Fautoload):
13512 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13513 * frame.h (XFRAME): Use XUNTAG.
13514
13515 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13516 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13517 Remove unportable assumptions about print widths of types like
13518 dbus_uint32_t.
13519 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13520 intptr_t when converting between pointer and integer, to avoid GCC
13521 warnings about wrong width.
13522
13523 2012-05-09 Eli Zaretskii <eliz@gnu.org>
13524
13525 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13526 stack for each reader_thread, instead of defaulting to 8MB
13527 determined by the linker. This avoids failures in creating
13528 subprocesses on Windows 7, see the discussion in this thread:
13529 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13530
13531 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13532
13533 Fix up display of the *Minibuf-0* buffer in the mini window.
13534 * keyboard.c (read_char): Don't clear the echo area if there's no
13535 message to clear.
13536 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
13537 contents of *Minibuf-0*) if there's no message displayed in its stead.
13538
13539 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
13540
13541 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13542 batch mode.
13543
13544 2012-05-06 Chong Yidong <cyd@gnu.org>
13545
13546 * lisp.mk (lisp): Update.
13547
13548 2012-05-05 Jim Meyering <meyering@redhat.com>
13549
13550 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13551
13552 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13553
13554 * data.c (PUT_ERROR): New macro.
13555 (syms_of_data): Use it. Add new error type `user-error'.
13556 * undo.c (user_error): New function.
13557 (Fprimitive_undo): Use it.
13558 * print.c (print_error_message): Adjust print style for `user-error'.
13559 * keyboard.c (user_error): New function.
13560 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13561
13562 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13563
13564 Do not limit current-time-string to years 1000..9999.
13565 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13566 (Fcurrent_time_string): Support any year that is supported by the
13567 underlying localtime representation. Don't use asctime, as it
13568 has undefined behavior for years outside the range -999..9999.
13569
13570 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13571
13572 Fix race conditions involving setenv, gmtime, localtime, asctime.
13573 Without this fix, interrupts could mess up code that uses these
13574 nonreentrant functions, since setting TZ invalidates existing
13575 tm_zone or tzname values, and since most of these functions return
13576 pointers to static storage.
13577 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13578 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13579 Grow the critical sections to include not just invoking
13580 localtime/gmtime, but also accessing these functions' results
13581 including their tm_zone values if any, and any related TZ setting.
13582 (format_time_string): Last arg is now struct tm *, not struct tm **,
13583 so that the struct tm is saved in the critical section.
13584 All callers changed. Simplify allocation of initial buffer, partly
13585 motivated by the fact that memory allocation needs to be outside
13586 the critical section.
13587
13588 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13589
13590 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13591 with RESET_INTERVAL.
13592
13593 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13594 Remove duplicated buffer name initialization.
13595
13596 2012-05-02 Jim Meyering <jim@meyering.net>
13597
13598 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13599
13600 * xfns.c (x_window): Use xstrdup (Bug#11375).
13601
13602 2012-05-02 Eli Zaretskii <eliz@gnu.org>
13603
13604 * xdisp.c (pos_visible_p): If already at a newline from the
13605 display string before the 'while' loop, don't walk back the glyphs
13606 from it3.glyph_row. Solves assertion violation when the display
13607 string begins with a newline (egg.el). (Bug#11367)
13608
13609 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13610
13611 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13612 Move to simple.el.
13613
13614 2012-05-01 Glenn Morris <rgm@gnu.org>
13615
13616 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13617 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13618 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13619 All were removed before 23.1.
13620
13621 * dispnew.c: Remove HAVE_LIBNCURSES test;
13622 it is always true on relevant platforms.
13623
13624 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13625 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13626
13627 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13628
13629 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13630
13631 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13632 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13633 Remove.
13634
13635 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13636
13637 Do not avoid creating empty evaporating overlays (Bug#9642).
13638 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13639 That is, do not delete an evaporating overlay if it becomes
13640 empty after its bounds are adjusted to fit within its buffer.
13641 This fix caused other problems, and I'm reverting it until we get
13642 to the bottom of them.
13643
13644 2012-04-27 Chong Yidong <cyd@gnu.org>
13645
13646 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13647
13648 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13649
13650 * xdisp.c (pos_visible_p): If the window start position is beyond
13651 ZV, start the display from buffer beginning. Prevents assertion
13652 violation in init_iterator when the minibuffer window is scrolled
13653 via the scroll bar.
13654
13655 * window.c (window_scroll_pixel_based): Likewise.
13656
13657 2012-04-27 Chong Yidong <cyd@gnu.org>
13658
13659 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13660
13661 2012-04-27 Glenn Morris <rgm@gnu.org>
13662
13663 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13664 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13665
13666 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13667
13668 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13669 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
13670
13671 2012-04-26 Eli Zaretskii <eliz@gnu.org>
13672
13673 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13674 display element, check also the underlying string or buffer
13675 character. (Bug#11341)
13676
13677 * w32menu.c: Include w32heap.h.
13678 (add_menu_item): If the call to AppendMenuW (via
13679 unicode_append_menu) fails, disable Unicode menus only if we are
13680 running on Windows 9X/Me.
13681
13682 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13683
13684 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13685 (xgetint): Add missing shift for LSB tags.
13686
13687 2012-04-24 Martin Rudalics <rudalics@gmx.at>
13688
13689 * keyboard.c (read_char): Don't wipe echo area for select window
13690 events: These might get delayed via `mouse-autoselect-window'
13691 (Bug#11304).
13692
13693 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
13694
13695 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13696 manipulation of :loaded-from data.
13697
13698 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
13699
13700 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13701 now a cons (bug#11311).
13702
13703 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13704
13705 Do not create empty overlays with the evaporate property (Bug#9642).
13706 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13707 if it becomes empty after its bounds are adjusted to fit within
13708 its buffer. Without this fix, in a nonempty buffer (let ((o
13709 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13710 yields an empty overlay that has the evaporate property, which is
13711 not supposed to happen.
13712
13713 Fix minor GTK3 problems found by static checking.
13714 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13715 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13716 (struct _EmacsFixedClass, emacs_fixed_get_type):
13717 Move decls here from emacsgtkfixed.h, since they needn't be public.
13718 (emacs_fixed_get_type): Now static.
13719 (emacs_fixed_class_init): Omit unused local.
13720 (emacs_fixed_child_type): Remove; unused.
13721 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13722 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13723 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13724 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13725 (EMACS_FIXED_GET_CLASS): Remove; unused.
13726 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13727
13728 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13729 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13730
13731 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13732
13733 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
13734 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
13735 (__malloc_size_t, __malloc_ptrdiff_t):
13736 Remove. All uses removed, replaced by the definiens if needed,
13737 since we can assume C89 or better now.
13738 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13739 (protect_malloc_state, align, get_contiguous_space)
13740 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13741 (malloc_atfork_handler_child, malloc_enable_thread)
13742 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13743 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13744 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13745 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13746 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13747 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13748 Define using prototypes, not old style.
13749 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13750 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13751 (align): Don't assume that signed integer overflow wraps around.
13752 Omit unused local var.
13753 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13754 (_free_internal_nolock, memalign, mallochook, reallochook):
13755 Omit no-longer-needed casts.
13756 (valloc): Use getpagesize, not __getpagesize.
13757 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13758 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13759
13760 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13761
13762 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
13763
13764 Move functions from C to Lisp. Make non-blocking method calls
13765 the default. Implement further D-Bus standard interfaces.
13766
13767 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13768 (QCdbus_request_name_allow_replacement)
13769 (QCdbus_request_name_replace_existing)
13770 (QCdbus_request_name_do_not_queue)
13771 (QCdbus_request_name_reply_primary_owner)
13772 (QCdbus_request_name_reply_in_queue)
13773 (QCdbus_request_name_reply_exists)
13774 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13775 (QCdbus_registered_serial, QCdbus_registered_method)
13776 (QCdbus_registered_signal): New Lisp objects.
13777 (XD_DEBUG_MESSAGE): Use sizeof.
13778 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13779 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13780 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13781 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13782 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13783 (xd_signature, xd_append_arg): Allow float for integer types.
13784 (xd_get_connection_references): New function.
13785 (xd_get_connection_address): Rename from xd_initialize.
13786 Return cached address.
13787 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13788 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13789 level.
13790 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
13791 Return number of refcounts.
13792 (Fdbus_get_unique_name): Make stronger parameter check.
13793 (Fdbus_message_internal): New defun.
13794 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13795 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13796 (Fdbus_send_signal, Fdbus_register_service)
13797 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13798 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13799 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13800 (Vdbus_compiled_version, Vdbus_runtime_version)
13801 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13802 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13803 (Vdbus_message_type_signal): New defvars.
13804 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13805 Adapt docstring.
13806
13807 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13808
13809 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13810 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13811 Do not assume ptrdiff_t is the same width as 'int'.
13812
13813 * alloc.c: Handle unusual debugging option combinations.
13814 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13815 since the two debugging options are incompatible.
13816 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13817 is defined.
13818 (mem_init, mem_insert, mem_insert_fixup):
13819 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13820 (NEED_MEM_INSERT): Remove; no longer needed.
13821
13822 2012-04-22 Leo Liu <sdl.web@gmail.com>
13823
13824 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13825
13826 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13827
13828 * sysdep.c [__FreeBSD__]: Minor cleanups.
13829 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13830 Use Emacs indenting style more consistently. Avoid some casts.
13831 Use 'double' consistently rather than mixing 'float' and 'double'.
13832
13833 2012-04-21 Eduard Wiebe <usenet@pusto.de>
13834
13835 * sysdep.c (list_system_processes, system_process_attributes):
13836 Add implementation for FreeBSD (Bug#5243).
13837
13838 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13839
13840 * lisp.mk (lisp): Update.
13841
13842 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13843
13844 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13845 It is never used otherwise.
13846
13847 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13848
13849 * print.c (print_preprocess): Only check print_depth if print-circle
13850 is nil.
13851 (print_object): Check for cycles even when print-circle is nil and
13852 print-gensym is t, but only check print_depth if print-circle is nil.
13853
13854 2012-04-20 Chong Yidong <cyd@gnu.org>
13855
13856 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13857 set the status to "failed" and ensure that sentinel is run.
13858
13859 2012-04-20 Glenn Morris <rgm@gnu.org>
13860
13861 * process.c (Fset_process_inherit_coding_system_flag)
13862 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
13863 (Fmake_network_process, Fmake_serial_process): Doc fix.
13864
13865 2012-04-20 Eli Zaretskii <eliz@gnu.org>
13866
13867 * xdisp.c (string_buffer_position_lim): Limit starting position to
13868 BEGV.
13869 (set_cursor_from_row): If called for a mode-line or header-line
13870 row, return zero immediately.
13871 (try_cursor_movement): If inside continuation line, don't back up
13872 farther than the first row after the header line, if any.
13873 Don't consider the header-line row as "partially visible", even if
13874 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13875
13876 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13877
13878 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13879 (bug#11238).
13880
13881 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
13882 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
13883
13884 configure: new option --enable-gcc-warnings (Bug#11207)
13885 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13886 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13887 (ALL_CFLAGS): Use new macros rather than old.
13888 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13889 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13890 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13891 -Wunused-result, -Wunused-variable. This should go away once
13892 the Emacs and Gnulib regex code is merged.
13893 (xmalloc, xrealloc): Now static.
13894
13895 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13896
13897 * dired.c (Fsystem_groups): Remove unused local.
13898
13899 2012-04-17 Glenn Morris <rgm@gnu.org>
13900
13901 * dired.c (Fsystem_users): Doc fix.
13902
13903 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13904
13905 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13906 (syms_of_dired): Add them.
13907
13908 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13909
13910 Fix minor alloc.c problems found by static checking.
13911 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13912 New extern decls, to avoid calling undeclared functions.
13913 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13914 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13915 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13916 (NEED_MEM_INSERT): New macro.
13917 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
13918 Remove one incorrect comment and fix another.
13919
13920 Fix minor ralloc.c problems found by static checking.
13921 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13922 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13923 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13924 (r_alloc_sbrk): Now static.
13925
13926 Improve ralloc.c interface checking.
13927 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13928 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13929 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13930 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13931 [REL_ALLOC]: ... to here, to check interface.
13932 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13933 Remove decls. This fixes an "It stinks!".
13934
13935 * alloc.c (which_symbols): Fix alignment issue / type clash.
13936
13937 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13938
13939 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13940 (struct Lisp_Misc_Any): Likewise.
13941 (struct Lisp_Free): Likewise.
13942 * alloc.c (union aligned_Lisp_Symbol): Define.
13943 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13944 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13945 (union aligned_Lisp_Misc): Define.
13946 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13947 aligned_Lisp_Misc instead of union Lisp_Misc.
13948 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
13949
13950 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13951
13952 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13953 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13954 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13955 * s/netbsd.h, s/sol2-6.h:
13956 Remove definition of GC_MARK_STACK, since the default now works.
13957 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13958 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13959 no longer the default.
13960 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13961
13962 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13963
13964 * lread.c (lisp_file_lexically_bound_p):
13965 Fix hang at ";-*-\n" (bug#11238).
13966
13967 2012-04-14 Eli Zaretskii <eliz@gnu.org>
13968
13969 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13970 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13971
13972 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13973
13974 * nsterm.m (constrainFrameRect): Always constrain when there is only
13975 one screen (Bug#10962).
13976
13977 2012-04-13 Ken Brown <kbrown@cornell.edu>
13978
13979 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13980
13981 2012-04-13 Reuben Thomas <rrt@sc3d.org>
13982
13983 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13984
13985 2012-04-11 Daniel Colascione <dancol@dancol.org>
13986
13987 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13988 against is gone. It's better to use vfork now so that when Cygwin
13989 gains a new, working vfork, we use it automatically (bug#10398).
13990
13991 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13992
13993 * window.c (save_window_save): Obey window-point-insertion-type.
13994
13995 2012-04-11 Glenn Morris <rgm@gnu.org>
13996
13997 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13998
13999 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14000
14001 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14002
14003 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14004
14005 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14006 (force_quit_count): New var.
14007 (handle_interrupt): Use it.
14008
14009 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14010
14011 * w32.c (w32_delayed_load): Record the full path of the library
14012 being loaded (bug#10424).
14013
14014 2012-04-09 Glenn Morris <rgm@gnu.org>
14015
14016 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14017 not just in the obarray, before snarfing them. (Bug#11036)
14018
14019 * Makefile.in ($(leimdir)/leim-list.el):
14020 Pass EMACS rather than BUILT_EMACS.
14021
14022 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14023
14024 * process.c (make_process):
14025 * process.h: Add integer `gnutls_handshakes_tried' member to
14026 process struct.
14027
14028 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14029 Add convenience `GNUTLS_LOG2i' macro.
14030
14031 * gnutls.c (gnutls_log_function2i): Convenience log function.
14032 (emacs_gnutls_read): Use new log functions,
14033 `gnutls_handshakes_tried' process member, and
14034 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14035 attempts per process (connection).
14036
14037 2012-04-09 Chong Yidong <cyd@gnu.org>
14038
14039 * eval.c (Fuser_variable_p, user_variable_p_eh)
14040 (lisp_indirect_variable): Functions deleted.
14041 (Fdefvar): Caller changed.
14042
14043 * callint.c (Finteractive, Fcall_interactively):
14044 * minibuf.c (Fread_variable): Callers changed.
14045
14046 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14047
14048 * xdisp.c (set_cursor_from_row): If the display string appears in
14049 the buffer at position that is closer to point than the position
14050 after the display string, display the cursor on the first glyph of
14051 the display string. Fixes cursor display when a 'display' text
14052 property immediately follows invisible text. (Bug#11094)
14053
14054 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14055
14056 composite.c: use 'double' consistently
14057 * composite.c (get_composition_id): Use 'double' consistently
14058 instead of converting 'float' to 'double' and vice versa; this is
14059 easier to understand and avoids a GCC warning.
14060
14061 2012-04-09 Glenn Morris <rgm@gnu.org>
14062
14063 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14064 preparation for dumping it with emacs. (Bug#4789)
14065 (leimdir): New variable.
14066 ($(leimdir)/leim-list.el): New rule.
14067 (emacs$(EXEEXT)): Depend on leim-list.el.
14068
14069 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14070 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14071 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14072
14073 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14074
14075 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14076 proper alignment.
14077
14078 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14079
14080 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14081 Remove unused local variable.
14082
14083 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14084
14085 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14086 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14087 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14088 objects, as mark_maybe_pointer will catch them otherwise.
14089 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14090 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14091
14092 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14093
14094 Fix typo that broke non-Windows builds.
14095 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14096
14097 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14098
14099 Support building on MS-Windows with libxml2.
14100
14101 * makefile.w32-in (OBJ2): Add xml.$(O).
14102 (GLOBAL_SOURCES): Add xml.c.
14103 ($(BLD)/xml.$(O)): New dependency list.
14104
14105 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14106 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14107 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14108 [!WINDOWSNT]: New macros.
14109 (init_libxml2_functions, libxml2_loaded_p): New functions.
14110 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14111 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14112 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14113 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14114 linked in).
14115 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14116 Call init_libxml2_functions before calling libxml2 functions.
14117 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14118
14119 * emacs.c: Don't include libxml/parser.h.
14120 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14121 xmlCleanupParser directly.
14122
14123 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14124
14125 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14126
14127 * indent.c (Fvertical_motion): If there is a display string at
14128 point, use it.vpos to compute how many lines to backtrack after
14129 move_it_to point. (Bug#11133)
14130
14131 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14132
14133 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14134 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14135 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14136 macros related to unification of CJK characters. For the details,
14137 see the discussion following the message here:
14138 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14139
14140 2012-04-04 Chong Yidong <cyd@gnu.org>
14141
14142 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14143
14144 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14145
14146 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14147 instead of alloca. (Bug#11138)
14148
14149 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14150
14151 * w32menu.c (is_simple_dialog): Properly check lisp types.
14152 (Bug#11141)
14153
14154 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14155
14156 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14157 position we get to after a call to move_it_to fails the
14158 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14159 only if we wind up in a string from display property. (Bug#11063)
14160
14161 * window.c (Fdelete_other_windows_internal): Invalidate the row
14162 and column information about mouse highlight, so that redisplay
14163 restores it after reallocating the glyph matrices. (Bug#7464)
14164
14165 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14166 string comes from a `display' text property, use the buffer
14167 position of that property as if we actually saw that position in
14168 the row's glyphs.
14169 (move_it_by_lines): Remove the assertion that
14170 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14171 violated when there's a before-string at the beginning of a line.
14172 (Bug#11063)
14173
14174 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14175
14176 * xdisp.c (append_space_for_newline): If the default face was
14177 remapped, use the remapped face for the appended newline.
14178 (extend_face_to_end_of_line): Use the remapped default face for
14179 extending the face to the end of the line.
14180 (display_line): Call extend_face_to_end_of_line when the default
14181 face was remapped. (Bug#11068)
14182
14183 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14184
14185 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14186
14187 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14188
14189 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14190
14191 2012-03-27 Glenn Morris <rgm@gnu.org>
14192
14193 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14194 Doc fixes.
14195
14196 2012-03-26 Kenichi Handa <handa@m17n.org>
14197
14198 * dispextern.h (struct glyph): Fix previous change. Change the
14199 bit length of glyphless.ch to 25 (Bug#11082).
14200
14201 2012-03-26 Chong Yidong <cyd@gnu.org>
14202
14203 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14204 (command_loop_1): Use it; inhibit selection update for
14205 handle-select-window too (Bug#8996).
14206
14207 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14208
14209 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
14210
14211 2012-03-25 Kenichi Handa <handa@m17n.org>
14212
14213 * dispextern.h (struct glyph): Change the bit length of
14214 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14215
14216 2012-03-24 Eli Zaretskii <eliz@gnu.org>
14217
14218 * s/ms-w32.h (tzname): Include time.h before redirecting to
14219 _tzname. Fixes the MSVC build. (Bug#9960)
14220
14221 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14222
14223 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14224 characters.
14225
14226 * xterm.c (XTread_socket): Only modify handling_signal if
14227 !SYNC_INPUT. (Bug#11080)
14228
14229 2012-03-23 Eli Zaretskii <eliz@gnu.org>
14230
14231 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14232 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14233 when fetching a multibyte character consumes more bytes than
14234 CHAR_BYTES returns, due to unification of CJK characters in
14235 string_char. (Bug#11073)
14236
14237 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14238
14239 * process.c (wait_reading_process_output): Handle pty disconnect
14240 by refraining from sending oneself a SIGCHLD (bug#10933).
14241
14242 2012-03-22 Chong Yidong <cyd@gnu.org>
14243
14244 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14245
14246 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
14247 Mark string as coming from a prefix property.
14248 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14249 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14250
14251 2012-03-21 Chong Yidong <cyd@gnu.org>
14252
14253 * xfaces.c (Vface_remapping_alist): Doc fix.
14254
14255 2012-03-20 Eli Zaretskii <eliz@gnu.org>
14256
14257 * w32proc.c (Fw32_set_console_codepage)
14258 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14259 Doc fixes.
14260
14261 2012-03-20 Chong Yidong <cyd@gnu.org>
14262
14263 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14264 to reflect default non-nil value of redisplay-dont-pause.
14265
14266 2012-03-19 Kenichi Handa <handa@m17n.org>
14267
14268 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14269 it fit in a valid range (Bug#11003).
14270
14271 2012-03-18 Eli Zaretskii <eliz@gnu.org>
14272
14273 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14274 that is not from display property, accept the row as a "cursor
14275 row" if one of the string's character has a non-nil `cursor'
14276 property. Fixes cursor positioning when there are newlines in
14277 overlay strings, e.g. in icomplete.el. (Bug#11035)
14278
14279 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14280
14281 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14282
14283 2012-03-12 Chong Yidong <cyd@gnu.org>
14284
14285 * eval.c (inhibit_lisp_code): Rename from
14286 inhibit_window_configuration_change_hook; move from window.c.
14287
14288 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14289 * window.c (run_window_configuration_change_hook)
14290 (syms_of_window): Callers changed.
14291
14292 2012-03-11 Chong Yidong <cyd@gnu.org>
14293
14294 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14295
14296 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14297
14298 2012-03-10 Chong Yidong <cyd@gnu.org>
14299
14300 * frame.c (other_visible_frames): Don't assume the selected frame
14301 is visible (Bug#10955).
14302
14303 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14304
14305 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14306
14307 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14308
14309 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14310 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14311 zero (Bug#10954).
14312
14313 2012-03-03 Glenn Morris <rgm@gnu.org>
14314
14315 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
14316
14317 2012-03-02 Eli Zaretskii <eliz@gnu.org>
14318
14319 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14320 position past the first glyph_row that ends at ZV. (Bug#10902)
14321 (redisplay_window, next_element_from_string): Fix typos in
14322 comments.
14323 (redisplay_window): Pass to move_it_vertically the margin in
14324 pixels, not in screen lines.
14325
14326 2012-03-02 Glenn Morris <rgm@gnu.org>
14327
14328 * buffer.c (buffer-list-update-hook): Doc fix.
14329
14330 2012-02-29 Eli Zaretskii <eliz@gnu.org>
14331
14332 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14333 push_it before setting up the iterator for the first overlay
14334 string, even if we have an empty string loaded.
14335 (next_overlay_string): If there's an empty string on the iterator
14336 stack, pop the stack. (Bug#10903)
14337
14338 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14339
14340 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14341 Suggested by Stefan Monnier in
14342 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14343 * alloc.c (widen_to_Lisp_Object): New static function.
14344 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14345 and widening them to Lisp_Objects. This would work even if
14346 USE_LSB_TAG is defined and wide integers are used, which might
14347 happen in a future version of Emacs.
14348
14349 2012-02-25 Chong Yidong <cyd@gnu.org>
14350
14351 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14352 Doc fix.
14353
14354 * xselect.c (Fx_selection_exists_p): Doc fix.
14355 (x_clipboard_manager_save_all): Print an informative message
14356 before saving to clipboard manager.
14357
14358 2012-02-24 Chong Yidong <cyd@gnu.org>
14359
14360 * keyboard.c (process_special_events): Handle all X selection
14361 requests in kbd_buffer, not just the next one (Bug#8869).
14362
14363 2012-02-23 Chong Yidong <cyd@gnu.org>
14364
14365 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14366 call when setting menu-bar-lines and tool-bar-lines parameters.
14367 (unwind_create_frame_1): New helper function.
14368
14369 * window.c (inhibit_window_configuration_change_hook): New var.
14370 (run_window_configuration_change_hook): Obey it.
14371 (syms_of_window): Initialize it.
14372
14373 2012-02-22 Chong Yidong <cyd@gnu.org>
14374
14375 * xterm.c (x_draw_image_relief): Add missing type check for
14376 Vtool_bar_button_margin (Bug#10743).
14377
14378 2012-02-21 Chong Yidong <cyd@gnu.org>
14379
14380 * fileio.c (Vfile_name_handler_alist): Doc fix.
14381
14382 * buffer.c (Fget_file_buffer): Protect against invalid file
14383 handler return value.
14384
14385 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14386
14387 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14388 when computing $valmask.
14389
14390 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14391 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14392 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14393 It's useless in that case, and it can cause problems on hosts
14394 that allocate halves of EMACS_INT values separately.
14395 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14396 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14397 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14398 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14399 it avoids undefined behavior on hosts where shifting right by more
14400 than the word width has undefined behavior.
14401
14402 2012-02-19 Chong Yidong <cyd@gnu.org>
14403
14404 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14405 (Funhandled_file_name_directory, Ffile_name_as_directory)
14406 (Fdirectory_file_name, Fexpand_file_name)
14407 (Fsubstitute_in_file_name): Protect against invalid file handler
14408 return values (Bug#10845).
14409
14410 2012-02-18 Eli Zaretskii <eliz@gnu.org>
14411
14412 * .gdbinit (pitx): Fix incorrect references to fields of the
14413 iterator stack.
14414
14415 2012-02-17 Chong Yidong <cyd@gnu.org>
14416
14417 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14418
14419 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14420
14421 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14422 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14423
14424 2012-02-15 Chong Yidong <cyd@gnu.org>
14425
14426 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14427 marked as special. Also, starting docstrings with * is obsolete.
14428
14429 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14430
14431 * gnutls.c (emacs_gnutls_write): Fix last change.
14432
14433 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14434
14435 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14436 send_process.
14437
14438 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14439
14440 * keymap.c (Fsingle_key_description): Handle char ranges.
14441
14442 2012-02-12 Chong Yidong <cyd@gnu.org>
14443
14444 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14445 as that creates a dangerous corner case.
14446
14447 * window.c (Fdelete_window_internal): Invalidate the mouse
14448 highlight (Bug#9904).
14449
14450 2012-02-12 Glenn Morris <rgm@gnu.org>
14451
14452 * xselect.c (Fx_own_selection_internal)
14453 (Fx_get_selection_internal, Fx_disown_selection_internal)
14454 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14455 * nsselect.m (Fx_own_selection_internal)
14456 (Fx_disown_selection_internal, Fx_selection_exists_p)
14457 (Fx_selection_owner_p, Fx_get_selection_internal):
14458 Sync docs and argument specs with the xselect.c versions.
14459
14460 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14461
14462 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14463
14464 2012-02-11 Eli Zaretskii <eliz@gnu.org>
14465
14466 * w32select.c (Fx_selection_exists_p): Sync doc string and
14467 argument list with xselect.c. (Bug#10783)
14468
14469 * w16select.c (Fx_selection_exists_p): Sync doc string and
14470 argument list with xselect.c. (Bug#10783)
14471
14472 2012-02-10 Glenn Morris <rgm@gnu.org>
14473
14474 * fns.c (Fsecure_hash): Doc fix.
14475
14476 2012-02-09 Kenichi Handa <handa@m17n.org>
14477
14478 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14479
14480 2012-02-07 Chong Yidong <cyd@gnu.org>
14481
14482 * buffer.c (Fbuffer_local_variables)
14483 (buffer_lisp_local_variables): Handle unbound vars correctly;
14484 don't let Qunbound leak into Lisp.
14485
14486 2012-02-07 Glenn Morris <rgm@gnu.org>
14487
14488 * image.c (Fimagemagick_types): Doc fix.
14489
14490 * image.c (imagemagick-render-type): Change it from a lisp object
14491 to an integer. Move the doc here from the lisp manual.
14492 Treat all values not equal to 0 the same.
14493
14494 2012-02-06 Chong Yidong <cyd@gnu.org>
14495
14496 * doc.c (store_function_docstring): Avoid applying docstring of
14497 alias to base function (Bug#2603).
14498
14499 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14500
14501 * .gdbinit (pp1, pv1): Remove redundant defines.
14502 (pr): Use pp.
14503
14504 2012-02-04 Chong Yidong <cyd@gnu.org>
14505
14506 * nsterm.m: Declare a global (Bug#10694).
14507
14508 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14509
14510 * w32.c (get_emacs_configuration_options):
14511 Include --enable-checking, if specified, in the return value.
14512
14513 2012-02-04 Martin Rudalics <rudalics@gmx.at>
14514
14515 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14516 after rounding frame sizes. (Bug#9723)
14517
14518 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14519
14520 * keyboard.c (adjust_point_for_property): Don't position point
14521 before BEGV. (Bug#10696)
14522
14523 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14524
14525 Handle overflow when computing char display width (Bug#9496).
14526 * character.c (char_width): Return EMACS_INT, not int.
14527 (char_width, c_string_width): Check for overflow when
14528 computing the width; this is possible now that individual
14529 characters can have unbounded width. Problem introduced
14530 by merge from Emacs 23 on 2012-01-19.
14531
14532 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
14533
14534 * dbusbind.c (Fdbus_register_method): Mention the return value
14535 :ignore in the docstring.
14536
14537 2012-02-02 Glenn Morris <rgm@gnu.org>
14538
14539 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14540
14541 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14542 Unconditionally set to t. (Bug#10673)
14543 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14544 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14545 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14546
14547 2012-02-02 Kenichi Handa <handa@m17n.org>
14548
14549 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14550 0, do not call append_composite_glyph.
14551
14552 2012-02-02 Kenichi Handa <handa@m17n.org>
14553
14554 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14555 NULL (Bug#6988).
14556 (x_produce_glyphs): If the component of a composition is a null
14557 string, set it->pixel_width to 1 to avoid zero-width glyph.
14558
14559 2012-02-01 Eli Zaretskii <eliz@gnu.org>
14560
14561 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14562 first 2 arguments are identical. This makes inserting large
14563 output from a subprocess an order of magnitude faster on
14564 MS-Windows, where all sbrk'ed memory is always contiguous.
14565
14566 2012-01-31 Glenn Morris <rgm@gnu.org>
14567
14568 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14569 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14570 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14571
14572 2012-01-29 Glenn Morris <rgm@gnu.org>
14573
14574 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14575
14576 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14577
14578 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14579
14580 2012-01-28 Chong Yidong <cyd@gnu.org>
14581
14582 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14583
14584 2012-01-26 Chong Yidong <cyd@gnu.org>
14585
14586 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14587
14588 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14589 repeat counts (Bug#10507).
14590
14591 2012-01-26 Glenn Morris <rgm@gnu.org>
14592
14593 * lread.c (syms_of_lread): Doc fix.
14594
14595 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14596
14597 * coding.c (encode_designation_at_bol): Change return value to
14598 EMACS_INT.
14599
14600 2012-01-25 Chong Yidong <cyd@gnu.org>
14601
14602 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14603
14604 2012-01-21 Chong Yidong <cyd@gnu.org>
14605
14606 * floatfns.c (Fcopysign): Make the second argument non-optional,
14607 since nil is not allowed anyway.
14608
14609 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14610
14611 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14612 (send_process): Likewise.
14613
14614 2012-01-19 Martin Rudalics <rudalics@gmx.at>
14615
14616 * window.c (save_window_save, Fcurrent_window_configuration)
14617 (Vwindow_persistent_parameters): Do not use Qstate.
14618 Rewrite doc-strings.
14619
14620 2012-01-19 Kenichi Handa <handa@m17n.org>
14621
14622 * character.c (char_width): New function.
14623 (Fchar_width, c_string_width, lisp_string_width):
14624 Use char_width (Bug#9496).
14625
14626 2012-01-16 Martin Rudalics <rudalics@gmx.at>
14627
14628 * window.c (Vwindow_persistent_parameters): New variable.
14629 (Fset_window_configuration, save_window_save): Handle persistent
14630 window parameters.
14631
14632 2012-01-14 Eli Zaretskii <eliz@gnu.org>
14633
14634 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14635 thrashing the stack of the thread. (Bug#9087)
14636
14637 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14638
14639 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14640
14641 2012-01-11 Eli Zaretskii <eliz@gnu.org>
14642
14643 * xdisp.c (rows_from_pos_range): Handle the case where the
14644 highlight ends on a newline. (Bug#10464)
14645 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14646 he end column for display of highlight that ends on a newline
14647 before a R2L line.
14648
14649 2012-01-11 Glenn Morris <rgm@gnu.org>
14650
14651 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14652 from load-path also when installation-directory is nil. (Bug#10208)
14653
14654 2012-01-10 Glenn Morris <rgm@gnu.org>
14655
14656 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14657
14658 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14659 Update template values to be closer to their typical values these days.
14660
14661 2012-01-09 Eli Zaretskii <eliz@gnu.org>
14662
14663 * xdisp.c (rows_from_pos_range): Accept additional argument
14664 DISP_STRING, and accept any glyph in a row whose object is that
14665 string as eligible for mouse highlight. Fixes mouse highlight of
14666 display strings from overlays. (Bug#10464)
14667
14668 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
14669
14670 emacs: fix an auto-save permissions race condition (Bug#10400)
14671 * fileio.c (auto_saving_dir_umask): New static var.
14672 (Fmake_directory_internal): Use it.
14673 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14674 creating the directory. The old code temporarily assigns
14675 too-generous permissions to the directory.
14676 (do_auto_save_eh): Clear it.
14677 (Fdo_auto_save): Catch all errors, not just file errors, so
14678 that the var is always cleared.
14679
14680 2012-01-07 Eli Zaretskii <eliz@gnu.org>
14681
14682 * search.c (scan_buffer): Pass character positions to
14683 know_region_cache, not byte positions. (Bug#6540)
14684
14685 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
14686
14687 * w32.c (sys_rename): Report EXDEV when rename of a directory
14688 fails because the target is on another logical disk. (Bug#10284)
14689
14690 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14691
14692 * xterm.c (x_embed_request_focus): New function.
14693
14694 * xterm.h: Add prototype.
14695
14696 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14697
14698 2012-01-05 Glenn Morris <rgm@gnu.org>
14699
14700 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14701
14702 2012-01-01 Eli Zaretskii <eliz@gnu.org>
14703
14704 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14705 Load gnutls_transport_set_lowat only if GnuTLS version is below
14706 2.11.1.
14707 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14708 GnuTLS versions below 2.11.1.
14709
14710 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14711
14712 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14713 to the doc string advising against its use for altering the way
14714 windows are scrolled.
14715
14716 2011-12-28 Kenichi Handa <handa@m17n.org>
14717
14718 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14719 coding-system ASCII compatible only when it does not produce BOM
14720 on encoding (Bug#10383).
14721
14722 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14723
14724 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14725 can scroll.
14726 (create_and_show_popup_menu): Always use menu_position_func for
14727 Gtk3 (Bug#10361).
14728
14729 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14730
14731 * callint.c (Fcall_interactively): Don't truncate prompt string.
14732
14733 2011-12-23 Eli Zaretskii <eliz@gnu.org>
14734
14735 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14736 property that ends at ZV, so that the bidi iteration could be
14737 resumed from there (after widening). (Bug#10360)
14738
14739 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14740
14741 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14742
14743 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14744
14745 * nsterm.m (x_free_frame_resources):
14746 Release f->output_data.ns->miniimage.
14747 (ns_index_color): Fix indentation. Do not retain
14748 color_table->colors[i].
14749
14750 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14751 before returning.
14752
14753 * nsfns.m (x_set_background_color): Assign return value from
14754 ns_index_color to face-background instead of NSColor*.
14755 (ns_implicitly_set_icon_type): Fix indentation.
14756 Change assignment in for loop to comparison.
14757
14758 * emacs.c (ns_pool): New variable.
14759 (main): Assign ns_pool.
14760 (Fkill_emacs): Call ns_release_autorelease_pool.
14761
14762 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14763 autorelease fdesc, release fdAttrs and tdict.
14764 (ns_get_covering_families): Release charset.
14765 (ns_findfonts): Release NSFontDescriptor created with new.
14766 (ns_uni_to_glyphs): Fix indentation.
14767 (setString): Release attrStr before assigning new value.
14768
14769 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14770
14771 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14772 and NS_IMPL_COCOA.
14773 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14774 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14775
14776 2011-12-18 David Reitter <reitter@cmu.edu>
14777
14778 * nsterm.m (ns_term_init): Subscribe for notifications
14779 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14780 to method trackingNotification in EmacsMenu.
14781
14782 * nsmenu.m (trackingMenu): New variable.
14783 (trackingNotification): New method (from Aquamacs).
14784 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
14785 from Aquamacs (Bug#7030).
14786
14787 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14788
14789 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14790 (symbol_to_nsstring): Fix indentation.
14791 (ns_symbol_to_pb): New function.
14792 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14793 (Fns_rotate_cut_buffers_internal): Remove.
14794 (Fns_store_selection_internal): Rename from
14795 Fns_store_cut_buffer_internal.
14796 (ns_get_foreign_selection, Fx_own_selection_internal)
14797 (Fx_disown_selection_internal, Fx_selection_exists_p)
14798 (Fns_get_selection_internal, Fns_store_selection_internal):
14799 Use ns_symbol_to_pb and check if return value is nil.
14800 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14801 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
14802 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14803 renamed to Sns_store_selection_internal.
14804 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14805 and remove this function.
14806 (ns_handle_selection_clear): Remove, never used.
14807 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14808 here.
14809
14810 2011-12-17 Ken Brown <kbrown@cornell.edu>
14811
14812 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14813 GID is unknown (Bug#10257).
14814
14815 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14816
14817 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14818 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14819 which caused a build failure on GNU/Linux IA-64. This problem was
14820 introduced by my 2011-10-07 patch.
14821
14822 2011-12-15 Juri Linkov <juri@jurta.org>
14823
14824 * image.c (imagemagick_error): New function. (Bug#10112)
14825 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14826 Use `imagemagick_error' where ImageMagick functions return
14827 `MagickFalse'.
14828 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14829 proper order.
14830
14831 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14832
14833 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14834 fill background (Bug#8992).
14835
14836 2011-12-13 Martin Rudalics <rudalics@gmx.at>
14837
14838 * window.c (Vwindow_combination_resize)
14839 (Vwindow_combination_limit): Use t instead of non-nil in
14840 doc-strings.
14841 (Vrecenter_redisplay): Add first sentence of doc-string on
14842 separate line.
14843 (Frecenter): Fix doc-string typo.
14844
14845 2011-12-11 Kenichi Handa <handa@m17n.org>
14846
14847 * coding.c (Funencodable_char_position): Pay attention to the
14848 buffer text relocation (Bug#9389).
14849
14850 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14851
14852 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14853 gtk_init (Bug#10100).
14854
14855 2011-12-10 Eli Zaretskii <eliz@gnu.org>
14856
14857 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14858 IT->string is nil. (Bug#10263)
14859
14860 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14861
14862 * nsterm.h (x_free_frame_resources): Declare.
14863
14864 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14865 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14866
14867 * nsterm.h (ns_get_defaults_value): Declare.
14868
14869 * nsterm.m (ns_default): Call ns_get_defaults_value.
14870
14871 2011-12-09 Eli Zaretskii <eliz@gnu.org>
14872
14873 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14874 (Bug#10170)
14875
14876 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14877
14878 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14879 that where the value of an _OBJC_* symbol points to is in the .bss
14880 section (Bug#10240).
14881
14882 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14883
14884 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
14885 after the loop to call ccl_driver at least once (Bug#8619).
14886
14887 2011-12-08 Kenichi Handa <handa@m17n.org>
14888
14889 * ftfont.c (get_adstyle_property): Fix previous change
14890 (Bug#10233).
14891
14892 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
14893
14894 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14895 dirs from the default value of EMACSLOADPATH (bug#10208).
14896
14897 2011-12-07 Glenn Morris <rgm@gnu.org>
14898
14899 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14900 installation and source directories as well. (Bug#10208)
14901
14902 2011-12-06 Chong Yidong <cyd@gnu.org>
14903
14904 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14905
14906 2011-12-06 Glenn Morris <rgm@gnu.org>
14907
14908 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14909 as an error, not just -1. (Bug#10217)
14910
14911 2011-12-05 Chong Yidong <cyd@gnu.org>
14912
14913 * keyboard.c (process_special_events): New function.
14914 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14915
14916 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14917
14918 * coding.c (encode_designation_at_bol): Don't use uninitialized
14919 local variable (Bug#9318).
14920
14921 2011-12-05 Kenichi Handa <handa@m17n.org>
14922
14923 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14924 return Qnil (Bug#8046, Bug#10193).
14925
14926 2011-12-05 Kenichi Handa <handa@m17n.org>
14927
14928 * coding.c (encode_designation_at_bol): New args charbuf_end and
14929 dst. Return the number of produced bytes. Callers changed.
14930 (coding_set_source): Return how many bytes coding->source was
14931 relocated.
14932 (coding_set_destination): Return how many bytes
14933 coding->destination was relocated.
14934 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
14935 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
14936
14937 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14938
14939 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14940 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14941 macro (Bug#9318).
14942
14943 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14944
14945 The following changes are to fix Bug#9318.
14946
14947 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
14948 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14949 (encode_coding_iso_2022, encode_coding_sjis)
14950 (encode_coding_big5, encode_coding_charset): Use the above macros.
14951
14952 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
14953
14954 * lisp.h (process_quit_flag): Fix external declaration.
14955
14956 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14957
14958 Don't macro-inline non-performance-critical code.
14959 * eval.c (process_quit_flag): New function.
14960 * lisp.h (QUIT): Use it.
14961
14962 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14963
14964 * nsfns.m (get_geometry_from_preferences): New function.
14965 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14966
14967 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14968
14969 * emacs.c (Qkill_emacs): Define.
14970 (syms_of_emacs): Initialize it.
14971 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14972 Qquit_flag to `kill-emacs' instead.
14973 (quit_throw_to_read_char): Add parameter `from_signal'.
14974 All callers changed. Call Fkill_emacs if requested and safe.
14975 * lisp.h (QUIT): Call Fkill_emacs if requested.
14976
14977 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14978
14979 * widget.c (update_wm_hints): Return if wmshell is null.
14980 (widget_update_wm_size_hints): New function.
14981
14982 * widget.h (widget_update_wm_size_hints): Declare.
14983
14984 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14985 widget_update_wm_size_hints (Bug#10104).
14986
14987 2011-12-03 Eli Zaretskii <eliz@gnu.org>
14988
14989 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14990 before a newline, prepare the bidi iterator for consuming the
14991 newline, and keep the current paragraph direction. (Bug#10183)
14992 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
14993
14994 2011-12-02 Juri Linkov <juri@jurta.org>
14995
14996 * search.c (Fword_search_regexp): New Lisp function created from
14997 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14998 (Fword_search_backward, Fword_search_forward)
14999 (Fword_search_backward_lax, Fword_search_forward_lax):
15000 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15001 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15002
15003 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15004
15005 * fileio.c (Finsert_file_contents): Move after-change-function call
15006 to before the "handled:" label, since all "goto handled" appear in
15007 cases where the *-change-functions have already been properly called
15008 (bug#10117).
15009
15010 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15011
15012 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15013 waiting for input. (Bug#10169)
15014
15015 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15016
15017 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15018 verifies glyph row's hash code--we have just reallocated the
15019 glyphs, so their contents can be complete garbage. (Bug#10164)
15020
15021 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15022
15023 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15024
15025 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15026
15027 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15028 attributes are tested _before_ calling verify_row_hash, to protect
15029 against GCC re-ordering of the tests. (Bug#10164)
15030
15031 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15032
15033 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15034
15035 * xterm.c (handle_one_xevent): Only set async_visible and friends
15036 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15037 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15038 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15039
15040 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15041
15042 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15043 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15044 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15045 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15046 All uses changed to use GCPRO1 etc.
15047 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15048 Revert to old implementation (i.e., before 2011-03-11).
15049
15050 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15051
15052 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15053 of scroll runs so as to avoid assigning disabled bogus rows and
15054 unnecessary graphics copy operations.
15055
15056 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15057
15058 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15059 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15060 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15061 (malloc, free, realloc, calloc): Redirect to e_* only when
15062 compiling Emacs.
15063
15064 * lisp.h (GCTYPEBITS): Move before first use.
15065 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15066 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15067 this macro definition.
15068
15069 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15070 _MSC_VER.
15071
15072 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15073
15074 * gtkutil.c (xg_create_frame_widgets):
15075 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15076 present with Gtk+ 2.0.
15077
15078 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15079
15080 * fileio.c (Finsert_file_contents): Undo previous change; see
15081 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15082
15083 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15084
15085 Rename locals to avoid shadowing.
15086 * fileio.c (Finsert_file_contents):
15087 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15088 * process.c (wait_reading_process_output):
15089 Rename inner 'proc' to 'p' to avoid shadowing.
15090 Indent for consistency with usual Emacs style.
15091
15092 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15093
15094 * xdisp.c (redisplay_window): If cursor row is not fully visible
15095 after recentering, and scroll-conservatively is set to a large
15096 number, scroll window by a few more lines to make the cursor fully
15097 visible and out of scroll-margin. (Bug#10105)
15098 (start_display): Don't move to the next line if the display should
15099 start at a newline that is part of a display vector or an overlay
15100 string. (Bug#10119)
15101
15102 2011-11-24 Juri Linkov <juri@jurta.org>
15103
15104 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15105 after the `MagickPingImage' call. (Bug#10112)
15106
15107 2011-11-23 Chong Yidong <cyd@gnu.org>
15108
15109 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15110
15111 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15112
15113 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15114 making another buffer current. (Bug#10114)
15115
15116 2011-11-23 Glenn Morris <rgm@gnu.org>
15117
15118 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15119
15120 2011-11-23 Chong Yidong <cyd@gnu.org>
15121
15122 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15123 using it (Bug#5984).
15124
15125 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15126
15127 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15128 and header-lines, as they don't have one computed for them.
15129 (Bug#10098)
15130
15131 * .gdbinit (prow): Make displayed values more self-explaining.
15132 Add row's hash code.
15133
15134 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15135
15136 * process.c (wait_reading_process_output): Fix asynchrounous
15137 GnuTLS socket handling on some versions of the GnuTLS library.
15138 (wait_reading_process_output): Add comment and URL.
15139
15140 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15141
15142 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15143
15144 2011-11-21 Chong Yidong <cyd@gnu.org>
15145
15146 * window.c (Fnext_window, Fprevious_window): Doc fix.
15147
15148 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15149
15150 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15151
15152 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15153
15154 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15155
15156 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15157
15158 * window.c (Fset_window_combination_limit): Rename argument
15159 STATUS to LIMIT.
15160 (Vwindow_combination_limit): Remove "status" from doc-string.
15161
15162 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15163
15164 * m/ibms390.h: Remove.
15165 * m/ibms390x.h: Don't include "ibms390.h".
15166
15167 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15168
15169 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15170 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15171
15172 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15173
15174 * casetab.c (Fset_case_table):
15175 * charset.c (Fcharset_after): Fix typos.
15176
15177 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15178
15179 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15180 Otherwise, valgrind does not work on some platforms.
15181 Problem reported by Andreas Schwab in
15182 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15183 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15184 is set, removing the need for VIRT_ADDRESS_VARIES.
15185 (PURE_P): Use a more-efficient implementation that needs just one
15186 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15187 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15188 to 4 (xorl, subq, cmpq, setbe).
15189 * alloc.c (pure): Always extern now, since that's the
15190 VIRT_ADDR_VARIES behavior.
15191 (PURE_POINTER_P): Use a single comparison, not two, for
15192 consistency with the new puresize.h.
15193 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15194 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15195 Remove VIRT_ADDR_VARIES no longer needed.
15196
15197 2011-11-19 Eli Zaretskii <eliz@gnu.org>
15198
15199 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15200 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15201 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15202 behave as if the cursor position were at the window margin.
15203
15204 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15205 and the cursor position is out of bounds, behave as if the cursor
15206 position were at the window margin. (Bug#10075)
15207
15208 2011-11-18 Chong Yidong <cyd@gnu.org>
15209
15210 * window.c (Fwindow_combination_limit): Make first argument
15211 non-optional, since it is meaningless for live windows like the
15212 selected window.
15213
15214 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15215
15216 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15217
15218 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15219
15220 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15221 (graft_intervals_into_buffer): Simplify.
15222
15223 2011-11-18 Eli Zaretskii <eliz@gnu.org>
15224
15225 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15226 hash values of the two rows.
15227 (copy_row_except_pointers): Preserve the used[] arrays and the
15228 hash values of the two rows. (Bug#10035)
15229 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
15230
15231 * xdisp.c (row_hash): New function, body extracted from
15232 compute_line_metrics.
15233 (compute_line_metrics): Call row_hash, instead of computing the
15234 hash code inline.
15235
15236 * dispnew.c (verify_row_hash): Call row_hash for computing the
15237 hash code of a row, instead of duplicating code from xdisp.c.
15238
15239 * dispextern.h (row_hash): Add prototype.
15240
15241 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15242
15243 * frame.c (delete_frame): Don't delete the terminal when the last
15244 X frame is closed if emacs is built with GTK toolkit.
15245
15246 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
15247
15248 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15249
15250 2011-11-17 Martin Rudalics <rudalics@gmx.at>
15251
15252 * window.c (Vwindow_splits): Rename to
15253 Vwindow_combination_resize. Suggested by Juri Linkov.
15254 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15255 of Vwindow_splits.
15256
15257 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
15258
15259 * nsfns.m (Fns_font_name):
15260 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
15261
15262 2011-11-16 Martin Rudalics <rudalics@gmx.at>
15263
15264 * window.h (window): Rename slot "nest" to "combination_limit".
15265 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15266 (Fset_window_nest): Rename to Fset_window_combination_limit.
15267 (Vwindow_nest): Rename to Vwindow_combination_limit.
15268 (recombine_windows, make_parent_window, make_window)
15269 (Fsplit_window_internal, saved_window)
15270 (Fset_window_configuration, save_window_save): Rename all
15271 occurrences of window_nest to window_combination_limit.
15272
15273 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
15274
15275 * image.c (imagemagick_load_image): Fix typo.
15276
15277 2011-11-14 Eli Zaretskii <eliz@gnu.org>
15278
15279 * xdisp.c (display_line): Move the call to
15280 highlight_trailing_whitespace before the call to
15281 compute_line_metrics, since the latter needs to see the final
15282 faces of all the glyphs to compute ROW's hash value.
15283 Fixes assertion violations in row_equal_p. (Bug#10035)
15284
15285 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
15286
15287 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15288 just return (bug#10044).
15289
15290 2011-11-12 Eli Zaretskii <eliz@gnu.org>
15291
15292 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15293 with user-defined heap size. Bump the default size of the temacs
15294 heap to 27MB, to avoid memory warning when running temacs.
15295 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15296
15297 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15298 current_matrix and desired_matrix. (Bug#9990)
15299 (verify_row_hash) [XASSERTS]: New function.
15300 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15301 that the hash value of glyph rows is correct.
15302
15303 2011-11-12 Martin Rudalics <rudalics@gmx.at>
15304
15305 * window.h (window): Remove splits slot.
15306 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15307 (Fdelete_other_windows_internal, make_parent_window)
15308 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15309 (Fset_window_configuration, save_window_save): Don't deal with
15310 split status of windows.
15311 (saved_window): Remove splits slot.
15312 (Vwindow_splits): Rewrite doc-string.
15313
15314 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15315
15316 * xfns.c (unwind_create_frame):
15317 * nsfns.m (unwind_create_frame):
15318 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15319 Vframe_list (Bug#9999).
15320
15321 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15322
15323 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
15324
15325 2011-11-11 Kenichi Handa <handa@m17n.org>
15326
15327 * callproc.c (Fcall_process): Set the member dst_multibyte of
15328 process_coding.
15329
15330 2011-11-11 Johan Bockgård <bojohan@gnu.org>
15331
15332 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15333 avoid a crash (bug#9496).
15334
15335 2011-11-09 Chong Yidong <cyd@gnu.org>
15336
15337 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15338 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15339
15340 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15341
15342 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15343
15344 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15345
15346 Avoid some portability problems by eschewing 'extern inline' functions.
15347 The trivial performance wins aren't worth the portability hassles; see
15348 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15349 et seq.
15350 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15351 (window_box_width, window_box_left, window_box_left_offset)
15352 (window_box_right, window_box_right_offset): Undo previous change,
15353 by removing the "extern"s.
15354 * intervals.c (adjust_intervals_for_insertion)
15355 (adjust_intervals_for_deletion): Undo previous change,
15356 making these static again.
15357 (offset_intervals, temp_set_point_both, temp_set_point)
15358 (copy_intervals_to_string): No longer inline.
15359 * xdisp.c (window_text_bottom_y, window_box_width)
15360 (window_box_height, window_box_left_offset)
15361 (window_box_right_offset, window_box_left, window_box_right)
15362 (window_box): No longer inline.
15363
15364 2011-11-08 Chong Yidong <cyd@gnu.org>
15365
15366 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
15367 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15368 Signal an error if not a live window.
15369 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15370 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15371
15372 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
15373
15374 * lisp.h (syms_of_abbrev): Remove declaration.
15375 Reported by CHENG Gao <chenggao@royau.me>.
15376
15377 2011-11-07 Eli Zaretskii <eliz@gnu.org>
15378
15379 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15380 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15381 of temacs in GUI mode.
15382
15383 2011-11-07 Martin Rudalics <rudalics@gmx.at>
15384
15385 * window.h: Declare delete_all_child_windows instead of
15386 delete_all_subwindows.
15387 * window.c (Fwindow_nest, Fset_window_nest)
15388 (Fset_window_new_total, Fset_window_new_normal)
15389 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15390 (delete_all_subwindows): Rename to delete_all_child_windows.
15391 (Fdelete_other_windows_internal, Fset_window_configuration):
15392 Call delete_all_child_windows instead of delete_all_subwindows.
15393 * frame.c (delete_frame): Call delete_all_child_windows instead
15394 of delete_all_subwindows.
15395
15396 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15397
15398 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15399 This is also needed for porting to any host where GC_MARK_STACK is
15400 not GC_MAKE_GCPROS_NOOPS.
15401 (which_symbols): Use it.
15402
15403 2011-11-07 Kenichi Handa <handa@m17n.org>
15404
15405 * coding.c (coding_set_destination): Check coding->src_pos only
15406 when coding->src_object is a buffer (bug#9910).
15407
15408 * process.c (send_process): Set the member src_multibyte of coding
15409 to 0 (bug#9911) when sending a unibyte text.
15410
15411 * callproc.c (Fcall_process): Set the member src_multibyte of
15412 process_coding to 0 (bug#9912).
15413
15414 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15415
15416 * xmenu.c (cleanup_widget_value_tree): New function.
15417 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15418 calling free_menubar_widget_value_tree directly (Bug#9830).
15419
15420 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15421
15422 Fix some portability problems with 'inline'.
15423 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15424 (window_box_width, window_box_left, window_box_left_offset)
15425 (window_box_right, window_box_right_offset): Declare extern.
15426 Otherwise, these inline functions do not conform to C99 and
15427 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15428 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15429 * intervals.c (adjust_intervals_for_insertion)
15430 (adjust_intervals_for_deletion): Now extern, because otherwise the
15431 extern inline functions 'offset_intervals' couldn't refer to it.
15432 (static_offset_intervals): Remove.
15433 (offset_intervals): Rewrite using the old contents of
15434 static_offset_intervals. The old version didn't conform to C99
15435 because an extern inline function contained a reference to an
15436 identifier with static linkage.
15437
15438 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15439
15440 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15441 GC.
15442
15443 2011-11-06 Eli Zaretskii <eliz@gnu.org>
15444
15445 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15446 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15447 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15448 return Qleft_to_right.
15449
15450 2011-11-06 Chong Yidong <cyd@gnu.org>
15451
15452 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15453 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15454 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15455 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15456 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15457 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15458 (Fwindow_vscroll): Doc fix.
15459 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15460 argument, since it makes no sense to pass a live window and for
15461 consistency with window-child.
15462
15463 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15464
15465 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15466 support MSVC.
15467
15468 2011-11-05 Jason Rumney <jasonr@gnu.org>
15469
15470 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15471 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15472 fonts (Bug#6029).
15473 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15474 bitwise arithmetic preventing use of unicode-sip and non-truetype
15475 opentype fonts.
15476
15477 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15478
15479 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15480 "emacs"-only part.
15481
15482 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15483 initialization code to keep similarity to xfns.c after changes
15484 from 2011-11-05.
15485
15486 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15487
15488 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15489 (unwind_create_frame): New function (Bug#9943).
15490 (Fx_create_frame): Restructure code to be more similar to the one in
15491 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15492 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15493 Move terminal->reference_count++ just before making the frame official
15494 (Bug#9943).
15495
15496 * nsterm.m (x_free_frame_resources): New function.
15497 (x_destroy_window): Move code to x_free_frame_resources.
15498
15499 * xfns.c (unwind_create_frame): Fix comment.
15500 (Fx_create_frame, x_create_tip_frame):
15501 Move terminal->reference_count++ just before making the frame
15502 official. Move initialization of image_cache_refcount and
15503 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15504
15505 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15506
15507 Support MSVC build with newer versions of Visual Studio.
15508 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15509 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15510 nt/gmake.defs.
15511
15512 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15513 which are not supported by MSVC.
15514 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15515 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15516 bitfields.
15517 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15518 types in bitfields.
15519 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15520
15521 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15522
15523 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
15524
15525 Support MSVC build with newer versions of Visual Studio.
15526 * w32.c: Don't include w32api.h for MSVC.
15527 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15528
15529 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15530 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15531 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15532 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15533 e_* cousins.
15534 (alloca) [_MSC_VER]: Define to _alloca.
15535
15536 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15537
15538 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15539
15540 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15541
15542 * xdisp.c (note_mouse_highlight): If either of
15543 previous/next-single-property-change returns nil, treat that as
15544 the beginning or the end of the buffer. (Bug#9955)
15545
15546 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15547
15548 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
15549 label is not null (Bug#9951).
15550 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15551 may be NULL.
15552
15553 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15554
15555 * window.c (Fwindow_body_size): Mention in the doc string that the
15556 return value is in frame's canonical units. (Bug#9949)
15557
15558 2011-11-03 Eli Zaretskii <eliz@gnu.org>
15559
15560 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15561
15562 * w32fns.c (unwind_create_frame): If needed, free the glyph
15563 matrices of the partially constructed frame. (Bug#9943)
15564 * xfns.c (unwind_create_frame): Likewise.
15565
15566 2011-11-01 Eli Zaretskii <eliz@gnu.org>
15567
15568 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15569 Don't stop backward scan on the continuation glyph, even though
15570 its CHARPOS is positive.
15571 (mouse_face_from_buffer_pos, note_mouse_highlight):
15572 Rename cover_string to disp_string.
15573
15574 2011-11-01 Martin Rudalics <rudalics@gmx.at>
15575
15576 * window.c (temp_output_buffer_show): Don't use
15577 Vtemp_buffer_show_specifiers.
15578 (Vtemp_buffer_show_specifiers): Remove unused variable.
15579
15580 2011-10-30 Eli Zaretskii <eliz@gnu.org>
15581
15582 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15583 past the beginning of the current glyph matrix.
15584
15585 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
15586
15587 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15588 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15589 HAVE_GTK3 (Bug#9869).
15590
15591 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15592 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15593
15594 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15595
15596 * xterm.c: Declare x_handle_net_wm_state to return int.
15597 (handle_one_xevent): Check if we are iconified but don't have
15598 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15599 (get_current_wm_state): Return non-zero if not hidden,
15600 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15601 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15602 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15603 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15604
15605 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15606
15607 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15608 so that this new function doesn't get optimized away by a
15609 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15610
15611 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15612
15613 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15614
15615 2011-10-29 Eli Zaretskii <eliz@gnu.org>
15616
15617 Fix the `xbytecode' command.
15618 * .gdbinit (xprintbytestr): New command.
15619 (xwhichsymbols): Rename from `which'; all callers changed.
15620 (xbytecode): Print the byte-code string as well.
15621
15622 2011-10-29 Kim Storm <storm@cua.dk>
15623
15624 * alloc.c (which_symbols): New function.
15625
15626 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15627
15628 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15629 line. (Bug#9903)
15630
15631 2011-10-29 Glenn Morris <rgm@gnu.org>
15632
15633 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15634 Not clear what it was for, and it causes various bugs. (Bug#9839)
15635
15636 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15637
15638 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15639 possible random value that matches one of those tested as
15640 condition to clear the mouse face.
15641
15642 2011-10-28 Chong Yidong <cyd@gnu.org>
15643
15644 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15645
15646 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15647
15648 * window.c (make_window): Initialize phys_cursor_on_p.
15649
15650 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15651
15652 * lisp.h (struct Lisp_Symbol): Update comments.
15653
15654 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
15655
15656 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15657
15658 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15659
15660 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15661 <oslsachem@gmail.com> for helping to debug this.
15662
15663 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15664 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15665 (g_b_init_get_glyph_outline_w): New static variables.
15666 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15667 (GetGlyphOutlineW_Proc): New typedefs.
15668 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
15669 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15670 New functions.
15671 (w32font_open_internal, compute_metrics):
15672 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
15673 instead of calling the "wide" APIs directly.
15674
15675 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15676
15677 * w32.h (syms_of_w32font): Add prototype.
15678
15679 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15680
15681 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15682 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15683 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15684 (Fmove_to_window_line): Doc fix.
15685
15686 2011-10-27 Chong Yidong <cyd@gnu.org>
15687
15688 * process.c (make_process): Set gnutls_state to NULL.
15689
15690 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15691 non-NULL, regardless of GNUTLS_INITSTAGE.
15692 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15693 an error. Set process slots as soon as we allocate them.
15694
15695 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15696
15697 2011-10-27 Chong Yidong <cyd@gnu.org>
15698
15699 * gnutls.c (emacs_gnutls_deinit): New function.
15700 Deallocate credentials structures as well as calling gnutls_deinit.
15701 (Fgnutls_deinit, Fgnutls_boot): Use it.
15702
15703 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15704 (deactivate_process): Call emacs_gnutls_deinit.
15705
15706 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15707
15708 * image.c (x_create_x_image_and_pixmap):
15709 * w32.c (sys_rename, w32_delayed_load):
15710 * w32font.c (fill_in_logfont):
15711 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15712
15713 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
15714
15715 * w32fns.c (w32_default_color_map): New function,
15716 extracted from Fw32_default_color_map.
15717 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
15718
15719 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15720
15721 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15722
15723 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15724
15725 * keyboard.c (test_undefined): New function (bug#9751).
15726 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15727
15728 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15729
15730 * sysdep.c (init_sys_modes): Fix the check for the controlling
15731 terminal (Bug#6649).
15732
15733 2011-10-20 Eli Zaretskii <eliz@gnu.org>
15734
15735 * dispextern.h (struct bidi_it): New member next_en_type.
15736
15737 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15738 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15739 current character, check also for next_en_type being WEAK_EN.
15740 (bidi_resolve_weak): Don't enter the expensive loop if the current
15741 position is before next_en_pos. Record the bidi type of the first
15742 non-ET, non-BN character we find, in addition to its position.
15743 (bidi_level_of_next_char): Invalidate next_en_type when
15744 next_en_pos is over-stepped.
15745
15746 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15747
15748 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15749 * editfns.c: Rewrite current-time-zone so that it invokes
15750 the equivalent of (format-time-string "%Z") to get the time zone name.
15751 This fixes a bug when the time zone name contains characters that
15752 need converting from the system time locale to Emacs internal format.
15753 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15754 that patch fixed format-time-string to do the conversion, but
15755 I forgot to fix current-time-zone.
15756 (format_time_string): New function, containing most of
15757 what Fformat_time_string used to contain.
15758 (Fformat_time_string): Rewrite in terms of format_time_string.
15759 This doesn't change this function's behavior.
15760 (current-time-zone): Rewrite to use format_time_string.
15761 This fixes the bug reported by Michael Schierl in
15762 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15763 Jason Rumney's 2007-06-07 change worked around this bug, but
15764 didn't fix it.
15765 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15766
15767 2011-10-19 Eli Zaretskii <eliz@gnu.org>
15768
15769 * xdisp.c (start_display): If the character at POS is displayed
15770 via a display vector, reset IT->current.dpvec_index to zero.
15771 (try_window_reusing_current_matrix): If a line ends in a display
15772 vector or the next line starts in a display vector, continue
15773 redrawing the window even though the character position of
15774 start_row was reached.
15775 (Bug#9771, part 2)
15776
15777 2011-10-18 Chong Yidong <cyd@gnu.org>
15778
15779 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15780 with nobreak-char-display too.
15781
15782 2011-10-18 Eli Zaretskii <eliz@gnu.org>
15783
15784 Fix part 3 of bug#9771.
15785 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15786 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15787 non-neutral characters if the current character is a paragraph
15788 separator (a.k.a. Newline). This avoids running the same
15789 expensive loop twice, once when we consume the preceding newline
15790 and the other time when the line actually needs to be displayed.
15791 Avoid the loop when we see neutrals on the base embedding level
15792 following a character whose directionality is the same as the
15793 paragraph's. This avoids running the expensive loop when a line
15794 ends in a long sequence of neutrals, like control characters.
15795 Add assertion against STRONG_AL type. Slightly rearrange code
15796 that determines the type of a neutral given the first non-neutral
15797 that follows it.
15798 (bidi_level_of_next_char): Set next_en_pos to zero when
15799 invalidating its info.
15800
15801 2011-10-17 Eli Zaretskii <eliz@gnu.org>
15802
15803 * xdisp.c (push_display_prop): Determine whether to record string
15804 or buffer position by IT->string, not by IT->method. Allow
15805 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
15806 (move_it_vertically_backward): Don't look for character position
15807 immediately after the newline when in a continuation line.
15808 (Bug#9771, part 1)
15809
15810 2011-10-15 Martin Rudalics <rudalics@gmx.at>
15811
15812 * window.c (coordinates_in_window): Rewrite and delabelize
15813 vertical border check. (Bug#5357) (Bug#9618)
15814
15815 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15816
15817 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15818 errors in XSetWindowBorder (bug#9310).
15819
15820 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15821
15822 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15823 avoid crash when xmalloc overrun checking is enabled.
15824
15825 2011-10-13 Eli Zaretskii <eliz@gnu.org>
15826
15827 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15828 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15829 cursor motion with <left> and <right> arrow keys.
15830
15831 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15832 some callers set that themselves.
15833
15834 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15835
15836 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15837 display string and the previous row comes from the same string and
15838 is empty. (Bug#9739) (Bug#9738)
15839
15840 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15841
15842 * doc.c (get_doc_string): Encode file name (bug#9735).
15843
15844 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15845
15846 * bidi.c (bidi_level_of_next_char):
15847 * xdisp.c (get_visually_first_element): Remove old incorrect
15848 comments regarding the Unicode Line Separator character.
15849
15850 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15851
15852 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15853
15854 * alloc.c (Fgc_status): Do not access beyond zombies array
15855 boundary if nzombies > MAX_ZOMBIES.
15856 * alloc.c (dump_zombies): Add missing format specifier.
15857
15858 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15859
15860 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15861 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15862
15863 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15864 Some packages use them to denote characters with modifiers.
15865
15866 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15867
15868 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15869 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15870 matching a pp-number. Rename parameter var to var1.
15871
15872 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15873
15874 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15875
15876 2011-10-08 Glenn Morris <rgm@gnu.org>
15877
15878 * callint.c (Fcall_interactively): Give a more explicit error for the
15879 'c' case with a non-character input. (Bug#8479)
15880
15881 2011-10-08 Eli Zaretskii <eliz@gnu.org>
15882
15883 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15884 lines.
15885 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15886 lines that are hscrolled on the left.
15887
15888 * dispnew.c (buffer_posn_from_coords): Account for a possible
15889 presence of header-line. (Bug#4426)
15890
15891 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15892
15893 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15894 Don't advertise functionality which we discourage or doesn't work.
15895
15896 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15897
15898 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15899 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15900 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15901 this makes Emacs dump core during garbage collection on rare
15902 occasions. sizeof is obviously inferior to offsetof here, so
15903 stick with offsetof.
15904 (GC_POINTER_ALIGNMENT): New macro.
15905 (mark_memory): Omit 3rd (offset) arg; caller changed.
15906 Don't assume EMACS_INT alignment is the same as pointer alignment.
15907
15908 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15909
15910 * keyboard.c (read_key_sequence_remapped): New var.
15911 (read_key_sequence): Compute remapping in the right buffer.
15912 (command_loop_1): Use read_key_sequence's remapping directly.
15913
15914 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15915
15916 * dired.c (file_name_completion): Don't expand file name.
15917 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15918 before checking file name handler.
15919
15920 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15921 they've been requested explicitly (bug#9591).
15922
15923 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
15924
15925 * keymap.c (Fsingle_key_description): Use make_specified_string
15926 instead of build_string to build string from push_key_description.
15927 (Bug#5193)
15928
15929 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15930
15931 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15932 This fixes a Y2038 bug on 64-bit hosts.
15933 * buffer.c (reset_buffer):
15934 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15935 (Fclear_buffer_auto_save_failure):
15936 Use 0, not -1, to represent an unset failure time, since time_t
15937 might not be signed.
15938
15939 Remove dependency on glibc malloc internals.
15940 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15941 Move back here from lisp.h, but with their new implementations.
15942 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15943 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15944 * charset.c (charset_table_init): New static var.
15945 (syms_of_charset): Use it instead of xmalloc. This removes a
15946 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15947 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15948 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15949 Move back to alloc.c.
15950 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15951 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15952
15953 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15954
15955 * nsterm.m (windowDidResize): Call x_set_window_size only when
15956 ns_in_resize is true. Otherwise set pixelwidth/height and
15957 call change_frame_size (Bug#9628).
15958
15959 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15960
15961 Port --enable-checking=all to Fedora 14 x86-64.
15962 * charset.c (syms_of_charset): Also account for glibc malloc's
15963 internal overhead when calculating the initial malloc maximum.
15964
15965 Port --enable-checking=all to Fedora 14 x86.
15966 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15967 Move to lisp.h.
15968 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15969 (overrun_check_realloc, overrun_check_free):
15970 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15971 That way, xmalloc returns a properly-aligned pointer even if
15972 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15973 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15974 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15975 into account when calculating the initial malloc maximum.
15976 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15977 Move here from alloc.c, so that charset.c can use it too.
15978 Properly align; the old code wasn't right for common 32-bit hosts
15979 when configured with --enable-checking=all.
15980 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15981 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15982
15983 2011-09-29 Eli Zaretskii <eliz@gnu.org>
15984
15985 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
15986 use EDOM.
15987
15988 2011-09-28 Eli Zaretskii <eliz@gnu.org>
15989
15990 * xdisp.c (compute_display_string_end): If there's no display
15991 string at CHARPOS, return -1.
15992
15993 * bidi.c (bidi_fetch_char): When compute_display_string_end
15994 returns a negative value, treat the character as a normal
15995 character not covered by a display string. (Bug#9624)
15996
15997 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
15998
15999 * lread.c (Fread_from_string): Fix typo in docstring.
16000
16001 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16002
16003 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16004 newline, reseat the iterator instead of bidi-iterating there one
16005 character at a time. (Bug#9610)
16006 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16007 TO_CHARPOS if the bidi iterator is at base embedding level.
16008
16009 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16010
16011 * lread.c (readevalloop): Use correct code for NBSP.
16012 (read1): Likewise. (Bug#9608)
16013
16014 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16015
16016 * dbusbind.c (Fdbus_register_signal): When service is not
16017 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16018
16019 2011-09-25 Glenn Morris <rgm@gnu.org>
16020
16021 * buffer.c (truncate-lines): Doc fix.
16022
16023 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16024
16025 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16026 (Fset_window_next_buffers): Doc fix.
16027
16028 2011-09-24 Glenn Morris <rgm@gnu.org>
16029
16030 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16031
16032 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16033
16034 Fix minor problems found by static checking.
16035 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16036 * indent.c (Fvertical_motion): Fix == vs = typo.
16037
16038 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16039
16040 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16041 Default value is now t. Doc fix.
16042
16043 * indent.c (Fvertical_motion): Compute and apply the overshoot
16044 logic when moving up, not only when moving down. Fix the
16045 confusing name and values of the it_overshoot_expected variable;
16046 logic changes accordingly. (Bug#9254) (Bug#9549)
16047
16048 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16049 CHARPOS is covered by a display string which includes newlines.
16050 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16051 is covered by a display string with embedded newlines.
16052
16053 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16054
16055 * dbusbind.c (Fdbus_register_signal): Add match rule to
16056 Vdbus_registered_objects_table. (Bug#9581)
16057 (Fdbus_register_method, Vdbus_registered_objects_table):
16058 Fix docstring.
16059
16060 2011-09-24 Jim Meyering <meyering@redhat.com>
16061
16062 do not ignore write error for any output size
16063 The previous change was incomplete.
16064 While it makes emacs --batch detect the vast majority of stdout
16065 write failures, errors were still ignored whenever the output size is
16066 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16067 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16068 && echo FAIL: ignored write error
16069 FAIL: ignored write error
16070 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16071 && echo FAIL: ignored write error
16072 FAIL: ignored write error
16073 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16074
16075 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16076
16077 * emacs.c (Fkill_emacs): In noninteractive mode exit
16078 non-successfully if a write error occurred on stdout. (Bug#9574)
16079
16080 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16081
16082 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16083 the xassert test.
16084
16085 * dispextern.h (struct it): Update the comment documenting what
16086 can it->OBJECT be.
16087
16088 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16089
16090 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16091 a display string, extend search for cursor position to end of row.
16092 (find_row_edges): If the row ends in a newline from a display
16093 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16094 Handle the case of a display string with multiple newlines.
16095 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16096 non-empty line. Fixes confusing cursor motion with arrow keys at
16097 the beginning of a line that starts with whitespace.
16098
16099 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16100
16101 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16102 (bug#9493).
16103
16104 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16105
16106 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16107 boolean (Bug#9154).
16108
16109 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16110
16111 * xdisp.c (display_line): Record maximum and minimum buffer
16112 positions even if no glyphs were produced (e.g., by a zero-width
16113 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16114 buffer positions that will be removed from the glyph row because
16115 they don't fit.
16116 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16117 column is beyond frame width: don't subtract 1 "pixel" when
16118 computing width of the stretch.
16119 (reseat_at_next_visible_line_start): Undo the change made on
16120 2011-09-17 that saved paragraph information and restored it after
16121 the call to `reseat'. (Bug#9545)
16122
16123 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16124
16125 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16126 and turn window cursor on if cleared (Bug#9415).
16127
16128 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16129
16130 * search.c (boyer_moore): Take unibyte characters from pattern
16131 literally. (Bug#9458)
16132
16133 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16134
16135 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16136
16137 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16138
16139 Fix minor problem found by static checking.
16140 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16141 initialized, to pacify gcc -Wuninitialized.
16142
16143 * fileio.c: Report proper errno when syscall falls.
16144 (Finsert_file_contents): Save and restore errno,
16145 so that report_file_error outputs the correct diagnostic.
16146 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16147
16148 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16149
16150 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16151
16152 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16153
16154 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16155 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16156
16157 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16158
16159 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16160 about the current paragraph and restore it after the call to reseat.
16161
16162 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16163 (bidi_find_paragraph_start): Search back for paragraph beginning
16164 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16165 (bidi_move_to_visually_next): Only trigger paragraph-related
16166 computations when the last character is a newline or at EOB, not
16167 just any NEUTRAL_B. (Bug#9470)
16168
16169 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16170 truncated lines if point is covered by a display string. (Bug#9524)
16171
16172 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16173
16174 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16175 (cons_to_x_long): New function.
16176 (lisp_data_to_selection_data): Use it. Correct the test for
16177 short-versus-long data; it was negated. Break out of vector
16178 loop, for efficiency, when a long datum is discovered.
16179
16180 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16181
16182 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16183
16184 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16185
16186 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16187 GCC PR/17406) by declaring this function with external scope.
16188
16189 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16190
16191 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16192 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16193
16194 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16195
16196 * editfns.c (Fformat): Correctly handle text properties on "%%".
16197
16198 2011-09-15 Eli Zaretskii <eliz@gnu.org>
16199
16200 * xterm.c (x_draw_composite_glyph_string_foreground):
16201 * w32term.c (x_draw_composite_glyph_string_foreground):
16202 * term.c (encode_terminal_code):
16203 * composite.c (composition_update_it, get_composition_id):
16204 * xdisp.c (get_next_display_element)
16205 (fill_composite_glyph_string): Add comments about special meaning
16206 of TAB characters in a composition.
16207
16208 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16209
16210 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
16211 This occurs when processing a multibyte format.
16212 Problem reported by Wolfgang Jenker.
16213
16214 2011-09-15 Johan Bockgård <bojohan@gnu.org>
16215
16216 * xdisp.c (try_cursor_movement): Only check for exact match if
16217 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16218
16219 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16220
16221 Remove unused external symbols.
16222 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16223 * xdisp.c (calc_pixel_width_or_height): Now static.
16224 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16225 * indent.c (check_display_width):
16226 * w32term.c: Fix comment to match code.
16227 * xterm.c, xterm.h (x_catching_errors): Remove.
16228
16229 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16230
16231 * xselect.c: Use signed conversions more consistently (Bug#9498).
16232 (selection_data_to_lisp_data): Assume incoming selection data are
16233 signed integers, not unsigned. This is to be consistent with
16234 outgoing selection data, which was modified to use signed integers
16235 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16236 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16237 expects long, not unsigned long.
16238
16239 2011-09-14 Eli Zaretskii <eliz@gnu.org>
16240
16241 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16242 computation of loop end. Reported by Johan Bockgård
16243 <bojohan@gnu.org>.
16244
16245 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
16246
16247 * frame.c (Fother_visible_frames_p): Function deleted.
16248
16249 2011-09-12 Eli Zaretskii <eliz@gnu.org>
16250
16251 * indent.c (compute_motion): Process display vector front to back
16252 rather than the other way around. (Bug#2496)
16253
16254 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16255
16256 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16257
16258 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
16259
16260 * minibuf.c (Fread_from_minibuffer): Doc fix.
16261
16262 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16263
16264 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16265 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16266
16267 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16268
16269 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16270 value for non-existent files.
16271
16272 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16273
16274 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16275 set its "size" to -1. This will set the modtime_size field of
16276 the corresponding buffer to -1, which is what
16277 verify-visited-file-modtime expects for files that do not exist.
16278 (Bug#9139)
16279
16280 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16281
16282 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16283 here ...
16284 * lisp.h: ... from here. push_key_description is no longer
16285 defined in keyboard.c, so its declaration should not be in
16286 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16287 logically belongs with push_key_description.
16288
16289 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16290
16291 * buffer.h: Include <sys/types.h> instead of <time.h>.
16292 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16293 Problem reported by Herbert J. Skuhra.
16294
16295 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16296
16297 * xml.c (parse_region): Make the parsing work for
16298 non-comment-starting XML files again (bug#9144).
16299
16300 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16301
16302 * image.c (gif_load): Fix calculation of bottom and right corner.
16303 (Bug#9468)
16304
16305 2011-09-10 Eli Zaretskii <eliz@gnu.org>
16306
16307 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16308 redisplay in small windows.
16309
16310 2011-09-09 Eli Zaretskii <eliz@gnu.org>
16311
16312 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16313
16314 2011-09-08 Martin Rudalics <rudalics@gmx.at>
16315
16316 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16317 Operate on live windows only.
16318
16319 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
16320
16321 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16322
16323 2011-09-07 Eli Zaretskii <eliz@gnu.org>
16324
16325 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16326 only under bidi iteration.
16327
16328 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16329
16330 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16331
16332 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16333
16334 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16335 Without this fix, the command to link temacs failed due to an
16336 undefined symbol __builtin_isnan. This is because
16337 /usr/include/iso/math_c99.h #defines isnan(x) to
16338 __builtin_isnan(x), but the bundled gcc, which identifies itself
16339 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16340 a __builtin_isnan.
16341 * floatfns.c (isnan): #undef, and then #define to a clone of
16342 what's in data.c.
16343 (Fisnan): Always define, since it's always available now.
16344 (syms_of_floatfns): Always define isnan at the Lisp level.
16345
16346 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16347
16348 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16349
16350 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16351
16352 * fileio.c: Fix bugs with large file offsets (Bug#9428).
16353 The previous code assumed that file offsets (off_t values) fit in
16354 EMACS_INT variables, which is not true on typical 32-bit hosts.
16355 The code messed up by falsely reporting buffer overflow in cases
16356 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16357 when "big" contains more than 2**29 bytes, even though this
16358 inserts just one byte and does not overflow the buffer.
16359 (Finsert_file_contents): Store file offsets as off_t
16360 values, not as EMACS_INT values. Check for overflow when
16361 converting between EMACS_INT and off_t. When checking for
16362 buffer overflow or for overlap, take the offsets into account.
16363 Don't use EMACS_INT for small values where int suffices.
16364 When checking for overlap, fix a typo: ZV was used where
16365 ZV_BYTE was intended.
16366 (Fwrite_region): Don't assume off_t fits into 'long'.
16367 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16368
16369 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
16370
16371 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16372
16373 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16374
16375 sprintf-related integer and memory overflow issues (Bug#9412).
16376
16377 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
16378 (esprintf, exprintf, evxprintf): New functions.
16379 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
16380 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
16381 (modify_event_symbol): Do not assume that the length of
16382 name_alist_or_stem is safe to alloca and fits in int.
16383 (Fexecute_extended_command): Likewise for function name and binding.
16384 (Frecursion_depth): Wrap around reliably on integer overflow.
16385 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16386 since some callers pass EMACS_INT values.
16387 (Fsingle_key_description): Don't crash if symbol name contains more
16388 than MAX_ALLOCA bytes.
16389 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16390 (get_minibuffer): Arg is now EMACS_INT, not int.
16391 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
16392 (esprintf, exprintf, evxprintf): New decls.
16393 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16394
16395 * dbusbind.c (signature_cat): New function.
16396 (xd_signature, Fdbus_register_signal):
16397 Do not overrun buffer; instead, report string overflow.
16398
16399 * dispnew.c (add_window_display_history): Don't overrun buffer.
16400 Truncate instead; this is OK since it's just a log.
16401
16402 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16403 even if the time zone offset is outlandishly large.
16404 Don't mishandle offset == INT_MIN.
16405
16406 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16407 when creating daemon; the previous buffer-overflow check was incorrect.
16408
16409 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16410 which has the guts of the old verror function.
16411
16412 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16413 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16414
16415 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16416 (font_unparse_xlfd): Don't blindly alloca long strings.
16417 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
16418 fits in int, when using sprintf. Use single snprintf to count
16419 length of string rather than counting it via multiple sprintfs;
16420 that's simpler and more reliable.
16421 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16422 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16423 sprintf, in case result does not fit in int.
16424
16425 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16426 (fontset_from_font): Print it.
16427
16428 * frame.c (tty_frame_count): Now printmax_t, not int.
16429 (make_terminal_frame, set_term_frame_name): Print it.
16430 (x_report_frame_params): In X, window IDs are unsigned long,
16431 not signed long, so print them as unsigned.
16432 (validate_x_resource_name): Check for implausibly long names,
16433 and don't assume name length fits in 'int'.
16434 (x_get_resource_string): Don't blindly alloca invocation name;
16435 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16436 not fit in int.
16437
16438 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16439 (xg_check_special_colors, xg_set_geometry):
16440 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16441
16442 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16443 Use esprintf, not sprintf, in case result does not fit in int.
16444
16445 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16446 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16447 it as a large positive number.
16448 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16449 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16450
16451 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16452 in case result does not fit in int.
16453
16454 * print.c (float_to_string): Detect width overflow more reliably.
16455 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16456 buffer overrun. Don't assume list length fits in 'int'. Treat
16457 print length of 0 as 0, not as infinity; to be consistent with other
16458 uses of print length in this function. Don't overflow print length
16459 index. Don't assume hash table size fits in 'long', or that
16460 vectorlike size fits in 'unsigned long'.
16461
16462 * process.c (make_process): Use printmax_t, not int, to format
16463 process-name gensyms.
16464
16465 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16466
16467 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16468 to avoid potential buffer overrun.
16469
16470 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16471 if X resource line is longer than 512 bytes.
16472
16473 * xfns.c (x_window): Make sprintf buffer a bit bigger
16474 to avoid potential buffer overrun.
16475
16476 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16477
16478 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16479
16480 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16481
16482 Integer overflow fixes for scrolling, etc.
16483 Without these, Emacs silently mishandles large integers sometimes.
16484 For example, "C-u 4294967297 M-x recenter" was treated as if
16485 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16486
16487 * xdisp.c (try_window_id): Check Emacs fixnum range before
16488 converting to 'int'.
16489
16490 * window.c (window_scroll_line_based, Frecenter):
16491 Check that an Emacs fixnum is in range before assigning it to 'int'.
16492 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16493 values converted from Emacs fixnums.
16494 (Frecenter): Don't wrap around a line count if it is out of 'int'
16495 range; instead, treat it as an extreme value.
16496 (Fset_window_configuration, compare_window_configurations):
16497 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16498
16499 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16500 that can exceed INT_MAX. Check that EMACS_INT value is in range
16501 before assigning it to the (possibly-narrower) index.
16502 (match_limit): Don't assume that a fixnum can fit in 'int'.
16503
16504 * print.c (print_object): Use ptrdiff_t, not int, for index that can
16505 exceed INT_MAX.
16506
16507 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
16508 (Fvertical_motion): Don't wrap around LINES values that don't fit
16509 in 'int'. Instead, treat them as extreme values. This is good
16510 enough for windows, which can't have more than INT_MAX lines anyway.
16511
16512 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16513
16514 * Require libxml/parser.h to avoid compilation warning.
16515
16516 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16517
16518 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16519 since this reportedly can destroy thread storage.
16520
16521 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
16522
16523 * syntax.c (find_defun_start): Update all cache variables if
16524 exiting early (Bug#9401).
16525
16526 2011-08-30 Eli Zaretskii <eliz@gnu.org>
16527
16528 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16529
16530 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16531 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16532 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16533
16534 * term.c (tty_append_glyph): New function.
16535 (produce_stretch_glyph): Static function and its prototype deleted.
16536
16537 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16538 Add prototypes.
16539
16540 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16541
16542 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16543 when checking :margin (Bug#9390).
16544 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
16545 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
16546 so that the name doesn't mislead. All uses changed.
16547
16548 2011-08-28 Johan Bockgård <bojohan@gnu.org>
16549
16550 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16551 set_tty_hooks.
16552
16553 2011-08-27 Eli Zaretskii <eliz@gnu.org>
16554
16555 * xdisp.c (move_it_to): Don't bail out early when reaching
16556 position beyond to_charpos, if we are scanning backwards.
16557 (move_it_vertically_backward): When DY == 0, make sure we get to
16558 the first character in the line after the newline.
16559
16560 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16561
16562 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16563 (ccl_driver): Do not generate an out-of-range pointer.
16564 (Fccl_execute_on_string): Remove unnecessary check for
16565 integer overflow, noted by Stefan Monnier in
16566 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16567 Remove a FIXME that didn't need fixing.
16568 Simplify the newly-introduced buffer reallocation code.
16569
16570 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
16571
16572 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16573
16574 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
16575
16576 Integer and memory overflow issues (Bug#9196).
16577
16578 * doc.c (get_doc_string): Rework so that
16579 get_doc_string_buffer_size is the actual buffer size, rather than
16580 being 1 less than the actual buffer size; this makes xpalloc more
16581 convenient.
16582
16583 * image.c (x_allocate_bitmap_record, cache_image):
16584 * xselect.c (Fx_register_dnd_atom):
16585 Simplify previous changes by using xpalloc.
16586
16587 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16588 since either will do and ptrdiff_t is convenient with xpalloc.
16589
16590 * charset.c (charset_table_size)
16591 (struct charset_sort_data.priority): Now ptrdiff_t.
16592 (charset_compare): Don't overflow if priorities differ greatly.
16593 (Fsort_charsets): Don't assume list length fits in int.
16594 Check for size-calculation overflow when allocating sort data.
16595 (syms_of_charset): Allocate an initial charset table that is
16596 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16597
16598 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16599
16600 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16601 The actual value is always <= INT_MAX, and leaving it unsigned made
16602 overflow checking harder.
16603
16604 * dispextern.h (struct glyph_matrix.rows_allocated)
16605 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16606 with xpalloc. The values are still always <= INT_MAX.
16607
16608 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16609
16610 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16611 (SAFE_NALLOCA): New macro.
16612
16613 * region-cache.c (struct boundary.pos, find_cache_boundary)
16614 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16615 (set_cache_region, invalidate_region_cache)
16616 (revalidate_region_cache, know_region_cache, region_cache_forward)
16617 (region_cache_backward, pp_cache):
16618 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16619 so that ptrdiff_t * can be passed to xpalloc.
16620 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16621 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16622 (pp_cache): Don't assume cache_len fits in int.
16623 * region-cache.h: Adjust extern decls to match.
16624
16625 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16626 EMACS_INT, since either will do, for xpalloc.
16627
16628 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16629 (xnmalloc, xnrealloc, xpalloc): New functions.
16630
16631 * bidi.c (bidi_shelve_header_size): New constant.
16632 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16633 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16634
16635 * bidi.c (bidi_cache_shrink):
16636 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16637 (overlay_strings):
16638 Don't update size of array until after memory allocation succeeds,
16639 because xmalloc/xrealloc may not return.
16640 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16641 now that we have proper integer overflow checking.
16642 (record_overlay_string, overlay_strings): Catch overflows when
16643 calculating size of overlay_str_buf.
16644
16645 * callproc.c (Fcall_process): Check for size overflow when
16646 calculating size of args2.
16647 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16648 Normally we prefer signed values, but sticking with ptrdiff_t would
16649 require adding more-complicated checks.
16650
16651 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16652 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16653 Redo buffer-overflow calculations to avoid integer overflow.
16654 Add a FIXME comment where memory seems to be over-allocated.
16655
16656 * character.c (Fstring): Check for size-calculation overflow.
16657
16658 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16659 unnecessary integer overflow. Check for size overflow.
16660 (encode_coding_object): Don't update size until xmalloc succeeds.
16661
16662 * composite.c (get_composition_id): Check for overflow in glyph
16663 length calculations.
16664
16665 Integer and memory overflow fixes for display code.
16666 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16667 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16668 (scrolling_window): Check for overflow in size calculations.
16669 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16670 Don't assume glyph table len fits in int.
16671 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16672 (row_table_size): Now ptrdiff_t, not int.
16673 (scrolling_window): Avoid overflow in size calculations.
16674 Don't update size until allocation succeeds.
16675 * fns.c (concat): Check for overflow in size calculations.
16676 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16677 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16678 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16679
16680 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16681 (get_doc_string): Check for size calculation overflow.
16682 Don't update size until allocation succeeds.
16683 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16684 EMACS_INT, where ptrdiff_t will do.
16685 (Fsubstitute_command_keys): Check for string overflow.
16686
16687 * editfns.c (set_time_zone_rule): Don't assume environment length
16688 fits in int.
16689 (message_length): Now ptrdiff_t, not int.
16690 (Fmessage_box): Don't update size until allocation succeeds.
16691 Don't assume message length fits in int.
16692 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16693
16694 * emacs.c (main): Do not reallocate argv, since there is a null at
16695 the end that can be overwritten, and this way there's no need to
16696 worry about size-calculation overflow.
16697 (sort_args): Check for size-calculation overflow.
16698
16699 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16700 alloc succeeds.
16701 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16702
16703 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16704 (x_set_scroll_bar_width, x_figure_window_size):
16705 Check for integer overflow.
16706 (x_set_alpha): Do not assume XINT fits in int.
16707
16708 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16709 This is for the members text_lines, text_cols, total_lines, total_cols,
16710 where the system imposes an 'int' limit.
16711
16712 * fringe.c (Fdefine_fringe_bitmap):
16713 Don't update size until alloc works.
16714
16715 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16716 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16717
16718 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16719 Check for size-calculation overflow.
16720 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16721 do, as we prefer signed integers.
16722 (id_to_widget.max_size, id_to_widget.used)
16723 (xg_store_widget_in_map, xg_remove_widget_from_map)
16724 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16725 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16726 Use and return ptrdiff_t, not int.
16727 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16728 * gtkutil.h: Change prototypes to match the above.
16729
16730 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16731 are duplicate now that they've been promoted to lisp.h.
16732 (x_allocate_bitmap_record, x_alloc_image_color)
16733 (make_image_cache, cache_image, xpm_load):
16734 Don't update size until alloc is done.
16735 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16736 (x_detect_edges):
16737 Check for size calculation overflow.
16738 (ct_colors_allocated_max): New constant.
16739 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16740 overflow.
16741
16742 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16743 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16744 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16745 Use ptrdiff_t, not int, to count maps.
16746 (read_char_minibuf_menu_prompt): Check for overflow in size
16747 calculations. Don't update size until allocation succeeds.
16748 Redo calculations to avoid overflow.
16749 * keyboard.h: Change prototypes to match the above.
16750
16751 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16752 to count maps.
16753 (current_minor_maps): Check for size calculation overflow.
16754 * keymap.h: Change prototypes to match the above.
16755
16756 * lread.c (read1, init_obarray): Don't update size until alloc done.
16757
16758 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16759 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16760
16761 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16762 Now ptrdiff_t, not int.
16763 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16764 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16765
16766 * process.c (Fnetwork_interface_list): Check for overflow
16767 in size calculation.
16768
16769 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16770
16771 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16772 overflow. Don't bother calling xmalloc when xrealloc will do.
16773
16774 * search.c (Freplace_match): Check for size calculation overflow.
16775 (Fset_match_data): Don't assume list lengths fit in 'int'.
16776
16777 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16778 for command line length. Do not attempt to address one before the
16779 beginning of an array, as that's not portable.
16780
16781 * term.c (max_frame_lines): Remove; unused.
16782 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16783 not int.
16784 (encode_terminal_code, calculate_costs): Check for size
16785 calculation overflow.
16786 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16787 table lengths and related sizes. Don't update size until alloc
16788 done. Redo calculations to avoid overflow.
16789 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16790
16791 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16792 subtracting pointers.
16793 (gobble_line): Check for overflow more carefully. Don't update size
16794 until alloc done.
16795
16796 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16797 Don't update size until alloc done.
16798 Redo size calculations to avoid overflow.
16799 Check for size calculation overflow.
16800 (main) [DEBUG]: Fix typo in invoking tparam1.
16801
16802 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16803 Use ptrdiff_t, not int, for sizes.
16804 (store_mode_line_noprop_char): Don't update size until alloc done.
16805
16806 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16807 Use ptrdiff_t, not int, for sizes.
16808 (Finternal_make_lisp_face, cache_face):
16809 Check for size calculation overflow.
16810 (cache_face): Treat size calculation overflows as if they were
16811 memory exhaustion (the usual treatment), rather than aborting.
16812
16813 * xfns.c (x_encode_text, x_set_name_internal)
16814 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16815 sizes, since they can exceed INT_MAX in size. Check for size
16816 calculation overflow.
16817
16818 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16819 (xg_select): Check for size calculation overflow.
16820 Don't update size until alloc done.
16821
16822 * xrdb.c (get_environ_db): Don't assume path length fits in int,
16823 as sprintf is limited to int lengths.
16824
16825 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16826 (X_LONG_MIN): New macros.
16827 Use them to make the following changes clearer.
16828 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16829 This change doesn't affect the value now, but it may help remind
16830 future maintainers not to raise the value too much later.
16831 (SELECTION_QUANTUM): Remove, replacing with ...
16832 (selection_quantum): ... new function, which avoids overflow.
16833 All uses changed.
16834 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16835 assumption that selection length fits in 'int'.
16836 (x_reply_selection_request, x_handle_selection_request)
16837 (x_get_window_property, receive_incremental_selection)
16838 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16839 (lisp_data_to_selection_data, clean_local_selection_data):
16840 Use ptrdiff_t, not int, to record length of selection.
16841 (x_reply_selection_request, x_get_window_property)
16842 (receive_incremental_selection, x_property_data_to_lisp):
16843 Redo calculations to avoid overflow.
16844 (x_reply_selection_request): When sending hint, ceiling it at
16845 X_LONG_MAX rather than relying on wraparound overflow to send
16846 something.
16847 (x_get_window_property, receive_incremental_selection)
16848 (lisp_data_to_selection_data, x_property_data_to_lisp):
16849 Check for size-calculation overflow.
16850 (x_get_window_property, receive_incremental_selection)
16851 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16852 Don't store size until memory allocation succeeds.
16853 (x_get_window_property): Plug memory leak on memory exhaustion.
16854 Don't double-block input; malloc is safe here. Don't assume 2**34
16855 - 4 fits in unsigned long. Add an xassert to check
16856 XGetWindowProperty overflow. Be more careful about overflow
16857 calculations, and distinguish size from memory overflow better.
16858 (receive_incremental_selection): When tracing, don't assume
16859 unsigned int is less than INT_MAX.
16860 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16861 harmful) conversions of unsigned short to int.
16862 (lisp_data_to_selection_data): Don't assume that integers
16863 in the range -65535 through -1 fit in an X unsigned short.
16864 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16865 result parameters unless successful. Rely on cons_to_unsigned
16866 to report problems with elements; the old code wasn't right anyway.
16867 (x_check_property_data): Check for int overflow; we cannot use
16868 a wider type due to X limits.
16869 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16870
16871 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
16872
16873 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16874 (x_term_init): Check for size calculation overflow.
16875 (x_color_cells): Don't store size until memory allocation succeeds.
16876 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
16877 Don't assume alloca size is less than MAX_ALLOCA.
16878 (x_term_init): Don't assume length fits in int (sprintf is limited
16879 to int size).
16880
16881 Use ptrdiff_t for composition IDs.
16882 * character.c (lisp_string_width):
16883 * composite.c (composition_table_size, n_compositions)
16884 (get_composition_id, composition_gstring_from_id):
16885 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16886 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16887 * window.c (Frecenter):
16888 Use ptrdiff_t, not int, for composition IDs.
16889 * composite.c (get_composition_id): Check for integer overflow.
16890 * composite.h: Adjust prototypes to match the above changes.
16891
16892 Use ptrdiff_t for hash table indexes.
16893 * category.c (hash_get_category_set):
16894 * ccl.c (ccl_driver):
16895 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16896 * coding.c (coding_system_charset_list, detect_coding_system):
16897 * coding.h (struct coding_system.id):
16898 * composite.c (get_composition_id, gstring_lookup_cache):
16899 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16900 * image.c (xpm_get_color_table_h):
16901 * lisp.h (hash_lookup, hash_put):
16902 * minibuf.c (Ftest_completion):
16903 Use ptrdiff_t for hash table indexes, not int (which is too
16904 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16905 32-bit --with-wide-int hosts).
16906
16907 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16908 Add a FIXME comment about memory leaks.
16909 (syms_of_charset): Don't assume xmalloc returns.
16910
16911 Don't assume that stated character widths fit in int.
16912 * character.c (Fchar_width, c_string_width, lisp_string_width):
16913 * character.h (CHAR_WIDTH):
16914 * indent.c (MULTIBYTE_BYTES_WIDTH):
16915 Use sanitize_char_width to avoid undefined and/or bad behavior
16916 with outlandish widths.
16917 * character.h (sanitize_tab_width): Rename from sanitize_width,
16918 now that we have two such functions. All uses changed.
16919 (sanitize_char_width): New inline function.
16920
16921 Don't assume that tab-width fits in int.
16922 * character.h (sanitize_width): New inline function.
16923 (SANE_TAB_WIDTH): New macro.
16924 (ASCII_CHAR_WIDTH): Use it.
16925 * indent.c (sane_tab_width): Remove. All uses replaced by
16926 SANE_TAB_WIDTH (current_buffer).
16927 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16928
16929 * fileio.c: Integer overflow issues with file modes.
16930 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16931
16932 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16933 Remove unreachable code.
16934 (read_hex, load_charset_map_from_file): Check for integer overflow.
16935
16936 * xterm.c: Don't go over XClientMessageEvent limit.
16937 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16938 (x_send_scroll_bar_event): Likewise. Check that the size does not
16939 exceed limits imposed by XClientMessageEvent, as well as the usual
16940 ptrdiff_t and size_t limits.
16941
16942 * keyboard.c: Overflow, signedness and related fixes.
16943 (make_lispy_movement): Use same integer type in forward decl
16944 that is used in the definition.
16945 (read_key_sequence, keyremap_step):
16946 Change bufsize argument back to int, undoing my 2011-03-30 change.
16947 We prefer signed types, and int is wide enough here.
16948 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16949 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16950 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16951 length, not size_t. Use ptrdiff_t for index, not int.
16952 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16953 possibility of integer overflow.
16954
16955 Overflow, signedness and related fixes for images.
16956
16957 * dispextern.h (struct it.stack[0].u.image.image_id)
16958 (struct_it.image_id, struct image.id, struct image_cache.size)
16959 (struct image_cache.used, struct image_cache.ref_count):
16960 * gtkutil.c (update_frame_tool_bar):
16961 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16962 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16963 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16964 * nsmenu.m (update_frame_tool_bar):
16965 * xdisp.c (calc_pixel_width_or_height):
16966 * xfns.c (image_cache_refcount):
16967 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16968 on typical 64-bit hosts.
16969
16970 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16971 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16972 Omit unnecessary casts to int.
16973 (parse_image_spec): Check that integers fall into 'int' range
16974 when the callers expect that.
16975 (image_ascent): Redo ascent calculation to avoid int overflow.
16976 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16977 (lookup_image): Remove unnecessary tests.
16978 (xbm_image_p): Locals are now of int, not EMACS_INT,
16979 since parse_image_check makes sure they fit into int.
16980 (png_load, gif_load, svg_load_image):
16981 Prefer int to unsigned where either will do.
16982 (tiff_handler): New function, combining the cores of the
16983 old tiff_error_handler and tiff_warning_handler.
16984 This function is rewritten to use vsnprintf and thereby avoid
16985 stack buffer overflows. It uses only the features of vsnprintf
16986 that are common to both POSIX and native Microsoft.
16987 (tiff_error_handler, tiff_warning_handler): Use it.
16988 (tiff_load, gif_load, imagemagick_load_image):
16989 Don't assume :index value fits in 'int'.
16990 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16991 (imagemagick_load_image): Check that crop parameters fit into
16992 the integer types that MagickCropImage accepts. Don't assume
16993 Vimagemagick_render_type has a nonnegative value. Don't assume
16994 size_t fits in 'long'.
16995 (gs_load): Use printmax_t to print the widest integers possible.
16996 Check for integer overflow when computing image height and width.
16997
16998 2011-08-26 Eli Zaretskii <eliz@gnu.org>
16999
17000 * xdisp.c (redisplay_window): Don't force window start if point
17001 will be invisible in the resulting window. (Bug#9324)
17002
17003 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17004
17005 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17006 the display spec is of the form `(space ...)'.
17007 (handle_display_spec): Return the value returned by
17008 handle_single_display_spec, not just 1 or zero.
17009 (handle_single_display_spec): If the display spec is of the form
17010 `(space ...)', and specifies display in the text area, return 2
17011 rather than 1.
17012 (try_cursor_movement): Check for the need to scroll more
17013 accurately, and prefer exact match for point under bidi.
17014 Don't advance `row' beyond the last row of the window.
17015
17016 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17017 into disp_prop; all users changed.
17018
17019 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17020 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17021 for the text covered by the display property.
17022
17023 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17024
17025 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17026 Change return value to nil.
17027 (Frecord_buffer): Delete unused function.
17028
17029 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17030
17031 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17032 buffers, return left-to-right.
17033 (set_cursor_from_row): Consider candidate row a win if its glyph
17034 represents a newline and point is on that newline. Fixes cursor
17035 positioning on the newline at EOL of R2L text within L2R
17036 paragraph, and vice versa.
17037 (try_cursor_movement): Check continued rows, in addition to
17038 continuation rows. Fixes unwarranted scroll when point enters a
17039 continued line of R2L text within an L2R paragraph, or vice versa.
17040 (cursor_row_p): Consider the case of point being equal to
17041 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17042 from the end of a short line to the beginning of a continued line
17043 of R2L text within L2R paragraph.
17044 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17045 composed characters.
17046
17047 * bidi.c (bidi_check_type): Use xassert.
17048 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17049 members.
17050
17051 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17052
17053 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17054 a character.
17055
17056 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17057
17058 * nsfont.m (ns_otf_to_script): Fix typo.
17059
17060 2011-08-22 Kenichi Handa <handa@m17n.org>
17061
17062 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17063 extra slot even if the purpose is char-code-property-table.
17064
17065 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17066
17067 * xdisp.c (redisplay_window): When computing centering_position,
17068 account for the height of the header line. (Bug#8874)
17069
17070 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17071 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17072 candidate is selected by the mouse, and that candidate has a
17073 composed character under the mouse.
17074
17075 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17076 coordinates reported by pos-visible-in-window-p for a composed
17077 character in column zero.
17078
17079 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17080
17081 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17082
17083 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17084
17085 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17086 consider it a hit if to_charpos is anywhere in the range of the
17087 composed buffer positions.
17088
17089 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17090
17091 * image.c (gif_load): Don't assume that each subimage has the same
17092 dimensions as the base image. Handle disposal method that is
17093 "undefined" by the gif spec (Bug#9335).
17094
17095 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17096
17097 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17098 (Fcondition_case): Document `debug' symbol in error handler.
17099
17100 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17101
17102 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17103 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17104 from an Org mode buffer to a Speedbar frame.
17105
17106 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17107 a composition, take its buffer position from IT->cmp_it.charpos.
17108 Fixes cursor positioning at the beginning of a line that begins
17109 with a composed character.
17110
17111 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17112
17113 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17114 character bidirectional type, use STRONG_L instead. Fixes crashes
17115 in a buffer produced by `describe-categories'.
17116
17117 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17118 members before the level stack, so they would be saved and
17119 restored when copying iterator state. Fixes incorrect reordering
17120 around TABs covered by display properties.
17121
17122 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17123
17124 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17125
17126 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17127
17128 * eval.c (internal_condition_case, internal_condition_case_1)
17129 (internal_condition_case_2, internal_condition_case_n):
17130 Remove unnecessary aborts (Bug#9081).
17131
17132 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17133
17134 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17135 has no `load' handler, try opening the file locally. (Bug#9311)
17136
17137 2011-08-16 Ken Brown <kbrown@cornell.edu>
17138
17139 * gmalloc.c: Expand comment.
17140
17141 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17142
17143 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17144 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17145
17146 2011-08-16 Ken Brown <kbrown@cornell.edu>
17147
17148 Fix memory allocation problems in Cygwin build (Bug#9273).
17149
17150 * unexcw.c ( __malloc_initialized): Declare external variable.
17151 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17152
17153 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17154 New variables.
17155 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17156 dumped emacs.
17157 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17158 in the static heap.
17159 [CYGWIN] (special_realloc): New function.
17160 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17161 requests to realloc storage in the static heap.
17162
17163 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17164
17165 * bidi.c (bidi_initialize): Remove unused local.
17166
17167 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17168
17169 * bidimirror.h:
17170 * biditype.h: Remove file.
17171 * makefile.w32-in ($(BLD)/bidi.$(O)):
17172 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17173
17174 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17175
17176 * chartab.c: Improve commentary for the uniprop_table API.
17177
17178 * bidi.c (bidi_paragraph_init): Support zero value of
17179 bidi_ignore_explicit_marks_for_paragraph_level.
17180 (bidi_initialize): Use uniprop_table instead of including
17181 biditype.h and bidimirror.h.
17182
17183 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17184 coordinates of the iterator when restoring from ppos_it.
17185 (Bug#9296)
17186
17187 2011-08-14 Kenichi Handa <handa@m17n.org>
17188
17189 * process.c (create_process): Call setup_process_coding_systems
17190 after the pid of the process is set to -1 (Bug#8162).
17191
17192 2011-08-14 Eli Zaretskii <eliz@gnu.org>
17193
17194 * xdisp.c (move_it_in_display_line_to): Don't invoke
17195 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17196 ppos_it. Fixes vertical cursor motion when line beginning is
17197 covered by an image. (Bug#9296)
17198
17199 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17200
17201 * nsterm.h (ns_run_ascript): Declare.
17202 (NSAPP_DATA2_RUNASSCRIPT): Define.
17203
17204 * nsfns.m (as_script, as_result, as_status): New static variables.
17205 (ns_run_ascript): New function.
17206 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
17207 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17208 the event loop. Get status from as_status (Bug#7276).
17209
17210 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17211 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17212 the event loop (Bug#7276).
17213
17214 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17215
17216 * gnutls.c (QCgnutls_bootprop_priority)
17217 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17218 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17219 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17220 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17221 (QCgnutls_bootprop_verify_hostname_error)
17222 (QCgnutls_bootprop_callbacks_verify): Rename from
17223 Qgnutls_bootprop_..., all uses changed.
17224
17225 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17226 uses changed.
17227
17228 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17229
17230 * xfaces.c (Qframe_set_background_mode): Now static.
17231 * dispextern.h (Qframe_set_background_mode): Remove decl.
17232
17233 * process.c (Fnetwork_interface_info): Declare local only if needed.
17234
17235 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17236
17237 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17238 (Fnetwork_interface_list): Allocate in increments of bytes instead
17239 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17240 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17241 sockaddr.
17242 (struct ifflag_def): notrailers is smart on OSX.
17243 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17244 Get hardware address with getifaddrs if available.
17245
17246 2011-08-12 Eli Zaretskii <eliz@gnu.org>
17247
17248 * xdisp.c (iterate_out_of_display_property): xassert that
17249 IT->position is set to within IT->object's boundaries. Break from
17250 the loop as soon as EOB is reached; avoids infloops in redisplay
17251 when IT->position is set up wrongly due to some bug.
17252 Set IT->current to match the bidi iterator unconditionally.
17253 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17254 entry. Force push_it to save on the stack the current
17255 buffer/string position, to be restored by pop_it. Fix flags in
17256 the iterator structure wrt the object coming from a display
17257 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17258 properties. (Bug#9284)
17259
17260 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
17261
17262 * fontset.c (fontset_get_font_group): Add proper type checks.
17263 (Bug#9172)
17264
17265 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17266
17267 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17268 and LC_VERSION_MIN_MACOSX.
17269 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17270 (dump_it) [LC_FUNCTION_STARTS]: Use it.
17271
17272 2011-08-08 Eli Zaretskii <eliz@gnu.org>
17273
17274 * xdisp.c (forward_to_next_line_start): Allow to use the
17275 no-display-properties-and-no-overlays under bidi display.
17276 Set disp_pos in the bidi iterator to avoid searches for display
17277 properties and overlays.
17278
17279 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
17280
17281 * editfns.c (Fset_time_zone_rule): Document relationship with the
17282 setenv function.
17283
17284 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17285 the font entity extracted from the cache (Bug#8109).
17286
17287 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
17288
17289 * composite.c (autocmp_chars): Don't reset point. That is done by
17290 restore_point_unwind (Bug#5984).
17291
17292 2011-08-07 Juri Linkov <juri@jurta.org>
17293
17294 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17295 to show the arg `TIME' instead of `TIMEVAL'.
17296
17297 2011-08-06 Eli Zaretskii <eliz@gnu.org>
17298
17299 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17300 display property strides EOL and includes a newline, as in
17301 longlines-mode. (Bug#9254)
17302 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17303 word-wrap under bidirectional display. (Bug#9224)
17304
17305 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17306 is non-zero, even if the data buffer is NULL. Fixes a crash in
17307 vertical-motion with longlines-mode. (Bug#9254)
17308
17309 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17310
17311 * bidi.c <bidi_cache_total_alloc>: Now static.
17312 (bidi_initialize): Initialize bidi_cache_total_alloc.
17313
17314 * xdisp.c (display_line): Release buffer allocated for shelved bidi
17315 cache. (Bug#9221)
17316
17317 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17318 amount allocated this far in `bidi_cache_total_alloc'.
17319 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17320 non-zero, only free the data buffer without restoring the cache
17321 contents. All callers changed.
17322
17323 * dispextern.h (bidi_unshelve_cache): Update prototype.
17324
17325 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17326 (move_it_in_display_line, move_it_to)
17327 (move_it_vertically_backward, move_it_by_lines): Replace the call
17328 to xfree to an equivalent call to bidi_unshelve_cache.
17329 (move_it_in_display_line_to): Fix logic of returning
17330 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
17331
17332 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17333
17334 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17335 came from a string character with a `cursor' property. (Bug#9229)
17336
17337 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17338
17339 * Makefile.in (LIB_PTHREAD): New variable.
17340 (LIBES): Add LIB_PTHREAD (Bug#9216).
17341
17342 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17343 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17344
17345 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17346
17347 * regex.c (re_iswctype): Remove some redundant boolean conversions.
17348
17349 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17350
17351 * xterm.c (x_find_topmost_parent): New function.
17352 (x_set_frame_alpha): Find topmost parent window with
17353 x_find_topmost_parent and set the property there also (bug#9181).
17354 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17355
17356 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17357
17358 * callproc.c (Fcall_process): Avoid vfork clobbering
17359 the local vars buffer, coding_systems, current_dir.
17360
17361 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17362
17363 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17364
17365 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17366
17367 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17368 so that it is not optimized away.
17369
17370 * xdisp.c (compute_display_string_pos): Remove unused local.
17371
17372 2011-08-02 Eli Zaretskii <eliz@gnu.org>
17373
17374 Fix slow cursor motion and scrolling in large buffers with
17375 selective display, like Org Mode buffers. (Bug#9218)
17376
17377 * dispextern.h (struct bidi_it): New member disp_prop_p.
17378
17379 * xdisp.c: Remove one-slot cache of display string positions.
17380 (compute_display_string_pos): Accept an additional argument
17381 DISP_PROP_P; callers changed. Scan at most 5K characters forward
17382 for a display string or property. If found, set DISP_PROP_P
17383 non-zero.
17384
17385 * bidi.c (bidi_fetch_char): Accept an additional argument
17386 DISP_PROP_P, and pass it to compute_display_string_pos.
17387 Only handle text covered by a display string if DISP_PROP_P is returned
17388 non-zero. All callers of bidi_fetch_char changed.
17389
17390 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17391
17392 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17393
17394 2010-12-03 Don March <don@ohspite.net>
17395
17396 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17397 last character M-[char] is translated to ESC [char] (bug#7541).
17398
17399 2011-08-02 Kenichi Handa <handa@m17n.org>
17400
17401 * lisp.h (uniprop_table): Extern it.
17402
17403 * chartab.c (uniprop_table): Make it non-static.
17404
17405 2011-08-01 Eli Zaretskii <eliz@gnu.org>
17406
17407 * xdisp.c (forward_to_next_line_start): Accept additional argument
17408 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17409 on the newline.
17410 (reseat_at_next_visible_line_start): Use the bidi iterator state
17411 returned by forward_to_next_line_start to restore the state of
17412 it->bidi_it after backing up to previous newline. (Bug#9212)
17413
17414 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17415
17416 * regex.c (re_comp): Protoize.
17417 (re_exec): Fix return type.
17418 (regexec): Fix type of `ret'. (Bug#9203)
17419
17420 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17421
17422 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17423 This is needed if max-image-size is a floating-point number.
17424
17425 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17426
17427 * print.c (print_object): Print empty symbol as ##.
17428
17429 * lread.c (read1): Read ## as empty symbol.
17430
17431 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17432
17433 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17434 setting frame foreground color (Bug#9175).
17435 (x_set_background_color): Likewise.
17436
17437 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17438 contents (Bug#9176).
17439 (EmacsTooltip -init): Remove bezels and add shadows to
17440 tooltip windows.
17441
17442 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17443 or scroll bar (Bug#8470).
17444
17445 * nsfont.m (nsfont_open): Remove assignment to voffset and
17446 unnecessary vars hshink, expand, hd, full_height, min_height.
17447 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17448
17449 * nsterm.h (nsfont_info): Remove voffset field.
17450
17451 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17452
17453 Implement strike-through and overline on NextStep (Bug#8863).
17454
17455 * nsfont.m (nsfont_open): Use underline position provided by font,
17456 instead of hard-coded value of 2.
17457 (nsfont_draw): Call ns_draw_text_decoration instead.
17458
17459 * nsterm.h: Add declaration for ns_draw_text_decoration.
17460
17461 * nsterm.m (ns_draw_text_decoration): New function for drawing
17462 underline, overline, and strike-through.
17463 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17464 ns_draw_text_decoration. Change treatment of cursor drawing to
17465 accommodate underlining, etc.
17466
17467 2011-07-28 Eli Zaretskii <eliz@gnu.org>
17468
17469 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17470 default.
17471
17472 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17473
17474 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17475 Without this fix, if a signal arrives just after memory fills up,
17476 'malloc' might be invoked reentrantly.
17477
17478 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17479 In other words, assume that every image size is allowed, on non-X
17480 hosts. This assumption is probably wrong, but it lets Emacs compile.
17481
17482 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17483
17484 * regex.c (re_iswctype): Convert return values to boolean.
17485
17486 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17487
17488 * xdisp.c (compute_display_string_pos): Don't use cached display
17489 string position if the buffer had its restriction changed.
17490 (Bug#9184)
17491
17492 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17493
17494 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17495
17496 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17497
17498 Integer signedness and overflow and related fixes. (Bug#9079)
17499
17500 * bidi.c: Integer size and overflow fixes.
17501 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17502 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17503 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17504 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17505 (bidi_find_other_level_edge):
17506 Use ptrdiff_t instead of EMACS_INT where either will do.
17507 This works better on 32-bit hosts configured --with-wide-int.
17508 (bidi_cache_ensure_space): Check for size-calculation overflow.
17509 Use % rather than repeated addition, for better worst-case speed.
17510 Don't set bidi_cache_size until after xrealloc returns, because it
17511 might not return.
17512 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
17513 (bidi_cache_ensure_space): Also check that the bidi cache size
17514 does not exceed that of the largest Lisp string or buffer. See Eli
17515 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
17516
17517 * alloc.c (__malloc_size_t): Remove.
17518 All uses replaced by size_t. See Andreas Schwab's note
17519 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17520
17521 * image.c: Improve checking for integer overflow.
17522 (check_image_size): Assume that f is nonnull, since
17523 it is always nonnull in practice. This is one less thing to
17524 worry about when checking for integer overflow later.
17525 (x_check_image_size): New function, which checks for integer
17526 overflow issues inside X.
17527 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17528 This removes the need for a memory_full check.
17529 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17530 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17531 (xbm_read_bitmap_data): Change locals back to 'int', since
17532 their values must fit in 'int'.
17533 (xpm_load_image, png_load, tiff_load):
17534 Invoke x_create_x_image_and_pixmap earlier,
17535 to avoid much needless work if the image is too large.
17536 (tiff_load): Treat overly large images as if
17537 x_create_x_image_and_pixmap failed, not as malloc failures.
17538 (gs_load): Use x_check_image_size.
17539
17540 * gtkutil.c: Omit integer casts.
17541 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17542 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17543
17544 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17545
17546 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17547 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17548 would wrongly return t on a 64-bit host.
17549
17550 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17551 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17552 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17553 and therefore cause GCC to emit a bogus diagnostic in some cases.
17554
17555 * image.c: Integer signedness and overflow and related fixes.
17556 This is not an exhaustive set of fixes, but it's time to
17557 record what I've got.
17558 (lookup_pixel_color, check_image_size): Remove redundant decls.
17559 (check_image_size): Don't assume that arbitrary EMACS_INT values
17560 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17561 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17562 (tiff_load, imagemagick_load_image):
17563 Check for overflow in size calculations.
17564 (x_create_x_image_and_pixmap): Remove unnecessary test for
17565 xmalloc returning NULL; that can't happen.
17566 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17567 (xpm_color_bucket): Use better integer hashing function.
17568 (xpm_cache_color): Don't possibly over-allocate memory.
17569 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17570 (gif_memory_source):
17571 Use ptrdiff_t, not int or size_t, to record sizes.
17572 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17573 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17574 either works, as we prefer signed integers.
17575 (tiff_read_from_memory, tiff_write_from_memory):
17576 Return tsize_t, not size_t, since that's what the TIFF API wants.
17577 (tiff_read_from_memory): Don't fail simply because the read would
17578 go past EOF; instead, return a short read.
17579 (tiff_load): Omit no-longer-needed casts.
17580 (Fimagemagick_types): Don't assume size fits into 'int'.
17581
17582 Improve hashing quality when configured --with-wide-int.
17583 * fns.c (hash_string): New function, taken from sxhash_string.
17584 Do not discard information about ASCII character case; this
17585 discarding is no longer needed.
17586 (sxhash-string): Use it. Change sig to match it. Caller changed.
17587 * lisp.h: Declare it.
17588 * lread.c (hash_string): Remove, since we now use fns.c's version.
17589 The fns.c version returns a wider integer if --with-wide-int is
17590 specified, so this should help the quality of the hashing a bit.
17591
17592 * emacs.c: Integer overflow minor fix.
17593 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17594 Define only if GNU_LINUX.
17595 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17596
17597 * dispnew.c: Integer signedness and overflow fixes.
17598 Remove unnecessary forward decls, that were a maintenance hassle.
17599 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17600 All uses changed.
17601 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17602 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17603 (prepare_desired_row, line_draw_cost):
17604 Use int, not unsigned, where either works.
17605 (save_current_matrix, restore_current_matrix):
17606 Use ptrdiff_t, not size_t, where either works.
17607 (init_display): Check for overflow more accurately, and without
17608 relying on undefined behavior.
17609
17610 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17611 Remove, replacing with the new symbols in lisp.h. All uses changed.
17612 * fileio.c (make_temp_name):
17613 * filelock.c (lock_file_1, lock_file):
17614 * xdisp.c (message_dolog):
17615 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17616 Use pMd etc. instead.
17617 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17618 replacing the pWIDE etc. symbols removed from editfns.c.
17619
17620 * keyboard.h (num_input_events): Now uintmax_t.
17621 This is (very slightly) less likely to mess up due to wraparound.
17622 All uses changed.
17623
17624 * buffer.c: Integer signedness fixes.
17625 (alloc_buffer_text, enlarge_buffer_text):
17626 Use ptrdiff_t rather than size_t when either will do, as we prefer
17627 signed integers.
17628
17629 * alloc.c: Integer signedness and overflow fixes.
17630 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17631 (__malloc_size_t): Default to size_t, not to int.
17632 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17633 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17634 Prefer ptrdiff_t to size_t when either would do, as we prefer
17635 signed integers.
17636 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17637 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17638 Now const. Initialize with values that are in range even if char
17639 is signed.
17640 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17641 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17642 These functions do the right thing with sizes > 2**32.
17643 (check_depth): Now ptrdiff_t, not int.
17644 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17645 Adjust to new way of storing sizes. Check for size overflow bugs
17646 in rest of code.
17647 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17648 slightly wrong anyway, as it missed one instance of
17649 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17650 (refill_memory_reserve): Omit needless cast to size_t.
17651 (mark_object_loop_halt): Mark as externally visible.
17652
17653 * xselect.c: Integer signedness and overflow fixes.
17654 (Fx_register_dnd_atom, x_handle_dnd_message):
17655 Use ptrdiff_t, not size_t, since we prefer signed.
17656 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17657 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17658 x_dnd_atoms_size and x_dnd_atoms_length.
17659
17660 * doprnt.c: Prefer signed to unsigned when either works.
17661 * eval.c (verror):
17662 * doprnt.c (doprnt):
17663 * lisp.h (doprnt):
17664 * xdisp.c (vmessage):
17665 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17666 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17667 prefer signed arithmetic to avoid comparison confusion.
17668 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17669 but is a bit tricky.
17670
17671 Assume freestanding C89 headers, string.h, stdlib.h.
17672 * data.c, doprnt.c, floatfns.c, print.c:
17673 Include float.h unconditionally.
17674 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17675 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17676 * regex.c: Likewise for stddef.h, string.h.
17677 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17678 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17679 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17680 (STDC_HEADERS): Remove obsolete defines.
17681 * sysdep.c: Include limits.h unconditionally.
17682
17683 Assume support for memcmp, memcpy, memmove, memset.
17684 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17685 * regex.c (memcmp, memcpy):
17686 Remove; we assume C89 now.
17687
17688 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17689 (__malloc_safe_bcopy): Remove; no longer needed.
17690
17691 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
17692 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17693 well either way, and we prefer signed to unsigned.
17694
17695 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17696
17697 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17698 closes the connection while we're reading (bug#9182).
17699
17700 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
17701
17702 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17703 are specified (Bug#9168).
17704
17705 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17706
17707 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17708 Found by GCC static checking and --with-wide-int on a 32-bit host.
17709
17710 2011-07-25 Eli Zaretskii <eliz@gnu.org>
17711
17712 * xdisp.c (compute_display_string_pos): Fix logic of caching
17713 previous display string position. Initialize cached_prev_pos to
17714 -1. Fixes slow-down at the beginning of a buffer.
17715
17716 2011-07-24 Eli Zaretskii <eliz@gnu.org>
17717
17718 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17719 for attrs[LFACE_FONTSET_INDEX].
17720
17721 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17722
17723 * xml.c (parse_region): Remove unused local
17724 that was recently introduced.
17725
17726 2011-07-23 Eli Zaretskii <eliz@gnu.org>
17727
17728 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17729 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17730
17731 * xdisp.c (move_it_in_display_line_to): Record the best matching
17732 position for TO_CHARPOS while scanning the line, and restore it on
17733 exit if none of the characters scanned was an exact match.
17734 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
17735 when exact match is impossible due to invisible text, and the
17736 lines are truncated.
17737
17738 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17739
17740 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17741 for OSX >= 10.7.
17742
17743 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17744
17745 Fix a significant slow-down of cursor motion with C-n, C-p,
17746 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17747 auto-repeat under bidi redisplay in fontified buffers.
17748 * xdisp.c (compute_stop_pos_backwards): New function.
17749 (next_element_from_buffer): Call compute_stop_pos_backwards to
17750 find a suitable prev_stop when we find ourselves before
17751 base_level_stop.
17752 (reseat): Don't look for prev_stop, as that could mean a very long
17753 run.
17754 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17755 <cached_disp_overlay_modiff>: Cache for last found display string
17756 position.
17757 (compute_display_string_pos): Return the cached position if asked
17758 about the same buffer in the same area of character positions, and
17759 the buffer wasn't changed since the time the display string
17760 position was cached.
17761
17762 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17763
17764 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17765 is an integer, which is important for empty lines. (Bug#9149)
17766
17767 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
17768
17769 * frame.c (Fmodify_frame_parameters): In tty case, update the
17770 default face if necessary (Bug#4238).
17771
17772 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
17773
17774 * editfns.c (Fstring_to_char): No need to explain what a character
17775 is in the docstring (Bug#6576).
17776
17777 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17778
17779 * xml.c (parse_region): Make sure we always return a tree.
17780
17781 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17782
17783 * xml.c (parse_region): If a document contains only comments,
17784 return that, too.
17785
17786 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17787
17788 * xml.c (make_dom): Return comments, too.
17789
17790 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17791
17792 Port to OpenBSD.
17793 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17794 and the surrounding thread.
17795 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17796 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17797 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17798 timer goes off.
17799 * s/openbsd.h (BROKEN_SIGIO): Define.
17800 * unexelf.c (unexec) [__OpenBSD__]:
17801 Don't update the .mdebug section of the Alpha COFF symbol table.
17802
17803 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17804
17805 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17806 (bug#8460).
17807
17808 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17809
17810 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17811 This fixes some race conditions on the permissions of any newly
17812 created file.
17813
17814 * alloc.c (valid_pointer_p): Use pipe, not open.
17815 This fixes some permissions issues when debugging.
17816
17817 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17818 If fchown fails to set both uid and gid, try to set just gid,
17819 as that is sometimes allowed. Adjust the file's mode to eliminate
17820 setuid or setgid bits that are inappropriate if fchown fails.
17821
17822 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17823
17824 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17825 to compare Lisp_Objects.
17826 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17827 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17828 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17829
17830 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17831
17832 * lread.c (read_integer): Unread even EOF character.
17833 (read1): Likewise. Properly record start position of symbol.
17834
17835 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17836 symbol character follows.
17837
17838 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17839
17840 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17841 This works around a problem with the previous change to Fcopy_file.
17842 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17843 and without this change, GCC might complain about discarding
17844 fchown's return value.
17845
17846 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
17847
17848 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17849
17850 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17851
17852 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17853
17854 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17855
17856 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17857 it's used from the C level.
17858
17859 * process.c: Use the same condition for POLL_FOR_INPUT in both
17860 keyboard.c and process.c (bug#1858).
17861
17862 2011-07-09 Lawrence Mitchell <wence@gmx.li>
17863
17864 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17865 (Fgnutls_boot): Use it.
17866
17867 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17868
17869 * doc.c (Fsubstitute_command_keys): Revert last change.
17870
17871 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17872
17873 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17874 quotes the next character, and doesn't affect other longer
17875 sequences (bug#8935).
17876
17877 * lread.c (syms_of_lread): Clarify that is isn't only
17878 `eval-buffer' and `eval-defun' that's affected by
17879 `lexical-binding' (bug#8460).
17880
17881 2011-07-15 Eli Zaretskii <eliz@gnu.org>
17882
17883 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
17884 bidi redisplay when a line includes both an image and is truncated.
17885
17886 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17887
17888 Fix minor problems found by static checking.
17889 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17890 (elsz): Now a signed constant, not a size_t var. We prefer signed
17891 types to unsigned, to avoid integer comparison confusion. Without
17892 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17893 "cannot optimize loop, the loop counter may overflow", a symptom
17894 of the confusion.
17895 * indent.c (Fvertical_motion): Mark locals as initialized.
17896 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17897
17898 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17899
17900 * search.c (Fre_search_backward): Mention `case-fold-search' in
17901 all the re_search_* functions (bug#8138).
17902
17903 * keyboard.c (Fopen_dribble_file): Document when the file is
17904 closed (bug#8056).
17905
17906 2011-07-14 Eli Zaretskii <eliz@gnu.org>
17907
17908 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17909 bidi_cache_idx.
17910
17911 Support bidi reordering of display and overlay strings.
17912 * xdisp.c (compute_display_string_pos)
17913 (compute_display_string_end): Accept additional argument STRING.
17914 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17915 (reseat_to_string): Initialize bidi_it->string.s and
17916 bidi_it->string.schars.
17917 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
17918 NULL (avoids a crash in bidi_paragraph_init).
17919 Initialize itb.string.lstring.
17920 (init_iterator): Call bidi_init_it only of a valid
17921 buffer position was specified. Initialize paragraph_embedding to
17922 L2R.
17923 (reseat_to_string): Initialize the bidi iterator.
17924 (display_string): If we need to ignore text properties of
17925 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17926 original value of -1 will not work with bidi.)
17927 (compute_display_string_pos): First arg is now struct
17928 `text_pos *'; all callers changed. Support display properties on
17929 Lisp strings.
17930 (compute_display_string_end): Support display properties on Lisp
17931 strings.
17932 (init_iterator, reseat_1, reseat_to_string): Initialize the
17933 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17934 when iterating on a string not from display properties).
17935 (compute_display_string_pos, compute_display_string_end):
17936 Fix calculation of the object to scan. Fixes an error when using
17937 arrow keys.
17938 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
17939 base_level_stop; instead, set base_level_stop to BEGV.
17940 Fixes crashes in vertical-motion.
17941 (next_element_from_buffer): Improve commentary for when
17942 the iterator is before prev_stop.
17943 (init_iterator): Initialize bidi_p from the default value of
17944 bidi-display-reordering, not from buffer-local value. Use the
17945 buffer-local value only if initializing for buffer iteration.
17946 (handle_invisible_prop): Support invisible properties on strings
17947 that are being bidi-reordered.
17948 (set_iterator_to_next): Support bidi reordering of C strings and
17949 Lisp strings.
17950 (next_element_from_string): Support bidi reordering of Lisp
17951 strings.
17952 (handle_stop_backwards): Support Lisp strings as well.
17953 (display_string): Support display of R2L glyph rows.
17954 Use IT_STRING_CHARPOS when displaying from a Lisp string.
17955 (init_iterator): Don't initialize it->bidi_p for strings
17956 here.
17957 (reseat_to_string): Initialize it->bidi_p for strings here.
17958 (next_element_from_string, next_element_from_c_string)
17959 (next_element_from_buffer): Add xassert's for correspondence
17960 between IT's object being iterated and it->bidi_it.string
17961 structure.
17962 (face_before_or_after_it_pos): Support bidi iteration.
17963 (next_element_from_c_string): Handle the case of the first string
17964 character that is not the first one in the visual order.
17965 (get_visually_first_element): New function, refactored from common
17966 parts of next_element_from_buffer, next_element_from_string, and
17967 next_element_from_c_string.
17968 (tool_bar_lines_needed, redisplay_tool_bar)
17969 (display_menu_bar): Force left-to-right direction. Add a FIXME
17970 comment for making that be controlled by a user option.
17971 (push_it, pop_it): Save and restore the state of the
17972 bidi iterator. Save and restore the bidi_p flag.
17973 (pop_it): Iterate out of display property for string iteration as
17974 well.
17975 (iterate_out_of_display_property): Support iteration over strings.
17976 (handle_single_display_spec): Set up it->bidi_it for iteration
17977 over a display string, and call bidi_init_it.
17978 (handle_single_display_spec, next_overlay_string)
17979 (get_overlay_strings_1, push_display_prop): Set up the bidi
17980 iterator for displaying display or overlay strings.
17981 (forward_to_next_line_start): Don't use the shortcut if
17982 bidi-iterating.
17983 (back_to_previous_visible_line_start): If handle_display_prop
17984 pushed the iterator stack, restore the internal state of the bidi
17985 iterator by calling bidi_pop_it same number of times.
17986 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17987 and we are bidi-iterating, don't decrement the iterator position;
17988 instead, set the first_elt flag in the bidi iterator, to produce
17989 the same effect.
17990 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17991 (push_display_prop): xassert that we are iterating a buffer.
17992 (push_it, pop_it): Save and restore paragraph_embedding member.
17993 (handle_single_display_spec, next_overlay_string)
17994 (get_overlay_strings_1, reseat_1, reseat_to_string)
17995 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17996 correctly. Don't assume unibyte strings are not bidi-reordered.
17997 (compute_display_string_pos)
17998 (compute_display_string_end): Fix handling the case of C string.
17999 (push_it, pop_it): Save and restore from_disp_prop_p.
18000 (handle_single_display_spec, push_display_prop): Set the
18001 from_disp_prop_p flag.
18002 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18003 (pop_it): Call iterate_out_of_display_property only if we are
18004 popping after iteration over a string that came from a display
18005 property. Fix a typo in popping stretch info. Add an assertion
18006 for verifying that the iterator position is in sync with the bidi
18007 iterator.
18008 (handle_single_display_spec, get_overlay_strings_1)
18009 (push_display_prop): Fix initialization of paragraph direction for
18010 string when that of the parent object is not yet determined.
18011 (reseat_1): Call bidi_init_it to resync the bidi
18012 iterator with IT's position. (Bug#7616)
18013 (find_row_edges): If ROW->start.pos gives position
18014 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18015 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18016 Reset the from_disp_prop_p flag.
18017 (SAVE_IT, RESTORE_IT): New macros.
18018 (pos_visible_p, face_before_or_after_it_pos)
18019 (back_to_previous_visible_line_start)
18020 (move_it_in_display_line_to, move_it_in_display_line)
18021 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18022 (try_scrolling, redisplay_window, display_line): Use them when
18023 saving a temporary copy of the iterator and restoring it back.
18024 (back_to_previous_visible_line_start, reseat_1)
18025 (init_iterator): Empty the bidi cache "stack".
18026 (move_it_in_display_line_to): If iterator ended up at
18027 EOL, but we never saw any buffer positions smaller than
18028 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18029 motion in bidi-reordered lines.
18030 (move_it_in_display_line_to): Record prev_method and prev_pos
18031 immediately before the call to set_iterator_to_next. Fixes cursor
18032 motion in bidi-reordered lines with stretch glyphs and strings
18033 displayed in margins. (Bug#8133) (Bug#8867)
18034 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18035 TO_CHARPOS.
18036 (pos_visible_p): Support positions in bidi-reordered lines.
18037 Save and restore bidi cache.
18038
18039 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18040 (bidi_paragraph_info): Delete unused struct.
18041 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18042 (bidi_cache_start): New variable.
18043 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18044 to zero.
18045 (bidi_cache_fetch_state, bidi_cache_search)
18046 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18047 (bidi_cache_find, bidi_peek_at_next_level)
18048 (bidi_level_of_next_char, bidi_find_other_level_edge)
18049 (bidi_move_to_visually_next): Compare cache index with
18050 bidi_cache_start rather than with zero.
18051 (bidi_fetch_char): Accept new argument STRING; all callers
18052 changed. Support iteration over a string. Support strings with
18053 display properties. Support unibyte strings. Fix the type of
18054 `len' according to what STRING_CHAR_AND_LENGTH expects.
18055 (bidi_paragraph_init, bidi_resolve_explicit_1)
18056 (bidi_resolve_explicit, bidi_resolve_weak)
18057 (bidi_level_of_next_char, bidi_move_to_visually_next):
18058 Support iteration over a string.
18059 (bidi_set_sor_type, bidi_resolve_explicit_1)
18060 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18061 can now be zero (for strings); special values 0 and -1 were
18062 changed to -1 and -2, respectively.
18063 (bidi_char_at_pos): New function.
18064 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18065 Call it instead of FETCH_MULTIBYTE_CHAR.
18066 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18067 initialized to valid values.
18068 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18069 values.
18070 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18071 the test for valid cached positions. Fix the logic for looking up
18072 the sentinel state in the cache. GCPRO the Lisp string we are
18073 iterating.
18074 (bidi_push_it, bidi_pop_it): New functions.
18075 (bidi_initialize): Initialize the bidi cache start stack pointer.
18076 (bidi_cache_ensure_space): New function, refactored from part of
18077 bidi_cache_iterator_state. Don't assume the required size is just
18078 one BIDI_CACHE_CHUNK away.
18079 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18080 (bidi_count_bytes, bidi_char_at_pos): New functions.
18081 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18082 always valid if bidi_cache_idx is valid.
18083 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18084 is valid if it's going to be used.
18085 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18086 (bidi_cache_fetch_state, bidi_cache_search)
18087 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18088 (bidi_cache_iterator_state, bidi_cache_find)
18089 (bidi_find_other_level_edge, bidi_cache_start_stack):
18090 All variables related to cache indices are now EMACS_INT.
18091
18092 * dispextern.h (struct bidi_string_data): New structure.
18093 (struct bidi_it): New member `string'. Make flag members be 1-bit
18094 fields, and put them last in the struct.
18095 (compute_display_string_pos, compute_display_string_end):
18096 Update prototypes.
18097 (bidi_push_it, bidi_pop_it): Add prototypes.
18098 (struct iterator_stack_entry): New members bidi_p,
18099 paragraph_embedding, and from_disp_prop_p.
18100 (struct it): Member bidi_p is now a bit field 1 bit wide.
18101 (bidi_shelve_cache, bidi_unshelve_cache):
18102 Declare prototypes.
18103
18104 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18105 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18106 and vector-like objects.
18107
18108 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18109 cache around display iteration.
18110
18111 * window.c (Fwindow_end, window_scroll_pixel_based)
18112 (displayed_window_lines, Frecenter): Save and restore the bidi
18113 cache around display iteration.
18114
18115 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18116
18117 * editfns.c (Fdelete_region): Clarify the use of the named
18118 parameters (bug#6788).
18119
18120 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18121
18122 * indent.c (Fvertical_motion): Set and restore w->pointm when
18123 saving and restoring the window's buffer (Bug#9006).
18124
18125 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18126
18127 * editfns.c (Fstring_to_char): Clarify just what is returned
18128 (bug#6576). Text by Eli Zaretskii.
18129
18130 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18131
18132 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18133
18134 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18135
18136 * buffer.c (mmap_find): Fix a typo.
18137
18138 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18139
18140 Fix execution of x selection hooks.
18141 * xselect.c (Qx_lost_selection_functions)
18142 (Qx_sent_selection_functions): New vars.
18143 (syms_of_xselect): DEFSYM them.
18144 (x_handle_selection_request): Pass Qx_sent_selection_functions
18145 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18146 (x_handle_selection_clear,x_clear_frame_selections):
18147 Pass Qx_lost_selection_functions rather than
18148 Vx_lost_selection_functions to Frun_hook_with_args.
18149
18150 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18151
18152 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18153 The old code sometimes used this field without initializing it.
18154
18155 * alloc.c (gc_sweep): Don't read past end of array.
18156 In theory, the old code could also have corrupted Emacs internals,
18157 though it'd be very unlikely.
18158
18159 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18160
18161 * character.c (Fcharacterp): Don't advertise optional ignored
18162 argument. (Bug#4026)
18163
18164 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18165
18166 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18167 key" (bug#4257).
18168
18169 * window.c (Fset_window_start): Doc fix (bug#4199).
18170 (Fset_window_hscroll): Ditto.
18171
18172 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18173
18174 Fix minor new problems caught by GCC 4.6.1.
18175 * term.c (init_tty): Remove unused local.
18176 * xsettings.c (store_monospaced_changed): Define this function only
18177 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18178 not used otherwise.
18179
18180 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18181
18182 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18183
18184 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18185
18186 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18187 are the mini-buffer and the echo area (bug#3320).
18188
18189 * term.c (init_tty): Remove support for supdup, c10 and perq
18190 terminals, which are no longer supported (bug#1482).
18191
18192 2011-07-10 Johan Bockgård <bojohan@gnu.org>
18193
18194 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18195
18196 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18197
18198 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18199 for non-popups (Bug#3642).
18200
18201 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18202
18203 * alloc.c (reset_malloc_hooks): Protoize.
18204 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
18205 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18206 * cm.c (losecursor): Likewise.
18207 * data.c (fmod): Likewise.
18208 * dispnew.c (swap_glyphs_in_rows): Likewise.
18209 * emacs.c (memory_warning_signal): Likewise.
18210 * floatfns.c (float_error): Likewise.
18211 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18212 (otf_open, font_otf_capability, generate_otf_features)
18213 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18214 Likewise.
18215 * image.c (pbm_read_file): Likewise.
18216 * indent.c (string_display_width): Likewise.
18217 * intervals.c (check_for_interval, search_for_interval)
18218 (inc_interval_count, count_intervals, root_interval)
18219 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18220 * lread.c (defalias): Likewise.
18221 * ralloc.c (r_alloc_check): Likewise.
18222 * regex.c (set_image_of_range_1, set_image_of_range)
18223 (regex_grow_registers): Likewise.
18224 * sysdep.c (strerror): Likewise.
18225 * termcap.c (valid_filename_p, tprint, main): Likewise.
18226 * tparam.c (main): Likewise.
18227 * unexhp9k800.c (run_time_remap, save_data_space)
18228 (update_file_ptrs, read_header, write_header, calculate_checksum)
18229 (copy_file, copy_rest, display_header): Likewise.
18230 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18231 Likewise.
18232 * xdisp.c (check_it): Likewise.
18233 * xfaces.c (register_color, unregister_color, unregister_colors):
18234 Likewise.
18235 * xfns.c (print_fontset_result): Likewise.
18236 * xrdb.c (member, fatal, main): Likewise.
18237
18238 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18239
18240 Fix minor problems found by static checking (Bug#9031).
18241 * chartab.c (char_table_set_range, map_sub_char_table):
18242 Remove unused locals.
18243 (uniprop_table): Now static.
18244 * composite.c (_work_char): Remove unused static var.
18245
18246 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
18247
18248 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18249
18250 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18251
18252 * gtkutil.c (qttip_cb): Remove code without function.
18253
18254 2011-07-09 Eli Zaretskii <eliz@gnu.org>
18255
18256 * w32.c (pthread_sigmask): New stub.
18257
18258 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
18259
18260 Use pthread_sigmask, not sigprocmask (Bug#9010).
18261 sigprocmask is portable only for single-threaded applications, and
18262 Emacs can be multi-threaded when it uses GTK.
18263 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18264 (LIBES): Use it.
18265 * callproc.c (Fcall_process):
18266 * process.c (create_process):
18267 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18268 Use pthread_sigmask, not sigprocmask.
18269
18270 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18271
18272 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18273 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18274 wrong (Bug#8591).
18275
18276 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18277
18278 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18279 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18280 (xg_hide_tooltip): Fix comment.
18281
18282 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18283 in registerServicesMenuSendTypes.
18284 (validRequestorForSendType): Don't check ns_return_types.
18285
18286 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18287 ns_return_type.
18288
18289 2011-07-08 Jason Rumney <jasonr@gnu.org>
18290
18291 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18292 SH_SHOW for hidden windows (Bug#5482).
18293
18294 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18295 frame struct members of non-existent frames (Bug#6284).
18296
18297 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18298
18299 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18300 variable firstTime not needed on OSX >= 10.6.
18301 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18302 >= 10.5. Use setKnobProportion, setDoubleValue.
18303
18304 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18305 (MAC_OS_X_VERSION_10_5): Define if not defined.
18306 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18307 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18308 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18309
18310 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
18311 cString and lossyCString on OSX >= 10.4.
18312
18313 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
18314 sizeToFit on OSX >= 10.2.
18315
18316 * nsimage.m (allocInitFromFile): Don't use deprecated method
18317 bestRepresentationForDevice on OSX >= 10.6.
18318
18319 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18320 to avoid warning.
18321
18322 * emacs.c: Declare unexec_init_emacs_zone.
18323
18324 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18325
18326 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18327
18328 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18329 on svcsMenu (Bug#8842).
18330
18331 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18332 ns_return_types.
18333 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18334
18335 * nsterm.m (QUTF8_STRING): Declare.
18336 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18337 (validRequestorForSendType): Return type is (id).
18338 Change indexOfObjectIdenticalTo to indexOfObject.
18339 Check if we have local selection before returning self (Bug#8842).
18340 (writeSelectionToPasteboard): Put local selection into paste board
18341 if we have a local selection (Bug#8842).
18342 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18343
18344 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18345 (ns_get_local_selection): Declare.
18346
18347 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18348
18349 * keymap.c (describe_map_tree): Don't insert a double newline at
18350 the end of the buffer (bug#1169) and return whether we inserted
18351 something.
18352
18353 * callint.c (Fcall_interactively): Change "reading args" to
18354 "providing args" to try to clarify what it does (bug#1010).
18355
18356 2011-07-07 Kenichi Handa <handa@m17n.org>
18357
18358 * composite.c (composition_compute_stop_pos): Ignore a static
18359 composition starting before CHARPOS (Bug#8915).
18360
18361 * xdisp.c (handle_composition_prop): Likewise.
18362
18363 2011-07-07 Eli Zaretskii <eliz@gnu.org>
18364
18365 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18366 (Bug#9015)
18367
18368 2011-07-07 Kenichi Handa <handa@m17n.org>
18369
18370 * character.h (unicode_category_t): New enum type.
18371
18372 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18373 (Qchar_code_property_table): New variable.
18374 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18375 (UNIPROP_COMPRESSED_FORM_P): New macros.
18376 (char_table_ascii): Uncompress the compressed values.
18377 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18378 Uncompress the compressed values.
18379 (sub_char_table_ref_and_range): Likewise.
18380 (char_table_ref_and_range): Uncompress the compressed values.
18381 (sub_char_table_set): New arg is_uniprop. Callers changed.
18382 Uncompress the compressed values.
18383 (sub_char_table_set_range): Args changed. Callers changed.
18384 (char_table_set_range): Adjuted for the above change.
18385 (map_sub_char_table): Delete args default_val and parent. Add arg
18386 top. Give decoded values to a Lisp function.
18387 (map_char_table): Adjust for the above change. Give decoded
18388 values to a Lisp function. Gcpro more variables.
18389 (uniprop_table_uncompress)
18390 (uniprop_decode_value_run_length): New functions.
18391 (uniprop_decoder, uniprop_decoder_count): New variables.
18392 (uniprop_get_decoder, uniprop_encode_value_character)
18393 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18394 New functions.
18395 (uniprop_encoder, uniprop_encoder_count): New variables.
18396 (uniprop_get_encoder, uniprop_table)
18397 (Funicode_property_table_internal, Fget_unicode_property_internal)
18398 (Fput_unicode_property_internal): New functions.
18399 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18400 Sunicode_property_table_internal, Sget_unicode_property_internal,
18401 and Sput_unicode_property_internal. Defvar_lisp
18402 char-code-property-alist.
18403
18404 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
18405 Vunicode_category_table.
18406
18407 * font.c (font_range): Adjust for the change of
18408 Vunicode_category_table.
18409
18410 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18411
18412 * m/iris4d.h: Remove file, move contents ...
18413 * s/irix6-5.h: ... here.
18414
18415 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18416
18417 Remove unportable assumption about struct layout (Bug#8884).
18418 * alloc.c (mark_buffer):
18419 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18420 (clone_per_buffer_values): Don't assume that
18421 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18422 This isn't true in general, and it's particularly not true
18423 if Emacs is configured with --with-wide-int.
18424 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18425 New macros, used in the buffer.c change.
18426
18427 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18428
18429 * xsettings.c: Use both GConf and GSettings if both are available.
18430 (store_config_changed_event): Add comment.
18431 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18432 (store_tool_bar_style_changed): New functions.
18433 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
18434 (struct xsettings): Move font inside HAVE_XFT.
18435 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
18436 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
18437 Move inside HAVE_XFT.
18438 (something_changed_gsettingsCB): Rename from something_changedCB.
18439 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18440 also.
18441 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
18442 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
18443 (something_changed_gconfCB): Rename from something_changedCB.
18444 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18445 (parse_settings): Move check for font inside HAVE_XFT.
18446 (read_settings, apply_xft_settings): Add comment.
18447 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18448 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18449 call store_font_name_changed.
18450 (xft_settings_event): Add comment.
18451 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18452 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18453 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18454 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18455 (xsettings_initialize): Call init_gsettings last.
18456 (xsettings_get_system_font, xsettings_get_system_normal_font):
18457 Add comment.
18458
18459 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18460
18461 Random fixes. E.g., (random) never returned negative values.
18462 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18463 subseconds part to the entropy, as that's a bit more random.
18464 Prefer signed to unsigned, since the signedness doesn't matter and
18465 in general we prefer signed. When given a limit, use a
18466 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18467 latter isn't right if USE_2_TAGS_FOR_INTS.
18468 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18469 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18470
18471 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18472
18473 * textprop.c (text_property_stickiness):
18474 Obey Vtext_property_default_nonsticky.
18475 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18476 * w32fns.c (syms_of_w32fns):
18477 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18478
18479 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18480
18481 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18482 This is more efficient than Ffile_directory_p and avoids a minor race.
18483
18484 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18485
18486 * buffer.c (Foverlay_put): Say what the return value is
18487 (bug#7835).
18488
18489 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18490 is a directory before asking whether to use the file name
18491 (bug#7564).
18492 (barf_or_query_if_file_exists): Make the "File is a directory"
18493 error be more correct.
18494
18495 * fns.c (Frequire): Remove the mention of the .gz files, since
18496 that's installation-specific, but keep the mention of
18497 `get-load-suffixes'.
18498
18499 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18500
18501 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18502 Report string overflow if the output is too long.
18503
18504 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
18505
18506 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18507 (syms_of_gnutls): Remove duplicate DEFSYM for
18508 Qgnutls_bootprop_verify_hostname_error, an error for
18509 Qgnutls_bootprop_verify_error (which is no longer used).
18510
18511 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18512 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18513 Also (re)move comments that are misplaced or no longer relevant.
18514
18515 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18516
18517 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18518
18519 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
18520
18521 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18522 and background color parameters if they have been changed.
18523
18524 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18525
18526 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18527
18528 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18529
18530 * xsettings.c (SYSTEM_FONT): Define only when used.
18531 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18532
18533 * keymap.c (access_keymap_1): Now static.
18534
18535 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
18536
18537 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18538 leave any prefix arg for the up event (Bug#1586).
18539
18540 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18541
18542 * lread.c (syms_of_lread): Mention single symbols defined by
18543 `defvar' or `defconst' (bug#7154).
18544
18545 * fns.c (Frequire): Mention .el.gz files (bug#7314).
18546 (Frequire): Mention get-load-suffixes.
18547
18548 2011-07-02 Martin Rudalics <rudalics@gmx.at>
18549
18550 * window.h (window): Remove clone_number slot.
18551 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18552 Remove.
18553 (make_parent_window, make_window, saved_window)
18554 (Fset_window_configuration, save_window_save): Don't deal with
18555 clone numbers.
18556 * buffer.c (Qclone_number): Remove declaration.
18557 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18558
18559 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18560
18561 Add multiple inheritance to keymaps.
18562 * keymap.c (Fmake_composed_keymap): New function.
18563 (Fset_keymap_parent): Simplify.
18564 (fix_submap_inheritance): Remove.
18565 (access_keymap_1): New function extracted from access_keymap to handle
18566 embedded parents and handle lists of maps.
18567 (access_keymap): Use it.
18568 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18569 (Fcopy_keymap): Handle embedded parents.
18570 (Fcommand_remapping, define_as_prefix): Simplify.
18571 (Fkey_binding): Simplify.
18572 (syms_of_keymap): Move minibuffer-local-completion-map,
18573 minibuffer-local-filename-completion-map,
18574 minibuffer-local-must-match-map, and
18575 minibuffer-local-filename-must-match-map to Elisp.
18576 (syms_of_keymap): Defsubr make-composed-keymap.
18577 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18578 (parse_menu_item): Trivial simplification.
18579
18580 2011-07-01 Glenn Morris <rgm@gnu.org>
18581
18582 * Makefile.in (SETTINGS_LIBS): Fix typo.
18583
18584 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
18585
18586 * coding.c (Fencode_coding_string): Record the last coding system
18587 used, as the function doc string says (bug#8738).
18588
18589 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18590
18591 * xsettings.c (store_monospaced_changed): Take new font as arg and
18592 check for change against current_mono_font.
18593 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18594 (emacs_settings_constructor, emacs_settings_get_property)
18595 (emacs_settings_set_property, emacs_settings_class_init)
18596 (emacs_settings_init, gsettings_obj): Remove.
18597 (something_changedCB): New function for HAVE_GSETTINGS.
18598 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18599 with value as argument.
18600 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18601 g_settings_new (Bug#8967). Do not create gsettings_obj.
18602 Remove calls to g_settings_bind. Connect something_changedCB to
18603 "changed".
18604
18605 * xgselect.c: Add defined (HAVE_GSETTINGS).
18606 (xgselect_initialize): Ditto.
18607
18608 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18609 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18610 xg_select.
18611
18612 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18613
18614 * eval.c (struct backtrace): Simplify and port the data structure.
18615 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18616 signed bit field, as this assumption is not portable and it makes
18617 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18618 "char debug_on_exit : 1" as this is not portable either; instead,
18619 use the portable "unsigned int debug_on_exit : 1". Remove unused
18620 member evalargs. Remove obsolete comments about cc bombing out.
18621
18622 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18623
18624 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
18625 Let HAVE_GSETTINGS override HAVE_GCONF.
18626 (store_monospaced_changed): New function.
18627 (EMACS_SETTINGS): A new type derived from GObject to handle
18628 GSettings notifications.
18629 (emacs_settings_constructor, emacs_settings_get_property)
18630 (emacs_settings_set_property, emacs_settings_class_init):
18631 New functions.
18632 (gsettings_client, gsettings_obj): New variables.
18633 (GSETTINGS_SCHEMA): New define.
18634 (something_changedCB): Call store_monospaced_changed.
18635 (init_gsettings): New function.
18636 (xsettings_initialize): Call init_gsettings.
18637 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18638 to NULL.
18639
18640 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
18641 GCONF_CFLAGS/LIBS.
18642
18643 2011-06-29 Martin Rudalics <rudalics@gmx.at>
18644
18645 * window.c (resize_root_window, grow_mini_window)
18646 (shrink_mini_window): Rename Qresize_root_window to
18647 Qwindow_resize_root_window and Qresize_root_window_vertically to
18648 Qwindow_resize_root_window_vertically.
18649
18650 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18651
18652 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18653
18654 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
18655
18656 * makefile.w32-in: Redesign dependencies so they reflect more
18657 clearly which files are directly included by each source file,
18658 and not through other includes.
18659
18660 2011-06-27 Martin Rudalics <rudalics@gmx.at>
18661
18662 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18663 (sort_overlays, overlay_strings): When an overlay's clone number
18664 matches the window's clone number process the overlay even if
18665 the overlay's window property doesn't match the current window.
18666
18667 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18668 (Fwindow_hchild): Rename to Fwindow_left_child.
18669 (Fwindow_next): Rename to Fwindow_next_sibling.
18670 (Fwindow_prev): Rename to Fwindow_prev_sibling.
18671 (resize_window_check): Rename to window_resize_check.
18672 (resize_window_apply): Rename to window_resize_apply.
18673 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18674 (Fdelete_other_windows_internal, resize_frame_windows)
18675 (Fsplit_window_internal, Fdelete_window_internal)
18676 (grow_mini_window, shrink_mini_window)
18677 (Fresize_mini_window_internal): Fix callers accordingly.
18678
18679 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18680
18681 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18682 (emacs_fixed_set_min_size): Remove.
18683 (emacs_fixed_new): Take frame as argument.
18684
18685 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18686 (_EmacsFixedPrivate): Remove minwidth/height.
18687 Add struct frame *f.
18688 (emacs_fixed_init): Initialize priv->f.
18689 (get_parent_class, emacs_fixed_set_min_size): Remove.
18690 (emacs_fixed_new): Set priv->f to argument.
18691 (emacs_fixed_get_preferred_width)
18692 (emacs_fixed_get_preferred_height): Use min_width/height from
18693 frames size_hint to set minimum and natural (Bug#8919).
18694 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18695 and use min_width/height from frames size_hint to set
18696 min_width/height (Bug#8919).
18697
18698 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
18699 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18700 Fix indentation.
18701
18702 2011-06-26 Eli Zaretskii <eliz@gnu.org>
18703
18704 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18705 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18706 called at ZV.
18707
18708 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
18709
18710 * process.c (wait_reading_process_output): Bypass select if
18711 waiting for a cell while ignoring keyboard input, and input is
18712 pending. Suggested by Jan Djärv (Bug#8869).
18713
18714 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18715
18716 Use gnulib's dup2 module instead of rolling our own.
18717 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18718
18719 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18720
18721 * dispnew.c (scrolling_window): Before scrolling, turn off a
18722 mouse-highlight in the window being scrolled.
18723
18724 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
18725
18726 Move DEFSYM to lisp.h and use everywhere.
18727
18728 * character.h (DEFSYM): Move declaration...
18729 * lisp.h (DEFSYM): ...here.
18730
18731 * gnutls.c:
18732 * minibuf.c:
18733 * w32menu.c:
18734 * w32proc.c:
18735 * w32select.c: Don't include character.h.
18736
18737 * alloc.c (syms_of_alloc):
18738 * buffer.c (syms_of_buffer):
18739 * bytecode.c (syms_of_bytecode):
18740 * callint.c (syms_of_callint):
18741 * casefiddle.c (syms_of_casefiddle):
18742 * casetab.c (init_casetab_once):
18743 * category.c (init_category_once, syms_of_category):
18744 * ccl.c (syms_of_ccl):
18745 * cmds.c (syms_of_cmds):
18746 * composite.c (syms_of_composite):
18747 * dbusbind.c (syms_of_dbusbind):
18748 * dired.c (syms_of_dired):
18749 * dispnew.c (syms_of_display):
18750 * doc.c (syms_of_doc):
18751 * editfns.c (syms_of_editfns):
18752 * emacs.c (syms_of_emacs):
18753 * eval.c (syms_of_eval):
18754 * fileio.c (syms_of_fileio):
18755 * fns.c (syms_of_fns):
18756 * frame.c (syms_of_frame):
18757 * fringe.c (syms_of_fringe):
18758 * insdel.c (syms_of_insdel):
18759 * keymap.c (syms_of_keymap):
18760 * lread.c (init_obarray, syms_of_lread):
18761 * macros.c (syms_of_macros):
18762 * msdos.c (syms_of_msdos):
18763 * print.c (syms_of_print):
18764 * process.c (syms_of_process):
18765 * search.c (syms_of_search):
18766 * sound.c (syms_of_sound):
18767 * syntax.c (init_syntax_once, syms_of_syntax):
18768 * terminal.c (syms_of_terminal):
18769 * textprop.c (syms_of_textprop):
18770 * undo.c (syms_of_undo):
18771 * w32.c (globals_of_w32):
18772 * window.c (syms_of_window):
18773 * xdisp.c (syms_of_xdisp):
18774 * xfaces.c (syms_of_xfaces):
18775 * xfns.c (syms_of_xfns):
18776 * xmenu.c (syms_of_xmenu):
18777 * xsettings.c (syms_of_xsettings):
18778 * xterm.c (syms_of_xterm): Use DEFSYM.
18779
18780 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18781
18782 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
18783
18784 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18785
18786 Integer and buffer overflow fixes (Bug#8873).
18787
18788 * print.c (printchar, strout): Check for string overflow.
18789 (PRINTPREPARE, printchar, strout):
18790 Don't set size unless allocation succeeds.
18791
18792 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18793 for sizes. Check for string overflow more accurately.
18794 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18795
18796 * macros.c: Integer and buffer overflow fixes.
18797 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18798 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18799 Use ptrdiff_t, not int, for sizes.
18800 Don't increment bufsize until after realloc succeeds.
18801 Check for size-calculation overflow.
18802 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18803
18804 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18805
18806 * lread.c: Integer overflow fixes.
18807 (read_integer): Radix is now EMACS_INT, not int,
18808 to improve quality of diagnostics for out-of-range radices.
18809 Calculate buffer size correctly for out-of-range radices.
18810 (read1): Check for integer overflow in radices, and in
18811 read-circle numbers.
18812 (read_escape): Avoid int overflow.
18813 (Fload, openp, read_buffer_size, read1)
18814 (substitute_object_recurse, read_vector, read_list, map_obarray):
18815 Use ptrdiff_t, not int, for sizes.
18816 (read1): Use EMACS_INT, not int, for sizes.
18817 Check for size overflow.
18818
18819 * image.c (cache_image): Check for size arithmetic overflow.
18820
18821 * lread.c: Integer overflow issues.
18822 (saved_doc_string_size, saved_doc_string_length)
18823 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18824 Now ptrdiff_t, not int.
18825 (read1): Don't assume doc string length fits in int. Check for
18826 out-of-range doc string lengths.
18827 (read_list): Don't assume file position fits in int.
18828 (read_escape): Check for hex character overflow.
18829
18830 2011-06-22 Leo Liu <sdl.web@gmail.com>
18831
18832 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18833 Move to minibuffer.el.
18834
18835 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18836
18837 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
18838 The following patches are for when GLYPH_DEBUG && !XASSERT.
18839 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18840 * dispnew.c (flush_stdout):
18841 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18842 Mark as externally visible.
18843 * dispnew.c (check_window_matrix_pointers): Now static.
18844 * dispnew.c (window_to_frame_vpos):
18845 * xfns.c (unwind_create_frame):
18846 * xterm.c (x_check_font): Remove unused local.
18847 * scroll.c (CHECK_BOUNDS):
18848 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18849 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18850 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18851 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18852 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18853 Now static.
18854 (debug_method_add): Use va_list and vsprintf rather than relying
18855 on undefined behavior with wrong number of arguments.
18856 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18857 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18858 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18859 since we're not interested in debugging glyphs with old libraries.
18860 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18861 GCC 4.6.0's static checking.
18862
18863 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18864
18865 Integer overflow and signedness fixes (Bug#8873).
18866 A few related buffer overrun fixes, too.
18867
18868 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18869
18870 * dispextern.h (struct face.stipple):
18871 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18872 (x_bitmap_mask, x_allocate_bitmap_record)
18873 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18874 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18875 (x_create_bitmap_from_xpm_data):
18876 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18877 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18878 (.bitmaps_last):
18879 * xfaces.c (load_pixmap):
18880 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18881 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18882 (.bitmaps_last, struct x_output.icon_bitmap):
18883 Use ptrdiff_t, not int, for bitmap indexes.
18884 (x_allocate_bitmap_record): Check for size overflow.
18885 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18886
18887 Use ptrdiff_t, not int, for overlay counts.
18888 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18889 * editfns.c (overlays_around, get_pos_property):
18890 * textprop.c (get_char_property_and_overlay):
18891 * xdisp.c (next_overlay_change, note_mouse_highlight):
18892 * xfaces.c (face_at_buffer_position):
18893 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18894 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18895 (Fnext_overlay_change, Fprevious_overlay_change)
18896 (mouse_face_overlay_overlaps, Foverlays_in):
18897 Use ptrdiff_t, not int, for sizes.
18898 (overlays_at, overlays_in): Check for size-calculation overflow.
18899
18900 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18901
18902 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18903 (x_session_initialize): Do not assume string length fits in int.
18904
18905 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18906 This is unlikely, but can occur if DPI is outlandish.
18907
18908 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
18909 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18910
18911 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18912 * xrdb.c (magic_file_p, search_magic_path):
18913 Omit last arg SUFFIX; it was always 0. All callers changed.
18914 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18915
18916 * xfont.c (xfont_match): Avoid need for strlen.
18917
18918 * xfns.c: Don't assume strlen fits in int.
18919 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18920
18921 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18922 not unsigned long, as we prefer signed integers. All callers changed.
18923 Detect integer overflow in repeat count.
18924 (message_dolog): Don't assume print length fits in 39 bytes.
18925 (display_mode_element): Don't assume strlen fits in int.
18926
18927 * termcap.c: Don't assume sizes fit in int and never overflow.
18928 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18929 (gobble_line): Check for size-calculation overflow.
18930
18931 * minibuf.c (Fread_buffer):
18932 * lread.c (intern, intern_c_string):
18933 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18934 Don't assume string length fits in int.
18935
18936 * keyboard.c (parse_tool_bar_item):
18937 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18938
18939 * font.c: Don't assume string length fits in int.
18940 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18941 Use ptrdiff_t, not int.
18942 (font_intern_prop): Don't assume string length fits in int.
18943 Don't assume integer property fits in fixnum.
18944 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
18945
18946 * filelock.c: Fix some buffer overrun and integer overflow issues.
18947 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
18948 Reformulate so as not to need the command string.
18949 Invoke gzip -cd rather than gunzip, as it's more portable.
18950 (lock_info_type, lock_file_1, lock_file):
18951 Don't assume pid_t and time_t fit in unsigned long.
18952 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18953 (current_lock_owner): Prefer signed type for sizes.
18954 Use memcpy, not strncpy, where memcpy is what is really wanted.
18955 Don't assume (via atoi) that time_t and pid_t fit in int.
18956 Check for time_t and/or pid_t out of range, e.g., via a network share.
18957 Don't alloca where an auto var works fine.
18958
18959 * fileio.c: Fix some integer overflow issues.
18960 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18961 Don't assume string length fits in int.
18962 (directory_file_name): Don't assume string length fits in long.
18963 (make_temp_name): Don't assume pid fits in int, or that its print
18964 length is less than 20.
18965
18966 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18967
18968 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18969
18970 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18971
18972 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18973 We prefer signed integers, even for size calculations.
18974
18975 * emacs.c: Don't assume string length fits in 'int'.
18976 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18977 (main): Don't invoke strlen when not needed.
18978
18979 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18980 (XD_DEBUG_MESSAGE): Don't waste a byte.
18981
18982 * callproc.c (getenv_internal_1, getenv_internal)
18983 (Fgetenv_internal):
18984 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18985
18986 * lread.c (invalid_syntax): Omit length argument.
18987 All uses changed. This doesn't fix a bug, but it simplifies the
18988 code away from its former Hollerith-constant appearance, and it's
18989 one less 'int' to worry about when looking at integer-overflow issues.
18990 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
18991
18992 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18993 This didn't break anything, but it didn't help either.
18994 It's confusing to put a bogus integer in a place where the actual
18995 value does not matter.
18996 (LIST_END_P): Remove unused macro and its bogus comment.
18997 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
18998
18999 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19000 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19001 implementation.
19002 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19003 We prefer signed types, and the value cannot exceed the EMACS_INT
19004 range anyway (because otherwise the length would not be representable).
19005 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19006 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19007 This avoids a GCC warning when WIDE_EMACS_INT.
19008
19009 * indent.c (sane_tab_width): New function.
19010 (current_column, scan_for_column, Findent_to, position_indentation)
19011 (compute_motion): Use it. This is just for clarity.
19012 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19013
19014 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19015
19016 * lisp.h (lint_assume): New macro.
19017 * composite.c (composition_gstring_put_cache):
19018 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19019
19020 * editfns.c, insdel.c:
19021 Omit unnecessary forward decls, to simplify future changes.
19022
19023 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19024
19025 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19026
19027 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19028 Use much-faster test for byte-length change.
19029 Don't assume string byte-length fits in 'int'.
19030 Check that character arg fits in 'int'.
19031 (mapcar1): Declare byte as byte, for clarity.
19032
19033 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19034
19035 * fns.c (concat): Catch string overflow earlier.
19036 Do not rely on integer wraparound.
19037
19038 * dispextern.h (struct it.overlay_strings_charpos)
19039 (struct it.selective): Now EMACS_INT, not int.
19040 * xdisp.c (forward_to_next_line_start)
19041 (back_to_previous_visible_line_start)
19042 (reseat_at_next_visible_line_start, next_element_from_buffer):
19043 Don't arbitrarily truncate the value of 'selective' to int.
19044
19045 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19046
19047 * composite.c: Don't truncate sizes to 'int'.
19048 (composition_gstring_p, composition_reseat_it)
19049 (composition_adjust_point): Use EMACS_INT, not int.
19050 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19051 not EMACS_UINT, for indexes.
19052
19053 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19054
19055 * buffer.c: Include <verify.h>.
19056 (struct sortvec.priority, struct sortstr.priority):
19057 Now EMACS_INT, not int.
19058 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19059 (struct sortstr.size, record_overlay_string)
19060 (struct sortstrlist.size, struct sortlist.used):
19061 Don't truncate size to int.
19062 (record_overlay_string): Check for size-calculation overflow.
19063 (init_buffer_once): Check at compile-time, not run-time.
19064
19065 2011-06-22 Jim Meyering <meyering@redhat.com>
19066
19067 Don't leak an XBM-image-sized buffer
19068 * image.c (xbm_load): Free the image buffer after using it.
19069
19070 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19071
19072 Port to Sun C.
19073 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19074 that Sun C diagnosed.
19075 * fns.c (secure_hash): Fix pointer signedness issue.
19076 * intervals.c (static_offset_intervals): New function.
19077 (offset_intervals): Use it.
19078
19079 2011-06-21 Leo Liu <sdl.web@gmail.com>
19080
19081 * deps.mk (fns.o):
19082 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19083 sha512.h.
19084
19085 * fns.c (secure_hash): Rename from crypto_hash_function and change
19086 the first arg to accept symbols.
19087 (Fsecure_hash): New primitive.
19088 (syms_of_fns): New symbols.
19089
19090 2011-06-20 Deniz Dogan <deniz@dogan.se>
19091
19092 * process.c (Fset_process_buffer): Clarify return value in
19093 docstring.
19094
19095 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19096
19097 * dispnew.c (add_window_display_history): Use BVAR.
19098
19099 * xdisp.c (debug_method_add): Use BVAR.
19100 (check_window_end, dump_glyph_matrix, dump_glyph)
19101 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19102
19103 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19104 Likewise.
19105
19106 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19107 check till after the cache is created in init_frame_faces.
19108
19109 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19110
19111 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19112
19113 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19114
19115 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19116 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19117 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19118
19119 Improve buffer-overflow checking (Bug#8873).
19120 * fileio.c (Finsert_file_contents):
19121 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19122 Remove the old (too-loose) buffer overflow checks.
19123 They weren't needed, since make_gap checks for buffer overflow.
19124 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19125 The old code merely checked for Emacs fixnum overflow, and relied
19126 on undefined (wraparound) behavior. The new code avoids undefined
19127 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19128
19129 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19130 Tune. Don't use wider integers than needed. Don't use alloca.
19131 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19132
19133 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19134
19135 * insdel.c, lisp.h (buffer_overflow): New function.
19136 (insert_from_buffer_1, replace_range, replace_range_2):
19137 * insdel.c (make_gap_larger):
19138 * editfns.c (Finsert_char):
19139 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19140
19141 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19142
19143 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19144
19145 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19146
19147 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19148 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19149
19150 * fileio.c: Don't assume EMACS_INT fits in off_t.
19151 (emacs_lseek): New static function.
19152 (Finsert_file_contents, Fwrite_region): Use it.
19153 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19154
19155 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19156
19157 * fns.c: Don't overflow int when computing a list length.
19158 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19159 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19160 truncation on 64-bit hosts. Check for QUIT every
19161 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19162 faster and is responsive enough.
19163 (Flength): Report an error instead of overflowing an integer.
19164 (Fsafe_length): Return a float if the value is not representable
19165 as a fixnum. This shouldn't happen except in contrived situations.
19166 (Fnthcdr, Fsort): Don't assume list length fits in int.
19167 (Fcopy_sequence): Don't assume vector length fits in int.
19168
19169 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19170 (header_size, word_size): New constants.
19171 (allocate_vectorlike): Don't check size overflow here.
19172 (allocate_vector): Check it here instead, since this is the only
19173 caller of allocate_vectorlike that could cause overflow.
19174 Check that the new vector's length is representable as a fixnum.
19175
19176 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19177 The previous code was bogus. For example, next_almost_prime (32)
19178 returned 39, which is undesirable as it is a multiple of 3; and
19179 next_almost_prime (24) returned 25, which is a multiple of 5 so
19180 why was the code bothering to check for multiples of 7?
19181
19182 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19183
19184 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19185
19186 Variadic C functions now count arguments with ptrdiff_t.
19187 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19188 Back then I didn't know that the Emacs coding style prefers signed int.
19189 Also, in the meantime I found a few more instances where arguments
19190 were being counted with int, which may truncate counts on 64-bit
19191 machines, or EMACS_INT, which may be unnecessarily wide.
19192 * lisp.h (struct Lisp_Subr.function.aMANY)
19193 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19194 Arg counts are now ptrdiff_t, not size_t.
19195 All variadic functions and their callers changed accordingly.
19196 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19197 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19198 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19199 * callint.c (Fcall_interactively): Check arg count for overflow,
19200 to avoid potential buffer overrun. Use signed char, not 'int',
19201 for 'varies' array, so that we needn't bother to check its size
19202 calculation for overflow.
19203 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19204 * eval.c (apply_lambda):
19205 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19206 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19207 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19208
19209 * callint.c (Fcall_interactively): Don't use index var as event count.
19210
19211 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19212 * mem-limits.h (SIZE): Remove; no longer used.
19213
19214 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
19215
19216 Remove unnecessary casts.
19217 * xterm.c (x_term_init):
19218 * xfns.c (x_set_border_pixel):
19219 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19220 These aren't needed now that we assume ANSI C.
19221
19222 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19223 It's more likely to cause problems (due to unsigned overflow)
19224 than to cure them.
19225
19226 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19227
19228 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19229
19230 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19231
19232 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19233
19234 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19235
19236 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19237
19238 GLYPH_CODE_FACE returns EMACS_INT, not int.
19239 * dispextern.h (merge_faces):
19240 * xfaces.c (merge_faces):
19241 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19242 Don't assume EMACS_INT fits in int.
19243
19244 * character.h (CHAR_VALID_P): Remove unused parameter.
19245 * fontset.c, lisp.h, xdisp.c: All uses changed.
19246
19247 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19248
19249 * fns.c (concat): Minor tuning based on overflow analysis.
19250 This doesn't fix any bugs. Use int to hold character, instead
19251 of constantly refetching from Emacs object. Use XFASTINT, not
19252 XINT, for value known to be a character. Don't bother comparing
19253 a single byte to 0400, as it's always less.
19254
19255 * floatfns.c (Fexpt):
19256 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19257
19258 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19259 for characters.
19260
19261 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19262
19263 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19264 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19265 incorrectly succeed when S was a string, because 4294967386 was
19266 truncated before it was used.
19267
19268 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19269 Otherwise, an out-of-range integer could cause undefined behavior
19270 on a 64-bit host.
19271
19272 * composite.c: Use int, not EMACS_INT, for characters.
19273 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19274 EMACS_INT, for values that are known to be in character range.
19275 This doesn't fix any bugs but is the usual style inside Emacs and
19276 may generate better code on 32-bit machines.
19277
19278 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19279 This is for reasons similar to the recent CHAR_STRING fix.
19280 * charset.c (Fencode_char): Check that character arg is actually
19281 a character. Pass an int to ENCODE_CHAR.
19282 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19283 wider than 'int', as a compile-time check to prevent future regressions
19284 in this area.
19285
19286 * character.c (char_string): Remove unnecessary casts.
19287
19288 Make sure a 64-bit char is never passed to CHAR_STRING.
19289 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19290 by silently ignoring the top 32 bits, allowing some values
19291 that were far too large to be valid characters.
19292 * character.h: Include <verify.h>.
19293 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19294 arguments are no wider than unsigned, as a compile-time check
19295 to prevent future regressions in this area.
19296 * data.c (Faset):
19297 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
19298 (Fsubst_char_in_region):
19299 * fns.c (concat):
19300 * xdisp.c (decode_mode_spec_coding):
19301 Adjust to CHAR_STRING's new requirement.
19302 * editfns.c (Finsert_char, Fsubst_char_in_region):
19303 * fns.c (concat): Check that character args are actually
19304 characters. Without this test, these functions did the wrong
19305 thing with wildly out-of-range values on 64-bit hosts.
19306
19307 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19308 These casts should not be needed on 32-bit hosts, either.
19309 * keyboard.c (read_char):
19310 * lread.c (Fload): Remove casts to unsigned.
19311
19312 * lisp.h (UNSIGNED_CMP): New macro.
19313 This fixes comparison bugs on 64-bit hosts.
19314 (ASCII_CHAR_P): Use it.
19315 * casefiddle.c (casify_object):
19316 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
19317 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19318 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19319 * dispextern.h (FACE_FROM_ID):
19320 * keyboard.c (read_char): Use UNSIGNED_CMP.
19321
19322 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19323 not to EMACS_INT, to avoid GCC warning.
19324
19325 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19326
19327 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19328 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19329 isn't needed on 32-bit machines.
19330
19331 * buffer.c (Fgenerate_new_buffer_name):
19332 Use EMACS_INT for count, not int.
19333 (advance_to_char_boundary): Return EMACS_INT, not int.
19334
19335 * data.c (Qcompiled_function): Now static.
19336
19337 * window.c (window_body_lines): Now static.
19338
19339 * image.c (gif_load): Rename local to avoid shadowing.
19340
19341 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19342 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19343 * alloc.c (make_save_value): Integer argument is now of type
19344 ptrdiff_t, not int.
19345 (mark_object): Use ptrdiff_t, not int.
19346 * lisp.h (pD): New macro.
19347 * print.c (print_object): Use it.
19348
19349 * alloc.c: Use EMACS_INT, not int, to count objects.
19350 (total_conses, total_markers, total_symbols, total_vector_size)
19351 (total_free_conses, total_free_markers, total_free_symbols)
19352 (total_free_floats, total_floats, total_free_intervals)
19353 (total_intervals, total_strings, total_free_strings):
19354 Now EMACS_INT, not int. All uses changed.
19355 (Fgarbage_collect): Compute overall total using a double, so that
19356 integer overflow is less likely to be a problem. Check for overflow
19357 when converting back to an integer.
19358 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19359 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19360 These were 'int' variables that could overflow on 64-bit hosts;
19361 they were never used, so remove them instead of repairing them.
19362 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
19363 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19364 Previously, this ceilinged at INT_MAX, but that doesn't work on
19365 64-bit machines.
19366 (allocate_pseudovector): Don't use EMACS_INT when int would do.
19367
19368 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
19369 (allocate_vectorlike): Check for ptrdiff_t overflow.
19370 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19371 when a (possibly-narrower) signed value would do just as well.
19372 We prefer using signed arithmetic, to avoid comparison confusion.
19373
19374 * alloc.c: Catch some string size overflows that we were missing.
19375 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19376 for convenience in STRING_BYTES_MAX.
19377 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19378 The definition here is exact; the one in lisp.h was approximate.
19379 (allocate_string_data): Check for string overflow. This catches
19380 some instances we weren't catching before. Also, it catches
19381 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19382 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19383 and ptrdiff_t and EMACS_INT are both 64 bits.
19384
19385 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19386 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
19387 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
19388
19389 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19390
19391 * alloc.c (Fmake_string): Check for out-of-range init.
19392
19393 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19394
19395 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19396
19397 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19398
19399 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19400 xg_get_default_scrollbar_width.
19401
19402 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19403 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19404 (style_changed_cb): Call update_theme_scrollbar_width and call
19405 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19406 all frames (Bug#8505).
19407 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19408 Call gtk_window_set_resizable if HAVE_GTK3.
19409 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19410 and height if HAVE_GTK3 (Bug#8505).
19411 (scroll_bar_width_for_theme): New variable.
19412 (update_theme_scrollbar_width): New function.
19413 (xg_get_default_scrollbar_width): Move code to
19414 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19415 (xg_initialize): Call update_theme_scrollbar_width.
19416
19417 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19418
19419 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19420
19421 2011-06-12 Martin Rudalics <rudalics@gmx.at>
19422
19423 * frame.c (make_frame): Call other_buffer_safely instead of
19424 other_buffer.
19425
19426 * window.c (temp_output_buffer_show): Call display_buffer with
19427 second argument Vtemp_buffer_show_specifiers and reset latter
19428 immediately after the call.
19429 (Vtemp_buffer_show_specifiers): New variable.
19430 (auto_window_vscroll_p, next_screen_context_lines)
19431 (Vscroll_preserve_screen_position): Remove leading asterisks from
19432 doc-strings.
19433
19434 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
19435
19436 Fix minor problems found by GCC 4.6.0 static checking.
19437 * buffer.c (Qclone_number): Remove for now, as it's unused.
19438 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19439 (record_buffer): Remove unused local.
19440 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19441 (set_frame_buffer_list): Remove; unused.
19442 * frame.h (other_visible_frames): Remove decl.
19443 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19444 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19445 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19446 if HAVE_GPM.
19447 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19448 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19449 Define only if HAVE_GPM.
19450 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19451 (update_hints_inhibit): Remove; never set. All uses removed.
19452 * widgetprv.h (emacsFrameClassRec): Remove decl.
19453 * window.c (delete_deletable_window): Now returns void, since it
19454 wasn't returning anything.
19455 (compare_window_configurations): Remove unused locals.
19456 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19457 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
19458 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19459 the same widths as pointers. This follows up on the 2011-05-06 patch.
19460 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19461 * xterm.h: Likewise.
19462 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19463
19464 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
19465
19466 * makefile.w32-in: Update dependencies.
19467 (LISP_H): Add lib/intprops.h.
19468
19469 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19470
19471 * image.c (gif_load): Add animation frame delay to the metadata.
19472 (syms_of_image): Use DEFSYM. New symbol `delay'.
19473
19474 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19475
19476 * window.c (delete_deletable_window): Re-add.
19477 (Fset_window_configuration): Rewrite to handle dead buffers and
19478 consequently deletable windows.
19479 (window_tree, Fwindow_tree): Remove. Supply functionality in
19480 window.el.
19481 (compare_window_configurations): Simplify code.
19482
19483 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19484
19485 * image.c (imagemagick_load_image): Fix type mismatch.
19486 (Fimagemagick_types): Likewise.
19487
19488 * window.h (replace_buffer_in_windows): Declare.
19489
19490 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19491
19492 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19493 Qclone_number. Remove external declaration of Qdelete_window.
19494 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19495 code.
19496 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19497 Run Qbuffer_list_update_hook if allowed.
19498 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19499 buffer list implementation.
19500 (other_buffer_safely): New function.
19501 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19502 calls to replace_buffer_in_windows and
19503 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19504 if allowed.
19505 (record_buffer): Inhibit quitting and rewrite using quittable
19506 functions. Run Qbuffer_list_update_hook if allowed.
19507 (Frecord_buffer, Funrecord_buffer): New functions.
19508 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19509 Move switch-to-buffer to window.el.
19510 (bury-buffer): Move to window.el.
19511 (Vbuffer_list_update_hook): New variable.
19512
19513 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19514 section.
19515
19516 * window.h (resize_frame_windows): Move up in code.
19517 (Fwindow_frame): Remove EXFUN.
19518 (replace_buffer_in_all_windows): Remove prototype.
19519 (replace_buffer_in_windows_safely): Add prototype.
19520
19521 * window.c: Declare Qdelete_window static again. Move down
19522 declaration of select_count.
19523 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19524 (Fother_window): Move to window.el.
19525 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19526 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19527 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19528 window.el.
19529 (replace_buffer_in_windows): Implement by calling
19530 Qreplace_buffer_in_windows.
19531 (replace_buffer_in_all_windows): Remove with some functionality
19532 moved into replace_buffer_in_windows_safely.
19533 (replace_buffer_in_windows_safely): New function.
19534 (select_window_norecord, select_frame_norecord): Move in front
19535 of run_window_configuration_change_hook. Remove now obsolete
19536 declarations.
19537 (Fset_window_buffer): Rewrite doc-string.
19538 Call Qrecord_window_buffer.
19539 (keys_of_window): Move binding for other-window to window.el.
19540
19541 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19542
19543 * dispextern.h (struct image): Replace data member, whose int_val
19544 and ptr_val fields were not used by anything, with a single
19545 lisp_val object.
19546
19547 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19548 (gif_clear_image, gif_load, imagemagick_load_image)
19549 (gs_clear_image, gs_load): Callers changed.
19550
19551 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19552
19553 * buffer.h: Include <time.h>, for time_t.
19554 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19555
19556 Fix minor problems found by static checking.
19557
19558 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19559
19560 Make identifiers static if they are not used in other modules.
19561 * data.c (Qcompiled_function, Qframe, Qvector):
19562 * image.c (QimageMagick, Qsvg):
19563 * minibuf.c (Qmetadata):
19564 * window.c (resize_window_check, resize_root_window): Now static.
19565 * window.h (resize_window_check, resize_root_window): Remove decls.
19566
19567 * window.c (window_deletion_count, delete_deletable_window):
19568 Remove; unused.
19569 (window_body_lines): Now static.
19570 (Fdelete_other_windows_internal): Mark vars as initialized.
19571 Make sure 'resize_failed' is initialized.
19572 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19573 (resize_window_apply): Remove unused local.
19574 * window.h (delete_deletable_window): Remove decl.
19575
19576 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
19577 (imagemagick_load_image): Fix pointer signedness problem by changing
19578 last arg from unsigned char * to char *. All uses changed.
19579 Also, fix a local for similar reasons.
19580 Remove unused locals. Remove locals to avoid shadowing.
19581 (fn_rsvg_handle_free): Remove; unused.
19582 (svg_load, svg_load_image): Fix pointer signedness problem.
19583 (imagemagick_load_image): Don't use garbage pointer image_wand.
19584
19585 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19586
19587 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
19588
19589 * image.c (gif_load): Fix omitted cast error introduced by
19590 2011-06-06 change.
19591
19592 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19593
19594 * window.h (resize_proportionally, orig_total_lines)
19595 (orig_top_line): Remove from window structure.
19596 (set_window_height, set_window_width, change_window_heights)
19597 (Fdelete_window): Remove prototypes.
19598 (resize_frame_windows): Remove duplicate declaration.
19599
19600 2011-06-10 Eli Zaretskii <eliz@gnu.org>
19601
19602 * window.h (resize_frame_windows, resize_window_check)
19603 (delete_deletable_window, resize_root_window)
19604 (resize_frame_windows): Declare prototypes.
19605
19606 * window.c (resize_window_apply): Make definition be "static" to
19607 match the prototype.
19608
19609 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19610
19611 * window.c: Remove declarations of Qwindow_size_fixed,
19612 window_min_size_1, window_min_size_2, window_min_size,
19613 size_window, window_fixed_size_p, enlarge_window, delete_window.
19614 Remove static from declaration of Qdelete_window, it's
19615 temporarily needed by Fbury_buffer.
19616 (replace_window): Don't assign orig_top_line and
19617 orig_total_lines.
19618 (Fdelete_window, delete_window): Remove. Window deletion is
19619 handled by window.el.
19620 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19621 Replace Fdelete_window calls with calls to Qdelete_window.
19622 (Fdelete_other_windows): Remove. Deleting other windows is
19623 handled by window.el.
19624 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19625 handled in window.el.
19626 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19627 Window minimum sizes are handled in window.el.
19628 (shrink_windows, size_window, set_window_height)
19629 (set_window_width, change_window_heights, window_height)
19630 (window_width, CURBEG, CURSIZE, enlarge_window)
19631 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19632 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19633 handled in window.el.
19634 (make_dummy_parent): Rename to make_parent_window and give it a
19635 second argument horflag.
19636 (make_window): Don't set resize_proportionally any more.
19637 (Fsplit_window): Remove. Windows are split in window.el.
19638 (save_restore_action, save_restore_orig_size)
19639 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19640 Resize mini windows in window.el.
19641 (grow_mini_window, shrink_mini_window): Implement by calling
19642 Qresize_root_window_vertically, resize_window_check and
19643 resize_window_apply.
19644 (saved_window, Fset_window_configuration, save_window_save):
19645 Do not handle orig_top_line, orig_total_lines, and
19646 resize_proportionally.
19647 (window_min_height, window_min_width): Move to window.el.
19648 (keys_of_window): Move bindings for delete-other-windows,
19649 split-window, delete-window and enlarge-window to window.el.
19650
19651 * buffer.c: Temporarily extern Qdelete_window.
19652 (Fbury_buffer): Temporarily call Qdelete_window instead of
19653 Fdelete_window (Fbury_buffer will move to window.el soon).
19654
19655 * frame.c (set_menu_bar_lines_1): Remove code handling
19656 orig_top_line and orig_total_lines.
19657
19658 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19659 set_window_height but set heights directly.
19660 (change_frame_size_1): Use resize_frame_windows.
19661
19662 * xdisp.c (init_xdisp): Don't use set_window_height but set
19663 heights directly.
19664
19665 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19666 Use resize_frame_windows instead of change_window_heights and run
19667 run_window_configuration_change_hook.
19668
19669 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19670 instead of change_window_heights and run
19671 run_window_configuration_change_hook.
19672
19673 2011-06-09 Martin Rudalics <rudalics@gmx.at>
19674
19675 * window.c (replace_window): Rename second argument REPLACEMENT to
19676 NEW. New third argument SETFLAG. Rewrite.
19677 (delete_window, make_dummy_parent): Call replace_window with
19678 third argument 1.
19679 (window_list_1): Move down in code.
19680 (run_window_configuration_change_hook): Move set_buffer part
19681 before select_frame_norecord part in order to unwind correctly.
19682 Rename count1 to count.
19683 (recombine_windows, delete_deletable_window, resize_root_window)
19684 (Fdelete_other_windows_internal)
19685 (Frun_window_configuration_change_hook, make_parent_window)
19686 (resize_window_check, resize_window_apply, Fresize_window_apply)
19687 (resize_frame_windows, Fsplit_window_internal)
19688 (Fdelete_window_internal, Fresize_mini_window_internal):
19689 New functions.
19690 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19691
19692 2011-06-08 Martin Rudalics <rudalics@gmx.at>
19693
19694 * window.h (window): Add some new members to window structure -
19695 normal_lines, normal_cols, new_total, new_normal, clone_number,
19696 splits, nest, prev_buffers, next_buffers.
19697 (WINDOW_TOTAL_SIZE): Move here from window.c.
19698 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
19699
19700 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19701 Remove.
19702 (make_dummy_parent): Set new members of windows structure.
19703 (make_window): Move down in code. Handle new members of window
19704 structure.
19705 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19706 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19707 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19708 (Fset_window_prev_buffers, Fwindow_next_buffers)
19709 (Fset_window_next_buffers, Fset_window_clone_number):
19710 New functions.
19711 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19712 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19713 Doc-string fixes.
19714 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19715 Argument WINDOW can be now internal window too.
19716 (Fwindow_use_time): Move up in code.
19717 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19718 Rewrite doc-string.
19719 (Fset_window_configuration, saved_window)
19720 (Fcurrent_window_configuration, save_window_save): Handle new
19721 members of window structure.
19722 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19723 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19724 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19725 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19726 Qget_mru_window, Qresize_root_window,
19727 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19728 Qauto_buffer_name; staticpro them.
19729
19730 2011-06-07 Martin Rudalics <rudalics@gmx.at>
19731
19732 * window.c (Fwindow_total_size, Fwindow_left_column)
19733 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19734 (Fwindow_list_1): New functions.
19735 (window_box_text_cols): Replace with window_body_cols.
19736 (Fwindow_width, Fscroll_left, Fscroll_right):
19737 Use window_body_cols instead of window_box_text_cols.
19738 (delete_window, Fset_window_configuration):
19739 Call delete_all_subwindows with window as argument.
19740 (delete_all_subwindows): Take a window as argument and not a
19741 structure. Rewrite.
19742 (window_loop): Remove handling of GET_LRU_WINDOW and
19743 GET_LARGEST_WINDOW.
19744 (Fget_lru_window, Fget_largest_window): Move to window.el.
19745
19746 * window.h: Extern window_body_cols instead of
19747 window_box_text_cols. delete_all_subwindows now takes a
19748 Lisp_Object as argument.
19749
19750 * indent.c (compute_motion, Fcompute_motion):
19751 Use window_body_cols instead of window_box_text_cols.
19752
19753 * frame.c (delete_frame): Call delete_all_subwindows with root
19754 window as argument.
19755
19756 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19757
19758 * fns.c (Fputhash): Document return value.
19759
19760 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
19761
19762 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19763
19764 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19765
19766 Cons<->int and similar integer overflow fixes (Bug#8794).
19767
19768 Check for overflow when converting integer to cons and back.
19769 * charset.c (Fdefine_charset_internal, Fdecode_char):
19770 Use cons_to_unsigned to catch overflow.
19771 (Fencode_char): Use INTEGER_TO_CONS.
19772 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19773 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19774 * data.c (long_to_cons, cons_to_long): Remove.
19775 (cons_to_unsigned, cons_to_signed): New functions.
19776 These signal an error for invalid or out-of-range values.
19777 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19778 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19779 * font.c (Ffont_variation_glyphs):
19780 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19781 * lisp.h: Include <intprops.h>.
19782 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19783 (cons_to_signed, cons_to_unsigned): New decls.
19784 (long_to_cons, cons_to_long): Remove decls.
19785 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19786 (Fprimitive_undo): Use CONS_TO_INTEGER.
19787 * xfns.c (Fx_window_property): Likewise.
19788 * xselect.c: Include <limits.h>.
19789 (x_own_selection, selection_data_to_lisp_data):
19790 Use INTEGER_TO_CONS.
19791 (x_handle_selection_request, x_handle_selection_clear)
19792 (x_get_foreign_selection, Fx_disown_selection_internal)
19793 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19794 (lisp_data_to_selection_data): Use cons_to_unsigned.
19795 (x_fill_property_data): Use cons_to_signed.
19796 Report values out of range.
19797
19798 Check for buffer and string overflow more precisely.
19799 * buffer.h (BUF_BYTES_MAX): New macro.
19800 * lisp.h (STRING_BYTES_MAX): New macro.
19801 * alloc.c (Fmake_string):
19802 * character.c (string_escape_byte8):
19803 * coding.c (coding_alloc_by_realloc):
19804 * doprnt.c (doprnt):
19805 * editfns.c (Fformat):
19806 * eval.c (verror):
19807 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19808 since they may not be the same number.
19809 * editfns.c (Finsert_char):
19810 * fileio.c (Finsert_file_contents):
19811 Likewise for BUF_BYTES_MAX.
19812
19813 * image.c: Use ptrdiff_t, not int, for sizes.
19814 (slurp_file): Switch from int to ptrdiff_t.
19815 All uses changed.
19816 (slurp_file): Check that file size fits in both size_t (for
19817 malloc) and ptrdiff_t (for sanity and safety).
19818
19819 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19820 if b->modtime has its maximal value.
19821
19822 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19823
19824 Don't assume time_t can fit into int.
19825 * buffer.h (struct buffer.modtime): Now time_t, not int.
19826 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19827 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19828
19829 Minor fixes for signed vs unsigned integers.
19830 * character.h (MAYBE_UNIFY_CHAR):
19831 * charset.c (maybe_unify_char):
19832 * keyboard.c (read_char, reorder_modifiers):
19833 XINT -> XFASTINT, since the integer must be nonnegative.
19834 * ftfont.c (ftfont_spec_pattern):
19835 * keymap.c (access_keymap, silly_event_symbol_error):
19836 XUINT -> XFASTINT, since the integer must be nonnegative.
19837 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19838 since it makes no difference and we prefer signed.
19839 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19840 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19841 nonnegative.
19842
19843 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19844
19845 * window.h (Fwindow_frame): Declare.
19846
19847 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19848
19849 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19850 (SPARE_MEMORY): Always define.
19851 (LARGE_REQUEST): Remove.
19852 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19853
19854 2011-06-06 Martin Rudalics <rudalics@gmx.at>
19855
19856 * lisp.h: Move EXFUNS for Fframe_root_window,
19857 Fframe_first_window and Fset_frame_selected_window to window.h.
19858
19859 * window.h: Move EXFUNS for Fframe_root_window,
19860 Fframe_first_window and Fset_frame_selected_window here from
19861 lisp.h.
19862
19863 * frame.c (Fwindow_frame, Fframe_first_window)
19864 (Fframe_root_window, Fframe_selected_window)
19865 (Fset_frame_selected_window): Move to window.c.
19866 (Factive_minibuffer_window): Move to minibuf.c.
19867 (Fother_visible_frames_p): New function.
19868
19869 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19870
19871 * window.c (decode_window, decode_any_window): Move up in code.
19872 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19873 (inhibit_frame_unsplittable): Remove unused variable.
19874 (Fwindow_buffer): Move up and rewrite doc-string.
19875 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19876 (Fwindow_prev): New functions.
19877 (Fwindow_frame): Move here from frame.c. Accept any window as
19878 argument.
19879 (Fframe_root_window, Fframe_first_window)
19880 (Fframe_selected_window): Move here from frame.c. Accept frame
19881 or arbitrary window as argument. Update doc-strings.
19882 (Fminibuffer_window): Move up in code.
19883 (Fwindow_minibuffer_p): Move up in code and simplify.
19884 (Fset_frame_selected_window): Move here from frame.c.
19885 Marginal rewrite.
19886 (Fselected_window, select_window, Fselect_window): Move up in
19887 code. Minor doc-string fixes.
19888
19889 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19890
19891 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19892 Do not assume that spare memory exists; that assumption is valid
19893 only if SYSTEM_MALLOC.
19894 (LARGE_REQUEST): New macro, so that the issue of large requests
19895 is separated from the issue of spare memory.
19896
19897 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19898
19899 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19900 format. (Bug#8806)
19901
19902 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19903
19904 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19905 before statements.
19906
19907 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19908
19909 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19910
19911 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19912
19913 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19914 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19915
19916 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
19917
19918 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19919
19920 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
19921
19922 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19923 (x_clipboard_manager_save): Add return value.
19924 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19925 New error handlers.
19926 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19927 Obey Vx_select_enable_clipboard_manager. Catch errors in
19928 x_clipboard_manager_save (Bug#8779).
19929 (Vx_select_enable_clipboard_manager): New variable.
19930 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
19931
19932 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
19933
19934 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19935
19936 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19937
19938 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19939 in the current matrix if keep_current_p is non-zero.
19940
19941 2011-06-04 Eli Zaretskii <eliz@gnu.org>
19942
19943 * bidi.c (bidi_level_of_next_char): Fix last change.
19944
19945 2011-06-03 Eli Zaretskii <eliz@gnu.org>
19946
19947 Support bidi reordering of text covered by display properties.
19948
19949 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19950 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19951 (bidi_cache_search, bidi_cache_iterator_state)
19952 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
19953 (bidi_level_of_next_char, bidi_move_to_visually_next):
19954 Support character positions inside a run of characters covered by a
19955 display string.
19956 (bidi_paragraph_init, bidi_resolve_explicit_1)
19957 (bidi_level_of_next_char): Call bidi_fetch_char and
19958 bidi_fetch_char_advance instead of FETCH_CHAR and
19959 FETCH_CHAR_ADVANCE.
19960 (bidi_init_it): Initialize new members.
19961 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19962 definitions.
19963 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19964 instead of using explicit *_CHAR codes.
19965 (bidi_resolve_explicit, bidi_resolve_weak):
19966 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
19967 bidirectional text is supported only in multibyte buffers.
19968 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19969 it to initialize the frame_window_p member of struct bidi_it.
19970 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19971 (bidi_resolve_explicit, bidi_resolve_weak)
19972 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19973 bidi_it->nchars is non-positive.
19974 (bidi_level_of_next_char): Don't try to lookup the cache for the
19975 next/previous character if nothing is cached there yet, or if we
19976 were just reseat()'ed to a new position.
19977
19978 * xdisp.c (set_cursor_from_row): Set start and stop points
19979 according to the row's direction when priming the loop that looks
19980 for the glyph on which to display cursor.
19981 (single_display_spec_intangible_p): Function deleted.
19982 (display_prop_intangible_p): Reimplement to call
19983 handle_display_spec instead of single_display_spec_intangible_p.
19984 Accept 3 additional arguments needed by handle_display_spec.
19985 This fixes incorrect cursor motion across display property with complex
19986 values: lists, `(when COND...)' forms, etc.
19987 (single_display_spec_string_p): Support property values that are
19988 lists with the argument STRING its top-level element.
19989 (display_prop_string_p): Fix the condition for processing a
19990 property that is a list to be consistent with handle_display_spec.
19991 (handle_display_spec): New function, refactored from the
19992 last portion of handle_display_prop.
19993 (compute_display_string_pos): Accept additional argument
19994 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19995 value of a `display' property is a "replacing spec".
19996 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19997 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19998 the display property, but just return a value indicating whether
19999 the display property will replace the characters it covers.
20000 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20001 frame_window_p members of struct bidi_it.
20002 (compute_display_string_pos, compute_display_string_end):
20003 New functions.
20004 (push_it): Accept second argument POSITION, where pop_it should
20005 jump to continue iteration.
20006 (reseat_1): Initialize bidi_it.disp_pos.
20007
20008 * keyboard.c (adjust_point_for_property): Adjust the call to
20009 display_prop_intangible_p to its new signature.
20010
20011 * dispextern.h (struct bidi_it): New member frame_window_p.
20012 (bidi_init_it): Update prototypes.
20013 (display_prop_intangible_p): Update prototype.
20014 (compute_display_string_pos, compute_display_string_end):
20015 Declare prototypes.
20016 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20017 EMACS_INT.
20018
20019 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20020
20021 Malloc failure behavior now depends on size of allocation.
20022 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20023 * lisp.h: Change signatures accordingly.
20024 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20025 All callers changed. (Bug#8762)
20026
20027 * gnutls.c: Use Emacs's memory allocators.
20028 Without this change, the gnutls library would invoke malloc etc.
20029 directly, which causes problems on non-SYNC_INPUT hosts, and which
20030 runs afoul of improving memory_full behavior. (Bug#8761)
20031 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20032 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20033 xfree instead of the default malloc, realloc, free.
20034 (Fgnutls_boot): No need to check for memory allocation failure,
20035 since xmalloc does that for us.
20036
20037 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20038 * category.c (hash_get_category_set):
20039 * ccl.c (ccl_driver):
20040 * charset.c (Fdefine_charset_internal):
20041 * charset.h (struct charset.hash_index):
20042 * composite.c (get_composition_id, gstring_lookup_cache)
20043 (composition_gstring_put_cache):
20044 * composite.h (struct composition.hash_index):
20045 * dispextern.h (struct image.hash):
20046 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20047 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20048 (hashfn_equal, hashfn_user_defined, make_hash_table)
20049 (maybe_resize_hash_table, hash_lookup, hash_put)
20050 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20051 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20052 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20053 * image.c (make_image, search_image_cache, lookup_image)
20054 (xpm_put_color_table_h):
20055 * lisp.h (struct Lisp_Hash_Table):
20056 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20057 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20058 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20059 * alloc.c (allocate_vectorlike):
20060 Check for overflow in vector size calculations.
20061 * ccl.c (ccl_driver):
20062 Check for overflow when converting EMACS_INT to int.
20063 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20064 need to be updated by these changes.
20065 * fns.c (make_hash_table, maybe_resize_hash_table):
20066 Check for integer overflow with large hash tables.
20067 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20068 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20069 (SXHASH_REDUCE): New macro.
20070 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20071 Use it instead of discarding useful hash info with large hash values.
20072 (sxhash_float): New function.
20073 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20074 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20075 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20076 Rewrite to use FIXNUM_BITS, as this simplifies things.
20077 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20078 Adjust signatures to match updated version of code.
20079 (consing_since_gc): Now EMACS_INT, since a single hash table can
20080 use more than INT_MAX bytes.
20081
20082 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20083
20084 Make it possible to build with GCC-4.6+ -O2 -flto.
20085
20086 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20087
20088 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20089
20090 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20091 Call minibuffer-inactive-mode.
20092
20093 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20094
20095 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20096 Update dependencies.
20097
20098 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20099
20100 * data.c (init_data): Remove code for UTS, this system is not
20101 supported anymore.
20102
20103 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20104
20105 Don't force ./temacs to start in terminal mode.
20106
20107 * frame.c (make_initial_frame): Initialize faces in all cases, not
20108 only when CANNOT_DUMP is defined.
20109 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20110
20111 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20112
20113 * dispnew.c (add_window_display_history): Use const for the string
20114 pointer. Remove declaration, not needed.
20115
20116 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20117
20118 Use 'inline', not 'INLINE'.
20119 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20120 * alloc.c, fontset.c (INLINE): Remove.
20121 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20122 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20123 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20124 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20125 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20126
20127 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20128
20129 Make it possible to run ./temacs.
20130
20131 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20132 syms_of_callproc does the same thing. Remove test for
20133 "initialized", do it in the caller.
20134 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20135
20136 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20137
20138 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20139 (read_minibuf): Use get_minibuffer.
20140 (syms_of_minibuf): Use DEFSYM.
20141 (Qmetadata): New var.
20142 * data.c (Qbuffer): Don't make it static.
20143 (syms_of_data): Use DEFSYM.
20144
20145 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20146
20147 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20148 (CCL_CODE_MIN): New macro.
20149
20150 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20151
20152 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20153
20154 * eval.c (Qdebug): Now static.
20155 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20156 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20157 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20158
20159 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20160
20161 * image.c: Various fixes to ImageMagick code comments.
20162 (Fimagemagick_types): Doc fix.
20163
20164 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20165
20166 Minor fixes prompted by GCC 4.6.0 warnings.
20167
20168 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20169
20170 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20171 (x_clipboard_manager_save_all): Move extern decl to ...
20172 * xterm.h: ... here, so that it can be checked for consistency.
20173
20174 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20175
20176 * xselect.c (x_clipboard_manager_save_frame)
20177 (x_clipboard_manager_save_all): New functions.
20178 (Fx_clipboard_manager_save): Lisp function deleted.
20179
20180 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20181 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20182
20183 * xterm.h: Update prototype.
20184
20185 2011-05-28 William Xu <william.xwl@gmail.com>
20186
20187 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20188 exiting (Bug#8239).
20189
20190 2011-05-28 Jim Meyering <meyering@redhat.com>
20191
20192 Avoid a sign-extension bug in crypto_hash_function.
20193 * fns.c (to_uchar): Define.
20194 (crypto_hash_function): Use it to convert some newly-signed
20195 variables to unsigned, to avoid sign-extension bugs. For example,
20196 without this change, (md5 "truc") would evaluate to
20197 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20198 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
20199 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
20200
20201 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20202
20203 Integer overflow fixes.
20204
20205 * dbusbind.c: Serial number integer overflow fixes.
20206 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
20207 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20208 to hold a serial number that is too large for a fixnum.
20209 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20210 Check for serial numbers out of range. Decode any serial number
20211 that was so large that it became a float. (Bug#8722)
20212
20213 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20214 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20215 Use XFASTINT rather than XUINT when numbers are nonnegative.
20216 (xd_append_arg, Fdbus_method_return_internal):
20217 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20218 arguments, check that Lisp number is nonnegative, rather than
20219 silently wrapping negative numbers around. (Bug#8722)
20220 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
20221 (Bug#8722)
20222
20223 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20224
20225 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20226
20227 ccl: Add integer overflow checks.
20228 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20229 (IN_INT_RANGE): New macros.
20230 (ccl_driver): Use them to check for integer overflow when
20231 decoding a CCL program. Many of the new checks are whether XINT (x)
20232 fits in int; it doesn't always, on 64-bit hosts. The new version
20233 doesn't catch all possible integer overflows, but it's an
20234 improvement. (Bug#8719)
20235
20236 * alloc.c (make_event_array): Use XINT, not XUINT.
20237 There's no need for unsigned here.
20238
20239 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20240 This follows up to the 2011-05-06 change that substituted uintptr_t
20241 for EMACS_INT. This case wasn't caught back then.
20242
20243 Rework Fformat to avoid integer overflow issues.
20244 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20245 now (part of C89). Include <verify.h>.
20246 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20247 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20248 (Fformat): Avoid the prepass trying to compute sizes; it was only
20249 approximate and thus did not catch overflow reliably. Instead, walk
20250 through the format just once, formatting and computing sizes as we go,
20251 checking for integer overflow at every step, and allocating a larger
20252 buffer as needed. Keep track separately whether the format is
20253 multibyte. Keep only the most-recently calculated precision, rather
20254 than them all. Record whether each argument has been converted to
20255 string. Use EMACS_INT, not int, for byte and char and arg counts.
20256 Support field widths and precisions larger than INT_MAX. Avoid
20257 sprintf's undefined behavior with conversion specifications such as %#d
20258 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20259 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20260 formatting out-of-range floating point numbers with int
20261 formats. (Bug#8668)
20262
20263 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20264
20265 * data.c: Avoid integer truncation in expressions involving floats.
20266 * data.c: Include <intprops.h>.
20267 (arith_driver): When there's an integer overflow in an expression
20268 involving floating point, convert the integers to floating point
20269 so that the resulting value does not suffer from catastrophic
20270 integer truncation. For example, on a 64-bit host (* 4
20271 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20272 Do not rely on undefined behavior after integer overflow.
20273
20274 merge count_size_as_multibyte, parse_str_to_multibyte
20275 * character.c, character.h (count_size_as_multibyte):
20276 Rename from parse_str_to_multibyte; all uses changed.
20277 Check for integer overflow.
20278 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20279 since it's now a duplicate of the other. This is more of
20280 a character than a buffer op, so better that it's in character.c.
20281 * fns.c, print.c: Adjust to above changes.
20282
20283 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20284
20285 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20286
20287 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20288
20289 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20290 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20291 (x_clipboard_manager_save): Now static.
20292 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20293
20294 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20295 (crypto_hash_function): Now static.
20296 Fix pointer signedness problems. Avoid unnecessary initializations.
20297
20298 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
20299
20300 * termhooks.h (Vselection_alist): Make it terminal-local.
20301
20302 * terminal.c (create_terminal): Initialize it.
20303
20304 * xselect.c: Support for clipboard managers.
20305 (Vselection_alist): Move to termhooks.h as terminal-local var.
20306 (LOCAL_SELECTION): New macro.
20307 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20308 (symbol_to_x_atom): Remove gratuitous arg.
20309 (x_handle_selection_request, lisp_data_to_selection_data)
20310 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
20311 (x_own_selection, x_get_local_selection, x_convert_selection):
20312 New arg, specifying work frame. Use terminal-local Vselection_alist.
20313 (some_frame_on_display): Delete unused function.
20314 (Fx_own_selection_internal, Fx_get_selection_internal)
20315 (Fx_disown_selection_internal, Fx_selection_owner_p)
20316 (Fx_selection_exists_p): New optional frame arg.
20317 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20318 (x_handle_selection_clear): Don't treat other terminals with the
20319 same keyboard specially. Use the terminal-local Vselection_alist.
20320 (x_clear_frame_selections): Use Frun_hook_with_args.
20321
20322 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20323
20324 * xterm.h: Add support for those atoms.
20325
20326 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
20327
20328 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20329 (converted_selections, conversion_fail_tag): New global variables.
20330 (x_selection_request_lisp_error): Free the above.
20331 (x_get_local_selection): Remove unnecessary code.
20332 (x_reply_selection_request): Args changed; handle arbitrary array
20333 of converted selections stored in converted_selections.
20334 Separate the XChangeProperty and SelectionNotify steps.
20335 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20336 (x_convert_selection): New function.
20337 (x_handle_selection_event): Simplify.
20338 (x_get_foreign_selection): Don't ignore incoming requests while
20339 waiting for an answer; this will fail when we implement
20340 SAVE_TARGETS, and seems unnecessary anyway.
20341 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20342 (Vx_sent_selection_functions): Doc fix.
20343
20344 2011-05-26 Leo Liu <sdl.web@gmail.com>
20345
20346 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20347
20348 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20349
20350 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20351
20352 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20353 for fringe update if it has periodic bitmap.
20354 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
20355 and fringe_bitmap_periodic_p.
20356
20357 * fringe.c (get_fringe_bitmap_data): New function.
20358 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20359 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20360 row. Mark glyph row for fringe update if periodicity changed.
20361
20362 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20363 for fringe update unless it has periodic bitmap.
20364
20365 2011-05-25 Kenichi Handa <handa@m17n.org>
20366
20367 * xdisp.c (get_next_display_element): Set correct it->face_id for
20368 a static composition.
20369
20370 2011-05-24 Leo Liu <sdl.web@gmail.com>
20371
20372 * deps.mk (fns.o):
20373 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20374
20375 * fns.c (crypto_hash_function, Fsha1): New function.
20376 (Fmd5): Use crypto_hash_function.
20377 (syms_of_fns): Add Ssha1.
20378
20379 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20380
20381 * gnutls.c: Remove unused macros.
20382 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20383 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20384 Remove macros that are defined and never used.
20385 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20386
20387 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20388
20389 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20390 (Fx_get_selection_internal): Minor cleanup.
20391 (Fx_own_selection_internal): Rename arguments for consistency with
20392 select.el.
20393
20394 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20395
20396 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20397
20398 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20399
20400 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20401
20402 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20403
20404 * dispnew.c (scrolling_window): Don't exclude the case that the
20405 last enabled row in the desired matrix touches the bottom boundary.
20406
20407 2011-05-21 Glenn Morris <rgm@gnu.org>
20408
20409 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
20410 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20411 and add some more files.
20412
20413 2011-05-20 Eli Zaretskii <eliz@gnu.org>
20414
20415 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20416 report_file_error introduced by the change from 2011-05-07.
20417
20418 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20419
20420 * systime.h (Time): Define only if emacs is defined.
20421 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20422 where the include path doesn't have X11/X.h by default. See
20423 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20424
20425 2011-05-20 Kenichi Handa <handa@m17n.org>
20426
20427 * composite.c (find_automatic_composition): Fix previous change.
20428
20429 2011-05-20 Glenn Morris <rgm@gnu.org>
20430
20431 * lisp.mk: New file, split from Makefile.in.
20432 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20433 (shortlisp): Remove.
20434 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20435
20436 2011-05-19 Glenn Morris <rgm@gnu.org>
20437
20438 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20439 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20440 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20441 (lisp): Set the order to that of loadup.el.
20442 (shortlisp): Make it a copy of $lisp.
20443 (SOME_MACHINE_LISP): Remove.
20444 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20445 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20446
20447 2011-05-18 Kenichi Handa <handa@m17n.org>
20448
20449 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20450 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20451 (find_automatic_composition): Mostly rewrite for efficiency.
20452
20453 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
20454
20455 * makefile.w32-in: Update dependencies.
20456
20457 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20458
20459 * menu.c: Include limits.h (fixes the MS-Windows build broken by
20460 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
20461
20462 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
20463
20464 Fix some integer overflow issues, such as string length overflow.
20465
20466 * insdel.c (count_size_as_multibyte): Check for string overflow.
20467
20468 * character.c (lisp_string_width): Check for string overflow.
20469 Use EMACS_INT, not int, for string indexes and lengths; in
20470 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20471 the resulting string length overflows an EMACS_INT; instead,
20472 report a string overflow if no precision given. When checking for
20473 precision exhaustion, use a check that cannot possibly have
20474 integer overflow. (Bug#8675)
20475 * character.h (lisp_string_width): Adjust to new signature.
20476
20477 * alloc.c (string_overflow): New function.
20478 (Fmake_string): Use it. This doesn't change behavior, but saves
20479 a few bytes and will simplify future changes.
20480 * character.c (string_escape_byte8): Likewise.
20481 * lisp.h (string_overflow): New decl.
20482
20483 Fixups, following up to the user-interface timestamp change.
20484 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20485 for UI timestamps, instead of unsigned long.
20486 * msdos.c (mouse_get_pos): Likewise.
20487 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
20488 * w32gui.h (Time): Define by including "systime.h" rather than by
20489 declaring it ourselves. (Bug#8664)
20490
20491 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20492 * image.c (clear_image_cache): Likewise.
20493
20494 * term.c (term_mouse_position): Don't assume time_t wraparound.
20495
20496 Be more systematic about user-interface timestamps.
20497 Before, the code sometimes used 'Time', sometimes 'unsigned long',
20498 and sometimes 'EMACS_UINT', to represent these timestamps.
20499 This change causes it to use 'Time' uniformly, as that's what X uses.
20500 This makes the code easier to follow, and makes it easier to catch
20501 integer overflow bugs such as Bug#8664.
20502 * frame.c (Fmouse_position, Fmouse_pixel_position):
20503 Use Time, not unsigned long, for user-interface timestamps.
20504 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20505 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20506 * keyboard.h (last_event_timestamp): Likewise.
20507 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20508 * menu.h (xmenu_show): Likewise.
20509 * term.c (term_mouse_position): Likewise.
20510 * termhooks.h (struct input_event.timestamp): Likewise.
20511 (struct terminal.mouse_position_hook): Likewise.
20512 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20513 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20514 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20515 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20516 what it was before.
20517 * menu.h, termhooks.h: Include "systime.h", for Time.
20518
20519 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20520 Don't assume that the difference between two unsigned long values
20521 can fit into an integer. At this point, we know button_down_time
20522 <= event->timestamp, so the difference must be nonnegative, so
20523 there's no need to cast the result if double-click-time is
20524 nonnegative, as it should be; check that it's nonnegative, just in
20525 case. This bug is triggered when events are more than 2**31 ms
20526 apart (about 25 days). (Bug#8664)
20527
20528 * xselect.c (last_event_timestamp): Remove duplicate decl.
20529 (x_own_selection): Remove needless cast to unsigned long.
20530
20531 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20532 that always fit in int. Use a sentinel instead of a counter, to
20533 avoid a temp and to allay GCC's concerns about possible int overflow.
20534 * frame.h (struct frame): Use int for menu_bar_items_used
20535 instead of EMACS_INT, since it always fits in int.
20536
20537 * menu.c (grow_menu_items): Check for int overflow.
20538
20539 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20540
20541 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20542 Before, the code was not consistent. These values cannot exceed
20543 2**31 - 1 so there's no need to make them unsigned.
20544 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20545 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20546 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20547 as modifiers.
20548 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20549
20550 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20551 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20552 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20553 presumably because the widths might not match.
20554
20555 * window.c (size_window): Avoid needless test at loop start.
20556
20557 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20558
20559 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20560
20561 2011-05-12 Drew Adams <drew.adams@oracle.com>
20562
20563 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20564
20565 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20566
20567 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20568 `width' to `bar_area_x' and `bar_area_width', respectively.
20569 (x_scroll_run): Take account of fringe background extension.
20570
20571 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20572 Rename local vars `left' and `width' to `bar_area_x' and
20573 `bar_area_width', respectively.
20574 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20575 background extension.
20576
20577 2011-05-10 Jim Meyering <meyering@redhat.com>
20578
20579 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20580
20581 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
20582
20583 * image.c (Finit_image_library): Return t for built-in image types,
20584 like pbm and xbm. (Bug#8640)
20585
20586 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20587
20588 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20589
20590 2011-05-07 Eli Zaretskii <eliz@gnu.org>
20591
20592 * w32console.c (Fset_screen_color): Doc fix.
20593 (Fget_screen_color): New function.
20594 (syms_of_ntterm): Defsubr it.
20595
20596 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20597 unlink the temporary file if Fcall_process didn't create it in the
20598 first place.
20599 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20600 child process will be redirected to a file specified with `:file'.
20601 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20602 cue to call_process_cleanup not to close that handle.
20603
20604 2011-05-07 Ben Key <bkey76@gmail.com>
20605
20606 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20607 one of two shell specific rules, either bootstrap-temacs-CMD or
20608 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20609 to the previous implementation of the bootstrap-temacs rule.
20610 The bootstrap-temacs-CMD rule is similar to the previous
20611 implementation of the bootstrap-temacs rule except that it
20612 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20613 variable.
20614
20615 These changes, along with some changes to nt/configure.bat,
20616 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20617 earlier fix to add support for --cflags and --ldflags options
20618 that include quotes so that it works whether make uses cmd or
20619 sh as the shell.
20620
20621 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
20622
20623 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20624 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20625 is a constant.
20626 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20627 a string. Handle both cases.
20628 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20629 (Fdbus_register_method): Use Qinvalid_function.
20630
20631 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20632
20633 * makefile.w32-in: Update dependencies.
20634 (LISP_H): Add inttypes.h and stdin.h.
20635 (PROCESS_H): Add unistd.h.
20636
20637 2011-05-06 Eli Zaretskii <eliz@gnu.org>
20638
20639 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20640 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20641
20642 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
20643
20644 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20645
20646 * term.c (vfatal): Remove stray call to va_end.
20647 It's not needed and the C Standard doesn't allow it here anyway.
20648
20649 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20650 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20651
20652 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20653 bytes.
20654
20655 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20656
20657 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20658
20659 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20660
20661 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20662
20663 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20664
20665 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20666 * charset.c (Fdefine_charset_internal): Don't initialize
20667 charset.code_space[15]. The value was garbage, on hosts with
20668 32-bit int (Bug#8600).
20669
20670 * lread.c (read_integer): Be more consistent with string-to-number.
20671 Use string_to_number to do the actual conversion; this avoids
20672 rounding errors and fixes some other screwups. Without this fix,
20673 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20674 (digit_to_number): Move earlier, for benefit of read_integer.
20675 Return -1 if the digit is out of range for the base, -2 if it is
20676 not a digit in any supported base. (Bug#8602)
20677
20678 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20679
20680 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20681 to match comment at start of function. This also removes a
20682 GCC warning about overflow in a 32+64-bit port.
20683
20684 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20685
20686 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20687 Reported by Stefan Monnier in
20688 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
20689 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20690 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
20691
20692 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20693 (EMACS_UINTPTR): Likewise, with uintptr_t.
20694
20695 * lisp.h: Prefer 64-bit EMACS_INT if available.
20696 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20697 on 32-bit hosts that have 64-bit int, so that they can access
20698 large files.
20699 However, temporarily disable this change unless the temporary
20700 symbol WIDE_EMACS_INT is defined.
20701
20702 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20703
20704 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20705 This removes an assumption that EMACS_INT and long are the same
20706 width as pointers. The assumption is true for Emacs porting targets
20707 now, but we want to make other targets possible.
20708 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20709 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20710 In the rest of the code, change types of integers that hold casted
20711 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20712 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20713 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20714 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20715 No need to cast type when ORing.
20716 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20717 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20718 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20719 assume EMACS_INT is the same width as char *.
20720 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20721 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20722 Remove no-longer-needed casts.
20723 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20724 (xg_tool_bar_help_callback, xg_make_tool_item):
20725 Use EMACS_INTPTR to hold an integer
20726 that will be cast to void *; this can avoid a GCC warning
20727 if EMACS_INT is not the same width as void *.
20728 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20729 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20730 (current_message_1, set_message_1):
20731 Use a local to convert to proper width without a cast.
20732 * xmenu.c (dialog_selection_callback): Likewise.
20733
20734 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20735 Also, don't assume VALBITS / RAND_BITS is less than 5,
20736 and don't rely on undefined behavior when shifting a 1 left into
20737 the sign bit.
20738 * lisp.h (get_random): Change signature to match.
20739
20740 * lread.c (hash_string): Use size_t, not int, for hash computation.
20741 Normally we prefer signed values; but hashing is special, because
20742 it's better to use unsigned division on hash table sizes so that
20743 the remainder is nonnegative. Also, size_t is the natural width
20744 for hashing into memory. The previous code used 'int', which doesn't
20745 retain enough info to hash well into very large tables.
20746 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20747
20748 * dbusbind.c: Don't possibly lose pointer info when converting.
20749 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20750 Use XPNTR rather than XHASH, so that the high-order bits of
20751 the pointer aren't lost when converting through void *.
20752
20753 * eval.c (Fautoload): Don't double-shift a pointer.
20754
20755 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20756
20757 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20758
20759 * gnutls.c (DEF_GNUTLS_FN):
20760 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20761
20762 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20763
20764 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20765 marker. (Bug#8610)
20766
20767 2011-05-05 Eli Zaretskii <eliz@gnu.org>
20768
20769 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20770 New version that can reserve upto 2GB of heap space.
20771
20772 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
20773
20774 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20775
20776 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20777
20778 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20779 `gnutls_certificate_set_x509_key_file'.
20780
20781 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
20782
20783 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20784 Update dependencies.
20785
20786 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20787
20788 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20789 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20790 Remove unused parameter `fildes'.
20791 * process.c (read_process_output, send_process): Don't pass it.
20792
20793 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20794
20795 Fix previous change: the library cache is defined in w32.c.
20796 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20797 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20798
20799 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20800
20801 Implement dynamic loading of GnuTLS on Windows.
20802
20803 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20804 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20805 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20806 Declare.
20807
20808 * gnutls.c (Qgnutls_dll): Define.
20809 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20810 (gnutls_*): Declare function pointers.
20811 (init_gnutls_functions): New function to initialize function pointers.
20812 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20813 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20814 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20815 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20816 (emacs_gnutls_write, emacs_gnutls_read)
20817 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20818 (Fgnutls_available_p): New function.
20819 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20820 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20821 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20822
20823 * image.c: Include w32.h.
20824 (Vimage_type_cache): Delete.
20825 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20826 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20827 (w32_delayed_load): Move to w32.c.
20828
20829 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20830
20831 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20832 (w32_delayed_load): Move from image.c. When loading a library, record
20833 its filename in the :loaded-from property of the library id.
20834 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20835 Initialize and staticpro them.
20836 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20837
20838 * process.c: Include lisp.h before w32.h, not after.
20839 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20840 instead of gnutls_record_check_pending.
20841
20842 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20843
20844 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20845
20846 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20847 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20848 as passed in.
20849
20850 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20851
20852 * xterm.c (x_set_frame_alpha): Do not set property on anything
20853 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20854
20855 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20856
20857 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20858
20859 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20860
20861 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20862 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20863 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20864 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20865 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20866 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20867 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20868 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20869 (Qgnutls_bootprop_callbacks_verify): Make static.
20870
20871 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20872
20873 * callproc.c: Indentation fixup.
20874
20875 * sysdep.c (wait_for_termination_1): Make static.
20876 (wait_for_termination, interruptible_wait_for_termination):
20877 Move after wait_for_termination_1.
20878
20879 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20880
20881 * sysdep.c (interruptible_wait_for_termination): New function
20882 which is like wait_for_termination, but allows keyboard
20883 interruptions.
20884
20885 * callproc.c (Fcall_process): Add (:file "file") as an option for
20886 the STDOUT buffer.
20887 (Fcall_process_region): Ditto.
20888
20889 2011-04-30 Eli Zaretskii <eliz@gnu.org>
20890
20891 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20892 rather than `XVECTOR (FOO)->size'.
20893
20894 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20895 inttypes.h, as a gnulib replacement is used if it not available in
20896 system headers.
20897
20898 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20899
20900 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20901 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20902 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20903
20904 * coding.c (coding_alloc_by_realloc): Error out if destination
20905 will grow beyond MOST_POSITIVE_FIXNUM.
20906 (decode_coding_emacs_mule): Abort if there isn't enough place in
20907 charbuf for the composition carryover bytes. Reserve an extra
20908 space for up to 2 characters produced in a loop.
20909 (decode_coding_iso_2022): Abort if there isn't enough place in
20910 charbuf for the composition carryover bytes.
20911
20912 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20913
20914 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20915 aborting when %lld or %lll format is passed.
20916 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20917 %llo or %llx format is passed. (Bug#8545)
20918
20919 * window.c (window_scroll_line_based): Use a marker instead of
20920 simple variables to record original value of point. (Bug#7952)
20921
20922 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20923 produced by %s or %c overflows available buffer space. (Bug#8545)
20924
20925 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20926
20927 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
20928 (SIZE_MAX): Move defn after all includes, as they might #define it.
20929
20930 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20931
20932 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20933
20934 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20935
20936 * keyboard.c (Qdelayed_warnings_hook): Define.
20937 (command_loop_1): Run `delayed-warnings-hook'
20938 if Vdelayed_warnings_list is non-nil.
20939 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20940 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20941
20942 2011-04-28 Eli Zaretskii <eliz@gnu.org>
20943
20944 * doprnt.c (doprnt): Don't return value smaller than the buffer
20945 size if the message was truncated. (Bug#8545).
20946
20947 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20948
20949 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20950 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20951
20952 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20953
20954 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20955
20956 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
20957
20958 * makefile.w32-in: Update dependencies.
20959
20960 2011-04-27 Eli Zaretskii <eliz@gnu.org>
20961
20962 Improve `doprnt' and its usage. (Bug#8545)
20963 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20964 `format_end'. Remove support for %l as a conversion specifier.
20965 Don't use xrealloc. Improve diagnostics when the %l size modifier
20966 is used. Update the commentary.
20967
20968 * eval.c (verror): Simplify calculation of size_t.
20969
20970 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20971 messages.
20972
20973 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20974
20975 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20976 change.
20977
20978 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20979
20980 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20981 This makes this file independent of the recent pseudovector change.
20982
20983 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
20984
20985 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20986
20987 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
20988 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
20989 Remove unused local.
20990 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
20991
20992 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
20993 GCC 4.6.0 optimizes based on type-based alias analysis.
20994 For example, if b is of type struct buffer * and v of type struct
20995 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20996 != &v->size, and therefore "v->size = 1; b->size = 2; return
20997 v->size;" must therefore return 1. This assumption is incorrect
20998 for Emacs, since it type-puns struct Lisp_Vector * with many other
20999 types. To fix this problem, this patch adds a new type struct
21000 vectorlike_header that documents the constraints on layout of vectors
21001 and pseudovectors, and helps optimizing compilers not get fooled
21002 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21003 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21004 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21005 the size member.
21006 (XSETPVECTYPE): Rewrite in terms of new macro.
21007 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21008 This is a bit clearer, and further avoids the possibility of
21009 undesirable aliasing.
21010 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21011 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21012 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21013 since Lisp_Subr is a special case (no "next" field).
21014 (ASIZE): Now uses header.size rather than size.
21015 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21016 to avoid the hassle of writing XVECTOR (foo)->header.size.
21017 (struct vectorlike_header): New type.
21018 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21019 object, to help avoid aliasing.
21020 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21021 (SUBRP): Likewise, since Lisp_Subr is a special case.
21022 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21023 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21024 (struct Lisp_Hash_Table): Combine first two members into a single
21025 struct vectorlike_header member. All uses of "size" and "next" members
21026 changed to be "header.size" and "header.next".
21027 * buffer.h (struct buffer): Likewise.
21028 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21029 * frame.h (struct frame): Likewise.
21030 * process.h (struct Lisp_Process): Likewise.
21031 * termhooks.h (struct terminal): Likewise.
21032 * window.c (struct save_window_data, struct saved_window): Likewise.
21033 * window.h (struct window): Likewise.
21034 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21035 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21036 * buffer.c (init_buffer_once): Likewise.
21037 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21038 special case.
21039 * process.c (Fformat_network_address): Use local var for size,
21040 for brevity.
21041
21042 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21043
21044 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21045 * data.c (atof): Remove decl; no longer used or needed.
21046 (digit_to_number): Move to lread.c.
21047 (Fstring_to_number): Use new string_to_number function, to be
21048 consistent with how the Lisp reader treats infinities and NaNs.
21049 Do not assume that floating-point numbers represent EMACS_INT
21050 without losing information; this is not true on most 64-bit hosts.
21051 Avoid double-rounding errors, by insisting on integers when
21052 parsing non-base-10 numbers, as the documentation specifies.
21053 * lisp.h (string_to_number): New decl, replacing ...
21054 (isfloat_string): Remove.
21055 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21056 (read1): Do not accept +. and -. as integers; this
21057 appears to have been a coding error. Similarly, do not accept
21058 strings like +-1e0 as floating point numbers. Do not report
21059 overflow for integer overflows unless the base is not 10 which
21060 means we have no simple and reliable way to continue.
21061 Break out the floating-point parsing into a new
21062 function string_to_number, so that Fstring_to_number parses
21063 floating point numbers consistently with the Lisp reader.
21064 (digit_to_number): Move here from data.c. Make it static inline.
21065 (E_CHAR, EXP_INT): Remove, replacing with ...
21066 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21067 (string_to_number): New function, replacing isfloat_string.
21068 This function checks for valid syntax and produces the resulting
21069 Lisp float number too. Rework it so that string-to-number
21070 no longer mishandles examples like "1.0e+". Use strtoumax,
21071 so that overflow for non-base-10 numbers is reported only when
21072 there's no portable and simple way to convert to floating point.
21073
21074 * textprop.c (set_text_properties_1): Rewrite for clarity,
21075 and to avoid GCC warning about integer overflow.
21076
21077 * intervals.h (struct interval): Use EMACS_INT for members
21078 where EMACS_UINT might cause problems. See
21079 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21080 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21081 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21082 All uses changed.
21083 (offset_intervals): Tell GCC not to worry about length overflow
21084 when negating a negative length.
21085
21086 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21087 (overrun_check_free): Likewise.
21088
21089 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21090 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21091 word size.
21092
21093 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21094 (gnutls_make_error): Rename local to avoid shadowing.
21095 (gnutls_emacs_global_deinit): ifdef out; not used.
21096 (Fgnutls_boot): Use const for pointer to readonly storage.
21097 Comment out unused local. Fix pointer signedness problems.
21098
21099 * lread.c (openp): Don't stuff size_t into an 'int'.
21100 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21101 about possible signed overflow.
21102
21103 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21104 (GDK_KEY_g): Don't define if already defined.
21105 (xg_prepare_tooltip): Avoid pointer signedness problem.
21106 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21107
21108 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21109 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21110
21111 * xfns.c (Fx_window_property): Simplify a bit,
21112 to make a bit faster and to avoid GCC 4.6.0 warning.
21113 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21114
21115 * fns.c (internal_equal): Don't assume size_t fits in int.
21116
21117 * alloc.c (compact_small_strings): Tighten assertion a little.
21118
21119 Replace pEd with more-general pI, and fix some printf arg casts.
21120 * lisp.h (pI): New macro, generalizing old pEd macro to other
21121 conversion specifiers. For example, use "...%"pI"d..." rather
21122 than "...%"pEd"...".
21123 (pEd): Remove. All uses replaced with similar uses of pI.
21124 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21125 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21126 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21127 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21128 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21129 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21130 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21131 64-bit hosts.
21132 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21133 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21134 * print.c (safe_debug_print, print_object): Likewise.
21135 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21136 to int.
21137 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21138 avoiding the 0 flag, which is not portable.
21139 * process.c (Fmake_network_process): Use pI to avoid cast.
21140 * region-cache.c (pp_cache): Likewise.
21141 * xdisp.c (decode_mode_spec): Likewise.
21142 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21143 behavior on 64-bit hosts with printf arg.
21144 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21145 (x_stop_queuing_selection_requests): Likewise.
21146 (x_get_window_property): Don't truncate byte count to an 'int'
21147 when tracing.
21148
21149 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21150 here, since it parses constructs like leading '-' and spaces,
21151 which are not wanted; and it overflows with large numbers.
21152 Instead, simply match F[0-9]+, which is what is wanted anyway.
21153
21154 * alloc.c: Remove unportable assumptions about struct layout.
21155 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21156 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21157 (allocate_vectorlike, make_pure_vector): Use the new macros,
21158 plus offsetof, to remove unportable assumptions about struct layout.
21159 These assumptions hold on all porting targets that I know of, but
21160 they are not guaranteed, they're easy to remove, and removing them
21161 makes further changes easier.
21162
21163 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21164 This doesn't fix a bug but makes the code clearer.
21165 (string_overrun_cookie): Now const. Use initializers that
21166 don't formally overflow signed char, to avoid warnings.
21167 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21168 can cause Emacs to crash when string overrun checking is enabled.
21169 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21170 multiple of sizeof (EMACS_INT); it need not be, if
21171 alignof(EMACS_INT) < sizeof (EMACS_INT).
21172 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21173
21174 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21175
21176 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21177
21178 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21179
21180 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21181 supposed to be handshaking. (Bug#8556)
21182 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21183
21184 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21185
21186 * lisp.h (Qdebug): List symbol.
21187 * eval.c (Qdebug): Restore global linkage.
21188 * keyboard.c (debug-on-event): New variable.
21189 (handle_user_signal): Break into debugger when debug-on-event
21190 matches the current signal symbol.
21191
21192 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21193
21194 * alloc.c (check_sblock, check_string_bytes)
21195 (check_string_free_list): Convert to standard C.
21196
21197 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21198
21199 * w32.c (emacs_gnutls_push): Fix typo.
21200
21201 2011-04-25 Eli Zaretskii <eliz@gnu.org>
21202
21203 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21204 "cast to pointer from integer of different size".
21205
21206 Improve doprnt and its use in verror. (Bug#8545)
21207 * doprnt.c (doprnt): Document the set of format control sequences
21208 supported by the function. Use SAFE_ALLOCA instead of always
21209 using `alloca'.
21210
21211 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21212 is one byte too soon. Don't use xrealloc; instead xfree and
21213 xmalloc anew.
21214
21215 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21216
21217 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21218 callbacks stage.
21219
21220 * gnutls.c: Renamed global_initialized to
21221 gnutls_global_initialized. Added internals for the
21222 :verify-hostname-error, :verify-error, and :verify-flags
21223 parameters of `gnutls-boot' and documented those parameters in the
21224 docstring. Start callback support.
21225 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21226 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21227 on error. Return error code.
21228 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21229 (emacs_gnutls_read): Likewise.
21230 (Fgnutls_boot): Return handshake error code.
21231 (emacs_gnutls_handle_error): New function.
21232 (wsaerror_to_errno): Likewise.
21233
21234 * w32.h (emacs_gnutls_pull): Add prototype.
21235 (emacs_gnutls_push): Likewise.
21236
21237 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21238 (emacs_gnutls_push): Likewise.
21239
21240 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21241
21242 * process.c (wait_reading_process_output): Check if GnuTLS
21243 buffered some data internally if no FDs are set for TLS
21244 connections.
21245
21246 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21247 (LIBS): Link to USER_LIBS.
21248 ($(BLD)/gnutls.$(0)): New target.
21249
21250 2011-04-24 Eli Zaretskii <eliz@gnu.org>
21251
21252 * xdisp.c (handle_single_display_spec): Rename the
21253 display_replaced_before_p argument into display_replaced_p, to
21254 make it consistent with the commentary. Fix typos in the
21255 commentary.
21256
21257 * textprop.c (syms_of_textprop): Remove dead code.
21258 (copy_text_properties): Delete obsolete commentary about an
21259 interface that was deleted long ago. Fix typos in the description
21260 of arguments.
21261
21262 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21263 to changes in oldXMenu/XMenu.h from 2011-04-16.
21264 <menu_help_message, prev_menu_help_message>: Constify.
21265 (IT_menu_make_room): menu->help_text is now `const char **';
21266 adjust.
21267
21268 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21269 to changes in oldXMenu/XMenu.h from 2011-04-16.
21270 (struct XMenu): Declare `help_text' `const char **'.
21271
21272 * xfaces.c <Qunspecified>: Make extern again.
21273
21274 * syntax.c: Include sys/types.h before including regex.h, as
21275 required by POSIX.
21276
21277 * doc.c (get_doc_string): Improve the format passed to `error'.
21278
21279 * doprnt.c (doprnt): Improve commentary.
21280
21281 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21282
21283 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21284 them with etags.
21285
21286 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21287 changes in globals.h immediately force recompilation.
21288 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21289 $(CURDIR)/s/ms-w32.h.
21290 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
21291
21292 * character.c (Fchar_direction): Function deleted.
21293 (syms_of_character): Don't defsubr it.
21294 <char-direction-table>: Deleted.
21295
21296 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21297
21298 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21299 * doprnt.c: Include limits.h.
21300 (SIZE_MAX): New macro.
21301 (doprnt): Return a size_t value. 2nd arg is now size_t.
21302 Many local variables are now size_t instead of int or unsigned.
21303 Improve overflow protection. Support `l' modifier for integer
21304 conversions. Support %l conversion. Don't assume an EMACS_INT
21305 argument for integer conversions and for %c.
21306
21307 * lisp.h (doprnt): Restore prototype.
21308
21309 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21310 $(SRC)/character.h.
21311
21312 * Makefile.in (base_obj): Add back doprnt.o.
21313
21314 * deps.mk (doprnt.o): Add back prerequisites.
21315 (callint.o): Depend on character.h.
21316
21317 * eval.c (internal_lisp_condition_case): Include the handler
21318 representation in the error message.
21319 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21320 when breaking from the loop.
21321
21322 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21323
21324 * callint.c (Fcall_interactively): When displaying error message
21325 about invalid control letter, pass the character's codepoint, not
21326 a pointer to its multibyte form. Improve display of the character
21327 in octal and display also its hex code.
21328
21329 * character.c (char_string): Use %x to display the (unsigned)
21330 codepoint of an invalid character, to avoid displaying a bogus
21331 negative value.
21332
21333 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21334 `error', not SYMBOL_NAME itself.
21335
21336 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21337 character arguments to `error'.
21338
21339 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21340 to `error' in error message about FINAL_CHAR argument. Make sure
21341 FINAL_CHAR is a character, and use %c when it is passed as
21342 argument to `error'.
21343
21344 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21345
21346 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21347
21348 * w32.c: Include <time.h>.
21349 (sys_localtime): New function.
21350
21351 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
21352
21353 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21354
21355 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
21356
21357 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
21358
21359 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21360 zombies (Bug#8467).
21361
21362 2011-04-19 Eli Zaretskii <eliz@gnu.org>
21363
21364 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21365 gl_state.e_property when gl_state.object is Qt.
21366
21367 * insdel.c (make_gap_larger): Remove limitation of buffer size
21368 to <= INT_MAX.
21369
21370 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
21371
21372 * xdisp.c (lookup_glyphless_char_display)
21373 (produce_glyphless_glyph): Handle cons cell entry in
21374 glyphless-char-display.
21375 (Vglyphless_char_display): Document it.
21376
21377 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21378 glyphless-char-display.
21379
21380 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
21381
21382 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21383
21384 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21385
21386 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21387 definition for no-X builds.
21388
21389 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
21390
21391 Static checks with GCC 4.6.0 and non-default toolkits.
21392
21393 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21394
21395 * process.c (keyboard_bit_set): Define only if SIGIO.
21396 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21397 (send_process): Repair possible setjmp clobbering.
21398
21399 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21400
21401 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21402
21403 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21404
21405 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21406 Define only if needed.
21407
21408 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21409 by pacifying GCC about it. Maybe it's time to retire it?
21410 * xfaces.c (USG, __TIMEVAL__): Likewise.
21411
21412 * dispextern.h (struct redisplay_interface): Rename param
21413 to avoid shadowing.
21414 * termhooks.h (struct terminal): Likewise.
21415 * xterm.c (xembed_send_message): Likewise.
21416
21417 * insdel.c (make_gap_smaller): Define only if
21418 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21419
21420 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21421 it.
21422
21423 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21424 so that we aren't warned about unused symbols.
21425
21426 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21427
21428 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
21429
21430 * xfns.c (x_real_positions): Mark locals as initialized.
21431
21432 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21433
21434 * xterm.c: Fix problems found by static analysis with other toolkits.
21435 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
21436 (x_dispatch_event): Declare static if USE_GTK, and
21437 define if USE_GTK || USE_X_TOOLKIT.
21438 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
21439 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
21440 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21441 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
21442
21443 * xmenu.c (menu_help_callback): Pointer type fixes.
21444 Use const pointers when pointing at readonly data. Avoid pointer
21445 signedness clashes.
21446 (FALSE): Remove unused macro.
21447 (update_frame_menubar): Remove unused decl.
21448
21449 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21450
21451 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21452 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21453 (single_menu_item): Rename local to avoid shadowing.
21454
21455 * keyboard.c (make_lispy_event): Remove unused local var.
21456
21457 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21458 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21459
21460 * bitmaps: Change bitmaps from unsigned char back to the X11
21461 compatible char. Avoid the old compiler warnings about
21462 out-of-range initializers by using, for example, '\xab' rather
21463 than 0xab.
21464
21465 * xgselect.c (xgselect_initialize): Check vs interface
21466 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21467
21468 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21469
21470 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21471 to read-only memory.
21472
21473 * fns.c (vector): Remove; this old hack is no longer needed.
21474
21475 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
21476 Remove unused var.
21477 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
21478
21479 * xrdb.c (x_load_resources): Omit unused local.
21480
21481 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
21482 (x_window): Rename locals to avoid shadowing.
21483 (USG): Use the kludged USG macro, to pacify gcc.
21484
21485 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
21486 (x_term_init): Remove local to avoid shadowing.
21487
21488 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
21489
21490 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21491 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21492
21493 2011-04-16 Eli Zaretskii <eliz@gnu.org>
21494
21495 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21496
21497 Fix regex.c, syntax.c and friends for buffers > 2GB.
21498 * syntax.h (struct gl_state_s): Declare character position members
21499 EMACS_INT.
21500
21501 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21502
21503 * textprop.c (verify_interval_modification, interval_of):
21504 Declare arguments EMACS_INT.
21505
21506 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21507 EMACS_INT.
21508
21509 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21510
21511 * indent.c (Fvertical_motion): Local variable it_start is now
21512 EMACS_INT.
21513
21514 * regex.c (re_match, re_match_2, re_match_2_internal)
21515 (bcmp_translate, regcomp, regexec, print_double_string)
21516 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21517 (re_compile_pattern, re_exec): Declare arguments and local
21518 variables `size_t' and `ssize_t' and return values `regoff_t', as
21519 appropriate.
21520 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21521 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21522 <compile_stack_type>: `size' and `avail' are now `size_t'.
21523
21524 * regex.h <regoff_t>: Use ssize_t, not int.
21525 (re_search, re_search_2, re_match, re_match_2): Arguments that
21526 specify buffer/string position and length are now ssize_t and
21527 size_t. Return type is regoff_t.
21528
21529 2011-04-16 Ben Key <bkey76@gmail.com>
21530
21531 * nsfont.m: Fixed bugs in ns_get_family and
21532 ns_descriptor_to_entity that were caused by using free to
21533 deallocate memory blocks that were allocated by xmalloc (via
21534 xstrdup). This caused Emacs to crash when compiled with
21535 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21536 --enable-checking=xmallocoverrun). xfree is now used to
21537 deallocate these memory blocks.
21538
21539 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
21540
21541 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21542
21543 emacs_write: Accept and return EMACS_INT for sizes.
21544 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21545 et seq.
21546 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21547 Accept and return EMACS_INT.
21548 (emacs_gnutls_write): Return the number of bytes written on
21549 partial writes.
21550 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
21551 (emacs_read, emacs_write): Remove check for negative size, as the
21552 Emacs source code has been audited now.
21553 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21554 (emacs_read, emacs_write): Use it.
21555 * process.c (send_process): Adjust to the new signatures of
21556 emacs_write and emacs_gnutls_write. Do not attempt to store
21557 a byte offset into an 'int'; it might overflow.
21558 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
21559
21560 * sound.c: Don't assume sizes fit in 'int'.
21561 (struct sound_device.period_size, alsa_period_size):
21562 Return EMACS_INT, not int.
21563 (struct sound_device.write, vox_write, alsa_write):
21564 Accept EMACS_INT, not int.
21565 (wav_play, au_play): Use EMACS_INT to store sizes and to
21566 record read return values.
21567
21568 2011-04-15 Ben Key <bkey76@gmail.com>
21569
21570 * keyboard.c (Qundefined): Don't declare static since it is used
21571 in nsfns.m.
21572 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21573 static since they are used in nsfont.m.
21574
21575 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21576
21577 * process.c (Qprocessp): Don't declare static.
21578 * lisp.h (Qprocessp): Declare again.
21579
21580 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
21581
21582 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21583
21584 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21585
21586 Improve C-level modularity by making more things 'static'.
21587
21588 Don't publish debugger-only interfaces to other modules.
21589 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21590 (verify_bytepos, count_markers): Move decls to the only modules
21591 that need them.
21592 * region-cache.h (pp_cache): Likewise.
21593 * window.h (check_all_windows): Likewise.
21594 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21595
21596 * sysdep.c (croak): Now static, if
21597 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21598 * syssignal.h (croak): Declare only if not static.
21599
21600 * alloc.c (refill_memory_reserve): Now static if
21601 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21602 * lisp.h (refill_memory_reserve): Declare only if not static.
21603
21604 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21605 Define only if USE_LUCID.
21606
21607 * xrdb.c (x_customization_string, x_rm_string): Now static.
21608
21609 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21610 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21611
21612 * xdisp.c (draw_row_with_mouse_face): Now static.
21613 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21614
21615 * window.h (check_all_windows): Mark externally visible.
21616
21617 * window.c (window_deletion_count): Now static.
21618
21619 * undo.c: Make symbols static if they're not exported.
21620 (last_undo_buffer, last_boundary_position, pending_boundary):
21621 Now static.
21622
21623 * textprop.c (interval_insert_behind_hooks): Now static.
21624 (interval_insert_in_front_hooks): Likewise.
21625
21626 * term.c: Make symbols static if they're not exported.
21627 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21628 (max_frame_lines, tty_set_terminal_modes):
21629 (tty_reset_terminal_modes, tty_turn_off_highlight):
21630 (get_tty_terminal): Now static.
21631 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21632 * termhooks.h (term_mouse_moveto): Do not declare if
21633 HAVE_WINDOW_SYSTEM.
21634 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21635 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21636
21637 * sysdep.c: Make symbols static if they're not exported.
21638 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21639 Now static.
21640 (sigprocmask_set, full_mask): Remove; unused.
21641 (wait_debugging): Mark as visible.
21642 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21643 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21644
21645 * syntax.c (syntax_temp): Define only if !__GNUC__.
21646
21647 * sound.c (current_sound_device, current_sound): Now static.
21648
21649 * search.c (searchbufs, searchbuf_head): Now static.
21650
21651 * scroll.c (scroll_cost): Remove; unused.
21652 * dispextern.h (scroll_cost): Remove decl.
21653
21654 * region-cache.h (pp_cache): Mark as externally visible.
21655
21656 * process.c: Make symbols static if they're not exported.
21657 (process_tick, update_tick, create_process, chan_process):
21658 (Vprocess_alist, proc_buffered_char, datagram_access):
21659 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21660 (deactivate_process): Mark defn as static, as well as decl.
21661 * lisp.h (create_process): Remove decl.
21662 * process.h (chan_process, Vprocess_alist): Remove decls.
21663
21664 * print.c: Make symbols static if they're not exported.
21665 (print_depth, new_backquote_output, being_printed, print_buffer):
21666 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21667 (print_interval, print_number_index, initial_stderr_stream):
21668 Now static.
21669 * lisp.h (Fprinc): Remove decl.
21670 (debug_output_compilation_hack): Mark as externally visible.
21671
21672 * sysdep.c (croak): Move decl from here to syssignal.h.
21673 * syssignal.h (croak): Put it here, so the API can be checked when
21674 'croak' is called from dissociate_if_controlling_tty.
21675
21676 * minibuf.c: Make symbols static if they're not exported.
21677 (minibuf_save_list, choose_minibuf_frame): Now static.
21678 * lisp.h (choose_minibuf_frame): Remove decl.
21679
21680 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21681
21682 * lread.c: Make symbols static if they're not exported.
21683 (read_objects, initial_obarray, oblookup_last_bucket_number):
21684 Now static.
21685 (make_symbol): Remove; unused.
21686 * lisp.h (initial_obarray, make_symbol): Remove decls.
21687
21688 * keyboard.c: Make symbols static if they're not exported.
21689 (single_kboard, recent_keys_index, total_keys, recent_keys):
21690 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21691 (this_single_command_key_start, echoing, last_auto_save):
21692 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21693 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21694 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21695 (Vlispy_mouse_stem, double_click_count):
21696 Now static.
21697 (force_auto_save_soon): Define only if SIGDANGER.
21698 (ignore_mouse_drag_p): Now static if
21699 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21700 (print_help): Remove; unused.
21701 (stop_character, last_timer_event): Mark as externally visible.
21702 * keyboard.h (ignore_mouse_drag_p): Declare only if
21703 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21704 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21705 * lisp.h (echoing): Remove decl.
21706 (force_auto_save_soon): Declare only if SIGDANGER.
21707 * xdisp.c (redisplay_window): Simplify code, to make it more
21708 obvious that ignore_mouse_drag_p is not accessed if !defined
21709 USE_GTK && !defined HAVE_NS.
21710
21711 * intervals.c: Make symbols static if they're not exported.
21712 (merge_properties_sticky, merge_interval_right, delete_interval):
21713 Now static.
21714 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21715
21716 * insdel.c: Make symbols static if they're not exported.
21717 However, leave prepare_to_modify_buffer alone. It's never
21718 called from outside this function, but that appears to be a bug.
21719 (combine_after_change_list, combine_after_change_buffer):
21720 (adjust_after_replace, signal_before_change): Now static.
21721 (adjust_after_replace_noundo): Remove; unused.
21722 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
21723 (signal_before_change): Remove decls.
21724
21725 * indent.c (val_compute_motion, val_vmotion): Now static.
21726
21727 * image.c: Make symbols static if they're not exported.
21728 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21729 if USE_GTK.
21730 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21731 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21732
21733 * fringe.c (standard_bitmaps): Now static.
21734 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21735
21736 * frame.c: Make symbols static if they're not exported.
21737 (x_report_frame_params, make_terminal_frame): Now static.
21738 (get_frame_param): Now static, unless HAVE_NS.
21739 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21740 (x_get_resource_string): Remove; not used.
21741 * frame.h (make_terminal_frame, x_report_frame_params):
21742 (x_get_resource_string); Remove decls.
21743 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21744 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21745
21746 * font.c, fontset.c: Make symbols static if they're not exported.
21747 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21748 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21749 * font.c (font_close_object): Now static.
21750 * font.h (font_close_object): Remove.
21751 * fontset.c (FONTSET_OBJLIST): Remove.
21752 (free_realized_fontset) #if-0 the body, which does nothing.
21753 (face_suitable_for_char_p): #if-0, as it's never called.
21754 * fontset.h (face_suitable_for_char_p): Remove decl.
21755 * xfaces.c (face_at_string_position):
21756 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
21757 since 0 is always ASCII.
21758
21759 * fns.c (weak_hash_tables): Now static.
21760
21761 * fileio.c: Make symbols static if they're not exported.
21762 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21763 (Vwrite_region_annotation_buffers): Now static.
21764
21765 * eval.c: Make symbols static if they're not exported.
21766 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21767 * lisp.h (backtrace_list): Remove decl.
21768
21769 * emacs.c: Make symbols static if they're not exported.
21770 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21771 (fatal_error_code, fatal_error_signal_hook, standard_args):
21772 Now static.
21773 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21774 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21775 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21776 * lisp.h (fatal_error_signal_hook): Remove decl.
21777 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21778
21779 * editfns.c: Move a (normally-unused) function to its only use.
21780 * editfns.c, lisp.h (get_operating_system_release): Remove.
21781 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21782 worth the hassle of breaking this out.
21783
21784 * xterm.c: Make symbols static if they're not exported.
21785 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21786 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21787 (x_destroy_window, x_delete_display):
21788 Now static.
21789 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21790 (x_mouse_leave): Remove; unused.
21791 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21792 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21793 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21794 Remove decls.
21795 (x_mouse_leave): Declare only if WINDOWSNT.
21796 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21797 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21798 USE_X_TOOLKIT.
21799
21800 * ftxfont.c: Make symbols static if they're not exported.
21801 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21802 HAVE_FREETYPE.
21803 * font.h (ftxfont_driver): Likewise.
21804
21805 * xfns.c: Make symbols static if they're not exported.
21806 (x_last_font_name, x_display_info_for_name):
21807 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21808 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21809 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21810 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21811 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21812 (last_show_tip_args): Now static.
21813 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21814 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21815 (x_screen_planes): Remove; unused.
21816 * dispextern.h (x_screen_planes): Remove decl.
21817
21818 * dispnew.c: Make symbols static if they're not exported.
21819 * dispextern.h (redraw_garbaged_frames, scrolling):
21820 (increment_row_positions): Remove.
21821 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21822 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21823 Now static.
21824 (redraw_garbaged_frames): Remove; unused.
21825
21826 * xfaces.c: Make symbols static if they're not exported.
21827 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21828 Remove decls.
21829 * xterm.h (defined_color): Remove decls.
21830 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21831 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21832 (menu_face_changed_default, defined_color, free_realized_face):
21833 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21834 (ascii_face_of_lisp_face): Remove; unused.
21835
21836 * xdisp.c: Make symbols static if they're not exported.
21837 * dispextern.h (scratch_glyph_row, window_box_edges):
21838 (glyph_to_pixel_coords, set_cursor_from_row):
21839 (get_next_display_element, set_iterator_to_next):
21840 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21841 (show_mouse_face): Remove decls
21842 * frame.h (message_buf_print): Likewise.
21843 * lisp.h (pop_message, set_message, check_point_in_composition):
21844 Likewise.
21845 * xterm.h (set_vertical_scroll_bar): Likewise.
21846 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21847 (message_buf_print, scratch_glyph_row, displayed_buffer):
21848 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21849 (get_next_display_element, show_mouse_face, window_box_edges):
21850 (frame_to_window_pixel_xy, check_point_in_composition):
21851 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21852 (glyph_to_pixel_coords): Remove; unused.
21853
21854 * dired.c (file_name_completion): Now static.
21855
21856 * dbusbind.c (xd_in_read_queued_messages): Now static.
21857
21858 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21859 * data.c (circular_list_error): Remove.
21860
21861 * commands.h (last_point_position, last_point_position_buffer):
21862 (last_point_position_window): Remove decls.
21863 * keyboard.c: Make these variables static.
21864
21865 * coding.h (coding, code_convert_region, encode_coding_gap):
21866 Remove decls.
21867 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21868 (iso_code_class, detect_coding, code_convert_region): Now static.
21869 (encode_coding_gap): Remove; unused.
21870
21871 * chartab.c (chartab_chars, chartab_bits): Now static.
21872
21873 * charset.h (charset_iso_8859_1): Remove decl.
21874 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21875 Now static.
21876
21877 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21878 * ccl.c (Vccl_program_table): Now static.
21879 (check_ccl_update): Remove; unused.
21880
21881 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21882 * category.h: ... from here.
21883 * category.c (check_category_table, set_category_set): Now static.
21884
21885 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21886 * lisp.h: Remove these decls.
21887
21888 * buffer.c (buffer_count): Remove unused var.
21889
21890 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21891 so that it's not optimized away.
21892 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21893 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21894 exported only to the debugger.
21895
21896 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
21897 * atimer.h (run_all_atimers): Remove; not exported.
21898
21899 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21900 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21901 was inaccessible from Lisp.
21902 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21903 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21904
21905 alloc.c: Import and export fewer symbols, and remove unused items.
21906 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21907 is defined.
21908 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21909 it's not optimized away by whole-program optimization.
21910 (message_enable_multibyte, free_misc): Remove.
21911 (catchlist, handlerlist, mark_backtrace):
21912 Declare only if BYTE_MARK_STACK.
21913 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21914 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21915 (message_enable_multibyte): Remove decl.
21916 (free_misc, interval_free_list, float_block, float_block_index):
21917 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21918 (cons_free_list, last_marked_index):
21919 Now static.
21920 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21921 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21922 (mark_backtrace): Define only if BYTE_MARK_STACK.
21923 * xdisp.c (message_enable_multibyte): Now static.
21924
21925 Declare Lisp_Object Q* variables to be 'static' if not exported.
21926 This makes it easier for human readers (and static analyzers)
21927 to see whether these variables are used from other modules.
21928 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21929 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21930 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21931 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21932 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21933 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21934 * xmenu.c, xselect.c:
21935 Declare Q* vars static if they are not used in other modules.
21936 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21937 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21938 Remove decls of unexported vars.
21939 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21940
21941 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21942
21943 Make Emacs functions such as Fatom 'static' by default.
21944 This makes it easier for human readers (and static analyzers)
21945 to see whether these functions can be called from other modules.
21946 DEFUN now defines a static function. To make the function external
21947 so that it can be used in other C modules, use the new macro DEFUE.
21948 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21949 (Finit_image_library):
21950 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21951 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21952 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21953 Remove decls, since these functions are now static.
21954 (Funintern, Fget_internal_run_time): New decls, since these functions
21955 were already external.
21956
21957 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21958 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21959 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21960 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21961 * keyboard.c, keymap.c, lread.c:
21962 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21963 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21964 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21965 Mark functions with DEFUE instead of DEFUN,
21966 if they are used in other modules.
21967 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21968 decls for now-static functions.
21969 * buffer.h (Fdelete_overlay): Remove decl.
21970 * callproc.c (Fgetenv_internal): Mark as internal.
21971 * composite.c (Fremove_list_of_text_properties): Remove decl.
21972 (Fcomposition_get_gstring): New forward static decl.
21973 * composite.h (Fcomposite_get_gstring): Remove decl.
21974 * dired.c (Ffile_attributes): New forward static decl.
21975 * doc.c (Fdocumntation_property): New forward static decl.
21976 * eval.c (Ffetch_bytecode): New forward static decl.
21977 (Funintern): Remove extern decl; now in .h file where it belongs.
21978 * fileio.c (Fmake_symbolic_link): New forward static decl.
21979 * image.c (Finit_image_library): New forward static decl.
21980 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21981 * intervals.h (Fprevious_property_change):
21982 (Fremove_list_of_text_properties): Remove decls.
21983 * keyboard.c (Fthis_command_keys): Remove decl.
21984 (Fcommand_execute): New forward static decl.
21985 * keymap.c (Flookup_key): New forward static decl.
21986 (Fcopy_keymap): Now static.
21987 * keymap.h (Flookup_key): Remove decl.
21988 * process.c (Fget_process): New forward static decl.
21989 (Fprocess_datagram_address): Mark as internal.
21990 * syntax.c (Fsyntax_table_p): New forward static decl.
21991 (skip_chars): Remove duplicate decl.
21992 * textprop.c (Fprevious_property_change): New forward static decl.
21993 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21994 Now internal.
21995 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21996 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21997
21998 * editfns.c (Fformat): Remove unreachable code.
21999
22000 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22001
22002 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22003 change. (Bug#8496)
22004
22005 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22006
22007 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22008 when at ZV. (Bug#8487)
22009
22010 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22011
22012 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22013 (Bug#8437)
22014 * keyboard.c (parse_tool_bar_item): Likewise.
22015 * sound.c (sound_cleanup, alsa_close): Likewise.
22016 * termcap.c (tgetent): Likewise.
22017 * xfns.c (x_default_font_parameter): Likewise.
22018 * xsettings.c (read_and_apply_settings): Likewise.
22019
22020 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22021 (overrun_check_free): Protoize.
22022
22023 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22024
22025 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22026 since callers should never pass a negative size.
22027 Change the signature to match that of plain 'read' and 'write'; see
22028 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22029 * lisp.h: Update prototypes of emacs_write and emacs_read.
22030
22031 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22032
22033 * xdisp.c (redisplay_window): Don't try to determine the character
22034 position of the scroll margin if the window start point w->startp
22035 is outside the buffer's accessible region. (Bug#8468)
22036
22037 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22038
22039 Fix write-region and its subroutines for buffers > 2GB.
22040 * fileio.c (a_write, e_write): Modify declaration of arguments and
22041 local variables to support buffers larger than 2GB.
22042 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22043
22044 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22045 argument, local variables, and return value.
22046
22047 * lisp.h: Update prototypes of emacs_write and emacs_read.
22048
22049 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22050
22051 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22052
22053 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22054
22055 Fix more problems found by GCC 4.6.0's static checks.
22056
22057 * xdisp.c (vmessage): Use a better test for character truncation.
22058
22059 * charset.c (load_charset_map): <, not <=, for optimization,
22060 and to avoid potential problems with integer overflow.
22061 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22062 * casetab.c (set_identity, shuffle): Likewise.
22063 * editfns.c (Fformat): Likewise.
22064 * syntax.c (skip_chars): Likewise.
22065
22066 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22067 This also lets GCC 4.6.0 generate slightly better loop code.
22068
22069 * callint.c (Fcall_interactively): <, not <=, for optimization.
22070 (Fcall_interactively): Count the number of arguments produced,
22071 not the number of arguments given. This is simpler and lets GCC
22072 4.6.0 generate slightly better code.
22073
22074 * ftfont.c: Distingish more carefully between FcChar8 and char.
22075 The previous code passed unsigned char * to a functions like
22076 strlen and xstrcasecmp that expect char *, which does not
22077 conform to the C standard.
22078 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22079 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22080 char * when the C standard requires it.
22081
22082 * keyboard.c (read_char): Remove unused var.
22083
22084 * eval.c: Port to Windows vsnprintf (Bug#8435).
22085 Include <limits.h>.
22086 (SIZE_MAX): Define if the headers do not.
22087 (verror): Do not give up if vsnprintf returns a negative count.
22088 Instead, grow the buffer. This ports to Windows vsnprintf, which
22089 does not conform to C99. Problem reported by Eli Zaretskii.
22090 Also, simplify the allocation scheme, by avoiding the need for
22091 calling realloc, and removing the ALLOCATED variable.
22092
22093 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22094
22095 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22096 But keep the doprint source code for now, as we might revamp it
22097 and use it again (Bug#8435).
22098 * lisp.h (doprnt): Remove.
22099 * Makefile.in (base_obj): Remove doprnt.o.
22100 * deps.mk (doprnt.o): Remove.
22101
22102 error: Print 32- and 64-bit integers portably (Bug#8435).
22103 Without this change, on typical 64-bit hosts error ("...%d...", N)
22104 was used to print both 32- and 64-bit integers N, which relied on
22105 undefined behavior.
22106 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22107 * lisp.h (error, verror): Mark as printf-like functions.
22108 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22109 Report overflow in size calculations when allocating printf buffer.
22110 Do not truncate output string at its first null byte.
22111 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22112 Truncate the output at a character boundary, since vsnprintf does not
22113 do that.
22114 * charset.c (check_iso_charset_parameter): Convert internal
22115 character to string before calling 'error', since %c now has the
22116 printf meaning.
22117 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22118 overflow when computing char to be passed to 'error'. Do not
22119 pass Lisp_Object to 'error'; pass the integer instead.
22120 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22121 formatted with plain %d.
22122
22123 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22124
22125 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22126
22127 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22128
22129 * xterm.c (x_catch_errors): Remove duplicate declaration.
22130
22131 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22132
22133 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22134
22135 2011-04-10 Jim Meyering <meyering@redhat.com>
22136
22137 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22138 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22139 return ssize_t not "int", and use size_t as the buffer length.
22140 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22141 * gnutls.h: Update declarations.
22142 * process.c (read_process_output): Use ssize_t, to match.
22143 (send_process): Likewise.
22144
22145 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22146
22147 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22148
22149 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22150
22151 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22152 Use unsigned char, to match FcChar8 type definition.
22153
22154 * xterm.c (handle_one_xevent):
22155 * xmenu.c (create_and_show_popup_menu):
22156 * xselect.c (x_decline_selection_request)
22157 (x_reply_selection_request): Avoid type-punned deref of X events.
22158
22159 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22160
22161 Fix some uses of `int' instead of EMACS_INT.
22162 * search.c (string_match_1, fast_string_match)
22163 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22164 (scan_buffer, find_next_newline_no_quit)
22165 (find_before_next_newline, search_command, Freplace_match)
22166 (Fmatch_data): Make some `int' variables be EMACS_INT.
22167
22168 * xdisp.c (display_count_lines): 3rd argument and return value now
22169 EMACS_INT. All callers changed.
22170 (pint2hrstr): Last argument is now EMACS_INT.
22171
22172 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22173 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22174 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22175 (decode_coding_utf_16, decode_coding_emacs_mule)
22176 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22177 (decode_coding_ccl, decode_coding_charset)
22178 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22179 (decode_coding_iso_2022, decode_coding_emacs_mule)
22180 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22181 <char_offset, last_offset>: Declare EMACS_INT.
22182 (encode_coding_utf_8, encode_coding_utf_16)
22183 (encode_coding_emacs_mule, encode_invocation_designation)
22184 (encode_designation_at_bol, encode_coding_iso_2022)
22185 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22186 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22187 Declare EMACS_INT.
22188 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22189 (encode_invocation_designation): Last argument P_NCHARS is now
22190 EMACS_INT.
22191 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22192 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22193
22194 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22195 All users changed.
22196
22197 * ccl.c (Fccl_execute_on_string): Declare some variables
22198 EMACS_INT.
22199
22200 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
22201
22202 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22203
22204 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22205
22206 * process.c (Fformat_network_address): Doc fix.
22207
22208 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22209
22210 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
22211
22212 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
22213
22214 * keyboard.c (read_char): Call Lisp function help-form-show,
22215 instead of using internal_with_output_to_temp_buffer.
22216 (Qhelp_form_show): New var.
22217 (syms_of_keyboard): Use DEFSYM macro.
22218
22219 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22220
22221 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22222
22223 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
22224
22225 * process.c (Flist_processes): Remove to Lisp.
22226 (list_processes_1): Delete.
22227
22228 2011-04-06 Eli Zaretskii <eliz@gnu.org>
22229
22230 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22231
22232 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22233
22234 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
22235
22236 Fix more problems found by GCC 4.6.0's static checks.
22237
22238 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22239
22240 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22241
22242 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
22243
22244 * xdisp.c (vmessage): Mark as a printf-like function.
22245
22246 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22247
22248 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22249
22250 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22251 printf-like functions.
22252 (tiff_load): Add casts to remove these marks before passing them
22253 to system-supplied API.
22254
22255 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22256
22257 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22258 This avoids several warnings with gcc -Wstrict-overflow.
22259 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22260 directly, rather than having caller test rule sign. This avoids
22261 some unnecessary tests.
22262 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22263 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22264 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
22265
22266 * xfont.c (xfont_text_extents): Remove var that was set but not used.
22267 (xfont_open): Avoid unnecessary tests.
22268
22269 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22270
22271 * composite.h, composite.c (composition_gstring_put_cache):
22272 Use EMACS_INT, not int, for length.
22273
22274 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22275 breaking out part of COMPOSITION_DECODE_RULE.
22276 (COMPOSITION_DECODE_RULE): Use it.
22277 * composite.c (get_composition_id): Remove unused local vars,
22278 by using the new macro.
22279
22280 * textprop.c (set_text_properties_1): Change while to do-while,
22281 since the condition is always true at first.
22282
22283 * intervals.c (graft_intervals_into_buffer): Mark var as used.
22284 (interval_deletion_adjustment): Return unsigned value.
22285 All uses changed.
22286
22287 * process.c (list_processes_1, create_pty, read_process_output):
22288 (exec_sentinel): Remove vars that were set but not used.
22289 (create_pty): Remove unnecessary "volatile"s.
22290 (Fnetwork_interface_info): Avoid possibility of int overflow.
22291 (read_process_output): Do adaptive read buffering even if carryover.
22292 (read_process_output): Simplify nbytes computation if buffered.
22293
22294 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22295
22296 * syntax.c (scan_words): Remove var that was set but not used.
22297 (update_syntax_table): Use unsigned instead of int.
22298
22299 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
22300 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
22301 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
22302
22303 * print.c (print_error_message): Avoid int overflow.
22304
22305 * font.c (font_list_entities): Redo for clarity,
22306 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22307
22308 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
22309 (font_score): Avoid potential overflow in diff calculation.
22310
22311 * fns.c (substring_both): Remove var that is set but not used.
22312 (sxhash): Redo loop for clarity and to avoid wraparound warning.
22313
22314 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22315
22316 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22317 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22318 can always succeed if overflow has undefined behavior.
22319
22320 * search.c (boyer_moore, wordify): Remove vars set but not used.
22321 (wordify): Omit three unnecessary tests.
22322
22323 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22324 All callers changed. This avoids the need for an unused var.
22325
22326 * casefiddle.c (casify_region): Remove var that is set but not used.
22327
22328 * dired.c (file_name_completion): Remove var that is set but not used.
22329
22330 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22331
22332 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
22333 (Finsert_file_contents): Remove unnecessary code checking fd.
22334
22335 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22336 Check for integer overflow on size calculations.
22337
22338 * buffer.c (Fprevious_overlay_change): Remove var that is set
22339 but not used.
22340
22341 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22342 Remove vars that are set but not used.
22343 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
22344 (timer_check_2): Mark vars as initialized.
22345
22346 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22347
22348 * image.c (lookup_image): Remove var that is set but not used.
22349 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
22350
22351 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22352 that are set but not used.
22353
22354 * xfns.c (make_invisible_cursor): Don't return garbage
22355 if XCreateBitmapFromData fails (Bug#8410).
22356
22357 * xselect.c (x_get_local_selection, x_handle_property_notify):
22358 Remove vars that are set but not used.
22359
22360 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
22361 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
22362
22363 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22364 Remove var that is set but not used.
22365 (scroll_bar_windows_size): Now size_t, not int.
22366 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22367 Check for overflow.
22368
22369 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22370 (map_tty_color) [!defined MSDOS]: Likewise.
22371
22372 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22373
22374 * coding.c: Remove vars that are set but not used.
22375 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22376 All callers changed.
22377 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22378 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22379 (decode_coding_charset): Remove vars that are set but not used.
22380
22381 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22382 that is set but not used.
22383
22384 * print.c (print_object): Remove var that is set but not used.
22385
22386 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
22387 The gnulib version avoids calling malloc in the usual case,
22388 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22389 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22390 * filelock.c (current_lock_owner): Likewise.
22391 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22392 * sysdep.c: Include allocator.h, careadlinkat.h.
22393 (emacs_no_realloc_allocator): New static constant.
22394 (emacs_readlink): New function.
22395 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22396 ../lib/careadlinkat.h.
22397
22398 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22399
22400 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22401 first non-nil return value).
22402
22403 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22404
22405 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22406 if not defined (Bug#8403).
22407
22408 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22409
22410 * xdisp.c (display_count_lines): Remove parameter `start',
22411 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22412 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22413 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22414 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22415 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22416 and thereabouts. All callers changed.
22417 (get_per_char_metric): Remove parameter `f', unused since
22418 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22419
22420 2011-04-02 Jim Meyering <meyering@redhat.com>
22421
22422 do not dereference NULL upon failed strdup
22423 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22424 (ns_get_family): Likewise.
22425
22426 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22427
22428 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22429
22430 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22431
22432 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22433 later (Bug#8403).
22434
22435 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22436
22437 Add lexical binding.
22438
22439 * window.c (Ftemp_output_buffer_show): New fun.
22440 (Fsave_window_excursion):
22441 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22442
22443 * lread.c (lisp_file_lexically_bound_p): New function.
22444 (Fload): Bind Qlexical_binding.
22445 (readevalloop): Remove `evalfun' arg.
22446 Bind Qinternal_interpreter_environment.
22447 (Feval_buffer): Bind Qlexical_binding.
22448 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22449 Mark as dynamic.
22450 (syms_of_lread): Declare `lexical-binding'.
22451
22452 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22453
22454 * keyboard.c (eval_dyn): New fun.
22455 (menu_item_eval_property): Use it.
22456
22457 * image.c (parse_image_spec): Use Ffunctionp.
22458
22459 * fns.c (concat, mapcar1): Accept byte-code-functions.
22460
22461 * eval.c (Fsetq): Handle lexical vars.
22462 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22463 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22464 (FletX, Flet): Obey lexical binding.
22465 (Fcommandp): Handle closures.
22466 (Feval): New `lexical' arg.
22467 (eval_sub): New function extracted from Feval. Use it almost
22468 everywhere where Feval was used. Look up vars in lexical env.
22469 Handle closures.
22470 (Ffunctionp): Move from subr.el.
22471 (Ffuncall): Handle closures.
22472 (apply_lambda): Remove `eval_flags'.
22473 (funcall_lambda): Handle closures and new byte-code-functions.
22474 (Fspecial_variable_p): New function.
22475 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22476 but without exporting it to Lisp.
22477
22478 * doc.c (Fdocumentation, store_function_docstring):
22479 * data.c (Finteractive_form): Handle closures.
22480
22481 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22482 interactive spec.
22483
22484 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22485 New byte-codes.
22486 (exec_byte_code): New function extracted from Fbyte_code to handle new
22487 calling convention for byte-code-functions. Add new byte-codes.
22488
22489 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
22490
22491 * alloc.c (Fmake_symbol): Init new `declared_special' field.
22492
22493 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22494
22495 * xdisp.c (redisplay_internal): Fix prototype.
22496
22497 2011-03-31 Eli Zaretskii <eliz@gnu.org>
22498
22499 * xdisp.c (SCROLL_LIMIT): New macro.
22500 (try_scrolling): Use it when setting scroll_limit.
22501 Limit scrolling to 100 screen lines.
22502 (redisplay_window): Even when falling back on "recentering",
22503 position point in the window according to scroll-conservatively,
22504 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22505
22506 (try_scrolling): When point is above the window, allow searching
22507 as far as scroll_max, or one screenful, to compute vertical
22508 distance from PT to the scroll margin position. This prevents
22509 try_scrolling from unnecessarily failing when
22510 scroll-conservatively is set to a value slightly larger than the
22511 window height. Clean up the case of PT below the margin at bottom
22512 of window: scroll_max can no longer be INT_MAX. When aggressive
22513 scrolling is in use, don't let point enter the opposite scroll
22514 margin as result of the scroll.
22515 (syms_of_xdisp) <scroll-conservatively>: Document the
22516 threshold of 100 lines for never-recentering scrolling.
22517
22518 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22519
22520 * dispextern.h (move_it_by_lines):
22521 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22522 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22523 (message_log_check_duplicate): Remove parameters `prev_bol' and
22524 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22525 (redisplay_internal): Remove parameter `preserve_echo_area',
22526 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22527
22528 * indent.c (Fvertical_motion):
22529 * window.c (window_scroll_pixel_based, Frecenter):
22530 Don't pass `need_y_p' to `move_it_by_lines'.
22531
22532 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22533
22534 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22535 steal a few bits to be more compact.
22536 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22537 Remove unneeded casts.
22538
22539 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22540
22541 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22542
22543 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22544 binding" message (bug#7967).
22545
22546 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22547
22548 Fix more problems found by GCC 4.6.0's static checks.
22549
22550 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22551 Remove unused local var.
22552
22553 * editfns.c (Fmessage_box): Remove unused local var.
22554
22555 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22556 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22557 Omit unused local vars.
22558 * window.c (shrink_windows): Omit unused local var.
22559 * menu.c (digest_single_submenu): Omit unused local var.
22560 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22561 Omit unused local var.
22562
22563 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22564 Don't assume string length fits in int.
22565 (keyremap_step, read_key_sequence): Use size_t for sizes.
22566 (read_key_sequence): Don't check last_real_key_start redundantly.
22567
22568 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22569 instead of alloca (Bug#8344).
22570
22571 * eval.c (Fbacktrace): Don't assume nargs fits in int.
22572 (Fbacktrace_frame): Don't assume nframes fits in int.
22573
22574 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22575
22576 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22577 concerns.
22578
22579 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22580
22581 * cm.c (calccost): Turn while-do into do-while, for clarity.
22582
22583 * keyboard.c (syms_of_keyboard): Use the same style as later
22584 in this function when indexing through an array. This also
22585 works around GCC bug 48267.
22586
22587 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22588
22589 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22590
22591 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22592 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22593
22594 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22595 This avoids undefined behavior on integer overflow, and is a bit
22596 more convenient anyway since it is compared to a size_t variable.
22597
22598 Variadic C functions now count arguments with size_t, not int.
22599 This avoids an unnecessary limitation on 64-bit machines, which
22600 caused (substring ...) to crash on large vectors (Bug#8344).
22601 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22602 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
22603 All variadic functions and their callers changed accordingly.
22604 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22605 * data.c (arith_driver, float_arith_driver): Likewise.
22606 * editfns.c (general_insert_function): Likewise.
22607 * eval.c (struct backtrace.nargs, interactive_p)
22608 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22609 (funcall_lambda, mark_backtrace): Likewise.
22610 * fns.c (concat): Likewise.
22611 * frame.c (x_set_frame_parameters): Likewise.
22612 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22613 0 if not found, not -1. All callers changed.
22614
22615 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22616 (stack_copy_size): Now size_t, not int.
22617 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22618
22619 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22620
22621 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22622 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22623 All callers changed.
22624
22625 * lisp.h (multibyte_char_to_unibyte):
22626 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22627 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22628 * character.h (CHAR_TO_BYTE8):
22629 * cmds.c (internal_self_insert):
22630 * editfns.c (general_insert_function):
22631 * keymap.c (push_key_description):
22632 * search.c (Freplace_match):
22633 * xdisp.c (message_dolog, set_message_1): All callers changed.
22634
22635 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22636
22637 * keyboard.c (safe_run_hook_funcall): New function.
22638 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22639 don't set the hook to nil, but remove the offending function instead.
22640 (Qcommand_hook_internal): Remove, unused.
22641 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22642 Vcommand_hook_internal.
22643
22644 * eval.c (enum run_hooks_condition): Remove.
22645 (funcall_nil, funcall_not): New functions.
22646 (run_hook_with_args): Call each function through a `funcall' argument.
22647 Remove `cond' argument, now redundant.
22648 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22649 (Frun_hook_with_args_until_failure): Adjust accordingly.
22650 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22651
22652 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22653
22654 * dispextern.h (string_buffer_position): Remove declaration.
22655
22656 * print.c (strout): Remove parameter `multibyte', unused since
22657 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22658
22659 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22660 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22661 All callers changed.
22662
22663 * w32.c (_wsa_errlist): Use braces for struct initializers.
22664
22665 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22666 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22667 All callers changed.
22668 (string_buffer_position): Likewise. Also, make static (it's never
22669 used outside xdisp.c).
22670 (cursor_row_p): Remove parameter `w', unused since
22671 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22672 (decode_mode_spec): Remove parameter `precision', introduced during
22673 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22674 All callers changed.
22675
22676 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22677
22678 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22679
22680 2011-03-27 Anders Lindgren <andlind@gmail.com>
22681
22682 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22683 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22684 (ns_update_auto_hide_menu_bar): New functions.
22685 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22686 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22687 ns_constrain_all_frames.
22688 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22689 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22690
22691 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22692
22693 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22694
22695 2011-03-27 Glenn Morris <rgm@gnu.org>
22696
22697 * syssignal.h: Replace RETSIGTYPE with void.
22698 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22699 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22700 Replace SIGTYPE with void everywhere.
22701 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22702 * s/template.h (SIGTYPE): Remove commented out definition.
22703
22704 2011-03-26 Eli Zaretskii <eliz@gnu.org>
22705
22706 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22707 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22708
22709 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
22710
22711 * w32.c (read_unc_volume): Use parameter `henum', instead of
22712 global variable `wget_enum_handle'.
22713
22714 * keymap.c (describe_vector): Remove parameters `indices' and
22715 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22716 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22717
22718 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22719
22720 * keyboard.c (timer_check): Remove parameter `do_it_now',
22721 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22722 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22723 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22724
22725 * keyboard.c (read_char):
22726 * w32menu.c (w32_menu_display_help):
22727 * xmenu.c (show_help_event, menu_help_callback):
22728 Adjust calls to `show_help_echo'.
22729
22730 * gtkutil.c (xg_maybe_add_timer):
22731 * keyboard.c (readable_events):
22732 * process.c (wait_reading_process_output):
22733 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22734
22735 * insdel.c (adjust_markers_gap_motion):
22736 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22737 (gap_left, gap_right): Don't call it.
22738
22739 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
22740
22741 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22742 incurred during fontification.
22743
22744 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22745
22746 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22747 (DEFVAR_PER_BUFFER): Don't pass it.
22748
22749 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22750 (scrolling_window): Don't pass it.
22751
22752 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22753
22754 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22755
22756 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22757 and `suffix'.
22758 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22759 of variables specific to SELinux and computation of `encoded_absname'.
22760
22761 * image.c (XPutPixel): Remove unused variable `height'.
22762
22763 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22764
22765 * unexw32.c (get_section_info): Remove unused variable `section'.
22766
22767 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22768 (system_process_attributes): Remove unused variable `sess'.
22769 (sys_read): Remove unused variable `err'.
22770
22771 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22772 (w32_wnd_proc): Remove unused variable `isdead'.
22773 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22774 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22775 (x_create_tip_frame): Remove unused variable `tem'.
22776
22777 * w32inevt.c (w32_console_read_socket):
22778 Remove unused variable `no_events'.
22779
22780 * w32term.c (x_draw_composite_glyph_string_foreground):
22781 Remove unused variable `width'.
22782
22783 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
22784
22785 * w32term.c (x_set_glyph_string_clipping):
22786 Don't pass uninitialized region to CombineRgn.
22787
22788 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
22789
22790 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22791 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22792 (Fx_close_connection): Remove unused variable `i'.
22793
22794 * w32font.c (w32font_draw): Return number of glyphs.
22795 (w32font_open_internal): Remove unused variable `i'.
22796 (w32font_driver): Add missing initializer.
22797
22798 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22799 (fill_in_menu): Remove unused variable `items_added'.
22800
22801 * w32term.c (last_mouse_press_frame): Remove static global variable.
22802 (w32_clip_to_row): Remove unused variable `f'.
22803 (x_delete_terminal): Remove unused variable `i'.
22804
22805 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22806 (NOTHING): Remove unused static global variable.
22807 (uniscribe_check_otf): Remove unused variable `table'.
22808 (uniscribe_font_driver): Add missing initializers.
22809
22810 2011-03-23 Julien Danjou <julien@danjou.info>
22811
22812 * term.c (Fsuspend_tty, Fresume_tty):
22813 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22814 * window.c (temp_output_buffer_show):
22815 * insdel.c (signal_before_change):
22816 * frame.c (Fhandle_switch_frame):
22817 * fileio.c (Fdo_auto_save):
22818 * emacs.c (Fkill_emacs):
22819 * editfns.c (save_excursion_restore):
22820 * cmds.c (internal_self_insert):
22821 * callint.c (Fcall_interactively):
22822 * buffer.c (Fkill_all_local_variables):
22823 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22824 Use Frun_hooks.
22825 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
22826 unconditionally since it does the check itself.
22827
22828 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
22829
22830 Fix more problems found by GCC 4.5.2's static checks.
22831
22832 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22833 the first time through the loop, since we know p0 < p1 then.
22834 This also avoids a gcc -Wstrict-overflow warning.
22835
22836 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22837 leading to a memory leak, possible in functions like
22838 load_charset_map_from_file that can allocate an unbounded number
22839 of objects (Bug#8318).
22840
22841 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22842 that could (at least in theory) be that large.
22843
22844 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22845 This is less likely to overflow, and avoids undefined behavior if
22846 overflow does occur. All callers changed. Use strtoul to scan
22847 for the unsigned long integer.
22848 (pint2hrstr): Simplify and tune code slightly.
22849 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
22850
22851 * scroll.c (do_scrolling): Work around GCC bug 48228.
22852 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22853
22854 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22855 This also avoids a warning with gcc -Wstrict-overflow.
22856 (validate_x_resource_name): Simplify count usage.
22857 This also avoids a warning with gcc -Wstrict-overflow.
22858
22859 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22860 fail (Bug#8306).
22861
22862 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
22863
22864 * process.c (Fmake_network_process): Use socklen_t, not int,
22865 where POSIX says socklen_t is required in portable programs.
22866 This fixes a porting bug on hosts like 64-bit HP-UX, where
22867 socklen_t is wider than int (Bug#8277).
22868 (Fmake_network_process, server_accept_connection):
22869 (wait_reading_process_output, read_process_output):
22870 Likewise.
22871
22872 * process.c: Rename or move locals to avoid shadowing.
22873 (list_processes_1, Fmake_network_process):
22874 (read_process_output_error_handler, exec_sentinel_error_handler):
22875 Rename or move locals.
22876 (Fmake_network_process): Define label "retry_connect" only if needed.
22877 (Fnetwork_interface_info): Fix pointer signedness.
22878 (process_send_signal): Add cast to avoid pointer signedness problem.
22879 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
22880 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
22881
22882 Make tparam.h and terminfo.c consistent.
22883 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22884 Include tparam.h instead, since it declares them.
22885 * cm.h (PC): Remove extern decl; tparam.h now does this.
22886 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22887 * terminfo.c: Include tparam.h, to check interfaces.
22888 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22889 (tparam): Adjust signature to match interface in tparam.h;
22890 this removes some undefined behavior. Check that outstring and len
22891 are zero, which they always are with Emacs.
22892 * tparam.h (PC, BC, UP): New extern decls.
22893
22894 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
22895 (xftfont_open): Rename locals to avoid shadowing.
22896
22897 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
22898 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22899 (OTF_TAG_SYM): Omit macro if not needed.
22900 (ftfont_list): Remove unused local.
22901 (get_adstyle_property, ftfont_pattern_entity):
22902 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22903 Rename locals to avoid shadowing.
22904
22905 * xfont.c (xfont_list_family): Mark var as initialized.
22906
22907 * xml.c (make_dom): Now static.
22908
22909 * composite.c (composition_compute_stop_pos): Rename local to
22910 avoid shadowing.
22911 (composition_reseat_it): Remove unused locals.
22912 (find_automatic_composition, composition_adjust_point): Likewise.
22913 (composition_update_it): Mark var as initialized.
22914 (find_automatic_composition): Mark vars as initialized,
22915 with a FIXME (Bug#8290).
22916
22917 character.h: Rename locals to avoid shadowing.
22918 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22919 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22920 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22921 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22922 to avoid shadowing.
22923
22924 * textprop.c (property_change_between_p): Remove; unused.
22925
22926 * intervals.c (interval_start_pos): Now static.
22927
22928 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22929
22930 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22931 Rename locals to avoid shadowing.
22932
22933 * sound.c (wav_play, au_play, Fplay_sound_internal):
22934 Fix pointer signedness.
22935 (alsa_choose_format): Remove unused local var.
22936 (wav_play): Initialize a variable to 0, to prevent undefined
22937 behavior (Bug#8278).
22938
22939 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22940
22941 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22942
22943 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22944 clobbering (Bug#8298).
22945 * sysdep.c (sys_subshell): Likewise.
22946 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
22947
22948 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22949 This should get cleaned up, so that child_setup has the
22950 same signature on all platforms.
22951
22952 * callproc.c (call_process_cleanup): Now static.
22953 (relocate_fd): Rename locals to avoid shadowing.
22954
22955 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
22956
22957 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22958 not to be necessary, and produces flickering.
22959
22960 2011-03-20 Glenn Morris <rgm@gnu.org>
22961
22962 * config.in: Remove file.
22963
22964 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
22965
22966 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22967 are now in src/globals.h.
22968 (syms_of_minibuf): Remove spurious & from previous change.
22969
22970 2011-03-20 Leo Liu <sdl.web@gmail.com>
22971
22972 * minibuf.c (completing-read-function): New variable.
22973 (completing-read-default): Rename from completing-read.
22974 (completing-read): Call completing-read-function.
22975
22976 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22977
22978 * xfaces.c (Fx_load_color_file):
22979 Read color file from absolute filename (bug#8250).
22980
22981 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22982
22983 * makefile.w32-in: Update dependencies.
22984
22985 2011-03-17 Eli Zaretskii <eliz@gnu.org>
22986
22987 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22988
22989 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22990
22991 Fix more problems found by GCC 4.5.2's static checks.
22992
22993 * process.c (make_serial_process_unwind, send_process_trap):
22994 (sigchld_handler): Now static.
22995
22996 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22997 That way, the code declares only the vars that it needs.
22998 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22999 * s/cygwin.h (PTY_ITERATION): Likewise.
23000 * s/darwin.h (PTY_ITERATION): Likewise.
23001 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23002
23003 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23004 * process.c (allocate_pty): Don't declare stb unless it's needed.
23005
23006 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23007 (CONSTANTLIM): Remove; unused.
23008 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23009 Define only if needed.
23010
23011 * unexelf.c (unexec): Name an expression,
23012 to avoid gcc -Wbad-function-cast warning.
23013 Use a different way to cause a compilation error if anyone uses
23014 n rather than nn, a way that does not involve shadowing.
23015 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23016
23017 * deps.mk (unexalpha.o): Remove; unused.
23018
23019 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23020 * unexec.h: New file.
23021 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23022 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23023 Depend on unexec.h.
23024 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23025 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23026 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23027 Change as necessary to match prototype in unexec.h.
23028
23029 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23030 shadowing.
23031 (back_comment, skip_chars): Mark vars as initialized.
23032
23033 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23034 Rename locals to avoid shadowing.
23035
23036 * lread.c (read1): Rewrite so as not to use empty "else".
23037 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23038
23039 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23040
23041 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23042 warning when compiling print.c.
23043
23044 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23045 instead of using an uninitialized var.
23046 (font_sort_entities): Mark var as initialized.
23047
23048 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23049
23050 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23051 pointers to constants.
23052 (font_parse_fcname): Remove unused vars.
23053 (font_delete_unmatched): Now static.
23054 (font_get_spec): Remove; unused.
23055 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23056 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23057 Rename or move locals to avoid shadowing.
23058
23059 * fns.c (require_nesting_list, require_unwind): Now static.
23060 (Ffillarray): Rename locals to avoid shadowing.
23061
23062 * floatfns.c (domain_error2): Define only if needed.
23063 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23064
23065 * alloc.c (mark_backtrace): Move decl from here ...
23066 * lisp.h: ... to here, so that it can be checked.
23067
23068 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23069 (Fdefvar): Rewrite so as not to use empty "else".
23070 (lisp_indirect_variable): Name an expression,
23071 to avoid gcc -Wbad-function-cast warning.
23072 (Fdefvar): Rename locals to avoid shadowing.
23073
23074 * callint.c (quotify_arg, quotify_args): Now static.
23075 (Fcall_interactively): Rename locals to avoid shadowing.
23076 Use const pointer when appropriate.
23077
23078 * lisp.h (get_system_name, get_operating_system_release):
23079 Move decls here, to check interfaces.
23080 * process.c (get_operating_system_release): Move decl to lisp.h.
23081 * xrdb.c (get_system_name): Likewise.
23082 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23083 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23084 some of which prompt warnings from gcc -Wbad-function-cast.
23085 (Fformat_time_string, Fencode_time, Finsert_char):
23086 (Ftranslate_region_internal, Fformat):
23087 Rename or remove local vars to avoid shadowing.
23088 (Ftranslate_region_internal): Mark var as initialized.
23089
23090 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23091 avoid shadowing.
23092
23093 * lisp.h (eassert): Check that the argument compiles, even if
23094 ENABLE_CHECKING is not defined.
23095
23096 * data.c (Findirect_variable): Name an expression, to avoid
23097 gcc -Wbad-function-cast warning.
23098 (default_value, arithcompare, arith_driver, arith_error): Now static.
23099 (store_symval_forwarding): Rename local to avoid shadowing.
23100 (Fmake_variable_buffer_local, Fmake_local_variable):
23101 Mark variables as initialized.
23102 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23103
23104 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23105 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23106 Rename locals to avoid shadowing.
23107 (mark_stack): Move local variables into the #ifdef region where
23108 they're used.
23109 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23110 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23111 needed otherwise.
23112 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23113 (GC_STRING_CHARS): Remove; not used.
23114 (Fmemory_limit): Cast sbrk's returned value to char *.
23115
23116 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23117 avoids undefined behavior in theory.
23118
23119 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23120
23121 Use functions, not macros, for up- and down-casing (Bug#8254).
23122 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23123 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23124 to use the following functions instead of these macros.
23125 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23126 EMACS_INT, since callers assume the returned value fits in int.
23127 (upcase1): Likewise, for UPCASE_TABLE.
23128 (uppercasep, lowercasep, upcase): New static inline functions.
23129 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23130 the race-condition problem in the old DOWNCASE.
23131
23132 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23133 Rename locals to avoid shadowing.
23134 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23135 (regex_compile, re_search_2, re_match_2_internal):
23136 Remove unused local vars.
23137 (FREE_VAR): Rewrite so as not to use empty "else",
23138 which gcc can warn about.
23139 (regex_compile, re_match_2_internal): Mark locals as initialized.
23140 (RETALLOC_IF): Define only if needed.
23141 (WORDCHAR_P): Likewise. This one is never needed, but is used
23142 only in a comment talking about a compiler bug, so put inside
23143 the #if 0 of that comment.
23144 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23145 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23146 Remove; unused.
23147
23148 * search.c (boyer_moore): Rename locals to avoid shadowing.
23149 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23150 (PREV_CHAR_BOUNDARY): Likewise.
23151
23152 * search.c (simple_search): Remove unused var.
23153
23154 * dired.c (compile_pattern): Move decl from here ...
23155 * lisp.h: ... to here, so that it can be checked.
23156 (struct re_registers): New forward decl.
23157
23158 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23159
23160 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23161 All uses changed.
23162 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23163 Rename locals to avoid shadowing.
23164 (Fvertical_motion): Mark locals as initialized.
23165
23166 * casefiddle.c (casify_object, casify_region): Now static.
23167 (casify_region): Mark local as initialized.
23168
23169 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23170
23171 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23172 New macros, so that the caller can use some names other than
23173 gcpro1, gcpro2, etc.
23174 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23175 of the new macros.
23176 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23177 argument, for consistency with GCPRO2_VAR, etc: it is now the
23178 prefix of the variable, not the variable itself. All uses
23179 changed.
23180 * dired.c (directory_files_internal, file_name_completion):
23181 Rename locals to avoid shadowing.
23182
23183 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23184 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23185 dired.c's scmp function, had undefined behavior.
23186 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23187 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23188 * buffer.h: ... to here, because these macros use current_buffer,
23189 and the new implementation with inline functions needs to have
23190 current_buffer in scope now, rather than later when the macros
23191 are used.
23192 (downcase, upcase1): New static inline functions.
23193 (DOWNCASE, UPCASE1): Reimplement using these functions.
23194 This avoids undefined behavior in expressions like
23195 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23196 from race conditions in accessing the global variables
23197 case_temp1 and case_temp2.
23198 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23199 * lisp.h (case_temp1, case_temp2): Remove their decls.
23200 * character.h (ASCII_CHAR_P): Move from here ...
23201 * lisp.h: ... to here, so that the inline functions mentioned
23202 above can use them.
23203
23204 * dired.c (directory_files_internal_unwind): Now static.
23205
23206 * fileio.c (file_name_as_directory, directory_file_name):
23207 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23208 Now static.
23209 (file_name_as_directory): Use const pointers when appropriate.
23210 (Fexpand_file_name): Likewise. In particular, newdir might
23211 point at constant storage, so make it a const pointer.
23212 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
23213 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23214 signedness issues.
23215 (Fset_file_times, Finsert_file_contents, auto_save_error):
23216 Rename locals to avoid shadowing.
23217
23218 * minibuf.c (choose_minibuf_frame_1): Now static.
23219 (Ftry_completion, Fall_completions): Rename or remove locals
23220 to avoid shadowing.
23221
23222 * marker.c (bytepos_to_charpos): Remove; unused.
23223
23224 * lisp.h (verify_bytepos, count_markers): New decls,
23225 so that gcc does not warn that these functions aren't declared.
23226
23227 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23228 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
23229 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
23230 (copy_text): Remove unused local var.
23231
23232 * filelock.c (within_one_second): Now static.
23233 (lock_file_1): Rename local to avoid shadowing.
23234
23235 * buffer.c (fix_overlays_before): Mark locals as initialized.
23236 (fix_start_end_in_overlays): Likewise. This function should be
23237 simplified by using pointers-to-pointers, but that's a different
23238 matter.
23239 (switch_to_buffer_1): Now static.
23240 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23241 (report_overlay_modification): Rename locals to avoid shadowing.
23242
23243 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
23244 Fix pointer signedness issue.
23245 (sys_subshell): Mark local as volatile if checking for lint,
23246 to suppress a gcc -Wclobbered warning that does not seem to be right.
23247 (MAXPATHLEN): Define only if needed.
23248
23249 * process.c (serial_open, serial_configure): Move decls from here ...
23250 * systty.h: ... to here, so that they can be checked.
23251
23252 * fns.c (get_random, seed_random): Move extern decls from here ...
23253 * lisp.h: ... to here, so that they can be checked.
23254
23255 * sysdep.c (reset_io): Now static.
23256 (wait_for_termination_signal): Remove; unused.
23257
23258 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23259 (copy_keymap_item, append_key, push_text_char_description):
23260 Now static.
23261 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
23262 (DENSE_TABLE_SIZE): Remove; unused.
23263 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23264 (describe_map_tree):
23265 Rename locals to avoid shadowing.
23266
23267 * keyboard.c: Declare functions static if they are not used elsewhere.
23268 (echo_char, echo_dash, cmd_error, top_level_2):
23269 (poll_for_input, handle_async_input): Now static.
23270 (read_char, kbd_buffer_get_event, make_lispy_position):
23271 (make_lispy_event, make_lispy_movement, apply_modifiers):
23272 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23273 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23274 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
23275 (read_key_sequence, read_char): Mark locals as initialized.
23276 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
23277
23278 * keyboard.h (make_ctrl_char): New decl.
23279 (mark_kboards): Move decl here ...
23280 * alloc.c (mark_kboards): ... from here.
23281
23282 * lisp.h (force_auto_save_soon): New decl.
23283
23284 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
23285 (DEFINE_DUMMY_FUNCTION): New macro.
23286 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23287 Use it.
23288 (main): Add casts to avoid warnings
23289 if GCC considers string literals to be constants.
23290
23291 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23292
23293 * dbusbind.c: Pointer signedness fixes.
23294 (xd_signature, xd_append_arg, xd_initialize):
23295 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23296 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23297 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23298 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23299
23300 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23301 if GCC considers string literals to be constants.
23302 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
23303
23304 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23305
23306 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23307 (print_preprocess, print_object): New macro to fix last change.
23308
23309 * print.c (print_preprocess): Don't forget font objects.
23310
23311 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
23312
23313 * emacs.c (USAGE3): Doc fixes.
23314
23315 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23316
23317 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23318 structure.
23319
23320 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
23321
23322 * lisp.h (VWindow_system, Qfile_name_history):
23323 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23324 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23325 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23326
23327 * w32select.c: Don't #include "keyboard.h".
23328 (run_protected): Add extern declaration for waiting_for_input.
23329
23330 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23331 * w32console.c (detect_input_pending, read_input_pending)
23332 (encode_terminal_code):
23333 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23334 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23335 (w32_system_caret_y, Qfile_name_history):
23336 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23337 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23338 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23339 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23340 * w32proc.c (Qlocal, report_file_error):
23341 * w32term.c (Vwindow_system, updating_frame):
23342 * w32uniscribe.c (initialized, uniscribe_font_driver):
23343 Remove unneeded extern declarations.
23344
23345 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
23346
23347 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
23348
23349 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
23350
23351 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23352 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23353 These macros can no longer be used for assignment.
23354
23355 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23356 Assign struct members directly, instead of using BUF_BEGV etc.
23357 (record_buffer_markers, fetch_buffer_markers): New functions for
23358 recording and fetching special buffer markers.
23359 (set_buffer_internal_1, set_buffer_temp): Use them.
23360
23361 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23362
23363 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23364
23365 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23366 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23367
23368 * xdisp.c (hscroll_window_tree):
23369 (reconsider_clip_changes): Use PT instead of BUF_PT.
23370
23371 2011-03-13 Eli Zaretskii <eliz@gnu.org>
23372
23373 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23374 $(EMACS_ROOT)/lib/intprops.h.
23375
23376 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23377
23378 Fix more problems found by GCC 4.5.2's static checks.
23379
23380 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23381 to unsigned char * to avoid compiler diagnostic.
23382 (xg_free_frame_widgets): Make it clear that a local variable is
23383 needed only if USE_GTK_TOOLTIP.
23384 (gdk_window_get_screen): Make it clear that this macro is needed
23385 only if USE_GTK_TOOLTIP.
23386 (int_gtk_range_get_value): New function, which avoids a diagnostic
23387 from gcc -Wbad-function-cast.
23388 (xg_set_toolkit_scroll_bar_thumb): Use it.
23389 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23390 diagnostic from gcc -Wbad-function-cast.
23391 (get_utf8_string, xg_get_file_with_chooser):
23392 Rename locals to avoid shadowing.
23393 (create_dialog): Move locals to avoid shadowing.
23394
23395 * xgselect.c (xg_select): Remove unused var.
23396
23397 * image.c (four_corners_best): Mark locals as initialized.
23398 (gif_load): Initialize transparent_p to zero (Bug#8238).
23399 Mark another local as initialized.
23400 (my_png_error, my_error_exit): Mark with NO_RETURN.
23401
23402 * image.c (clear_image_cache): Now static.
23403 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
23404 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
23405 (x_edge_detection): Remove unnecessary cast that
23406 gcc -Wbad-function-cast diagnoses.
23407 (gif_load): Fix pointer signedness.
23408 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23409 (jpeg_load, gif_load): Rename locals to avoid shadowing.
23410
23411 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
23412
23413 Improve quality of tests for time stamp overflow.
23414 For example, without this patch (encode-time 0 0 0 1 1
23415 1152921504606846976) returns the obviously-bogus value (-948597
23416 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23417 reports time overflow. See
23418 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
23419 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23420 * editfns.c: Include limits.h and intprops.h.
23421 (TIME_T_MIN, TIME_T_MAX): New macros.
23422 (time_overflow): Move earlier, to before first use.
23423 (hi_time, lo_time): New functions, for an accurate test for
23424 out-of-range times.
23425 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23426 (Fget_internal_run_time): Don't assume time_t fits in int.
23427 (make_time): Use list2 instead of Fcons twice.
23428 (Fdecode_time): More accurate test for out-of-range times.
23429 (check_tm_member): New function.
23430 (Fencode_time): Use it, to test for out-of-range times.
23431 (lisp_time_argument): Don't rely on undefined left-shift and
23432 right-shift behavior when checking for time stamp overflow.
23433
23434 * editfns.c (time_overflow): New function, refactoring common code.
23435 (Fformat_time_string, Fdecode_time, Fencode_time):
23436 (Fcurrent_time_string): Use it.
23437
23438 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23439 * dired.c (make_time): Move to ...
23440 * editfns.c (make_time): ... here.
23441 * systime.h: Note the move.
23442
23443 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23444
23445 * fringe.c (update_window_fringes): Remove unused variables.
23446
23447 * unexmacosx.c (copy_data_segment): Also copy __got section.
23448 (Bug#8223)
23449
23450 2011-03-12 Eli Zaretskii <eliz@gnu.org>
23451
23452 * termcap.c [MSDOS]: Include "msdos.h".
23453 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23454 Constify `char *' arguments and their references according to
23455 prototypes in tparam.h.
23456
23457 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
23458
23459 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23460 Adapt all references accordingly.
23461
23462 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23463
23464 2011-03-11 Tom Tromey <tromey@redhat.com>
23465
23466 * buffer.c (syms_of_buffer): Remove obsolete comment.
23467
23468 2011-03-11 Eli Zaretskii <eliz@gnu.org>
23469
23470 * termhooks.h (encode_terminal_code): Declare prototype.
23471
23472 * msdos.c (encode_terminal_code): Don't declare prototype.
23473
23474 * term.c (encode_terminal_code): Now external again, used by
23475 w32console.c and msdos.c.
23476
23477 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23478 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
23479
23480 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
23481
23482 Fix some minor problems found by GCC 4.5.2's static checks.
23483
23484 * fringe.c (update_window_fringes): Mark locals as initialized
23485 (Bug#8227).
23486 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
23487
23488 * alloc.c (mark_fringe_data): Move decl from here ...
23489 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23490 to check its interface.
23491 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23492
23493 * fontset.c (free_realized_fontset): Now static.
23494 (Fset_fontset_font): Rename local to avoid shadowing.
23495 (fontset_font): Mark local as initialized.
23496 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
23497
23498 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23499
23500 * xselect.c (x_disown_buffer_selections): Remove; not used.
23501 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
23502 (x_own_selection, Fx_disown_selection_internal): Rename locals
23503 to avoid shadowing.
23504 (x_handle_dnd_message): Remove local to avoid shadowing.
23505
23506 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23507 so that the caller can use some name other than gcpro1.
23508 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
23509 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23510 (Fx_backspace_delete_keys_p):
23511 Use them to avoid shadowing, and rename vars to avoid shadowing.
23512 (x_decode_color, x_set_name, x_window): Now static.
23513 (Fx_create_frame): Add braces to silence GCC warning.
23514 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
23515 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23516 Remove unused locals.
23517 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23518 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23519 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23520 macros.
23521
23522 * xterm.h (x_mouse_leave): New decl.
23523
23524 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23525 Remove unused functions.
23526 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23527 (x_calc_absolute_position): Now static.
23528 (XTread_socket): Don't define label "out" unless it's used.
23529 Don't declare local "event" unless it's used.
23530 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23531 unless they are used.
23532 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23533 (x_fatal_error_signal): Remove; not used.
23534 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23535 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23536 (x_error_catcher, x_connection_closed, x_error_handler):
23537 (x_error_quitter, xembed_send_message, x_iconify_frame):
23538 (my_log_handler): Rename locals to avoid shadowing.
23539 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
23540 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
23541
23542 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23543 Rename or move locals to avoid shadowing.
23544 (tty_defined_color, merge_face_heights): Now static.
23545 (free_realized_faces_for_fontset): Remove; not used.
23546 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23547 does not deduce is never used uninitialized.
23548 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23549 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
23550
23551 * terminal.c (store_terminal_param): Now static.
23552
23553 * xmenu.c (menu_highlight_callback): Now static.
23554 (set_frame_menubar): Remove unused local.
23555 (xmenu_show): Rename parameter to avoid shadowing.
23556 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23557 since they might point to immutable storage.
23558 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23559 since it's unused otherwise.
23560
23561 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
23562 Add a FIXME, since the code still doesn't look right. (Bug#8215)
23563 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23564 avoids a gcc -Wuninitialized diagnostic.
23565 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
23566 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23567 does not deduce are never used uninitialized.
23568
23569 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23570
23571 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
23572 * window.c (window_loop, size_window):
23573 (run_window_configuration_change_hook, enlarge_window): Likewise.
23574
23575 * window.c (display_buffer): Now static.
23576 (size_window): Mark variables that gcc -Wuninitialized
23577 does not deduce are never used uninitialized.
23578 * window.h (check_all_windows): New decl, to forestall
23579 gcc -Wmissing-prototypes diagnostic.
23580 * dispextern.h (bidi_dump_cached_states): Likewise.
23581
23582 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23583 shadowing.
23584 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
23585 Include <limits.h>.
23586 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23587 and to avoid gcc -Wuninitialized warning.
23588 (load_charset_map): Mark variables that gcc -Wuninitialized
23589 does not deduce are never used uninitialized.
23590 (load_charset): Abort instead of using uninitialized var (Bug#8229).
23591
23592 * coding.c (coding_set_source, coding_set_destination):
23593 Use "else { /* comment */ }" rather than "else /* comment */;"
23594 for clarity, and to avoid gcc -Wempty-body warning.
23595 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23596 a block, when the outer 'i' will do.
23597 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23598 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23599 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23600 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23601 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23602 Rename locals to avoid shadowing.
23603 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
23604 * coding.c (emacs_mule_char, encode_invocation_designation):
23605 Now static, since they're not used elsewhere.
23606 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
23607 (decode_coding_object, encode_coding_object, detect_coding_system):
23608 (decode_coding_emacs_mule): Mark variables that gcc
23609 -Wuninitialized does not deduce are never used uninitialized.
23610 (detect_coding_iso_2022): Initialize a local variable that might
23611 be used uninitialized. Leave a FIXME because it's not clear that
23612 this initialization is needed. (Bug#8211)
23613 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23614 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23615 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23616 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23617 Remove unused macros.
23618
23619 * category.c (hash_get_category_set): Remove unused local var.
23620 (copy_category_table): Now static, since it's not used elsewhere.
23621 * character.c (string_count_byte8): Likewise.
23622
23623 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23624 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23625
23626 * chartab.c (copy_sub_char_table): Now static, since it's not used
23627 elsewhere.
23628 (sub_char_table_ref_and_range, char_table_ref_and_range):
23629 Rename locals to avoid shadowing.
23630 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
23631
23632 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
23633 (BIDI_BOB): Remove unused macro.
23634
23635 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23636 deduce are never used uninitialized.
23637 * term.c (encode_terminal_code): Likewise.
23638
23639 * term.c (encode_terminal_code): Now static. Remove unused local.
23640
23641 * tparam.h: New file.
23642 * term.c, tparam.h: Include it.
23643 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23644 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23645 Move these decls to tparam.h, and make them agree with what
23646 is actually in tparam.c. The previous trick of using incompatible
23647 decls in different modules does not conform to the C standard.
23648 All callers of tparam changed to use tparam's actual API.
23649 * tparam.c (tparam1, tparam, tgoto):
23650 Use const pointers where appropriate.
23651
23652 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23653 * cm.h (struct cm): Likewise.
23654 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23655 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23656 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23657 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23658 (turn_on_face, init_tty): Likewise.
23659 * termchar.h (struct tty_display_info): Likewise.
23660
23661 * term.c (term_mouse_position): Rename local to avoid shadowing.
23662
23663 * alloc.c (mark_ttys): Move decl from here ...
23664 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23665
23666 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23667
23668 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23669
23670 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
23671
23672 * search.c (compile_pattern_1): Remove argument regp, unused since
23673 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23674 (compile_pattern): Don't pass it.
23675
23676 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23677
23678 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23679 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23680 for ! HAVE_GTK3.
23681 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23682
23683 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23684
23685 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23686 gdk_window_get_screen, gdk_window_get_geometry,
23687 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23688 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23689 (xg_get_pixbuf_from_pixmap): New function.
23690 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23691 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23692 Call xg_get_pixbuf_from_pixmap instead of
23693 gdk_pixbuf_get_from_drawable.
23694 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23695 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23696 (xg_check_special_colors): Use GtkStyleContext and its functions
23697 for HAVE_GTK3.
23698 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23699 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23700 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
23701 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23702 Call gtk_widget_get_preferred_size.
23703 (xg_frame_resized): gdk_window_get_geometry only takes 5
23704 parameters.
23705 (xg_win_to_widget, xg_event_is_for_menubar):
23706 Call gdk_x11_window_lookup_for_display.
23707 (xg_set_widget_bg): New function.
23708 (delete_cb): New function.
23709 (xg_create_frame_widgets): Connect delete-event to delete_cb.
23710 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
23711 (xg_set_background_color): Call xg_set_widget_bg.
23712 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23713 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23714 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23715 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23716 if ! HAVE_GTK3.
23717 (update_frame_tool_bar): Call gtk_widget_hide.
23718 (xg_initialize): Use GDK_KEY_g.
23719
23720 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23721 if ! HAVE_GTK3
23722 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23723
23724 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23725 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23726 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23727
23728 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
23729
23730 * w32xfns.c (select_palette): Check success of RealizePalette against
23731 GDI_ERROR, not zero.
23732
23733 See ChangeLog.11 for earlier changes.
23734
23735 ;; Local Variables:
23736 ;; coding: utf-8
23737 ;; End:
23738
23739 Copyright (C) 2011-2013 Free Software Foundation, Inc.
23740
23741 This file is part of GNU Emacs.
23742
23743 GNU Emacs is free software: you can redistribute it and/or modify
23744 it under the terms of the GNU General Public License as published by
23745 the Free Software Foundation, either version 3 of the License, or
23746 (at your option) any later version.
23747
23748 GNU Emacs is distributed in the hope that it will be useful,
23749 but WITHOUT ANY WARRANTY; without even the implied warranty of
23750 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23751 GNU General Public License for more details.
23752
23753 You should have received a copy of the GNU General Public License
23754 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.