Don't use -subsystem=console link option, it is the default.
[bpt/emacs.git] / src / ChangeLog
1 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
2
3 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
4 Without this fix, "make distclean" leaves stamp-h1 behind.
5
6 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
7
8 * w32fns.c (w32_fullscreen_rect): New function to compute the
9 window rectangle for the given fullscreen mode.
10 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
11 longer tunes the window size. This keeps the window's edges flush
12 with the screen and allows the taskbar to hide itself in fullboth.
13
14 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
15 window decorations and uses the entire screen.
16
17 * w32term.h (w32_fullscreen_rect) Add prototype.
18 (struct w32_output): Replace normal_width, normal_height,
19 normal_top, and normal_left members with a single normal_placement
20 struct.
21 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
22 Remove macros.
23 (FRAME_NORMAL_PLACEMENT): New macro.
24
25 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
26
27 * minibuf.c (Ftest_completion): Silence compiler warning.
28
29 2013-04-15 Eli Zaretskii <eliz@gnu.org>
30
31 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
32 bug#14062.
33
34 * frame.h (WINDOW_FRAME): Protect macro and its argument with
35 parentheses.
36
37 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
38 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
39 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
40 parentheses where appropriate.
41
42 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
43
44 * keyboard.c (timer_start_idle): Remove no-longer-used local.
45
46 2013-04-14 Eli Zaretskii <eliz@gnu.org>
47
48 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
49 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
50 Mention in the doc string that setting these variables takes
51 effect only after a call to set-window-buffer. (Bug#14200)
52
53 2013-04-13 Eli Zaretskii <eliz@gnu.org>
54
55 * indent.c (Fvertical_motion): Don't consider display strings on
56 overlay strings as display strings on the buffer position we
57 started from. This prevents vertical cursor motion from jumping
58 more than one line when there's an overlay string with a display
59 property at end of line.
60 Reported by Karl Chen <Karl.Chen@quarl.org> in
61 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
62
63 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
64
65 * window.c (select_window): `record_buffer' even if window is
66 already selected (bug#14191).
67
68 2013-04-11 Eli Zaretskii <eliz@gnu.org>
69
70 * window.c (Fwindow_end): Test more flags, including the buffer's
71 last_overlay_modified flag, to determine whether the window's
72 display is really up-to-date. Prevents the function from
73 returning a stale value. (Bug#14170)
74 (Fwindow_line_height): Fix the test for up-to-date-ness of the
75 current matrix.
76
77 2013-04-10 Eli Zaretskii <eliz@gnu.org>
78
79 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
80 garbaged only if it is not already the top frame on its TTY.
81 This prevents flickering due to constant redrawing of TTY frames when
82 there are GUI frames open in the same session. (Bug#13864)
83
84 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
85
86 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
87 of marking the idle timers directly.
88
89 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
90
91 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
92 tables (bug#14054).
93
94 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
95
96 * window.c (select_window): Don't record_buffer while the invariant is
97 temporarily broken (bug#14161).
98
99 * fns.c (Fdelq): Don't assume !NILP => CONSP.
100
101 2013-04-07 Eli Zaretskii <eliz@gnu.org>
102
103 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
104
105 2013-04-07 Romain Francoise <romain@orebokech.com>
106
107 Ignore additional platform-specific ACL errors (Bug#13702).
108 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
109 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
110
111 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
112
113 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
114 f->output_data.ns.
115
116 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
117
118 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
119 This bug was introduced by my 2013-02-25 change that simplified
120 data_start configuration. Without this change, on GNU/Linux
121 an Emacs configured with --enable-profiling fails immediately
122 due to a profiler signal.
123 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
124 with these flags. On platforms where special flags are needed
125 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
126 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
127 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
128
129 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
130
131 Get rid of some platform-specific functions examining window
132 system and its capabilities. This is a partial rework of the
133 2013-04-05 change.
134 * lisp.h (have_menus_p): Remove prototype. This function is
135 replaced with platform-independent window_system_available.
136 (check_window_system): Move to...
137 * frame.h (decode_window_system_frame, window_system_available):
138 ...here, add new prototypes.
139 * frame.c (window_system_available, decode_window_system_frame):
140 New functions.
141 (check_window_system): Platform-independent now.
142 * xterm.h (x_in_use): Remove declaration.
143 (check_x_frame):
144 * w32term.h (check_x_frame):
145 * nsterm.h (check_x_frame): Remove prototypes. This function
146 is replaced with platform-independent decode_window_system_frame.
147 * msdos.c (have_menus_p): Remove.
148 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
149 Remove platform-specific functions. Use check_window_system,
150 decode_window_system_frame and check_ns_display_info where
151 appropriate. Minor style and comment tweaks.
152 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
153 (check_x_frame): Likewise.
154 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
155 Likewise.
156 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
157 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
158 * xmenu.c, xselect.c: All related users changed.
159
160 2013-04-03 Kenichi Handa <handa@gnu.org>
161
162 The following changes is to optimize the code for reading UTF-8
163 files.
164
165 * coding.c (check_ascii): Rename from detect_ascii. Return value
166 changed. Check EOL format. Do not call adjust_coding_eol_type
167 here.
168 (check_utf_8): New function.
169 (adjust_coding_eol_type): Do nothing if already adjusted.
170 (detect_coding): Compare the return value of check_ascii with
171 coding->src_bytes. Call adjust_coding_eol_type if necessary.
172 (decode_coding_gap): Optimize for valid UTF-8.
173
174 2013-03-21 Kenichi Handa <handa@gnu.org>
175
176 * coding.c (syms_of_coding): Cancel previous change.
177
178 * insdel.c (insert_from_gap): Fix previous change.
179
180 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
181
182 Consistently use platform-specific function to detect window system.
183 * lisp.h (check_window_system): New prototype. This function is
184 going to replace check_x, check_w32 and check_ns.
185 (have_menus_p): Mention msdos.c in comment.
186 * fontset.c (check_window_system_func): Remove. Adjust all users.
187 * fontset.h (check_window_system_func): Remove prototype.
188 * nsterm.h (check_ns):
189 * xterm.h (check_x):
190 * w32term.h (check_w32): Likewise.
191 * menu.c (Fx_popup_menu): Use check_window_system.
192 * msdos.c (check_window_system): Define for MS-DOS.
193 * nsfns.m (check_window_system): Define for NS. Adjust all users.
194 * w32fns.c (check_window_system): Likewise for MS-Windows.
195 * xfns.c (check_window_system): Likewise for X.
196 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
197 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
198
199 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
200
201 Prefer < to > in range checks such as 0 <= i && i < N.
202 This makes it easier to visualize quantities on a number line.
203 This patch doesn't apply to all such range checks,
204 only to the range checks affected by the 2013-03-24 change.
205 This patch reverts most of the 2013-03-24 change.
206 * alloc.c (xpalloc, Fgarbage_collect):
207 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
208 * character.c (string_escape_byte8):
209 * charset.c (read_hex):
210 * data.c (cons_to_unsigned):
211 * dispnew.c (update_frame_1):
212 * doc.c (Fsubstitute_command_keys):
213 * doprnt.c (doprnt):
214 * editfns.c (hi_time, decode_time_components):
215 * fileio.c (file_offset):
216 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
217 * font.c (font_intern_prop):
218 * frame.c (x_set_alpha):
219 * gtkutil.c (get_utf8_string):
220 * indent.c (check_display_width):
221 * keymap.c (Fkey_description):
222 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
223 * lread.c (read1):
224 * minibuf.c (read_minibuf_noninteractive):
225 * process.c (wait_reading_process_output):
226 * search.c (Freplace_match):
227 * window.c (get_phys_cursor_glyph):
228 * xdisp.c (redisplay_internal):
229 * xsmfns.c (smc_save_yourself_CB):
230 Prefer < to > for range checks.
231 * dispnew.c (sit_for): Don't mishandle NaNs.
232 This fixes a bug introduced in the 2013-03-24 change.
233 * editfns.c (decode_time_components): Don't hoist comparison.
234 This fixes another bug introduced in the 2013-03-24 change.
235
236 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
237
238 * frame.h (struct frame): Drop scroll_bottom_vpos
239 member becaue all real users are dead long ago.
240 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
241 * xdisp.c (redisplay_internal): Adjust user.
242
243 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
244
245 * nsmenu.m (showAtX:Y:for:): setLevel to
246 NSPopUpMenuWindowLevel (Bug#13998).
247
248 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
249
250 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
251 (ns_check_pending_open_menu): Declare.
252
253 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
254 (x_activate_menubar): Update the menu with title that matches
255 ns_get_pending_menu_title, and call
256 ns_check_pending_openmenu (Bug#12698).
257 (menuWillOpen:): New method.
258 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
259
260 * nsterm.m (menu_will_open_state, menu_mouse_point)
261 (menu_pending_title): New varaibles.
262 (ns_get_pending_menu_title, ns_check_menu_open)
263 (ns_check_pending_open_menu): New functions.
264
265 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
266
267 * indent.c (current_column_bol_cache): Remove leftover which is not
268 used in Fmove_to_column any more.
269 (current_column, scan_for_column): Adjust users.
270 * keyboard.c (last_point_position_buffer, last_point_position_window):
271 Remove leftovers which are not used for recording undo any more.
272 (command_loop_1, syms_of_keyboard): Adjust users.
273 * xdisp.c (last_max_ascent): Remove leftover which is not used in
274 redisplay_window any more.
275 (move_it_to): Adjust user.
276
277 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
278
279 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
280 Update dependencies.
281
282 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
283
284 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
285 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
286 forward references.
287
288 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
289
290 * window.h (struct window): Replace hchild, vchild and buffer slots
291 with the only contents slot. This is possible because each valid
292 window may have either the child window (in vertical or horizontal
293 combination) or buffer to display (for the leaf window). Using that,
294 a lof of operations to traverse and/or change window hierarchies may
295 be simplified. New member horizontal is used to distinguish between
296 horizontal and vertical combinations of internal windows.
297 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
298 (WINDOW_VERTICAL_COMBINATION_P): New macros.
299 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
300 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
301 Use contents slot, not buffer, where appropriate.
302 (wset_combination): New function.
303 (wset_buffer): Add eassert.
304 (Fframe_first_window): Simplify the loop reaching first window.
305 (Fwindow_buffer): Use WINDOW_LEAF_P.
306 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
307 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
308 (unshow_buffer): Convert initial debugging check to eassert.
309 (replace_window, recombine_windows, Fdelete_other_windows_internal)
310 (make_parent_window, window_resize_check, window_resize_apply)
311 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
312 (Fset_window_configuration, delete_all_child_windows, save_window_save):
313 Adjust to match struct window changes.
314 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
315 (mark_window_cursors_off, count_windows, get_leaf_windows)
316 (foreach_window_1): Simplify the loop.
317 * alloc.c (mark_object): Do not check for the leaf window because
318 internal windows has no glyph matrices anyway.
319 * dispnew.c (clear_window_matrices, showing_window_margins_p)
320 (allocate_matrices_for_window_redisplay, fake_current_matrices)
321 (allocate_matrices_for_frame_redisplay, free_window_matrices)
322 (build_frame_matrix_from_window_tree, mirror_make_current)
323 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
324 (update_window_tree, set_window_update_flags): Simplify the loop.
325 (sync_window_with_frame_matrix_rows): Enforce live window.
326 Use contents slot, not buffer, where appropriate.
327 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
328 and WINDOW_HORIZONTAL_COMBINATION_P.
329 (make_frame_visible_1): Simplify the loop.
330 Use contents slot, not buffer, where appropriate.
331 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
332 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
333 (expose_window_tree): Likewise.
334 Use contents slot, not buffer, where appropriate.
335 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
336 to avoid deleted windows. Use contents slot instead of buffer.
337 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
338 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
339 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
340 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
341
342 2013-03-28 Eli Zaretskii <eliz@gnu.org>
343
344 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
345 identify the reasons for assertion violations in bug#14062 and
346 similar ones.
347 (Fx_show_tip): Fix compilation error under
348 "--enable-check-lisp-object-type". (Bug#14073)
349
350 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
351 Reported by <rzl24ozi@gmail.com>.
352
353 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
354
355 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
356 start marker...
357 (unwind_with_echo_area_buffer): ...to restore it here.
358 This is needed to ensure that...
359 (redisplay_window): ...both window markers are valid here,
360 which is verified by eassert.
361 * editfns.c (save_excursion_save): Do not assume that
362 selected_window always displays the buffer.
363 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
364 Fix comment.
365
366 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
367
368 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
369 the upcase table.
370
371 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
372
373 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
374
375 2013-03-27 Eli Zaretskii <eliz@gnu.org>
376
377 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
378 since MinGW's w32api headers do. This avoids compiler warnings.
379
380 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
381 if already defined.
382
383 2013-03-26 Eli Zaretskii <eliz@gnu.org>
384
385 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
386
387 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
388
389 * gtkutil.c (style_changed_cb): Check if frame is live and an
390 X frame (Bug#14038).
391
392 2013-03-26 Eli Zaretskii <eliz@gnu.org>
393
394 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
395 Define only for _WIN32_WINNT less than 0x0500.
396 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
397 MinGW64.
398 Move inclusion of time.h before sys/time.h, so that MinGW64 could
399 see its own definitions of 'struct timeval' and 'struct timezone'.
400
401 Fix incompatibilities between MinGW.org and MinGW64 headers.
402 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
403
404 * w32.c (REPARSE_DATA_BUFFER): Guard with
405 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
406
407 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
408
409 * xterm.c: Include X11/XKBlib.h
410 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
411
412 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
413
414 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
415 written backwards.
416 * blockinput.h (input_blocked_p): Likewise.
417 * bytecode.c (exec_byte_code): Likewise.
418 * callproc.c (call_process_kill, call_process_cleanup)
419 (Fcall_process): Likewise.
420 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
421 (Fccl_execute_on_string): Likewise.
422 * character.c (string_escape_byte8): Likewise.
423 * charset.c (read_hex): Likewise.
424 * cm.c (calccost): Likewise.
425 * data.c (cons_to_unsigned): Likewise.
426 * dired.c (directory_files_internal, file_name_completion):
427 Likewise.
428 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
429 (sit_for): Likewise.
430 * doc.c (Fsubstitute_command_keys): Likewise.
431 * doprnt.c (doprnt): Likewise.
432 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
433 * emacsgtkfixed.c: Likewise.
434 * fileio.c (file_offset, Fwrite_region): Likewise.
435 * floatfns.c (Fexpt, fmod_float): Likewise.
436 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
437 Likewise.
438 * font.c (font_intern_prop): Likewise.
439 * frame.c (x_set_alpha): Likewise.
440 * gtkutil.c (get_utf8_string): Likewise.
441 * indent.c (check_display_width): Likewise.
442 * intervals.c (create_root_interval, rotate_right, rotate_left)
443 (split_interval_right, split_interval_left)
444 (adjust_intervals_for_insertion, delete_node)
445 (interval_deletion_adjustment, adjust_intervals_for_deletion)
446 (merge_interval_right, merge_interval_left, copy_intervals)
447 (set_intervals_multibyte_1): Likewise.
448 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
449 * keymap.c (Fkey_description): Likewise.
450 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
451 * lread.c (openp, read_integer, read1, string_to_number):
452 Likewise.
453 * menu.c (ensure_menu_items): Likewise.
454 * minibuf.c (read_minibuf_noninteractive): Likewise.
455 * print.c (printchar, strout): Likewise.
456 * process.c (create_process, Faccept_process_output)
457 (wait_reading_process_output, read_process_output, send_process)
458 (wait_reading_process_output): Likewise.
459 * profiler.c (make_log, handle_profiler_signal): Likewise.
460 * regex.c (re_exec): Likewise.
461 * regex.h: Likewise.
462 * search.c (looking_at_1, Freplace_match): Likewise.
463 * sysdep.c (get_child_status, procfs_ttyname)
464 (procfs_get_total_memory): Likewise.
465 * systime.h (EMACS_TIME_VALID_P): Likewise.
466 * term.c (dissociate_if_controlling_tty): Likewise.
467 * window.c (get_phys_cursor_glyph): Likewise.
468 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
469 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
470 Likewise.
471 * xfns.c (Fx_window_property): Likewise.
472 * xmenu.c (set_frame_menubar): Likewise.
473 * xselect.c (x_get_window_property, x_handle_dnd_message):
474 Likewise.
475 * xsmfns.c (smc_save_yourself_CB): Likewise.
476 * xterm.c (x_scroll_bar_set_handle): Likewise.
477
478 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
479
480 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
481 to be optional or nil. Adjust comment and convert it to docstring.
482 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
483 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
484
485 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
486
487 Static checking by GCC 4.8-20130319.
488 * image.c (gif_load): Assume pass < 3 to pacify GCC.
489 * process.c (Fset_process_datagram_address)
490 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
491 * xdisp.c (get_char_face_and_encoding):
492 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
493 (get_glyph_face_and_encoding): Prepare face before possibly using it.
494 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
495
496 2013-03-24 Ken Brown <kbrown@cornell.edu>
497
498 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
499 fix compilation on 64-bit Cygwin, where underscores are not
500 automatically prepended.
501
502 * w32term.c (w32_initialize): Silence compiler warning.
503
504 2013-03-23 Eli Zaretskii <eliz@gnu.org>
505
506 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
507 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
508 variables, to save and restore frame dimensions.
509 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
510 after returning from a 'fullscreen' configuration.
511 use SendMessage instead of PostMessage to send the SC_RESTORE message,
512 to avoid races between the main thread and the input thread.
513
514 * w32term.h (struct w32_output): New members normal_width,
515 normal_height, normal_top, normal_left, and prev_fsmode.
516 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
517 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
518 members of a frame.
519
520 * w32term.c (w32fullscreen_hook): Record last value of the frame's
521 'fullscreen' parameter. Always record previous width and height
522 of the frame, except when switching out of maximized modes, so
523 that they could be restored correctly, instead of resetting to the
524 default frame dimensions. Send SC_RESTORE command to the frame,
525 unless we are going to send SC_MAXIMIZE, to restore the frame
526 resize hints in the mouse pointer shown by the window manager.
527 (Bug#14032)
528
529 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
530
531 * lisp.h (get_frame_param): Adjust conditions for prototype
532 declaration.
533
534 2013-03-22 Ken Brown <kbrown@cornell.edu>
535
536 * unexcw.c: Drop unneeded inclusion of w32common.h.
537 (report_sheap_usage): Declare.
538 (read_exe_header): Add magic numbers for x86_64.
539 (fixup_executable): Fix printf format specifier for unsigned long
540 argument.
541
542 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
543
544 * frame.h (struct frame): Put menu_bar_window under #ifdef
545 because this member is not needed when X toolkit is in use.
546 (fset_menu_bar_window):
547 * dispnew.c (clear_current_matrices, clear_desired_matrices)
548 (free_glyphs, update_frame):
549 * xdisp.c (expose_frame): Likewise.
550 (display_menu_bar): Likewise. Remove redundant eassert.
551 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
552 toolkit is in use.
553
554 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
555
556 Use functions and constants to manipulate Lisp_Save_Value objects.
557 This replaces code that used macros and strings and token-pasting.
558 The change makes the C source a bit easier to follow,
559 and shrinks the Emacs executable a bit.
560 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
561 (make_save_value): Change 1st arg from string to enum. All callers
562 changed.
563 (INTX): Remove.
564 (mark_object): Use if, not #if, for GC_MARK_STACK.
565 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
566 (XSAVE_OBJECT): Now functions, not macros.
567 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
568 the constant was never used.
569 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
570 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
571 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
572 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
573 New constants.
574 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
575 type3 with a single member save_type. All uses changed.
576 (save_type, set_save_pointer, set_save_integer): New functions.
577 * print.c (PRINTX): Remove.
578
579 * alloc.c: Remove redundant static declarations.
580
581 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
582
583 * window.h (struct window): Convert left_col, top_line, total_lines
584 and total_cols from Lisp_Objects to integers. Adjust comments.
585 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
586 Remove.
587 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
588 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
589 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
590 Adjust users where appropriate.
591
592 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
593
594 * frame.h (struct frame): Drop resx and resy because the same data is
595 available from window system-specific output context. Adjust users.
596 (default_pixels_per_inch_x, default_pixels_per_inch_y):
597 New functions to provide defaults when no window system available.
598 (FRAME_RES_X, FRAME_RES_Y): New macros.
599 (NUMVAL): Move from xdisp.c.
600 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
601 (Ffont_face_attributes, Fopen_font):
602 * image.c (gs_load):
603 * w32font.c (fill_in_logfont):
604 * xdisp.c (calc_pixel_width_or_height):
605 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
606 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
607
608 2013-03-20 Kenichi Handa <handa@gnu.org>
609
610 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
611 to 1 (temporary workaround until a bug related to ASCII
612 optimization is fixed).
613
614 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
615
616 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
617 Signal error if window is not internal. Adjust docstring.
618 (delete_all_child_windows): Use combination_limit to save the buffer.
619 (Fset_window_configuration): Adjust accordingly.
620 * print.c (syms_of_print): Initialize debugging output not here...
621 (init_print_once): ...but in a new function here.
622 * lisp.h (init_print_once): Add prototype.
623 * emacs.c (main): Add call to init_print_once. Adjust comments.
624
625 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
626
627 * window.c (window_resize_check, window_resize_apply)
628 (window_from_coordinates, recombine_windows, set_window_buffer)
629 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
630 (Fsplit_window_internal, Fdelete_window_internal)
631 (freeze_window_starts): Use bool for booleans.
632 * window.h (window_frame_coordinates, resize_frame_windows)
633 (freeze_window_starts, set_window_buffer): Adjust prototypes.
634
635 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
636
637 * dispnew.c (bitch_at_user): Use `user-error'.
638
639 2013-03-17 Ken Brown <kbrown@cornell.edu>
640
641 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
642 as return type of image_background. (Bug#13981)
643 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
644
645 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
646
647 * nsterm.m (updateFrameSize:): Change resize increments if needed.
648 (ns_select): Don't return with result uninitialized.
649
650 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
651 and getDirectory.
652
653 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
654 New functions.
655 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
656 directories. If filename is nil, get directory name (Bug#13932).
657 Use getFilename and getDirectory.
658 (getFilename, getDirectory): New methods for EmacsSavePanel and
659 EmacsOpenPanel.
660 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
661
662 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
663
664 * coding.c (decode_coding_gap): Fix typo caught by static checking.
665
666 2013-03-15 Kenichi Handa <handa@gnu.org>
667
668 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
669 (adjust_after_replace): Make it back to static. Delete the third
670 arg text_at_gap_tail. Cancel the code for handling it.
671
672 * coding.h (struct coding_system): New member eol_seen.
673
674 * coding.c (detect_ascii): New function.
675 (detect_coding): Set coding->head_ascii and coding->eol_seen only
676 when the source bytes are actually scanned. On detecting for
677 coding_category_utf_8_auto, call detect_ascii instead of scanning
678 source bytes directly.
679 (produce_chars): Call insert_from_gap with the new arg 0.
680 (encode_coding): Likewise.
681 (decode_coding_gap): Control ASCII optimization by the variable
682 disable_ascii_optimization instead of #ifndef .. #endif.
683 Deccode EOL format according to coding->eol_seen.
684 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
685 variable.
686
687 * lisp.h (adjust_after_replace): Cancel externing it.
688 (insert_from_gap): Adjust prototype.
689
690 2013-03-15 Eli Zaretskii <eliz@gnu.org>
691
692 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
693 FULLSCREEN_MAXIMIZED. (Bug#13935)
694
695 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
696
697 * region-cache.c (find_cache_boundary, move_cache_gap)
698 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
699 Simplify debugging check and convert to eassert. Adjust comment.
700 (pp_cache): Put under ENABLE_CHECKING.
701
702 2013-03-14 Eli Zaretskii <eliz@gnu.org>
703
704 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
705 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
706 and WM_ACTIVATEAPP.
707 (w32fullscreen_hook): If the frame is visible, reset
708 f->want_fullscreen flag after changing the frame size. If the
709 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
710 (Bug#13953)
711
712 2013-03-13 Daniel Colascione <dancol@dancol.org>
713
714 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
715 too so that these builds can use Cygwin's file conversion
716 functions. (We've been building and linking cygw32.o all along
717 and just not using it.)
718
719 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
720
721 File synchronization fixes (Bug#13944).
722 * Makefile.in (LIB_FDATASYNC): New macro.
723 (LIBES): Use it.
724 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
725 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
726 Don't worry about HAVE_FSYNC, since a substitute fsync is
727 available if the system lacks one.
728 (Fwrite_regin): Retry fsync if interrupted.
729
730 2013-03-13 Eli Zaretskii <eliz@gnu.org>
731
732 * w32term.c (w32_read_socket): If the Emacs frame is being
733 activated, call w32fullscreen_hook, to make sure the new frame
734 dimensions are in effect. (Bug#13937)
735
736 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
737
738 * xdisp.c (init_iterator): Simplify because both character and byte
739 positions are either specified or -1. Add eassert. Adjust comment.
740 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
741 character and byte positions can be obtained from marker.
742
743 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
744
745 Static checking by Sun C 5.12.
746 * alloc.c (buffer_memory_full) [REL_ALLOC]:
747 * bytecode.c (exec_byte_code):
748 * dispnew.c (init_display):
749 * eval.c (error):
750 * fileio.c (Fsubstitute_in_file_name):
751 * keyboard.c (Fevent_convert_list):
752 * keymap.c (Fsingle_key_description):
753 * term.c (maybe_fatal, fatal):
754 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
755 * xsmfns.c (Fhandle_save_session):
756 Omit unreachable code.
757 * keymap.c (map_keymap_char_table_item): Cast void * to
758 a function pointer type; the C Standard requires this.
759
760 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
761 Include <sys/param.h> unconditionally, as that works elsewhere and
762 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
763 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
764 and FreeBSD now.
765
766 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
767
768 * insdel.c (adjust_after_replace): Use bool for boolean.
769
770 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
771
772 * keyboard.c: Move keyboard decoding to read_key_sequence.
773 (decode_keyboard_code): Remove.
774 (tty_read_avail_input): Don't try to decode input.
775 (read_decoded_char): New function.
776 (read_key_sequence): Use it.
777
778 2013-03-10 Daniel Colascione <dancol@dancol.org>
779
780 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
781 (GUI_SDATA, guichar_t): Macros to abstract out differences between
782 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
783 w32fns.c.
784
785 * w32term.c (construct_drag_n_drop): Use the above macros to make
786 drag-and-drop work for non-ASCII filenames in cygw32 builds.
787
788 * w32fns.c (x_set_name, x_set_title): Use the above macros to
789 properly display non-ASCII frame titles in cygw32 builds.
790
791 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
792 call ShellExecute in cygw32 builds.
793
794 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
795 common file dialog code.
796
797 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
798 can just use du like other systems.
799
800 * coding.c (from_unicode_buffer): Declare.
801 * coding.c (from_unicode_buffer): Implement.
802
803 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
804
805 * lread.c: Minor cleanup.
806 (FROM_FILE_P): New macro.
807 (skip_dyn_bytes, unreadchar, read1): Use it.
808 (read_list): Consolidate duplicated code.
809
810 * bytecode.c (struct byte_stack): Remove `constants' when unused.
811
812 2013-03-10 Eli Zaretskii <eliz@gnu.org>
813
814 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
815 (redisplay_internal, set_cursor_from_row, try_window)
816 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
817 (display_line, notice_overwritten_cursor)
818 (mouse_face_from_buffer_pos, note_mouse_highlight):
819 Use MATRIX_ROW_DISPLAYS_TEXT_P.
820 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
821 (mouse_face_from_string_pos, fast_find_string_pos):
822 Use MATRIX_ROW_VPOS.
823
824 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
825
826 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
827
828 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
829 MATRIX_MODE_LINE_ROW.
830
831 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
832
833 2013-03-10 handa <handa@gnu.org>
834
835 * lisp.h (adjust_after_replace): Extern it.
836
837 * coding.c (detect_coding): Cound the heading ASCII bytes in the
838 case of detection for coding_category_utf_8_auto.
839 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
840 Skip decoding if all bytes are ASCII.
841
842 * insdel.c (adjust_after_replace): Make it public. New arg
843 text_at_gap_tail.
844 (adjust_after_insert): Call adjust_after_replace with the new arg
845 value 0.
846
847 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
848
849 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
850 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
851 from Elisp via unread-command-events.
852
853 * keyboard.c (access_keymap_keyremap): Accept nil return value from
854 functions to mean "no change".
855
856 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
857
858 region-cache.c, scroll.c, search.c: Use bool for booleans.
859 * lisp.h (compile_pattern):
860 * scroll.c (do_scrolling, do_direct_scrolling):
861 * search.c (struct regexp_cache, compile_pattern_1)
862 (compile_pattern, string_match_1, search_command)
863 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
864 (search_regs_saved, Fregexp_quote):
865 Use bool for boolean.
866 * region-cache.c (region_cache_forward, region_cache_backward):
867 Fix comments to match code: these functions return int, not boolean.
868
869 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
870
871 * search.c (find_newline): Accept start and end byte positions
872 as arguments and allow -1 if not known.
873 (find_newline_no_quit): Likewise for start position.
874 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
875 * bidi.c (bidi_find_paragraph_start): Pass byte position to
876 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
877 * editfns.c (Fconstrain_to_field): Break long line.
878 Adjust call to find_newline.
879 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
880 Use DEC_BOTH to start next search from the previous buffer
881 position, where appropriate.
882 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
883 (get_visually_first_element, move_it_vertically_backward): Likewise.
884 Obtain byte position from the display iterator, where appropriate.
885
886 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
887
888 print.c, process.c: Use bool for booleans.
889 * lisp.h (wait_reading_process_output):
890 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
891 (strout, debug_output_compilation_hack, float_to_string, print)
892 (print_object):
893 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
894 (decode_status, status_message, create_process, create_pty)
895 (Fmake_network_process, Fnetwork_interface_info)
896 (wait_reading_process_output, read_process_output)
897 (write_queue_push, write_queue_pop, process_send_signal)
898 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
899 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
900 Use bool for booleans.
901 * process.c (Fnetwork_interface_list): Remove unused local.
902 (connect_counter): Now EMACS_INT, not int.
903
904 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
905
906 * bidi.c (bidi_fetch_char): Swap first and second arguments
907 to match other functions accepting character and byte positions.
908 Adjust comment.
909 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
910 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
911 when you need just to move to the previous buffer position.
912 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
913
914 2013-03-07 Eli Zaretskii <eliz@gnu.org>
915
916 * .gdbinit (prowlims): Display the enabled_p flag of the row.
917
918 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
919
920 Avoid character to byte conversions in motion subroutines.
921 * indent.h (compute_motion, vmotion): Add byte position argument.
922 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
923 Add eassert.
924 (Fcompute_motion): Break long line. Adjust call to compute_motion.
925 Use list5 for return value.
926 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
927 Adjust comments, style and calls to compute_motion.
928 (Fvertical_motion): Adjust call to vmotion.
929 * window.c (Fdelete_other_windows_internal): Record window start
930 byte position and adjust call to vmotion.
931 (window_scroll_line_based): Likewise with call to compute_motion.
932 Use SET_PT_BOTH.
933 (Frecenter): Adjust calls to vmotion.
934
935 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
936
937 * lisp.h (list2i, list3i): New functions.
938 (list4i): Move from window.c and make LISP_INLINE.
939 * editfns.c (make_lisp_time):
940 * fns.c (Flocale_info):
941 * keyboard.c (parse_modifiers):
942 * xterm.c (x_ewmh_activate_frame): Use list2i.
943 * instel.c (signal_after_change):
944 * nsfns.m (Fx_server_version, Fxw_color_values):
945 * w32fns.c (Fxw_color_values, Fx_server_version):
946 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
947 * fileio.c (Fvisited_file_modtime):
948 * nsfns.m (Fns_display_usable_bounds):
949 * w32.c (ltime): Use list4i.
950
951 2013-03-06 Eli Zaretskii <eliz@gnu.org>
952
953 * search.c (find_newline_no_quit): Rename from find_next_newline.
954 Add commentary.
955
956 * lisp.h (find_newline_no_quit): Rename prototype.
957
958 * xdisp.c (back_to_previous_line_start)
959 (forward_to_next_line_start, get_visually_first_element)
960 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
961 * indent.c (vmotion): Callers of find_newline_no_quit changed.
962 * bidi.c (bidi_find_paragraph_start): Callers of
963 find_newline_no_quit changed.
964
965 * msdos.c: Change encoding to cp850. (Bug#13879)
966 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
967
968 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
969
970 Coding system support cleanup and minor refactoring.
971 * coding.h (enum coding_result_code): Remove
972 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
973 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
974 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
975 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
976 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
977 (decode_coding_region, encode_coding_region, decode_coding_string):
978 Remove unused compatibility macros.
979 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
980 (record_conversion_result): Adjust user.
981 (syms_of_coding): Likewise.
982 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
983 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
984 (decode_coding_object): Simplify since xrealloc never returns NULL.
985 Add eassert.
986
987 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
988
989 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
990 * sysdep.c (list_system_processes)
991 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
992 Make it a stub in this case; otherwise the build might fail,
993 and this code hasn't been tested on such hosts anyway.
994 Problem reported by Nelson H. F. Beebe in
995 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
996 and analyzed by Jérémie Courrèges-Anglas in
997 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
998
999 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1000
1001 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1002 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1003 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1004 * bidi.c (bidi_find_paragraph_start): Likewise.
1005 * indent.c (vmotion): Likewise.
1006
1007 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1008
1009 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1010 * filelock.c: Include <c-ctype.h>.
1011 (MAX_LFINFO): New top-level constant.
1012 (lock_info_type): Remove members pid, boot_time. Add members at,
1013 dot, colon. Change user member to be the entire buffer, not a
1014 pointer. This allows us to handle the case where a foreign
1015 pid or boot time exceeds the local range. All uses changed.
1016 (LINKS_MIGHT_NOT_WORK): New constant.
1017 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1018 (defined_WINDOWSNT): Remove.
1019 (MAKE_LOCK_NAME, file_in_lock_file_name):
1020 Always use .#FILE (not .#-FILE) for the file lock,
1021 even if it is a regular file.
1022 (rename_lock_file): New function.
1023 (create_lock_file): Use it.
1024 (create_lock_file, read_lock_data):
1025 Prefer a symbolic link for the lock file, falling back on a
1026 regular file if symlinks don't work. Do not try to create
1027 symlinks on MS-Windows, due to security hassles. Stick with
1028 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1029 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1030 host may be using a Windowsish file system, and cannot use
1031 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1032 doesn't work. Don't fail merely because of a symlink-contents
1033 length limit in the current file system; fall back on regular
1034 files. Increase the symlink contents length limit to 8 KiB, this
1035 should be big enough for any real use and doesn't crunch the
1036 stack.
1037 (create_lock_file, lock_file_1, read_lock_data):
1038 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1039 (lock_file_1): Return error number, not bool. All callers changed.
1040 (ELOOP): New macro, if not already defined.
1041 (read_lock_data): Return size of lock file contents, not Lisp object.
1042 All callers changed. Handle a race condition if some other process
1043 replaces a regular-file lock with a symlink lock or vice versa,
1044 while we're trying to read the lock.
1045 (current_lock_owner): Parse contents more carefully, to help avoid
1046 confusing a regular-file lock with some other application's use
1047 of the file. Check for lock file contents being too long, or
1048 not parsing correctly.
1049 (current_lock_owner, lock_file):
1050 Allow foreign pid and boot times that exceed the local range.
1051 (current_lock_owner, lock_if_free, lock_file):
1052 Simplify allocation of lock file contents.
1053 * w32.c (sys_rename_replace): New function, containing most of
1054 the contents of the old sys_rename.
1055 (sys_rename): Use it.
1056 (fchmod): New dummy function.
1057 * w32.h (sys_rename_replace, fchmod): New decls.
1058
1059 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1060
1061 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1062 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1063 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1064 <dmantipov@yandex.ru>.
1065
1066 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1067
1068 * composite.c (get_composition_id, fill_gstring_header):
1069 Use make_uninit_vector where appropriate.
1070 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1071 * xselect.c (clean_local_selection_data): Likewise.
1072
1073 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1074
1075 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1076 * image.c (imagemagick_load_image): Calculate height and width
1077 after flattening the image, not before.
1078
1079 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1080
1081 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1082 * ftfont.c (ftfont_shape_by_flt): Likewise.
1083 * w32uniscribe.c (uniscribe_shape): Likewise.
1084
1085 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1086
1087 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1088 The old approach, which fell back on DIR/.#FILE.0 through
1089 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1090 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1091 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1092 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1093 because the locking mechanism was never reliable in that case).
1094 This patch fixes this and other bugs discovered by a code
1095 inspection that was prompted by
1096 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1097 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1098 to avoid interoperability problems between the MS-Windows and
1099 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1100 instances of Emacs now ignore each others' locks.
1101 * filelock.c (defined_WINDOWSNT): New constant.
1102 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1103 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1104 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1105 regular files on MS-Windows hosts.
1106 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1107 Use SAFE_ALLOCA to avoid problems with long file names.
1108 (MAX_LFINFO): Now a local constant, not a global macro.
1109 (IS_LOCK_FILE): Remove.
1110 (lock_file_1): Don't inspect errno if symlink call succeeds;
1111 that's not portable.
1112 (lock_file): Document that this function can return if lock
1113 creation fails.
1114 (lock_file): Don't access freed storage.
1115
1116 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1117
1118 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1119
1120 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1121
1122 * textprop.c: Use bool for booleans.
1123 (validate_interval_range, Fadd_text_properties)
1124 (Fremove_text_properties): Prefer bool to int when either works.
1125
1126 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1127
1128 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1129 If the interval tree changes as a side effect of calling
1130 modify_region, re-do processing starting from the call to
1131 validate_interval_range. (Bug#13743)
1132
1133 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1134
1135 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1136 (Bug#13546).
1137
1138 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1139
1140 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1141 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1142 access to the lock file until it is written and closed.
1143 (Bug#13807)
1144
1145 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1146
1147 * callint.c (Qcall_interactively):
1148 * macros.c (Qexecute_kbd_macro):
1149 Now static.
1150
1151 2013-02-26 Bastien Guerry <bzg@gnu.org>
1152
1153 * window.c (Frecenter): Tiny docstring enhancement.
1154
1155 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1156
1157 Minor textprop integer cleanup.
1158 * intervals.h, textprop.c (add_text_properties_from_list):
1159 Return void, not int, since nobody uses the return value.
1160 * textprop.c (validate_plist, add_properties, remove_properties)
1161 (Fadd_text_properties):
1162 Don't assume list length fits in int.
1163 (interval_has_all_properties, interval_has_some_properties)
1164 (interval_has_some_properties_list, add_properties, remove_properties)
1165 (Fadd_text_properties, Fremove_text_properties)
1166 (Fremove_list_of_text_properties, text_property_stickiness):
1167 Use bool for booleans.
1168 (Fadd_text_properties, Fremove_text_properties):
1169 (Fremove_list_of_text_properties):
1170 Reindent do-while as per GNU style.
1171
1172 2013-02-25 Eli Zaretskii <eliz@gnu.org>
1173
1174 Implement CLASH_DETECTION for MS-Windows.
1175
1176 * filelock.c [WINDOWSNT]: Include w32.h.
1177 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1178 function of that name. Up-case the macro arguments.
1179 (IS_LOCK_FILE): New macro.
1180 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1181 (create_lock_file): New function, with body extracted from
1182 lock_file_1.
1183 [WINDOWSNT]: Implement lock files by writing a regular file with
1184 the lock information as its contents.
1185 (read_lock_data): New function, on Posix platforms just calls
1186 emacs_readlinkat.
1187 [WINDOWSNT]: Read the lock info from the file.
1188 (current_lock_owner): Call read_lock_data instead of calling
1189 emacs_readlinkat directly.
1190 (lock_file) [WINDOWSNT]: Run the file name through
1191 dostounix_filename.
1192
1193 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1194 just check if the process by that PID exists.
1195
1196 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1197 also present, as doing so will fail to error out if the file
1198 already exists.
1199
1200 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1201
1202 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1203 (Fremove_list_of_text_properties): Skip all of the intervals in
1204 the region between START and END that already have resp. don't
1205 have the requested properties, not just the first one.
1206 Add assertions that the loop afterwards always modifies the
1207 properties. (Bug#13743)
1208
1209 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1210
1211 * callint.c (Fcall_interactively): Use the right lexical environment
1212 for `interactive' specs (bug#13811).
1213 * eval.c (Feval): Accept a lexical environment.
1214
1215 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1216
1217 Simplify data_start configuration (Bug#13783).
1218 This is a followon simplification to the fix for Bug#13650.
1219 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1220 (START_FILES): Remove. All uses removed.
1221 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1222 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1223 (buildobj.h): Use it.
1224 ($(ALLOBJS)): Depend on globals.h.
1225 (temacs$(EXEEXT)): Use $(ALLOBJS).
1226 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1227 * deps.mk (vm-limit.o):
1228 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1229 Do not depend on mem-limits.h.
1230 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1231 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1232 [__GNUC__ && !ORDINARY_LINK]: Remove.
1233 * mem-limits.h, pre-crt0.c: Remove.
1234 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1235 * unexcoff.c (etext): New decl.
1236 (make_hdr): Use DATA_START instead of start_of_data.
1237 * vm-limit.c: Move most of mem-limits.h's contents here.
1238 (data_start): New decl. It's OK if this is approximate,
1239 so simplify-away some unnecessary exactness.
1240 (POINTER): Remove; all uses removed.
1241 (data_space_start): Now char *, to avoid casts.
1242 (exceeds_lisp_ptr): New function, replacing the old
1243 EXCEEDS_LISP_PTR macro. All uses changed.
1244 (check_memory_limits): Simplify and remove casts.
1245 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1246 (memory_warnings): Use data_start instead of start_of_data.
1247
1248 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1249
1250 * xdisp.c (set_message): Only check for debug-on-message if STRING
1251 is a string. (Bug#13797)
1252
1253 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1254
1255 Fix regression introduced by July 10 filelock.c patch.
1256 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1257 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1258 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1259 and diagnosed by Andreas Schwab in
1260 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1261
1262 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1263
1264 Assume C89 or better.
1265 * ralloc.c (SIZE, POINTER, NIL):
1266 * vm-limit.c (POINTER):
1267 Remove, replacing all uses with C89 equivalents. These old
1268 symbols were present only for porting to pre-C89 platforms.
1269
1270 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
1271
1272 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1273 This avoids warning messages reported as part of Bug#13546.
1274
1275 2013-02-21 Ken Brown <kbrown@cornell.edu>
1276
1277 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1278
1279 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1280
1281 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1282
1283 * keyboard.c (Qcommand_execute): New var.
1284 (command_loop_1, read_char): Use it.
1285 (Fcommand_execute): Remove, replace by an Elisp implementation.
1286 (syms_of_keyboard): Adjust accordingly.
1287
1288 2013-02-19 Daniel Colascione <dancol@dancol.org>
1289
1290 * sheap.c (report_sheap_usage): Use message, not message1, so
1291 that we don't try to create a buffer while we're in the middle
1292 of dumping Emacs. Explain why.
1293
1294 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
1295
1296 * search.c (find_newline): Return byte position in bytepos.
1297 Adjust comment.
1298 (find_next_newline_no_quit, find_before_next_newline):
1299 Add bytepos argument.
1300 * lisp.h (find_newline, find_next_newline_no_quit)
1301 (find_before_next_newline): Adjust prototypes.
1302 * bidi.c (bidi_find_paragraph_start):
1303 * editfns.c (Fconstrain_to_field, Fline_end_position):
1304 * indent.c (compute_motion, vmotion):
1305 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1306 (get_visually_first_element, move_it_vertically_backward):
1307 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1308
1309 2013-02-19 Eli Zaretskii <eliz@gnu.org>
1310
1311 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1312 resources were not orderly released.
1313
1314 2013-02-17 Eli Zaretskii <eliz@gnu.org>
1315
1316 * xdisp.c (x_draw_vertical_border): For a window that is neither
1317 the leftmost nor the rightmost, redraw both the left and the right
1318 vertical borders. (Bug#13723)
1319
1320 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1321
1322 * xml.c (init_libxml2_functions):
1323 * sound.c (sound_warning):
1324 * sheap.c (report_sheap_usage):
1325 * process.c (wait_reading_process_output):
1326 * msdos.c (XMenuActivate):
1327 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1328 * keyboard.c (top_level_1):
1329 * editfns.c (Fmessage, Fmessage_box):
1330 * callint.c (Fcall_interactively):
1331 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1332
1333 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1334
1335 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
1336 * frame.c (syms_of_frame): ... to here.
1337
1338 2013-02-16 Eli Zaretskii <eliz@gnu.org>
1339
1340 * w32.c (sys_chown): Remove unused function.
1341
1342 * w32term.c <input_signal_count>: Declare 'volatile'
1343 unconditionally. (Bug#9066)
1344
1345 * w32.c (set_errno): Reset h_errno and don't set it to any other
1346 value. Set errno instead.
1347 (check_errno): Reset h_errno.
1348 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1349 (sys_gethostname, sys_getservbyname, sys_getpeername)
1350 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1351 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1352 h_errno.
1353 (sys_gethostbyname): Set h_errno only errors detected.
1354
1355 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1356
1357 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1358
1359 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1360
1361 * keyboard.c (read_char): Fix calculation of auto-save time out
1362 when auto-save-timeout is less than 4. (Bug#13720)
1363
1364 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
1365 time. Improve diagnostics in DebPrint. (Bug#13546)
1366
1367 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1368 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1369 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1370 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1371 make sure errno is set to an appropriate value. (Bug#13546)
1372 (socket_to_fd): Add assertion against indexing fd_info[] with a
1373 value that is out of bounds.
1374 (sys_accept): If fd is negative, do not set up the child_process
1375 structure for reading.
1376
1377 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1378
1379 * composite.c (fill_gstring_header): Remove useless prototype.
1380 Break long line.
1381 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1382 * print.c (PRINTDECLARE, print_object):
1383 * search.c (compile_pattern, fast_looking_at, search_buffer):
1384 (simple_search, boyer_moore, Freplace_match):
1385 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1386 (get_overlay_arrow_glyph_row, display_mode_element):
1387 (decode_mode_spec_coding, message3):
1388 * xfaces.c (face_at_string_position): Use bool for booleans.
1389 Adjust comments.
1390
1391 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1392
1393 Fix AIX port (Bug#13650).
1394 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1395 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1396 was #undeffed earlier, so it cannot be used as a macro here.
1397 Use the constant and not the macro.
1398
1399 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1400
1401 * w32proc.c (new_child): If no vacant slots are found in
1402 child_procs[], make another pass looking for slots whose process
1403 has exited or died. (Bug#13546)
1404
1405 * w32.c (sys_pipe): When failing due to file descriptors above
1406 MAXDESC, set errno to EMFILE.
1407 (_sys_read_ahead): Update cp->status when failing to read serial
1408 communications input, so that the status doesn't stay at
1409 STATUS_READ_IN_PROGRESS. (Bug#13546)
1410
1411 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1412
1413 * gtkutil.c (tb_size_cb): New function.
1414 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1415
1416 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1417
1418 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1419 an event.
1420
1421 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1422
1423 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1424
1425 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1426
1427 * font.c (font_range): Add pos_byte argument. Adjust comment
1428 and break long line.
1429 * font.h (font_range): Adjust prototype.
1430 * composite.c (autocmp_chars): Pass byte position to font_range.
1431 Break long line. Remove useless prototype and format comment.
1432
1433 2013-02-13 Glenn Morris <rgm@gnu.org>
1434
1435 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1436
1437 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1438
1439 Improve AIX port some more (Bug#13650).
1440 With this, it should be as good as it was in 23.3, though it's
1441 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1442 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1443 * unexaix.c (start_of_text): Remove.
1444 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1445 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1446 (orig_load_scnptr, orig_data_scnptr):
1447 Now off_t, not long, since they are file offsets.
1448 (make_hdr): Use _data, not start_of_data ().
1449 This is the key part of the fix.
1450 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1451 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1452
1453 * pre-crt0.c (data_start): Initialize to 1.
1454 This ports to compilers that optimize the external declaration
1455 'int x = 0;' as if it were 'int x;' to shrink the executable.
1456
1457 Improve AIX port (Bug#13650).
1458 This doesn't fix the bug, but it makes progress: Emacs builds now.
1459 * unexaix.c: Include inttypes.h, stdarg.h.
1460 (report_error, report_error_1): Mark as _Noreturn.
1461 (report_error): Don't report the wrong errno.
1462 (report_error_1): Now varargs. All callers changed.
1463 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1464 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1465 (write_ptr): Use %p to print address rather than %lx and a cast
1466 to unsigned long. Grow buffer a bit, to be safer.
1467
1468 2013-02-13 Eli Zaretskii <eliz@gnu.org>
1469
1470 * bidi.c (bidi_resolve_neutral): After finding the next
1471 non-neutral character, accept NEUTRAL_ON type as well, because
1472 directional control characters, such as LRE and RLE, have their
1473 type converted to that by bidi_resolve_weak. This avoids aborts
1474 when LRE/RLE follows a run of neutrals.
1475 (bidi_move_to_visually_next): Assert that return value of
1476 bidi_peek_at_next_level is non-negative. Negative values will
1477 cause an infloop.
1478
1479 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1480
1481 Minor getenv-related fixes.
1482 * callproc.c (Fcall_process_region) [!DOS_NT]:
1483 Avoid unnecessary duplicate call to getenv.
1484 * callproc.c (init_callproc):
1485 * dispnew.c (init_display):
1486 * sysdep.c (sys_subshell):
1487 Omit unnecessary cast of getenv or egetenv.
1488
1489 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
1490
1491 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1492 Update dependencies.
1493
1494 2013-02-12 Eli Zaretskii <eliz@gnu.org>
1495
1496 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1497 marker's position.
1498 (display_line): Set w->region_showing to the value of
1499 it->region_beg_charpos, not to -1. This fixes redisplay
1500 optimization when cursor is moved up after M->. (Bug#13623)
1501 (Bug#13626)
1502 (try_scrolling): Scroll text up more if point is too close to ZV
1503 and inside the scroll margin. This makes sure point is moved
1504 outside the scroll margin in these cases.
1505
1506 * window.h (struct window): region_showing can no longer be
1507 negative.
1508
1509 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1510
1511 Tune by using memchr and memrchr.
1512 * doc.c (Fsnarf_documentation):
1513 * fileio.c (Fsubstitute_in_file_name):
1514 * search.c (find_newline, scan_newline):
1515 * xdisp.c (pos_visible_p, display_count_lines):
1516 Use memchr and memrchr rather than scanning byte-by-byte.
1517 * search.c (find_newline): Rename from scan_buffer.
1518 Omit first arg TARGET, as it's always '\n'. All callers changed.
1519
1520 Clean up read_key_sequence a tiny bit more.
1521 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1522 (read_key_sequence): Remove unused locals.
1523
1524 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1525
1526 Clean up read_key_sequence a bit; reread active keymaps after first event.
1527 * keyboard.c (read_char, read_char_x_menu_prompt)
1528 (read_char_minibuf_menu_prompt):
1529 Replace nmaps+maps with a single `map' arg.
1530 (follow_key): Operate on a single map.
1531 (active_maps): New function.
1532 (test_undefined): Also return true for nil bindings.
1533 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1534 a single (composed) keymap. Remember `first_event' to choose the right
1535 set of active keymaps. Recompute the set of keymaps after receiving
1536 the first event. Remove GOBBLE_FIRST_EVENT.
1537 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1538 * keyboard.h (read_char): Update declaration.
1539 * lread.c (read_filtered_event): Adjust call to read_char.
1540
1541 2013-02-11 Eli Zaretskii <eliz@gnu.org>
1542
1543 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1544 Don't use the limitation on backwards movement when lines are truncated
1545 in the window. (Bug#13675)
1546
1547 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1548
1549 * marker.c (set_marker_internal): If desired position is passed
1550 as a marker, avoid call to buf_charpos_to_bytepos.
1551 * window.c (Fset_window_point): Omit redundant type checking.
1552 (Fset_window_start): Likewise. Format comment.
1553 (window_scroll_pixel_based): Use set_marker_restricted_both
1554 with character and byte positions obtained from an iterator.
1555 (Fset_window_configuration): Use set_marker_restricted_both.
1556 * xdisp.c (message_dolog): Likewise.
1557
1558 2013-02-10 Eli Zaretskii <eliz@gnu.org>
1559
1560 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1561 When text lines are longer than window's screen lines, don't move back
1562 too far. This speeds up some redisplay operations. (Bug#13675)
1563
1564 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1565
1566 * syntax.c (scan_sexps_forward): Fix byte position calculation
1567 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1568
1569 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1570
1571 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1572 that was not needed.
1573
1574 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1575
1576 Minor hashing refactoring.
1577 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1578 (sxhash_float): Return EMACS_UINT, for consistency with the other
1579 hash functions.
1580 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1581 non-static inline function and therefore can't use static vars.
1582 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1583 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1584 with the other hash functions.
1585
1586 2013-02-09 Eli Zaretskii <eliz@gnu.org>
1587
1588 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1589 XXXXXX part of the temporary file pattern is not downcased even
1590 when w32-downcase-file-names is non-nil. (Bug#13661)
1591
1592 * xdisp.c (decode_mode_spec): Remove handling of %t.
1593
1594 * msdos.c (careadlinkatcwd): Remove.
1595
1596 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1597
1598 * lread.c (skip_dyn_bytes): New function (bug#12598).
1599 (read1): Use it. Use getc instead of READCHAR to read bytes.
1600 (load_each_byte): Remove. Update users.
1601
1602 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1603
1604 * search.c (scan_buffer): Calculate end byte position just once.
1605 (scan_newline): Do not recalculate start_byte.
1606 (search_command): Use eassert.
1607 * syntax.c (struct lisp_parse_state): New member location_byte.
1608 (scan_sexps_forward): Record from_byte and avoid redundant
1609 character to byte position calculation ...
1610 (Fparse_partial_sexp): ... here. Break too long line.
1611
1612 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1613
1614 * lisp.h (make_uninit_vector): New function.
1615 * alloc.c (Fvector, Fmake_byte_code):
1616 * ccl.c (Fregister_ccl_program):
1617 * charset.c (Fdefine_charset_internal, define_charset_internal):
1618 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1619 * composite.c (syms_of_composite):
1620 * font.c (Fquery_font, Ffont_info, syms_of_font):
1621 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1622 * ftfont.c (ftfont_shape_by_flt):
1623 * indent.c (recompute_width_table):
1624 * nsselect.m (clean_local_selection_data):
1625 * syntax.c (init_syntax_once):
1626 * w32unsubscribe.c (uniscribe_shape):
1627 * window.c (Fcurrent_window_configuration):
1628 * xfaces.c (Fx_family_fonts):
1629 * xselect.c (selection_data_to_lisp_data): Use it.
1630
1631 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1632
1633 * coding.c (Fdefine_coding_system_internal): Use AREF where
1634 argument is known to be a vector.
1635 * fns.c (Flocale_info): Likewise for ASET.
1636 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1637 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1638
1639 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1640
1641 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1642 height.
1643
1644 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1645 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1646 updateCollectionBehaviour.
1647
1648 * nsterm.m (NEW_STYLE_FS): Remove.
1649 (ns_last_use_native_fullscreen): New variable.
1650 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1651 (x_set_window_size): Do not take title bar and tool bar into account
1652 if isFullscreen returns YES.
1653 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1654 (check_native_fs): New function.
1655 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1656 (ns_term_init): Remove NEW_STYLE_FS.
1657 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1658 and tool bar if isFullscreen returns NO.
1659 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1660 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1661 with HAVE_NATIVE_FS.
1662 (window:willUseFullScreenPresentationOptions:): New method.
1663 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1664 Hide toolbar if not enabled (Bug#13444).
1665 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1666 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1667 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1668 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1669 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1670 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1671 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1672 (syms_of_nsterm): Add ns-use-native-fullscreen.
1673
1674 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1675
1676 * fileio.c (Qchoose_write_coding_system): Now static.
1677
1678 2013-02-04 Eli Zaretskii <eliz@gnu.org>
1679
1680 * xdisp.c (window_buffer_changed): region_showing can be negative,
1681 which still means region is being displayed.
1682 (redisplay_internal): Resurrect code that forced redisplay of the
1683 whole window when showing region and the mark has changed.
1684 Record the new mark position to allow redisplay optimizations.
1685 (display_line): If it->region_beg_charpos is non-zero, set the
1686 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1687
1688 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1689 not bitfield of 1 bit.
1690
1691 2013-02-03 Daniel Colascione <dancol@dancol.org>
1692
1693 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1694 daemon mode works on cygw32 when Emacs is installed and not just
1695 during development.
1696
1697 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1698
1699 Avoid file time stamp bug on MS-Windows (Bug#13149).
1700 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1701 as FAT32 doesn't update time stamps when truncating them.
1702 Also, check that a file time stamp is not a multiple of 100 ns;
1703 this should catch all instances of the problem on MS-Windows,
1704 as its native file system resolution is 100 ns or worse, and
1705 checking for a non-multiple of 100 ns should impose only a small
1706 overhead on systems with ns resolution.
1707
1708 2013-02-02 Eli Zaretskii <eliz@gnu.org>
1709
1710 Avoid encoding file names on MS-Windows when they need to be run
1711 through dostounix_filename.
1712 * w32.c (normalize_filename): Accept an additional argument
1713 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1714 downcase it even if w32-downcase-file-names is non-nil.
1715 (dostounix_filename): Accept an additional argument MULTIBYTE and
1716 pass it to normalize_filename.
1717 (emacs_root_dir): Adjust.
1718
1719 * msdos.h (dostounix_filename): Adjust prototype.
1720
1721 * w32.h (dostounix_filename): Adjust prototype.
1722
1723 * msdos.c (dostounix_filename): Accept an additional argument and
1724 ignore it.
1725 (init_environment): Adjust callers of dostounix_filename.
1726
1727 * fileio.c (Ffile_name_directory, file_name_as_directory)
1728 (directory_file_name, Fexpand_file_name)
1729 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1730 dostounix_filename.
1731 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1732 non-nil.
1733 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1734 variables, as egetenv is case-insensitive for DOS_NT.
1735
1736 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1737 with an encoded file name.
1738
1739 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1740 Adjust calls to dostounix_filename.
1741
1742 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1743
1744 * unexw32.c (unexec): Adjust call to dostounix_filename.
1745
1746 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1747
1748 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1749 dostounix_filename.
1750
1751 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1752 dostounix_filename.
1753
1754 * callproc.c (Fcall_process): Make sure program name in PATH and
1755 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1756 is passed to exec/spawnve, which fails unless the file-name
1757 encoding is UTF-8.
1758
1759 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1760 even if w32-quote-process-args is nil.
1761
1762 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1763
1764 Fix timestamp bug when write-region appends nothing (Bug#13149).
1765 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1766 the file's time stamp doesn't change if Emacs happens to write nothing
1767 to the file, and on a buggy file system this could cause Emacs to
1768 incorrectly infer that the file system doesn't have the bug.
1769 Avoid this problem by inhibiting the inference in this case.
1770
1771 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1772
1773 * window.h (struct window): Convert base_line_number, base_line_pos
1774 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1775 Convert region_showing member from Lisp_Object to bitfield.
1776 Remove sequence_number member. Adjust comments.
1777 * window.c (sequence_number): Remove.
1778 (make_window): Initialize column_number_displayed.
1779 * print.c (print_object): Follow the printed representation of
1780 frames and print window pointer to distinguish between windows.
1781 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1782 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1783 (wset_column_number_displayed, wset_region_showing): Remove.
1784 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1785 (try_scrolling, try_cursor_movement, redisplay_window)
1786 (try_window_reusing_current_matrix, try_window_id, display_line)
1787 (display_mode_lines, decode_mode_spec): Adjust users.
1788 * .gdbinit (pwinx): Do not print sequence_number.
1789
1790 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1791
1792 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1793 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1794 * dired.c: Include <fcntl.h>.
1795 (open_directory): New function, which uses open and fdopendir
1796 rather than opendir. DOS_NT platforms still use opendir, though.
1797 (directory_files_internal, file_name_completion): Use it.
1798 (file_attributes): New function, with most of the old Ffile_attributes.
1799 (directory_files_internal, Ffile_attributes): Use it.
1800 (file_attributes, file_name_completion_stat): First arg is now fd,
1801 not dir name. All uses changed. Use fstatat rather than lstat +
1802 stat.
1803 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1804 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1805 (emacs_readlinkat): New function, with much of the old
1806 Ffile_symlink_p, but with an fd argument for speed.
1807 It uses readlinkat rather than careadlinkatcwd, so that it
1808 need not assume the working directory.
1809 (Ffile_symlink_p): Use it.
1810 * filelock.c (current_lock_owner): Use emacs_readlinkat
1811 rather than emacs_readlink.
1812 * lisp.h (emacs_readlinkat): New decl.
1813 (READLINK_BUFSIZE, emacs_readlink): Remove.
1814 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1815 (emacs_norealloc_allocator, emacs_readlink): Remove.
1816 This stuff is moved to fileio.c.
1817 * w32.c (fstatat, readlinkat): New functions.
1818 (careadlinkat): Don't check that fd == AT_FDCWD.
1819 (careadlinkatcwd): Remove; no longer needed.
1820
1821 2013-01-31 Glenn Morris <rgm@gnu.org>
1822
1823 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
1824 (Fwrite_region): Update for new choose_write_coding_system args.
1825 Move the last piece of choose_write_coding_system here. (Bug#13522)
1826 (syms_of_fileio): Add choose-write-coding-system.
1827
1828 2013-01-30 Eli Zaretskii <eliz@gnu.org>
1829
1830 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1831 (sys_close): Zero out the flags for the file descriptor before
1832 closing it. (Bug#13546)
1833
1834 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
1835 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1836 Use CharNextExA and CharPrevExA to iterate over file names encoded in
1837 DBCS. (Bug#13553)
1838
1839 * w32.c (w32_get_long_filename, init_environment, readlink):
1840 Support file names encoded in DBCS codepages.
1841 (readlink): Use the current file-name-coding-system, not the ANSI
1842 codepage, to decode and handle targets of symlinks.
1843
1844 2013-01-28 Eli Zaretskii <eliz@gnu.org>
1845
1846 * w32.c (opendir): Now accepts a 'const char *'.
1847
1848 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1849
1850 Remove obsolete redisplay code. See the discussion at
1851 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1852 * dispnew.c (preemption_period, preemption_next_check): Remove.
1853 (Vredisplay_preemption_period): Likewise.
1854 (update_frame, update_single_window, update_window, update_frame_1):
1855 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1856 used, following the 2012-06-22 change.
1857
1858 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1859
1860 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1861
1862 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1863
1864 * font.c (num_fonts): Remove the leftover from old
1865 debugging code. Adjust comment style here and there.
1866 * insdel.c (insert_1): Remove.
1867 * lisp.h (insert_1): Remove prototype.
1868 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
1869
1870 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1871
1872 * w32.c (max_filename_mbslen): New function.
1873 (normalize_filename, readdir): Use it to detect locales where ANSI
1874 encoding of file names uses a double-byte character set (DBCS).
1875 If a DBCS encoding is used, advance by characters using
1876 CharNextExA, instead of incrementing a 'char *' pointer.
1877 Use _mbslwr instead of _strlwr. (Bug#13515)
1878
1879 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1880 request of memory reservation to 1.7GB. (Bug#13065)
1881
1882 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
1883
1884 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1885 at check_extra_latin label. (Bug#13505)
1886
1887 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1888
1889 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1890 Avoid redundant calls to strlen.
1891
1892 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1893
1894 Drop async_visible and async_iconified fields of struct frame.
1895 This is possible because async input is gone; for details, see
1896 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1897 * frame.h (struct frame): Remove async_visible and async_iconified
1898 members, convert garbaged to unsigned bitfield. Adjust comments.
1899 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1900 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1901 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1902 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1903 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1904 * w32term.c: Ditto.
1905 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1906 properly. Likewise for obscured.
1907 * xterm.c: Ditto.
1908 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
1909 properly.
1910 * nsterm.m: Ditto.
1911 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1912
1913 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1914
1915 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1916 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1917
1918 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1919
1920 * xdisp.c (message2, message2_nolog): Remove functions.
1921 (message3, message3_nolog): Extract nbytes and multibyteness directly
1922 from the string. Change all callers.
1923 (message3_nolog): Don't set message_enable_multibyte since set_message
1924 will reset it anyway.
1925 (message1, message1_nolog): Use message3.
1926 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1927 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1928 (set_message): Drop all but the second arg, which has to be a string.
1929 (set_message_1): Simplify now that we know that a1 is NULL and the
1930 second arg is a string.
1931 * frame.h (struct frame): Remove `message_buf' field.
1932 Use glyphs_initialized_p instead.
1933 (FRAME_MESSAGE_BUF): Remove macro.
1934 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1935 * lisp.h (message2, message2_nolog): Remove declarations.
1936 (message3, message3_nolog): Update declarations.
1937 * keyboard.c (read_char_minibuf_menu_text)
1938 (read_char_minibuf_menu_width): Remove vars.
1939 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1940 to correctly handle multibyte strings.
1941 * frame.c (delete_frame): Don't free message_buf any more.
1942 * editfns.c (message_text, message_length): Remove vars.
1943 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1944 * fileio.c (auto_save_error): Use message3 instead of message2.
1945 * dispnew.c (adjust_frame_message_buffer): Remove function.
1946
1947 2013-01-23 Eli Zaretskii <eliz@gnu.org>
1948
1949 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1950 real estate used for the tool bar and the menu bar.
1951
1952 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1953
1954 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1955 hidden buffer is prepared to modification (Bug#13164).
1956
1957 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1958
1959 * window.h (struct window): Change window_end_valid member from
1960 Lisp_Object to a bitfield. Adjust comments.
1961 (wset_window_end_valid): Remove.
1962 * window.c (adjust_window_count): Clear window_end_valid.
1963 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1964 (Fwindow_line_height, set_window_buffer, Frecenter)
1965 (Fsplit_window_internal, Fdelete_other_windows_internal)
1966 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1967 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1968 * xdisp.c (check_window_end, reconsider_clip_changes)
1969 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1970 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1971 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1972
1973 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1974
1975 * xdisp.c (mark_window_display_accurate): Simplify the loop
1976 assuming that the only one of vchild, hchild or buffer window
1977 slots is non-nil. Call mark_window_display_accurate_1 for
1978 the leaf windows only.
1979 (mark_window_display_accurate_1): Always assume leaf window.
1980 Adjust comment.
1981
1982 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1983
1984 * emacs.c (Qkill_emacs_hook): Now static.
1985
1986 * fileio.c (Finsert_file_contents): Simplify.
1987 Remove unnecessary assignments and tests.
1988
1989 2013-01-21 Eli Zaretskii <eliz@gnu.org>
1990
1991 * w32.c (acl_set_file): Don't test for errors unless
1992 set_file_security returns FALSE. Avoids spurious errors when
1993 saving files.
1994
1995 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1996
1997 * fileio.c (Finsert_file_contents): Revert code introduced at
1998 2013-01-18 in favor of the simpler and generally better fix.
1999 Save stack space by removing 'buffer' and reusing 'read_buf'
2000 where appropriate.
2001
2002 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2003
2004 * lisp.h (eabs): Define unconditionally (Bug#13419).
2005 The old "#if !defined (eabs)" was an unnecessary revenant of back
2006 when this macro was called "abs". Document 'eabs' better.
2007
2008 2013-01-19 Glenn Morris <rgm@gnu.org>
2009
2010 * fns.c (Frandom): Doc fix.
2011
2012 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2013
2014 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2015 segfault when there are lots of overlays.
2016
2017 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2018 when there are lots of overlays.
2019 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2020 for the details and a way to reproduce.
2021
2022 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2023
2024 * fileio.c: Use O_APPEND to append.
2025 This corresponds better to the natural interpretation of "append",
2026 and avoids the need to open the output file twice, or to invoke
2027 lseek when APPEND is neither nil nor a number.
2028 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2029 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2030 file possibly twice, and lseeking to its end; this avoids the
2031 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2032 at the same time: the combination is never needed and apparently
2033 it doesn't work with DOS_NT.
2034
2035 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2036 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2037
2038 Allow floating-point file offsets.
2039 Problem reported by Vitalie Spinu in
2040 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2041 * fileio.c (emacs_lseek): Remove.
2042 (file_offset): New function.
2043 (Finsert_file_contents, Fwrite_region): Use it.
2044
2045 2013-01-19 Chong Yidong <cyd@gnu.org>
2046
2047 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2048 aborting on Fsignal (Bug#13289).
2049
2050 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2051
2052 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2053 set_file_security as failure due to insufficient privileges.
2054 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2055 (fstat): Return owner and group like 'stat' and 'lstat' do.
2056
2057 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2058
2059 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2060 The bug was observed on Ubuntu operating inside a virtual machine,
2061 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2062 The workaround introduces a race condition on non-buggy hosts,
2063 but it's an unlikely race and anyway there's a nearly identical
2064 nearby race that can't be fixed.
2065 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2066 New static vars.
2067 (Fwrite_region): Test for file system time stamp bug.
2068 (init_fileio): New function.
2069 * lisp.h (init_fileio): Declare it.
2070 * emacs.c (main): Call it.
2071
2072 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2073 and make it more consistent with other stat-failure diagnostics.
2074
2075 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2076
2077 Fix crash when inserting data from non-regular files.
2078 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2079 for the error description produced by valgrind.
2080 * fileio.c (read_non_regular): Rename to read_contents.
2081 Free Lisp_Save_Value object used to pass parameters.
2082 (read_non_regular_quit): Rename to read_contents_quit.
2083 (Finsert_file_contents): Redesign internal file reading loop to adjust
2084 gap and end positions after each read and so help make_gap to work
2085 properly. Do not signal an I/O error too early and so do not leave
2086 not yet decoded characters in a buffer, which was the reason of
2087 redisplay crash. Use list2 to build return value. Adjust comments.
2088
2089 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2090
2091 Close a race when statting and reading files (Bug#13149).
2092 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2093 This avoids a race if the file is renamed between stat and open.
2094 This race is not the problem originally noted in Bug#13149;
2095 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2096
2097 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2098
2099 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2100 objects, related functions and macros.
2101 (make_save_value): Adjust prototype.
2102 (make_save_pointer): New prototype.
2103 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2104 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2105 * alloc.c (format_save_value): Rename to make_save_value.
2106 (make_save_pointer): New function.
2107 (record_xmalloc): Use make_save_pointer.
2108 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2109 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2110 Change users of make_save_value to make_save_pointer.
2111 Likewise for format_save_value and make_save_value.
2112
2113 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2114
2115 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2116 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2117 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2118 debugging stubs.
2119
2120 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2121
2122 * alloc.c (free_save_value): Now static.
2123
2124 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2125
2126 * keymap.c (map_keymap_internal): Use format_save_value.
2127 (map_keymap_char_table_item): Adjust accordingly.
2128 * fileio.c (non_regular_fd, non_regular_inserted)
2129 (non_regular_nbytes): Remove.
2130 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2131 Use format_save_value to pass parameters to read_non_regular.
2132 (read_non_regular): Use XSAVE_ macros to extract parameters.
2133 Adjust comment.
2134 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2135 format_save_value.
2136 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2137
2138 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2139
2140 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2141 extraction from any Lisp_Save_Value slot. Add type checking.
2142 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2143 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2144 * xselect.c: All users changed.
2145
2146 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2147
2148 Some convenient bits to deal with Lisp_Save_Values.
2149 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2150 (allocate_misc): Remove prototype.
2151 (format_save_value): New prototype.
2152 * alloc.c (allocate_misc): Revert back to static.
2153 (format_save_value): New function to build Lisp_Save_Value
2154 object with the specified internal structure.
2155 (make_save_value): Reimplement using format_save_value.
2156 * editfns.c (save_excursion_save): Use format_save_value.
2157 (save_excursion_restore): Use XSAVE_OBJECT.
2158
2159 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2160
2161 Avoid needless casts with XSAVE_POINTER.
2162 * alloc.c (mark_object) [GC_MARK_STACK]:
2163 * dired.c (directory_files_internal_unwind):
2164 * fileio.c (do_auto_save_unwind):
2165 * gtkutil.c (pop_down_dialog):
2166 * keymap.c (map_keymap_char_table_item):
2167 * lread.c (load_unwind):
2168 * nsmenu.m (pop_down_menu):
2169 * print.c (print_object) [GC_MARK_STACK]:
2170 * xfns.c (clean_up_file_dialog):
2171 * xmenu.c (cleanup_widget_value_tree):
2172 Omit casts between XSAVE_POINTER and a pointer type.
2173
2174 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2175
2176 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2177 * eval.c (eval_sub): Protect `form' from being GCed before its
2178 car and cdr becomes protected with the backtrace entry.
2179
2180 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2181
2182 Make Lisp_Save_Value more versatile storage for up to four objects.
2183 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2184 (struct Lisp_Save_Value): New layout. Adjust comments.
2185 (XSAVE_POINTER): New macro.
2186 (XSAVE_INTEGER): Likewise.
2187 (allocate_misc): Add prototype.
2188 (free_misc): Likewise.
2189 * alloc.c (allocate_misc): Now global.
2190 (free_misc): Likewise. Adjust comment.
2191 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2192 (free_save_value): Likewise.
2193 (mark_object): Likewise.
2194 * editfns.c (save_excursion_save): Pack everything within
2195 Lisp_Save_Value and so avoid xmalloc.
2196 (save_excursion_restore): Adjust to match new layout. Use free_misc
2197 because we do not allocate extra memory any more. Add eassert.
2198 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2199 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2200 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2201 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2202 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2203
2204 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2205
2206 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2207 (nsfont_draw): Remove disabling of LCD smoothing.
2208 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2209 Bug#11484 with LCD smoothing on.
2210
2211 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
2212
2213 Fix SIGDANGER handlers, for AIX (Bug#13408).
2214 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2215 Move handlers here from emacs.c; they were out of place.
2216
2217 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2218
2219 * xterm.c (syms_of_xterm): Adjust documentation for
2220 scroll-bar-adjust-thumb-portion.
2221
2222 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2223
2224 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2225 determine whether scroll bar thumb size should be adjusted or
2226 not. Use variable for MOTIF.
2227
2228 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2229 GTK.
2230
2231 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2232
2233 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2234 event is generated.
2235 (doCommandBySelector:): Set processingCompose to NO.
2236
2237 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2238 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2239 (nsfont_list_family): Add block/unblock_input calls.
2240 (nsfont_open): Move block_input earlier. Add unblock_input before early
2241 return.
2242 (nsfont_draw): Add block/unblock_input calls.
2243
2244 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2245
2246 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2247 for old_charpos and old_bytepos.
2248
2249 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2250
2251 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2252 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2253 Clear tzvalbuf_in_environ if this workaround is in effect.
2254 Problem and fix reported by Kazuhiro Ito.
2255
2256 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2257
2258 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2259 Fix ambiguous doc string cross-reference(s).
2260
2261 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2262 doc string cross-reference(s).
2263
2264 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2265 string cross-reference(s).
2266
2267 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2268
2269 Avoid unnecessary byte position calculation for the gap movement.
2270 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2271 anyway, all of them should use move_gap_both instead.
2272 * lisp.h (move_gap): Remove prototype.
2273 * insdel.c (move_gap): Remove.
2274 (move_gap_both): Add eassert.
2275 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2276 * xml.c (parse_region): Likewise.
2277
2278 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2279
2280 emacsclient -t should not suspend Emacs server (Bug#13387)
2281 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2282 New functions.
2283 * term.c (init_tty): Use them instead of rolling our own code.
2284 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2285 switches from 'signal' to 'pthread_sigmask', which is safer in
2286 multithreaded applications.
2287 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2288 which has already arranged for that.
2289 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2290 This is the main part of the bug fix.
2291
2292 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
2293
2294 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2295 x_last_font_name (Bug#13403).
2296
2297 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2298
2299 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2300 the type of per-buffer values where appropriate.
2301 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2302 predicate, which is how it's really used now. Adjust comment.
2303 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2304 * buffer.c (buffer_slot_type_mismatch): Remove.
2305 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2306 predicate. Adjust comment.
2307 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2308 fill-column, left-margin, tab-width, buffer-saved-size,
2309 left-margin-width, right-margin-width, left-fringe-width,
2310 right-fringe-width, scroll-bar-width and buffer-display-count.
2311 Use Qstringp for default-directory, buffer-file-name,
2312 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2313 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2314 line-spacing.
2315 * data.c (store_symval_forwarding): Adjust to call the predicate.
2316
2317 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
2318
2319 * w32.c (get_name_and_id, acl_set_file):
2320 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2321
2322 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2323
2324 * lisp.h (make_gap_1): New prototype.
2325 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2326 gap size values.
2327 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2328 naming convention.
2329 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2330 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
2331 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2332 (make_gap_1): New function to adjust the gap of any buffer.
2333 * coding.c (coding_alloc_by_making_gap): Use it.
2334 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2335 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2336
2337 2013-01-08 Juri Linkov <juri@jurta.org>
2338
2339 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2340 of (supports :underline (:style wave)). (Bug#13000)
2341
2342 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2343
2344 * undo.c (Fprimitive_undo): Move to simple.el.
2345 (syms_of_undo): Remove declarations for Sprimitive_undo.
2346
2347 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2348
2349 * keyboard.c (echo_add_key): Rename from echo_add_char.
2350
2351 2013-01-06 Chong Yidong <cyd@gnu.org>
2352
2353 * keyboard.c (echo_add_char): New function, factored out from
2354 echo_char. Don't add a space if the previous echo string was
2355 empty (Bug#13255).
2356 (echo_char): Use it.
2357 (read_key_sequence): When echoing mock input, ensure that the
2358 trailing dash is properly added.
2359
2360 2013-01-05 Eli Zaretskii <eliz@gnu.org>
2361
2362 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2363 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
2364 digits for buffer positions, before misalignment starts.
2365 Display "0" for integer "object" field.
2366 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2367 Display the newline glyph more unambiguously.
2368
2369 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2370
2371 * nsterm.m (ns_draw_underwave):
2372 * w32term.c (w32_draw_underwave):
2373 * xterm.c (x_draw_underwave): Make underwave look more triangular
2374 and also degrade gracefully for small fonts. (Bug#13000)
2375
2376 * nsterm.m (ns_draw_text_decoration):
2377 * w32term.c (x_draw_glyph_string):
2378 * xterm.c (x_draw_glyph_string): Don't use previous underline
2379 thickness and position if previous underline type is underwave.
2380
2381 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2382
2383 * fileio.c (Ffile_acl): Undocument return format.
2384
2385 2013-01-02 Glenn Morris <rgm@gnu.org>
2386
2387 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2388
2389 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2390
2391 Simplify via eabs.
2392 * dired.c (file_name_completion):
2393 * doc.c (get_doc_string):
2394 * floatfns.c (round2):
2395 * font.c (font_score, font_delete_unmatched):
2396 * fringe.c (compute_fringe_widths):
2397 * lread.c (read_list):
2398 * minibuf.c (Ftry_completion):
2399 * term.c (tty_ins_del_lines):
2400 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2401 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2402
2403 2012-12-31 Eli Zaretskii <eliz@gnu.org>
2404
2405 * w32.c (unsetenv): Set up the string passed to _putenv
2406 correctly.
2407 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
2408 for the bug this caused.
2409
2410 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2411
2412 * coding.c (Qmac): Now static.
2413
2414 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2415
2416 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2417 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2418 handlebox_widget. Set toolbar_in_hbox to false/true, set
2419 toolbar_is_packed to true.
2420 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2421 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2422 Show all on TOOLBAR_TOP_WIDGET.
2423 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2424 by TOOLBAR_TOP_WIDGET.
2425 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2426 Check toolbar_is_packed.
2427 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2428 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2429 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2430 false.
2431 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2432 (xg_update_menubar): Update title only if
2433 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2434 (xg_update_submenu): Skip tearoff only if
2435 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2436 (xg_initialize): Initialize xg_detached_menus only if
2437 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2438
2439 * xterm.h (struct x_output): Surround handlebox_widget with
2440 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2441 toolbar_in_hbox is bool.
2442
2443 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2444
2445 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2446 (LIBS_GNUSTEP): Define.
2447 (LIBES): Add $(LIBS_GNUSTEP).
2448 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2449
2450 2012-12-30 Eli Zaretskii <eliz@gnu.org>
2451
2452 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2453 continuation glyph on a TTY with an indication of an empty line.
2454 (Bug#13277)
2455
2456 2012-12-29 Eli Zaretskii <eliz@gnu.org>
2457
2458 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2459 file's SELinux context or ACLs successfully set, nil otherwise.
2460 (Bug#13298)
2461 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
2462
2463 * w32proc.c (reader_thread): Avoid passing NULL handles to
2464 SetEvent and WaitForSingleObject.
2465
2466 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2467
2468 Port EXTERNALLY_VISIBLE to Clang 3.2.
2469 * conf_post.h (__has_attribute): New macro.
2470 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2471
2472 2012-12-27 Glenn Morris <rgm@gnu.org>
2473
2474 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2475 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2476
2477 2012-12-27 Eli Zaretskii <eliz@gnu.org>
2478
2479 * fileio.c (file_name_as_directory, directory_file_name):
2480 Accept an additional argument MULTIBYTE to indicate whether the input C
2481 came from a multibyte or a unibyte Lisp string; all callers
2482 adjusted. Don't assume the input string is always multibyte.
2483 (Bug#13262)
2484 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2485 don't ENCODE_FILE them, and return a unibyte string if the input
2486 was unibyte.
2487 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2488 don't assume the input strings will always be multibyte. If the
2489 input strings are multibyte, decode strings obtained from C
2490 library functions.
2491
2492 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2493
2494 * lisp.h (toplevel): Add two notices to the comment about
2495 defining a new Lisp data type.
2496 * print.c (print_object): If Lisp_Save_Value object's pointer
2497 is the address of a memory area containing Lisp_Objects, try
2498 to print them.
2499 * alloc.c (valid_lisp_object_p): Adjust comment.
2500
2501 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2502
2503 * keyboard.c (record_asynch_buffer_change): Initialize an event
2504 only if it's really needed.
2505 * frame.h (enum output_method): Remove output_mac member since
2506 it's a leftover from the deleted code.
2507 * frame.c (Fframep): Adjust user here ...
2508 * terminal.c (Fterminal_live_p): ... and here.
2509 * coding.c (Qmac): Now here because it's only used to denote
2510 end-of-line encoding type.
2511 (syms_of_coding): DEFSYM it.
2512 * frame.h (Qmac): Remove duplicated declaration.
2513
2514 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2515
2516 * window.c (select_window_1): Now static, since it's used only here.
2517
2518 2012-12-25 Eli Zaretskii <eliz@gnu.org>
2519
2520 * window.c (window_body_cols): Subtract display margins from the
2521 window body width on TTYs as well. See
2522 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2523 for the original report.
2524
2525 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2526
2527 * xdisp.c (redisplay_window): Remove inner local variable
2528 because the outer shadowed one has the same meaning.
2529 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2530 set but never used.
2531 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2532 (xg_create_tool_bar): Adjust users.
2533
2534 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2535
2536 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2537 * buffer.c (Fget_buffer_create): Use it to set compact field of
2538 struct buffer_text to avoid accessing an uninitialized value
2539 when compact_buffer is called for the first time.
2540 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2541 (Fset_buffer_modified_p): Use buffer_window_count to check
2542 whether the buffer is displayed in some window.
2543 * xdisp.c (message_dolog): Likewise.
2544
2545 2012-12-23 Eli Zaretskii <eliz@gnu.org>
2546
2547 * w32.c (acl_set_file): If setting the file security descriptor
2548 fails, and the new DACL is identical to the existing one, silently
2549 return success. This fixes problems for users backing up their
2550 own files without having the necessary privileges for setting
2551 security descriptors.
2552
2553 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2554 values.
2555 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2556 after WaitForSingleObject returns normally. This expedites reader
2557 thread shutdown when delete_child triggers it.
2558 (reap_subprocess): More accurate commentary for why we call
2559 delete_child only when cp->fd is negative.
2560
2561 * w32.c (sys_close): Do not call delete_child on a subprocess
2562 whose handle is not yet closed. Instead, set its file descriptor
2563 to a negative value, so that reap_subprocess will call
2564 delete_child on that subprocess when its SIGCHLD arrives.
2565 This avoids closing handles used for communications between sys_select
2566 and reader_thread, which doesn't give sys_select a chance to
2567 notice that the process exited and invoke the SIGCHLD handler for
2568 it.
2569
2570 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2571
2572 * nsfns.m (Fns_do_applescript): Run event loop until script has
2573 been executed (Bug#12969).
2574 (ns_run_ascript): Chech as_script for nil, set to nil after
2575 executing script.
2576
2577 2012-12-22 Martin Rudalics <rudalics@gmx.at>
2578
2579 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2580
2581 2012-12-22 Eli Zaretskii <eliz@gnu.org>
2582
2583 * w32term.c (w32fullscreen_hook): New function.
2584 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2585
2586 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2587
2588 * fileio.c (Finsert_file_contents): Doc fix.
2589
2590 * w32proc.c (new_child, delete_child, find_child_pid): For a
2591 subprocess, consider its slot being in use as long as its process
2592 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2593 slot when a new process is started immediately after killing
2594 another one, without waiting enough time for the first process to
2595 be reaped and resources allocated for it be orderly freed.
2596 (Bug#13086)
2597 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2598
2599 2012-12-21 Chong Yidong <cyd@gnu.org>
2600
2601 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2602
2603 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2604
2605 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2606
2607 * w32.c (get_name_and_id): Always pass NULL as the first argument
2608 of lookup_account_sid. Avoids crashes with UNC file names that
2609 refer to DFS domains, not to specific machine names. (Bug#12621)
2610 Remove now unused argument FNAME; all callers changed.
2611 (get_file_owner_and_group): Remove now unused argument FNAME; all
2612 callers changed.
2613
2614 2012-12-21 Chong Yidong <cyd@gnu.org>
2615
2616 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2617 error for invalid chars, don't check for a nil return value.
2618
2619 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2620
2621 Avoid calls to CHAR_TO_BYTE if byte position is known.
2622 * editfns.c (make_buffer_string_both): Use move_gap_both.
2623 (Fbuffer_string): Use make_buffer_string_both.
2624 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2625 Adjust comment.
2626 (buf_bytepos_to_charpos): Likewise.
2627 (charpos_to_bytepos): Remove.
2628 * fileio.c (Finsert_file_contents): Use move_gap_both.
2629 * search.c (Freplace_match): Likewise.
2630 * process.c (process_send_region): Likewise. Use convenient
2631 names for byte positions.
2632 * lisp.h (charpos_to_bytepos): Remove prototype.
2633 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2634 * insdel.c (move_gap): Likewise.
2635
2636 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2637
2638 * xdisp.c (redisplay_internal): Remove now-unused local.
2639
2640 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2641
2642 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2643 (redisplay_internal): Don't bother selecting the frame to get the
2644 proper value of frame-local variables (bug#13225).
2645
2646 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2647
2648 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2649 Rename 4th argument since it may be buffer or string. Adjust comment.
2650 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2651
2652 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2653
2654 * coding.c (Fdetect_coding_region): Do not check start and end with
2655 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2656 (code_convert_region): Likewise.
2657
2658 2012-12-18 Eli Zaretskii <eliz@gnu.org>
2659
2660 * w32.c (acl_get_file, acl_set_file): Run the file name through
2661 map_w32_filename, and resolve any symlinks in the file name, like
2662 Posix platforms do.
2663 (acl_set_file): Call revert_to_self, if any privileges were
2664 enabled.
2665
2666 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
2667
2668 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2669 ($(BLD)/w32.$(O)): Update dependencies.
2670
2671 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2672
2673 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2674 propagate redisplay's scrolling (if any) to the right window.
2675 (redisplay_internal): Use ensure_selected_frame.
2676 (display_mode_lines): Complete last fix.
2677 * window.c (select_window_1): New func, extracted from select_window.
2678 (select_window): Use it.
2679 * window.h (select_window_1): Declare.
2680
2681 2012-12-17 Eli Zaretskii <eliz@gnu.org>
2682
2683 Emulate Posix ACL APIs on MS-Windows.
2684 * w32.c: Include sddl.h and sys/acl.h.
2685 (SDDL_REVISION_1): Define if not already defined.
2686 (g_b_init_get_security_descriptor_dacl)
2687 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2688 (g_b_init_is_valid_security_descriptor)
2689 (g_b_init_set_file_security): New static flags.
2690 (globals_of_w32): Initialize them to zero.
2691 (SetFileSecurity_Name): New string constant.
2692 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2693 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2694 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2695 (IsValidSecurityDescriptor_Proc): New typedefs.
2696 (get_file_security, get_security_descriptor_owner)
2697 (get_security_descriptor_group): Set errno to ENOTSUP.
2698 (set_file_security, get_security_descriptor_dacl)
2699 (is_valid_security_descriptor, convert_sd_to_sddl)
2700 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2701 (acl_free, acl_get_file, acl_set_file): New functions.
2702
2703 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2704
2705 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2706
2707 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2708 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2709 for some of that bug's symptoms can now cause Emacs to abort.
2710 Remove the workaround.
2711 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2712 The bug that caused SIGCHLD to get lost has been fixed, and the
2713 workaround for it can now cause Emacs to abort.
2714
2715 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2716
2717 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2718 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2719 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2720
2721 2012-12-16 Romain Francoise <romain@orebokech.com>
2722
2723 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2724 (Fcopy_file): Change last arg to `preserve_extended_attributes'
2725 and copy ACL entries of file in addition to SELinux context if set.
2726 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2727
2728 * Makefile.in (LIBACL_LIBS): New macro.
2729 (LIBES): Use it.
2730
2731 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2732
2733 * fileio.c (internal_delete_file): Use bool for boolean.
2734
2735 2012-12-15 Eli Zaretskii <eliz@gnu.org>
2736
2737 Fix bug #13079 on MS-Windows with temp files not being deleted.
2738 * w32.h (_child_process): New members input_file and
2739 pending_deletion.
2740 (register_child): First argument is now pid_t.
2741 (record_infile, record_pending_deletion): New prototypes.
2742
2743 * w32proc.c (new_child): Initialize input_file and
2744 pending_deletion members of the child.
2745 (delete_child): Delete the child's temporary input file, if any,
2746 that is pending deletion.
2747 (register_child): First argument is now pid_t.
2748 (record_infile, record_pending_deletion): New functions.
2749 (reap_subprocess): Fix a typo in DebPrint string.
2750 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2751
2752 * fileio.c (internal_delete_file): Return an int again: non-zero
2753 if delete-file succeeds, zero otherwise.
2754
2755 * lisp.h (internal_delete_file): Adjust prototype.
2756
2757 * callproc.c (Fcall_process): Don't overwrite infile with result
2758 of DECODE_FILE.
2759 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2760 asynchronous subprocess, record the name of the input file name,
2761 if any.
2762 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2763 delete the file, record it as pending deletion when the subprocess
2764 exits.
2765
2766 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2767
2768 * editfns.c [HAVE_PWD_H]: Include grp.h.
2769
2770 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2771
2772 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2773
2774 Fix permissions bugs with setgid directories etc. (Bug#13125)
2775 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2776 to mark it as a placeholder. The old value was often wrong.
2777 The only user of this attribute has been changed to use
2778 file-ownership-preserved-p instead, with its new group arg.
2779 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2780
2781 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2782
2783 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2784 Keep selected_window and selected_frame in sync.
2785
2786 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2787
2788 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2789 try to get accurate owner and group information from NT file
2790 security APIs. This is to make most callers of 'stat' and
2791 'lstat', which don't need that information, much faster.
2792
2793 * dired.c (Ffile_attributes) [WINDOWSNT]:
2794 Set w32_stat_get_owner_group to a non-zero value, to request accurate
2795 owner and group information from 'lstat'.
2796
2797 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2798
2799 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2800 as that confuses set-auto-coding, so insist on the head-read
2801 returning the full 1024 bytes. Let lseek compute the tail offset;
2802 less work for us. Do not ignore I/O errors when reading the tail.
2803
2804 * xdisp.c: Minor style fixes.
2805 (init_iterator): Hoist assignment out of if-expression.
2806 (markpos_of_region): Callers now test for sign, not for -1.
2807
2808 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2809
2810 Minor redisplay optimization when the region length is zero.
2811 * xdisp.c (markpos_of_region): New function.
2812 (init_iterator): Do not highlight the region of zero length.
2813 (redisplay_window): Check whether the region is of non-zero length.
2814 (try_cursor_movement): Allow if the region length is zero.
2815 (try_window_reusing_current_matrix, try_window_id): Likewise.
2816
2817 2012-12-13 Eli Zaretskii <eliz@gnu.org>
2818
2819 * search.c (search_buffer): Check the inverse translations of each
2820 character in pattern when the buffer being searched is unibyte.
2821 (Bug#13084)
2822
2823 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2824
2825 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2826 files, fixing a regression from 24.2.
2827 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
2828
2829 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2830
2831 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2832 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2833 Remove unnecessary S_ISLNK test, as (contra the comments) this
2834 function can't copy symlinks. Improve quality of error message
2835 when attempting to copy files that are neither regular files nor
2836 directories.
2837
2838 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2839
2840 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2841 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2842 * window.c (Frecenter):
2843 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2844 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2845
2846 2012-12-12 Daniel Colascione <dancol@dancol.org>
2847
2848 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
2849 the dumped Emacs is not a sparse file, greatly improving Cygwin
2850 "make bootstrap" performance.
2851
2852 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
2853
2854 * inotify.c (inotify_callback): Generate an Emacs event for every
2855 incoming inotify event.
2856
2857 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2858
2859 * xdisp.c (handle_face_prop): Fix logic of computing
2860 it->start_of_box_run_p.
2861 (append_space_for_newline): If the glyph row is R2L, reset the
2862 iterator's end_of_box_run_p flag before prepending the space glyph.
2863 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2864 iterator's start_of_box_run_p flag before prepending the stretch.
2865 (append_glyph, produce_image_glyph, append_composite_glyph)
2866 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2867 left_box_line_p and right_box_line_p flags of the glyph for R2L
2868 glyph rows. (Bug#13011)
2869
2870 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2871
2872 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2873 if changed buffer is not shown in a window.
2874 * insdel.c (prepare_to_modify_buffer): Likewise.
2875 * window.c (replace_buffer_in_windows_safely): Do nothing
2876 if buffer is not shown in a window.
2877 (Fforce_window_update): Likewise if string or buffer argument
2878 is passed.
2879
2880 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2881
2882 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2883 encoded_file_name, which is what it is.
2884
2885 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2886
2887 Consistently use marker_position and marker_byte_position.
2888 * fringe.c (Ffringe_bitmaps_at_pos):
2889 * indent.c (Fvertical_motion):
2890 * insdel.c (prepare_to_modify_buffer):
2891 * keyboard.c (make_lispy_position):
2892 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2893 (window_scroll_pixel_based, displayed_window_lines)
2894 (Fset_window_configuration):
2895 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2896 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2897 Replace direct access to marker fields with calls
2898 to marker_position and/or marker_byte_position.
2899
2900 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
2901
2902 * makefile.w32-in (SIG2STR_H): New macro.
2903 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2904 ($(BLD)/w32notify.$(O)): Update dependencies.
2905
2906 2012-12-10 Daniel Colascione <dancol@dancol.org>
2907
2908 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2909 Windows file notification functionality unless WINDOWSNT.
2910
2911 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2912 declarations.
2913
2914 * w32fns.c (cache_system_info): Initialize the global hinst
2915 variable here so various initialization calls DTRT.
2916
2917 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
2918 (hinst): Remove unneeded extern declaration.
2919 (_start): Remove initialization of above variables; remove
2920 initialization of hinst, as cache_system_info now does that.
2921
2922 * emacs.c (main): Call cache_system_info early in startup; we
2923 previously weren't calling it in Cygwin builds.
2924
2925 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2926 Teach the autoconf build system how to compile a Windows resource file
2927 and link it to Emacs.
2928
2929 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2930
2931 Per-buffer window counters.
2932 * buffer.h (struct buffer): New member window_count.
2933 (buffer_window_count): New function.
2934 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2935 Initialize window_count.
2936 (Fkill_buffer): Verify window_count for the buffer being killed.
2937 (modify_overlay): Do not force redisplay if buffer is not shown
2938 in any window.
2939 (init_buffer_once): Initialize window_count for buffer_defaults
2940 and buffer_local_symbols.
2941 * window.h (buffer_shared): Remove declaration.
2942 (wset_buffer): Convert from inline ...
2943 * window.c (wset_buffer): ... to an ordinary function.
2944 (adjust_window_count): New function.
2945 (make_parent_window): Use it.
2946 * xdisp.c (buffer_shared): Remove.
2947 (redisplay_internal, redisplay_window): Adjust users.
2948 (buffer_shared_and_changed): Use per-buffer window counter.
2949
2950 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2951
2952 Support for filesystem notifications on MS-Windows.
2953 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2954 and this is a TTY frame, signal the caller that keyboard input is
2955 available.
2956
2957 * w32xfns.c (drain_message_queue): Now returns an int: an
2958 indication whether any WM_EMACS_FILENOTIFY messages were found in
2959 the queue.
2960
2961 * w32inevt.c (handle_file_notifications): New function.
2962 (w32_console_read_socket): Call it to process file notifications.
2963
2964 * w32console.c (initialize_w32_display): Record the main thread ID
2965 in dwMainThreadId.
2966
2967 * deps.mk (inotify.o): New dependency list.
2968
2969 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2970
2971 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2972 (WM_EMACS_END): Bump value by 1.
2973 (notification_buffer_in_use, file_notifications)
2974 (notifications_size, notifications_desc): Declare.
2975 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2976 Add prototypes.
2977
2978 * w32term.c (lispy_file_action, queue_notifications): New functions.
2979 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2980 <Qrenamed_to>: New symbols.
2981 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2982
2983 * w32notify.c: New file, implements file event notifications for
2984 MS-Windows.
2985
2986 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2987 by posting it to the w32_read_socket queue.
2988
2989 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2990
2991 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2992 (GLOBAL_SOURCES): Add w32notify.c
2993 ($(BLD)/w32notify.$(O)): New set of dependencies.
2994
2995 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2996
2997 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2998 Handle FILE_NOTIFY_EVENT.
2999 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3000 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3001 w32notify-handle-event by default.
3002
3003 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3004 syms_of_w32notify.
3005
3006 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3007
3008 Support for filesystem notifications on GNU/Linux via inotify.
3009 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3010
3011 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3012
3013 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3014 (syms_of_keyboard): DEFSYM it.
3015 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3016 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3017 Qfile_inotify events.
3018 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3019 special-event-map to inotify-handle-event.
3020
3021 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3022
3023 * Makefile.in (base_obj): Add inotify.o.
3024
3025 * inotify.c: New file.
3026
3027 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3028
3029 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3030
3031 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3032
3033 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3034 DWORD_PTR, for compatibility with 64-bit builds.
3035
3036 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3037 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3038 (system_process_attributes): Use SIZE_T rather than DWORD, for
3039 compatibility with 64-bit builds.
3040
3041 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3042
3043 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3044
3045 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3046
3047 * indent.c (Fvertical_motion): If a display string will be
3048 displayed on the left or the right margin, don't consider it as a
3049 factor in cursor positioning. (Bug#13108)
3050
3051 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3052
3053 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3054
3055 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3056
3057 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3058 for string length.
3059
3060 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3061
3062 * w32.c (unsetenv): Return 0 if the input string is too long.
3063
3064 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3065
3066 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3067 * alloc.c (xputenv): New function.
3068 * dbusbind.c (Fdbus_init_bus):
3069 * emacs.c (main):
3070 * xterm.c (x_term_init):
3071 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3072 * editfns.c (initial_tz): Move static var decl up.
3073 (tzvalbuf_in_environ): New static var.
3074 (init_editfns): Initialize these two static vars.
3075 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3076 Save old TZ value on stack, if it's small.
3077 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3078 instead, use xputenv+unsetenv to set and restore TZ.
3079 (environbuf): Remove static var. All uses removed.
3080 (Fset_time_zone_rule): Do not save TZ and environ;
3081 no longer needed here.
3082 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3083 Move to inside set_time_zone_rule; they don't need file scope any more.
3084 (set_time_zone_rule): Maintain the TZ=value string separately.
3085 (syms_of_editfns): Don't initialize initial_tz;
3086 init_editfns now does it.
3087 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3088 * lisp.h (xputenv): New decl.
3089
3090 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3091
3092 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3093
3094 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3095
3096 * w32.c (unsetenv, sys_putenv): New functions.
3097
3098 2012-12-08 Chong Yidong <cyd@gnu.org>
3099
3100 * editfns.c (Finsert_char): Make the error message more
3101 informative (Bug#12992).
3102
3103 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3104
3105 Simplify get_lim_data.
3106 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3107 Remove USG and vlimit methods; no longer used these days.
3108 Add #error catchall just in case.
3109
3110 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3111 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3112 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3113 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3114 (deleted_pid_list, Fdelete_process, create_process)
3115 (record_child_status_change, handle_child_signal, deliver_child_signal)
3116 (init_process_emacs, syms_of_process):
3117 Assume SIGCHLD is defined.
3118 (parse_signal): Remove. All uses removed.
3119 (abbr_to_signal): New static function.
3120 (Fsignal_process): Use it to convert signal names to ints.
3121 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3122 kill (getpgrp (), ...).
3123 (emacs_sigaction_init): Assume SIGCHLD is defined.
3124 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3125 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3126 * syssignal.h (EMACS_KILLPG): Remove.
3127 All uses replaced by 'kill' with a negative pid.
3128 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3129 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3130
3131 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3132
3133 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3134 This will cause a production Emacs to dump core instead of
3135 infinite-looping.
3136
3137 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3138
3139 * frame.c (make_frame): Do not set window's buffer to t.
3140 * window.c (Fsplit_window_internal): Likewise. Previously it was
3141 used to indicate that the window is being set up. Now we use
3142 set_window_buffer for all new windows, so the condition in ...
3143 (Fset_window_buffer): ... is always true and can be removed.
3144
3145 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3146
3147 Convenient macro to check whether the buffer is hidden.
3148 * buffer.h (BUFFER_HIDDEN_P): New macro.
3149 * frame.c (make_frame): Use it. Adjust comment.
3150 * buffer.c (candidate_buffer): New function.
3151 (Fother_buffer, other_buffer_safely): Use it.
3152
3153 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3154
3155 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3156 if the child process is still running. Instead, exit the wait
3157 loop and return zero. (Bug#13086)
3158
3159 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3160
3161 * frame.h (x_char_width, x_char_height): Remove prototypes.
3162 * w32term.h (x_char_width, x_char_height): Likewise.
3163 * xfns.c (x_char_width, x_char_height): Remove.
3164 * w32fns.c (x_char_width, x_char_height): Likewise.
3165 * nsfns.c (x_char_width, x_char_height): Likewise.
3166 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3167 all window frames.
3168 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3169 * keyboard.c (command_loop_1): Remove prototype.
3170 (command_loop_2, top_level_1): Add static to match prototype.
3171
3172 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3173
3174 Fix a recently-introduced delete-process race condition.
3175 * callproc.c, process.h (record_kill_process):
3176 New function, containing part of the old call_process_kill.
3177 (call_process_kill): Use it.
3178 This does not change call_process_kill's behavior.
3179 * process.c (Fdelete_process): Use record_kill_process to fix a
3180 race condition that could cause Emacs to lose track of a child.
3181
3182 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3183
3184 Avoid code duplication between prev_frame and next_frame.
3185 * frame.c (candidate_frame): New function. Add comment.
3186 (prev_frame, next_frame): Use it. Adjust comment.
3187
3188 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3189
3190 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3191 fails, signal an error instead of continuing with an empty
3192 string. (Bug#13079)
3193 Encode expanded temp file pattern before passing it to mkstemp or
3194 mktemp.
3195
3196 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3197 Encode the file name before passing it to dostounix_filename, in
3198 case it will downcase it (under w32-downcase-file-names).
3199 (Bug#12933)
3200
3201 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3202
3203 Minor call-process cleanups.
3204 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3205 at the same time as other platforms, to simplify analysis.
3206 No need for fd0_volatile since we have synch_process_fd.
3207 Avoid needless emacs_close; arg is always negative.
3208
3209 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3210
3211 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3212 processes.
3213
3214 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3215
3216 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3217 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3218 and mouse_face_hidden members to a bitfields.
3219 * frame.h (struct frame): Remove set-but-not-used space_width member.
3220 (FRAME_SPACE_WIDTH): Remove.
3221 * nsterm.m, w32term.c, xterm.c: Adjust users.
3222 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3223 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3224 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3225 members to a bitfields.
3226
3227 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3228
3229 Don't let call-process be a zombie factory (Bug#12980).
3230 Fixing this bug required some cleanup of the signal-handling code.
3231 As a side effect, this change also fixes a longstanding rare race
3232 condition whereby Emacs could mistakenly kill unrelated processes,
3233 and it fixes a bug where a second C-g does not kill a recalcitrant
3234 synchronous process in GNU/Linux and similar platforms.
3235 The patch should also fix the last vestiges of Bug#9488,
3236 a bug which has mostly been fixed on the trunk by other changes.
3237 * callproc.c, process.h (synch_process_alive, synch_process_death)
3238 (synch_process_termsig, sync_process_retcode):
3239 Remove. All uses removed, to simplify analysis and so that
3240 less consing is done inside critical sections.
3241 * callproc.c (call_process_exited): Remove. All uses replaced
3242 with !synch_process_pid.
3243 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3244 These take the role of what used to be in unwind-protect arg.
3245 All uses changed.
3246 (block_child_signal, unblock_child_signal):
3247 New functions, to avoid races that could kill innocent-victim processes.
3248 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3249 (call_process_kill): Record killed processes as deleted, so that
3250 zombies do not clutter up the system. Do this inside a critical
3251 section, to avoid a race that would allow the clutter.
3252 (call_process_cleanup): Fix code so that the second C-g works again
3253 on common platforms such as GNU/Linux.
3254 (Fcall_process): Create the child process in a critical section,
3255 to fix a race condition. If creating an asynchronous process,
3256 record it as deleted so that zombies do not clutter up the system.
3257 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3258 light of these changes. Omit unnecessary call to emacs_close
3259 before failure, as the unwind-protect code does that.
3260 * callproc.c (call_process_cleanup):
3261 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3262 * process.c (record_deleted_pid): New function, containing
3263 code refactored out of Fdelete_process.
3264 (Fdelete_process): Use it.
3265 (process_status_retrieved): Remove. All callers changed to use
3266 child_status_change.
3267 (record_child_status_change): Remove, folding its contents into ...
3268 (handle_child_signal): ... this signal handler. Now, this
3269 function is purely a handler for SIGCHLD, and is not called after
3270 a synchronous waitpid returns; the synchronous code is moved to
3271 wait_for_termination. There is no need to worry about reaping
3272 more than one child now.
3273 * sysdep.c (get_child_status, child_status_changed): New functions.
3274 (wait_for_termination): Now takes int * status and bool
3275 interruptible arguments, too. Do not record child status change;
3276 that's now the caller's responsibility. All callers changed.
3277 Reimplement in terms of get_child_status.
3278 (wait_for_termination_1, interruptible_wait_for_termination):
3279 Remove. All callers changed to use wait_for_termination.
3280 * syswait.h: Include <stdbool.h>, for bool.
3281 (record_child_status_change, interruptible_wait_for_termination):
3282 Remove decls.
3283 (record_deleted_pid, child_status_changed): New decls.
3284 (wait_for_termination): Adjust to API changes noted above.
3285
3286 * bytecode.c, lisp.h (Qbytecode): Remove.
3287 No longer needed after 2012-11-20 interactive-p changes.
3288
3289 2012-12-03 Eli Zaretskii <eliz@gnu.org>
3290
3291 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3292 the scroll margin, move point outside the margin. (Bug#13055)
3293
3294 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3295
3296 * gtkutil.c (my_log_handler): New function.
3297 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3298
3299 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3300
3301 * lisp.h (modify_region): Rename to...
3302 (modify_region_1): ...new prototype.
3303 * textprop.c (modify_region): Now static. Adjust users.
3304 * insdel.c (modify_region): Rename to...
3305 (modify_region_1): ...new function to work with current buffer.
3306 Adjust comment and users. Use true and false for booleans.
3307
3308 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3309
3310 * alloc.c (free_save_value): New function.
3311 (safe_alloca_unwind): Use it.
3312 * lisp.h (free_save_value): New prototype.
3313 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3314 Add comment.
3315 (save_excursion_restore): Adjust to match saved data structure.
3316 Use free_save_value to offload some work from GC. Drop obsolete
3317 #if 0 code.
3318
3319 2012-12-03 Chong Yidong <cyd@gnu.org>
3320
3321 * fileio.c (Vauto_save_list_file_name): Doc fix.
3322
3323 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
3324
3325 * w32fns.c: Remove prototype of atof.
3326 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
3327 builds.
3328 (file_dialog_callback): Make it UINT_PTR.
3329
3330 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3331 with 64-bit builds.
3332
3333 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3334 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3335 defined.
3336
3337 2012-12-03 Glenn Morris <rgm@gnu.org>
3338
3339 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
3340
3341 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3342
3343 Fix xpalloc confusion after memory is exhausted.
3344 * alloc.c (xpalloc): Comment fix.
3345 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3346 and signals an error, do not clear charset_table_size, as
3347 charset_table is still valid.
3348 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3349
3350 Use execve to avoid need to munge environ (Bug#13054).
3351 * callproc.c (Fcall_process):
3352 * process.c (create_process):
3353 Don't save and restore environ; no longer needed.
3354 * callproc.c (child_setup):
3355 Use execve, not execvp, to preserve environ.
3356
3357 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3358
3359 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3360
3361 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3362
3363 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3364 display for sliced images (Bug#10500).
3365
3366 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3367
3368 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
3369
3370 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3371 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3372
3373 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3374
3375 * xdisp.c (window_outdated): Remove eassert since it hits
3376 some suspicious corner cases (see Bug#13007 and Bug#13012).
3377 (mode_line_update_needed): New function.
3378 (redisplay_internal, redisplay_window): Use it.
3379 (ensure_selected_frame): New function.
3380 (redisplay_internal, unwind_redisplay): Use it.
3381 (redisplay_internal): Move comment about buffer_shared...
3382 (buffer_shared_and_changed): ...near to its real use.
3383
3384 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3385
3386 * callproc.c (Fcall_process): Don't misreport vfork failure.
3387
3388 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3389
3390 * callproc.c (Fcall_process): Fix vfork portability problems.
3391 Do not assume that fd[0], count, filefd, and save_environ survive
3392 vfork. Fix bug whereby wrong errno value could be reported for
3393 pipe failure. Some minor cleanups, too, as follows. Move buf and
3394 bufsize to the context where they're needed. Change new_argv to
3395 be of type char **, as this is more convenient and avoids casts.
3396 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3397 Now local constants, not macros.
3398
3399 2012-11-18 Kenichi Handa <handa@gnu.org>
3400
3401 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3402 for the variable "f".
3403
3404 2012-11-13 Kenichi Handa <handa@gnu.org>
3405
3406 * font.c (font_unparse_xlfd): Exclude special characters from the
3407 generating XLFD name.
3408
3409 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3410
3411 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3412 * dired.c (stat_uname, stat_gname):
3413 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3414
3415 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3416 * dired.c (directory_files_internal, file_name_completion):
3417 Assume EAGAIN and EINTR are defined.
3418
3419 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3420 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3421 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3422 * lread.c (readbyte_from_file): Assume EINTR is defined.
3423 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3424 Assume EIO and EAGAIN are defined.
3425 * unexcoff.c (write_segment): Assume EFAULT is defined.
3426
3427 2012-11-27 Eli Zaretskii <eliz@gnu.org>
3428
3429 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3430 (Bug#11964)
3431
3432 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3433 highlighting on the frame was cleared. Prevents assertion
3434 violations when repeatedly clicking on the "Top" link of the
3435 "bread-crumbs" in Info buffers.
3436
3437 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3438
3439 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3440
3441 2012-11-24 Ken Brown <kbrown@cornell.edu>
3442
3443 * keyboard.c (HAVE_MOUSE):
3444 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3445 were always defined.
3446
3447 2012-11-24 Eli Zaretskii <eliz@gnu.org>
3448
3449 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3450 between bpos_covered and bpos_max. This fixes cursor display when
3451 several display strings follow each other.
3452
3453 * .gdbinit (pgx): If the glyph's object is a string, display the
3454 pointer to string data, rather than the value of the string object
3455 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3456
3457 * indent.c (Fvertical_motion): If the starting position is covered
3458 by a display string, return to one position before that, to avoid
3459 overshooting it inside move_it_to. (Bug#12930)
3460
3461 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3462
3463 * frame.h (struct frame): Remove display_preempted member
3464 since all users are dead long ago.
3465 * nsterm.h (struct x_output): Use the only dummy member.
3466 * w32menu.c (pending_menu_activation): Remove since not
3467 really used.
3468 (set_frame_menubar): Adjust user.
3469 * w32term.h (struct x_output): Drop outdated #if 0 code.
3470 (struct w32_output): Use bitfields for explicit_parent,
3471 asked_for_visible and menubar_active members.
3472 Drop unused pending_menu_activation member.
3473 * xterm.h (struct x_output): Drop outdated #if 0 code.
3474 Use bitfields for explicit_parent, asked_for_visible,
3475 has_been_visible and net_wm_state_hidden_seen members.
3476
3477 2012-11-23 Eli Zaretskii <eliz@gnu.org>
3478
3479 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3480 of a literal "/". (Bug#12955)
3481 (gl-stamp): Invoke fc.exe directly, not through cmd.
3482
3483 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3484
3485 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3486 * dired.c: Assume HAVE_DIRENT_H.
3487 (NAMLEN): Remove, replacing with ...
3488 (dirent_namelen): New function. All uses changed. Use the GNU macro
3489 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3490 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3491 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3492 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3493 $(NT_INC)/dirent.h.
3494 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3495 * ndir.h: Rename to ../nt/inc/dirent.h.
3496 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3497 Do not include <dirent.h>; no longer needed.
3498 * w32.c: Include <dirent.h> rather than "ndir.h".
3499
3500 2012-11-23 Chong Yidong <cyd@gnu.org>
3501
3502 * xftfont.c (xftfont_open): Remove duplicate assignment.
3503
3504 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3505
3506 * alloc.c (Fgarbage_collect): Unblock input after clearing
3507 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3508 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3509 * msdos.c (IT_frame_up_to_date): Use it here...
3510 * w32term.c (w32_frame_up_to_date): ...here...
3511 * xterm.c (XTframe_up_to_date): ...and here...
3512 * nsterm.m (ns_frame_up_to_date): ...but not here.
3513 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3514 Adjust users.
3515 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3516 Do not check whether GC is in progress.
3517
3518 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3519
3520 * xdisp.c (window_buffer_changed): New function.
3521 (update_menu_bar, update_tool_bar): Use it to
3522 simplify large 'if' statements.
3523 (redisplay_internal): Generalize commonly used
3524 'tail' and 'frame' local variables.
3525
3526 2012-11-22 Eli Zaretskii <eliz@gnu.org>
3527
3528 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3529 with Windows system header.
3530
3531 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3532
3533 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3534 * alloc.c: Assume unistd.h exists.
3535 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3536 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3537 (getwd) [USG]: Remove; no longer needed.
3538 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3539 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3540 * w32.h (getcwd): Remove decl.
3541
3542 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3543
3544 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3545 Make it set selected_window as well.
3546 (update_tool_bar): Use it.
3547
3548 2012-11-21 Ken Brown <kbrown@cornell.edu>
3549
3550 * emacs.c (main): Set the G_SLICE environment variable for all
3551 Cygwin builds, not just GTK builds. See
3552 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3553
3554 2012-11-21 Eli Zaretskii <eliz@gnu.org>
3555
3556 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3557 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3558 Define for the MSVC compiler.
3559
3560 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
3561
3562 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3563 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3564 dostounix_filename. Prevents crashes down the road, because
3565 dostounix_filename assumes it gets a unibyte string.
3566 Reported by Michel de Ruiter <michel@sentient.nl>, see
3567 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3568
3569 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3570
3571 Conflate Qnil and Qunbound for `symbol-function'.
3572 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3573 * lread.c (init_obarray): Set `function' fields to Qnil.
3574 * eval.c (Fcommandp): Ignore Qunbound.
3575 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3576 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3577 Test NILP rather than Qunbound.
3578 (Ffmakunbound): Set to Qnil.
3579 (Fsymbol_function): Never signal an error.
3580 (Finteractive_form): Ignore Qunbound.
3581
3582 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3583
3584 * eval.c (interactive_p): Remove no-longer-used decl.
3585
3586 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3587
3588 * xdisp.c (buffer_shared): Adjust comment.
3589 (buffer_shared_and_changed): New function.
3590 (prepare_menu_bars, redisplay_internal): Use it to
3591 decide whether all windows or frames should be updated.
3592 (window_outdated): New function.
3593 (text_outside_line_unchanged_p, redisplay_window): Use it.
3594 (redisplay_internal): Likewise. Fix indentation.
3595
3596 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3597
3598 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3599 (syms_of_eval): Remove corresponding defsubr.
3600 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3601
3602 2012-11-19 Daniel Colascione <dancol@dancol.org>
3603
3604 * w32fns.c (Fx_file_dialog):
3605 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3606 cygwin_convert_file_name*.
3607
3608 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3609 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3610
3611 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3612
3613 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3614
3615 2012-11-18 Eli Zaretskii <eliz@gnu.org>
3616
3617 * w32select.c: Include w32common.h before w32term.h, so that
3618 windows.h gets included before w32term.h uses some of its
3619 features, see below.
3620
3621 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3622 New typedefs.
3623 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3624 New prototypes.
3625 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3626
3627 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
3628
3629 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3630 (ns_select): Return at once if events are held (Bug#12834).
3631
3632 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
3633
3634 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3635 Needed following 2012-10-20 change. (Bug#12902)
3636
3637 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
3638
3639 * w32proc.c (waitpid): Remove unused label get_result.
3640
3641 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
3642
3643 * makefile.w32-in (SYSWAIT_H): New macro.
3644 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3645 ($(BLD)/sysdep.$(O)): Update dependencies.
3646
3647 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3648
3649 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3650 * callproc.c (relocate_fd): Assume F_DUPFD.
3651 * emacs.c, term.c (O_RDWR): Remove.
3652 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3653 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3654 * nsterm.m: Assume <fcntl.h> exists.
3655 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3656 (create_pty, Fmake_network_process, server_accept_connection)
3657 (wait_reading_process_output, init_process_emacs):
3658 Assume O_NONBLOCK.
3659 (wait_reading_process_output): Put in a special case for WINDOWSNT
3660 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3661 It's not clear this is needed, but it's a more-conservative change.
3662 (create_process): Assume FD_CLOEXEC.
3663 (create_process, create_pty): Assume O_NOCTTY.
3664 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3665 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3666 Omit if not DOS_NT, since F_GETFL is not defined there.
3667 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3668 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3669 (O_NOCTTY): Remove.
3670 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3671 lack it, since gnulib guarantees this.
3672 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3673
3674 2012-11-17 Eli Zaretskii <eliz@gnu.org>
3675
3676 * w32.c (faccessat): Pretend that directories have the execute bit
3677 set. Emacs expects that, e.g., in files.el:cd-absolute.
3678
3679 * w32proc.c (create_child): Don't clip the PID of the child
3680 process to fit into an Emacs integer, as this is no longer a
3681 restriction.
3682 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3683 reaping only the process specified by PID argument, if that is
3684 positive. Use PID instead of dead_child to know which process to
3685 reap. Wait for the child to die only if WNOHANG is not in
3686 OPTIONS.
3687 (sys_select): Don't set dead_child.
3688
3689 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3690 as it is no longer needed.
3691
3692 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3693 no longer needed.
3694 (record_child_status_change): Remove the setting of
3695 record_at_most_one_child for the !WNOHANG case.
3696
3697 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3698
3699 Fix problems in ns port found by static checking.
3700 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3701 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3702 not to process group.
3703 (ns_select): Use emacs_write, not write, as that's more robust
3704 in the presence of signals.
3705 (fd_handler:): Check for read errors.
3706
3707 2012-11-16 Glenn Morris <rgm@gnu.org>
3708
3709 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3710
3711 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
3712
3713 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3714
3715 2012-11-16 Eli Zaretskii <eliz@gnu.org>
3716
3717 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3718 use the same value of thread handle.
3719 (start_timer_thread): If the timer thread exited (due to error),
3720 clean up by closing the two handles it used. Duplicate the caller
3721 thread's handle here, so it gets duplicated only once, when
3722 launching the timer thread. Set priority of the timer thread, not
3723 the caller thread.
3724 (getitimer): Don't duplicate the caller thread's handle here.
3725 (Bug#12832)
3726
3727 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
3728
3729 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3730 called (Bug#12834).
3731
3732 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3733
3734 Remove no-longer-used pty_max_bytes variable.
3735 * process.c (pty_max_bytes): Remove; unused.
3736 (send_process): Do not set it.
3737
3738 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
3739
3740 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3741 Update dependencies.
3742
3743 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3744
3745 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3746 This follows up on the 2012-09-29 patch that removed indirection
3747 for the 'function' field. Reported by Sergey Vinokurov in
3748 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3749
3750 2012-11-14 Eli Zaretskii <eliz@gnu.org>
3751
3752 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3753 different name, as the MS runtime does not have such a function,
3754 and probably never will.) All callers changed. Ignore DIRFD
3755 value if PATH is an absolute file name, to match Posix spec
3756 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3757 symlinks.
3758
3759 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3760
3761 * xdisp.c (echo_area_display, redisplay_internal):
3762 Omit redundant check whether frame_garbaged is set.
3763
3764 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3765
3766 Use faccessat, not access, when checking file permissions (Bug#12632).
3767 This fixes a bug that has been present in Emacs since its creation.
3768 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3769 which must set some sort of record. (Torek's bug report was against
3770 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3771 same common flaw.) See Torek's Usenet posting
3772 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3773 Posted: Fri Apr 8 14:18:56 1983.
3774 * Makefile.in (LIB_EACCESS): New macro.
3775 (LIBES): Use it.
3776 * callproc.c (init_callproc):
3777 * charset.c (init_charset):
3778 * fileio.c (check_existing, check_executable, check_writable)
3779 (Ffile_readable_p):
3780 * lread.c (openp, load_path_check):
3781 * process.c (allocate_pty):
3782 * xrdb.c (file_p):
3783 Use effective UID when checking permissions, not real UID.
3784 * callproc.c (init_callproc):
3785 * charset.c (init_charset):
3786 * lread.c (load_path_check, init_lread):
3787 Test whether directories are accessible, not merely whether they exist.
3788 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3789 * fileio.c (check_existing, check_executable, check_writable)
3790 (Ffile_readable_p):
3791 Use symbolic names instead of integers for the flags, as they're
3792 portable now.
3793 (check_writable): New arg AMODE. All uses changed.
3794 Set errno on failure.
3795 (Ffile_readable_p): Use faccessat, not stat + open + close.
3796 (Ffile_writable_p): No need to call check_existing + check_writable.
3797 Just call check_writable and then look at errno. This saves a syscall.
3798 dir should never be nil; replace an unnecessary runtime check
3799 with an eassert. When checking the parent directory of a nonexistent
3800 file, check that the directory is searchable as well as writable, as
3801 we can't create files in unsearchable directories.
3802 (file_directory_p): New function, which uses 'stat' on most platforms
3803 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3804 (Ffile_directory_p, Fset_file_times): Use it.
3805 (file_accessible_directory_p): New function, which uses a single
3806 syscall for efficiency.
3807 (Ffile_accessible_directory_p): Use it.
3808 * xrdb.c (file_p): Use file_directory_p.
3809 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3810 * lread.c (openp): When opening a file, use fstat rather than
3811 stat, as that avoids a permissions race. When not opening a file,
3812 use file_directory_p rather than stat.
3813 (dir_warning): First arg is now a usage string, not a format.
3814 Use errno. All uses changed.
3815 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3816 that merely introduced a race.
3817 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3818 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3819 and similarly for the other O_* flags.
3820 * w32.c (sys_faccessat): Rename from sys_access and switch to
3821 faccessat's API. All uses changed.
3822 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3823 (magic_db): Rename from magic_file_p.
3824 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3825 char *, so that we don't have to test for file existence
3826 separately from opening the file for reading. This removes a race
3827 fixes a permission-checking problem, and simplifies the code.
3828 All uses changed.
3829 (file_p): Remove; no longer needed.
3830
3831 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3832
3833 Omit glyphs initialization at startup.
3834 * dispnew.c (glyphs_initialized_initially_p): Remove.
3835 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3836 (Fredraw_frame): Move actual code from here...
3837 (redraw_frame): ...to here. Add eassert. Adjust comment.
3838 (Fredraw_display): Use redraw_frame.
3839 * xdisp.c (clear_garbaged_frames): Likewise.
3840
3841 2012-11-13 Eli Zaretskii <eliz@gnu.org>
3842
3843 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3844 passed to pint2str and pint2hrstr to be at most the size of the
3845 frame's decode_mode_spec_buffer. This avoids crashes with very
3846 large values of FIELD_WIDTH argument to decode_mode_spec.
3847 (Bug#12867)
3848
3849 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3850
3851 Fix a race with verify-visited-file-modtime (Bug#12863).
3852 Since at least 1991 Emacs has ignored an mtime difference of no
3853 more than one second, but my guess is that this was to work around
3854 file system bugs that were fixed long ago. Since the race is
3855 causing problems now, let's remove that code.
3856 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3857 whose time stamp is off by no more than a second. Insist that the
3858 file time stamps match exactly.
3859
3860 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3861
3862 * frame.h (struct frame): Convert external_tool_bar member to
3863 1-bit unsigned bitfield.
3864 * termhooks.h (struct terminal): Remove mouse_moved member since
3865 all users are long dead. Adjust comment on mouse_position_hook.
3866
3867 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3868
3869 Simplify by using FOR_EACH_FRAME here and there.
3870 * frame.c (next_frame, prev_frame, other_visible_frames)
3871 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3872 * w32term.c (x_window_to_scroll_bar): Likewise.
3873 * window.c (window_list): Likewise.
3874 * xdisp.c (x_consider_frame_title): Likewise.
3875 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3876 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3877 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3878 * xmenu.c (menubar_id_to_frame): Likewise.
3879 * xselect.c (frame_for_x_selection): Likewise.
3880 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3881 (x_window_to_menu_bar): Likewise.
3882 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3883
3884 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3885
3886 * data.c (Qdefalias_fset_function): Now static.
3887
3888 Another tweak to vectorlike_header change.
3889 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3890 Remove, and replace all uses with ...
3891 (next_in_free_list, set_next_in_free_list):
3892 New functions, which respect C's aliasing rules better.
3893
3894 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3895
3896 * window.c (list4i): Rename from 'quad'. All uses changed.
3897 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3898
3899 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
3900
3901 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3902 warning about mixing declarations and code in ISO C90.
3903
3904 2012-11-10 Martin Rudalics <rudalics@gmx.at>
3905
3906 * window.c (Fsplit_window_internal): Set combination limit of
3907 new parent window to t iff Vwindow_combination_limit is t;
3908 fixing a regression introduced with the change from 2012-09-22.
3909 (Fset_window_combination_limit): Fix doc-string.
3910
3911 2012-11-10 Eli Zaretskii <eliz@gnu.org>
3912
3913 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3914 amount when the scroll margins are too large. When scrolling
3915 backwards in the buffer, give up if cannot reach point or the
3916 scroll margin within a reasonable number of screen lines.
3917 Fixes point position in window under scroll-up/down-aggressively when
3918 point is positioned many lines beyond the window top/bottom.
3919 (Bug#12811)
3920
3921 * ralloc.c (relinquish): If real_morecore fails to return memory
3922 to the system, don't crash; instead, leave the last heap
3923 unchanged and return. (Bug#12774)
3924
3925 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3926
3927 * lisp.h (AUTOLOADP): New macro.
3928 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3929 * data.c (Ffset): Remove special ad-advice-info handling.
3930 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3931 (Fsubr_arity): CSE.
3932 (Finteractive_form): Simplify.
3933 (Fquo): Don't insist on having at least 2 arguments.
3934 (Qdefalias_fset_function): New var.
3935
3936 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3937
3938 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3939
3940 * nsfont.m (Qcondensed, Qexpanded): New variables.
3941 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3942 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3943
3944 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3945
3946 Fix recently introduced crash on MS-Windows (Bug#12839).
3947 * w32term.h (struct scroll_bar): Use convenient header.
3948 (SCROLL_BAR_VEC_SIZE): Remove.
3949 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3950
3951 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3952
3953 Tweak last vectorlike_header change.
3954 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3955 vectorlike object on the free list. This is introduced to avoid
3956 some (but not all) pointer casting and aliasing problems, see
3957 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3958 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3959 objects.
3960 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3961
3962 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3963
3964 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
3965 been removed, so remove them here also.
3966
3967 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3968
3969 * doc.c (Fdocumentation): Handle new property
3970 dynamic-docstring-function to replace the old ad-advice-info.
3971
3972 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3973
3974 * fns.c (Qeql, hashtest_eq): Now static.
3975
3976 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3977
3978 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3979 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3980 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3981 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3982
3983 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3984
3985 Use same hash function for hashfn_profiler as for hash_string etc.
3986 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3987 * lisp.h (sxhash_combine): New inline function, with the contents
3988 of the old SXHASH_COMBINE.
3989 * profiler.c (hashfn_profiler): Use it, instead of having a
3990 special hash function containing a comparison that always yields 1.
3991
3992 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3993
3994 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3995 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3996 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3997 Remove unused vars.
3998
3999 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4000
4001 * image.c (xpm_make_color_table_h): Fix compiler error because
4002 make_hash_table changed.
4003
4004 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4005
4006 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4007
4008 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4009
4010 Use ad-hoc comparison function for the profiler's hash-tables.
4011 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4012 (make_log): Use them.
4013 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4014 call Fequal any more.
4015 (Ffunction_equal): New function.
4016 (cmpfn_profiler, hashfn_profiler): New functions.
4017 (syms_of_profiler): Initialize them.
4018 * lisp.h (struct hash_table_test): New struct.
4019 (struct Lisp_Hash_Table): Use it.
4020 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4021 * fns.c (make_hash_table): Take a struct to describe the test.
4022 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4023 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4024 (hash_lookup, hash_remove_from_table): Move assertion checking of
4025 hashfn result here. Check hash-equality before calling cmpfn.
4026 (Fmake_hash_table): Adjust call to make_hash_table.
4027 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4028 (syms_of_fns): Initialize them.
4029 * emacs.c (main): Move syms_of_fns earlier.
4030 * xterm.c (syms_of_xterm):
4031 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4032 * print.c (print_object): Adjust to new hash-table struct.
4033 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4034
4035 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4036
4037 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4038 value of w32-scroll-lock-modifier is neither nil nor one of the
4039 known key modifiers. (Bug#12806)
4040
4041 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4042
4043 Shrink struct vectorlike_header to the only size field.
4044 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4045 Adjust comment.
4046 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4047 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4048 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4049 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4050 information from the vector header. Adjust comment.
4051 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4052 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4053 layout.
4054 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4055 (struct vectorlike_header): Remove next member. Adjust comment.
4056 (struct Lisp_Subr): Add convenient header. Adjust comment.
4057 (allocate_pseudovector): Adjust prototype.
4058 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4059 (sweep_string, lisp_malloc): Remove useless prototypes.
4060 (enum mem_type): Adjust comment.
4061 (NEXT_IN_FREE_LIST): New macro.
4062 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4063 (Fmake_bool_vector): Likewise.
4064 (struct large_vector): New type to represent allocation unit for
4065 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4066 (large_vectors): Change type to struct large_vector.
4067 (allocate_vector_from_block): Simplify.
4068 (PSEUDOVECTOR_NBYTES): Replace with...
4069 (vector_nbytes): ...new function. Adjust users.
4070 (sweep_vectors): Adjust processing of large vectors.
4071 (allocate_vectorlike): Likewise.
4072 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4073 Add easserts. Adjust XSETPVECTYPESIZE usage.
4074 (allocate_buffer): Use BUFFER_PVEC_INIT.
4075 (live_vector_p): Adjust to match large vector.
4076 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4077 * buffer.h (struct buffer): Add next member.
4078 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4079 New macros.
4080 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4081 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4082 (copy_hash_table): Adjust to match vector header change.
4083 * lread.c (defsubr): Use XSETPVECTYPE.
4084 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4085 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4086 (xvecsize): New command.
4087
4088 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4089
4090 * keyboard.c (event_to_kboard): Do not dereference
4091 frame_or_window field of SELECTION_REQUEST_EVENT
4092 and SELECTION_CLEAR_EVENT events (Bug#12814).
4093 * xterm.h (struct selection_input_event): Adjust comment.
4094
4095 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4096
4097 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4098 such as Scroll Lock, if the respective keys are treated as
4099 function keys, not as modifiers. This avoids destroying non-ASCII
4100 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4101
4102 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4103
4104 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4105
4106 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4107
4108 Restore some duplicate definitions (Bug#12814).
4109 This undoes part of the 2012-11-03 changes. Some people build
4110 with plain -g rather than with -g3, and they need the duplicate
4111 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4112 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4113 Define as macros, as well as as enums or as constants.
4114
4115 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4116
4117 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4118 to keypad keys (Bug#12816).
4119
4120 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4121
4122 Minor adjustments of recently-changed frame functions.
4123 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4124 known to be a frame (we're in the FRAMEP branch).
4125 * lisp.h (Qframep): Remove decl. frame.h declares this.
4126 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4127 since they're meant for Lisp fixnum values.
4128
4129 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4130
4131 * window.c (Fwindow_combination_limit): Revert to the only
4132 required argument and adjust docstring as suggested in
4133 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4134 by Martin Rudalics <rudalics@gmx.at>.
4135
4136 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4137
4138 Widely used frame validity and checking functions.
4139 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4140 * frame.c (decode_live_frame, decode_any_frame): New functions.
4141 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4142 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4143 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4144 (Fframe_pointer_visible_p): Use decode_any_frame.
4145 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4146 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4147 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4148 (Fframe_focus): Likewise. Allow zero number of arguments.
4149 Adjust docstring.
4150 (frame_buffer_list, frame_buffer_predicate): Remove.
4151 * lisp.h (frame_buffer_predicate): Remove prototype.
4152 * buffer.c (Fother_buffer): Use decode_any_frame.
4153 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4154 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4155 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4156 (Fclose_font, Ffont_info): Use decode_live_frame.
4157 * fontset.c (check_fontset_name): Likewise.
4158 * terminal.c (Fframe_terminal): Likewise.
4159 * w32fns.c (check_x_frame): Likewise.
4160 * window.c (Fminibuffer_window, Fwindow_at)
4161 (Fcurrent_window_configuration): Likewise.
4162 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4163 Likewise. Allow zero number of arguments. Adjust docstring.
4164 * dispnew.c (Fredraw_frame): Likewise.
4165 * xfaces.c (frame_or_selected_frame): Remove.
4166 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4167 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4168 (Fframe_face_alist): Use decode_live_frame.
4169 * xfns.c (check_x_frame): Likewise.
4170
4171 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4172
4173 * window.c (quad): New function.
4174 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4175 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4176 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4177 (Fwindow_line_height): Use it.
4178 (Fwindow_fringes): Use list3.
4179 (Fwindow_scroll_bars): Use list4.
4180 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4181 (Fwindow_combination_limit): Allow zero number of arguments.
4182
4183 2012-11-05 Eli Zaretskii <eliz@gnu.org>
4184
4185 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4186
4187 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
4188 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
4189 file descriptor 2 for standard error. (Bug#12805)
4190
4191 2012-11-05 Chong Yidong <cyd@gnu.org>
4192
4193 * process.c (wait_reading_process_output): Revert previous change.
4194
4195 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4196
4197 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4198 This removes code that has been obsolete since around 1990.
4199 * callproc.c (Fcall_process):
4200 * emacs.c (main):
4201 * process.c (create_process):
4202 * term.c (dissociate_if_controlling_tty):
4203 Assume setsid exists.
4204 * callproc.c (child_setup): Assume setpgid exists and behaves as
4205 per POSIX.1-1988 or later.
4206 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4207 * emacs.c (shut_down_emacs):
4208 * sysdep.c (sys_suspend, init_foreground_group):
4209 Assume getpgrp behaves as per POSIX.1-1998 or later.
4210 * msdos.c (setpgrp): Remove.
4211 (tcgetpgrp, setpgid, setsid): New functions.
4212 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4213 * term.c (no_controlling_tty): Remove; unused.
4214 * w32proc.c (setpgrp): Remove.
4215 (setsid, tcgetpgrp): New functions.
4216
4217 Simplify by assuming __fpending.
4218 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4219 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4220 Do not assume that __fpending's result fits in int.
4221
4222 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4223
4224 Remove EMACS_OUTQSIZE+sleep hack.
4225 * dispnew.c (update_frame_1): Remove hack for terminals slower
4226 than 2400 bps, which throttled Emacs by having it sleep.
4227 This code hasn't worked since at least 2007, when the multi-tty stuff
4228 was added, and anyway those old terminals are long dead.
4229 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4230 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4231
4232 Fix data-loss with --version (Bug#9574).
4233 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4234 as we can't assume that emacs_strerror is initialized, and strerror
4235 is good enough here.
4236 (main): Invoke atexit earlier, to catch earlier instances of
4237 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4238
4239 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4240
4241 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4242 (keyDown): Remap keypad keys to X11 virtual key codes.
4243
4244 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4245
4246 Fix data-loss with --batch (Bug#9574).
4247 * emacs.c: Include <close-stream.h>.
4248 (close_output_streams): New function.
4249 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4250 and handles errors appropriately.
4251 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4252 does that now.
4253
4254 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4255 The symptom is a diagnostic "GLib-WARNING **: In call to
4256 g_spawn_sync(), exit status of a child process was requested but
4257 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4258 waitpid(), so exit status can't be returned." The diagnostic
4259 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4260 The real bug is a race condition between Emacs and glib: Emacs
4261 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4262 so that glib can't find it. Work around the bug by invoking
4263 waitpid only on subprocesses that Emacs itself creates.
4264 * process.c (create_process, record_child_status_change):
4265 Don't use special value -1 in pid field, as the caller now must
4266 know the pid rather than having the callee infer it.
4267 The inference was sometimes incorrect anyway, due to another race.
4268 (create_process): Set new 'alive' member if child is created.
4269 (process_status_retrieved): New function.
4270 (record_child_status_change): Use it.
4271 Accept negative 1st argument, which means to wait for the
4272 processes that Emacs already knows about. Move special-case code
4273 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4274 processes that have already been waited for, by testing and
4275 clearing new 'alive' member.
4276 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4277 now does this internally.
4278 (handle_child_signal): Let record_child_status_change do all
4279 the work, since we do not want to reap all exited child processes,
4280 only the child processes that Emacs itself created.
4281 * process.h (Lisp_Process): New boolean member 'alive'.
4282
4283 Omit duplicate definitions no longer needed with gcc -g3.
4284 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4285 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4286 Define only as macros. There's no longer any need to also define
4287 these symbols as enums or as constants, since we now assume
4288 gcc -g3 when debugging.
4289
4290 2012-11-03 Eli Zaretskii <eliz@gnu.org>
4291
4292 * lisp.mk: Adjust comments to the fact that term/internal is now
4293 loaded from loadup.el.
4294
4295 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4296 (msdos_fatal_signal): New function.
4297 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4298 its argument list.
4299
4300 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4301 for GCC versions before 4.
4302 (emacs_raise): Define to call msdos_fatal_signal.
4303
4304 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4305 iterator when starting in the middle of a display or overlay
4306 string. (Bug#12745)
4307
4308 2012-11-03 Chong Yidong <cyd@gnu.org>
4309
4310 * process.c (wait_reading_process_output): Clean up the last
4311 change.
4312
4313 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4314
4315 * process.c (wait_reading_process_output): Avoid a race condition
4316 with SIGIO delivery (Bug#11536).
4317
4318 2012-11-03 Chong Yidong <cyd@gnu.org>
4319
4320 * buffer.c (cursor_type): Untabify docstring.
4321
4322 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4323
4324 * frame.h (struct frame): Drop can_have_scroll_bars member
4325 which is meaningless for a long time. Adjust comments.
4326 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4327 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4328
4329 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4330
4331 * window.c (decode_next_window_args): Update window arg after
4332 calling decode_live_window and so fix crash reported at
4333 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4334 by Juanma Barranquero <lekktu@gmail.com>.
4335 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4336 * font.c (Ffont_at): Likewise.
4337
4338 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4339
4340 * widget.c (resize_cb): New function.
4341 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4342 (EmacsFrameResize): Check if all is up to date before changing frame
4343 size.
4344
4345 2012-11-02 Eli Zaretskii <eliz@gnu.org>
4346
4347 Implement backtrace output for fatal errors on MS-Windows.
4348 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4349 (BACKTRACE_LIMIT_MAX): New macro.
4350 (w32_backtrace): New function.
4351 (emacs_abort): Use w32_backtrace when the user chooses not to
4352 attach a debugger. Update the text of the abort dialog.
4353
4354 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4355
4356 Window-related stuff cleanup here and there.
4357 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4358 Use decode_any_window.
4359 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4360 * xdisp.c (Fformat_mode_line): Likewise.
4361 * font.c (Ffont_at): Use decode_live_window.
4362 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4363 * window.c (decode_next_window_args): Likewise.
4364 (decode_any_window): Remove static.
4365 * window.h (decode_any_window): Add prototype.
4366 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4367 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4368 respectively.
4369
4370 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4371
4372 Remove pad from struct input_event.
4373 * termhooks.h (struct input_event): Remove padding field.
4374 Adjust comment.
4375 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4376 member is never cons for a long time. Adjust comment.
4377 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4378 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4379 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4380 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4381
4382 2012-11-01 Eli Zaretskii <eliz@gnu.org>
4383
4384 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4385
4386 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4387
4388 Fix crash when using Emacs as commit editor for git (Bug#12697).
4389 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4390 and it is configured in conf_post.h.
4391 (Fcall_process): Don't invoke both setsid and setpgid; the former
4392 is enough, if it exists.
4393 * callproc.c (Fcall_process, child_setup):
4394 * process.c (create_process): Use setpgid.
4395 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4396 for the real thing.
4397 * dispnew.c (init_display): Initialize the foreground group
4398 if we are running a tty display.
4399 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4400 * lisp.h (init_foreground_group): New decl.
4401 * sysdep.c (inherited_pgroup): New static var.
4402 (init_foreground_group, tcsetpgrp_without_stopping)
4403 (narrow_foreground_group, widen_foreground_group): New functions.
4404 (init_sys_modes): Narrow foreground group.
4405 (reset_sys_modes): Widen foreground group.
4406
4407 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
4408
4409 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4410
4411 2012-10-31 Martin Rudalics <rudalics@gmx.at>
4412
4413 * minibuf.c (read_minibuf): Restore current buffer since
4414 choose_minibuf_frame calling Fset_frame_selected_window may
4415 change it (Bug#12766).
4416
4417 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4418
4419 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4420
4421 2012-10-30 Kenichi Handa <handa@gnu.org>
4422
4423 * font.c (Ffont_at): If WINDOW is specified and it is not
4424 displaying the current buffer, signal an error.
4425
4426 2012-10-29 Daniel Colascione <dancol@dancol.org>
4427
4428 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4429 In preparation for fixing bug#12739, move these functions from
4430 here...
4431
4432 * coding.h, coding.c: ... to here, and compile them only when
4433 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4434 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
4435
4436 2012-10-28 Eli Zaretskii <eliz@gnu.org>
4437
4438 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4439 (timer_loop, getitimer, setitimer): Use it instead of
4440 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4441 'clock'.
4442 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4443 literal 10000.
4444
4445 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4446
4447 * nsterm.m (NO_APPDEFINED_DATA): New define.
4448 (last_appdefined_event_data): New variable
4449 (last_appdefined_event): Remove.
4450 (ns_select): Initialize t from last_appdefined_event_data instead
4451 of [last_appdefined_event data1].
4452 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4453 remove last_appdefined_event (Bug#12698).
4454
4455 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4456
4457 * frame.c (x_set_font): Catch internal error.
4458
4459 2012-10-27 Eli Zaretskii <eliz@gnu.org>
4460
4461 Avoid overflow in w32 implementation of interval timers.
4462 When possible, for ITIMER_PROF count only times the main thread
4463 actually executes.
4464 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
4465 'volatile ULONGLONG' types. All the other data which was
4466 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
4467 (GetThreadTimes_Proc): New typedef.
4468 (w32_get_timer_time): New function, returns a suitable time value
4469 for the timer.
4470 (timer_loop): Enter critical section when accessing ULONGLONG
4471 values of the itimer_data struct, as these accesses are no longer
4472 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4473 Remove unused variable.
4474 (init_timers): Initialize s_pfn_Get_Thread_Times.
4475 (start_timer_thread): Don't assign itimer->caller_thread here.
4476 (getitimer): Assign itimer->caller_thread here.
4477 (setitimer): Always call getitimer to get the value of ticks_now.
4478 (sys_spawnve): Avoid compiler warning about format mismatch.
4479
4480 2012-10-26 Eli Zaretskii <eliz@gnu.org>
4481
4482 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4483 mouse movement events if the menu bar is active. This avoids
4484 producing a busy "hour-glass" cursor by Windows if the mouse
4485 pointer is positioned over a tooltip shown for some menu item.
4486
4487 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4488
4489 Don't assume process IDs fit in int.
4490 * emacs.c (shut_down_emacs) [!DOS_NT]:
4491 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4492 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4493 Use pid_t, not int, to store process IDs, as 'int'
4494 is not wide enough on a few platforms (e.g., AIX and IRIX).
4495
4496 2012-10-23 Kenichi Handa <handa@gnu.org>
4497
4498 The following change is to make face-font-rescale-alist work
4499 correctly for non-ASCII fonts.
4500
4501 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4502 (font_open_for_lface): Handle Vface_font_rescale_alist.
4503
4504 2012-10-23 Chong Yidong <cyd@gnu.org>
4505
4506 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4507
4508 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4509
4510 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4511 for screen font.
4512 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4513
4514 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4515 event (Bug#12681).
4516
4517 2012-10-21 Glenn Morris <rgm@gnu.org>
4518
4519 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4520
4521 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4522
4523 Port to OpenBSD 5.1.
4524 * frame.c (Fmouse_position, Fmouse_pixel_position):
4525 * xdisp.c (produce_stretch_glyph):
4526 Declare local vars only when they're needed.
4527 This is clearer and avoids a warning on OpenBSD about unused vars.
4528 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4529 This is safer, and avoids OpenBSD warnings about unused vars.
4530 * keyboard.c (record_menu_key): Remove unnecessary decl.
4531 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4532 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4533 as our definition clashes with OpenBSD's.
4534 * xfaces.c (load_face_colors, check_lface_attrs)
4535 (get_lface_attributes_no_remap, get_lface_attributes)
4536 (lface_fully_specified_p, x_supports_face_attributes_p)
4537 (tty_supports_face_attributes_p, face_fontset, realize_face)
4538 (realize_x_face, realize_tty_face):
4539 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4540 merely Lisp_Object *. This is more informative and avoids
4541 a warning on OpenBSD about accessing beyond an object's size.
4542
4543 2012-10-20 Chong Yidong <cyd@gnu.org>
4544
4545 * lread.c (Fload): Doc fix (Bug#12592).
4546
4547 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4548
4549 * font.c (Ffont_at): Fix previous change.
4550
4551 2012-10-19 Eli Zaretskii <eliz@gnu.org>
4552
4553 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4554 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
4555 for the reasons.
4556
4557 * alloc.c (NSTATICS): Decrease to 0x800.
4558
4559 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4560
4561 * fns.c (Fnreverse): Include the problem element when signaling an
4562 error (bug#12677).
4563
4564 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4565
4566 * nsterm.m (ns_select): Check writefds before call to
4567 FD_ISSET (Bug#12668).
4568
4569 2012-10-18 Daniel Colascione <dancol@dancol.org>
4570
4571 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4572 (staticpro): If we run out of staticpro slots, die with an
4573 informative error instead of just calling emacs_abort.
4574
4575 2012-10-18 Martin Rudalics <rudalics@gmx.at>
4576
4577 Fix two flaws reported by Dmitry Antipov.
4578 * window.c (Ftemp_output_buffer_show): Remove.
4579 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4580 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4581
4582 2012-10-17 Eli Zaretskii <eliz@gnu.org>
4583
4584 * makefile.w32-in ($(BLD)/w32.$(O)):
4585 ($(BLD)/vm-limit.$(O)):
4586 ($(BLD)/term.$(O)):
4587 ($(BLD)/unexw32.$(O)):
4588 ($(BLD)/fileio.$(O)):
4589 ($(BLD)/dispnew.$(O)): Update dependencies.
4590
4591 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4592 Add prototypes.
4593
4594 * w32proc.c: Include ctype.h.
4595
4596 * w32.h (init_environment, check_windows_init_file)
4597 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4598 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4599 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4600 (sys_link): Add prototypes.
4601
4602 * w32.c: Include w32select.h.
4603 (sys_access, e_malloc, sys_select): Add prototypes.
4604 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4605
4606 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4607
4608 * unexw32.c: Include lisp.h and w32.h.
4609
4610 * term.c [WINDOWSNT]: Include w32term.h.
4611
4612 * process.c [WINDOWSNT]: Add prototype of sys_select.
4613
4614 * fileio.c [WINDOWSNT]: Include w32.h.
4615
4616 * dispnew.c [WINDOWSNT]: Include w32.h.
4617
4618 * cygw32.c (Fcygwin_convert_path_to_windows)
4619 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4620 Lisp_Object values. (Bug#12661)
4621
4622 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4623 to Lisp_Object. (Bug#12661)
4624
4625 2012-10-17 Kenichi Handa <handa@gnu.org>
4626
4627 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4628 invalidate.
4629
4630 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4631
4632 * buffer.c (Fkill_buffer): When unchaining the marker,
4633 reset its buffer pointer to NULL (Bug#12652).
4634
4635 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4636
4637 Do not verify indirection counters of killed buffers (Bug#12579).
4638 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4639 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4640
4641 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4642
4643 * alloc.c (Fmake_byte_code): Fix typo in comment.
4644 * print.c (print_interval): Define as static to match prototype.
4645 * indent.c (disptab_matches_widthtab, recompute_width_table):
4646 Convert to eassert.
4647
4648 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4649
4650 * editfns.c (get_system_name): Remove.
4651 * lisp.h (get_system_name): Remove prototype.
4652 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4653 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4654
4655 2012-10-15 Daniel Colascione <dancol@dancol.org>
4656
4657 * dbusbind.c: Add comment explaining reason for previous change.
4658
4659 2012-10-15 Martin Rudalics <rudalics@gmx.at>
4660
4661 * window.c (Fwindow_end): Rewrite check whether cached position
4662 can be used (Bug#12600).
4663 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4664 Set windows_or_buffers_changed.
4665
4666 2012-10-15 Daniel Colascione <dancol@dancol.org>
4667
4668 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4669 enabled by undefining the symbol "interface", which the platform
4670 headers define to something incompatible.
4671
4672 2012-10-14 Daniel Colascione <dancol@dancol.org>
4673
4674 * image.c (init_tiff_functions, init_imagemagick_functions)
4675 (init_svg_functions): Fix cygw32 build break by using these
4676 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4677
4678 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4679
4680 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4681
4682 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4683
4684 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4685
4686 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4687
4688 * coding.c (detect_coding): Set coding->id before calling
4689 this->detector.
4690
4691 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4692
4693 * fileio.c: Formatting fixes.
4694
4695 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4696
4697 Fix some stat-related races.
4698 * fileio.c (Fwrite_region): Avoid race condition if a file is
4699 removed or renamed by some other process immediately after Emacs
4700 writes it but before Emacs stats it. Do not assume that stat (or
4701 fstat) succeeds.
4702 * image.c (slurp_file): Resolve the file name with fopen + fstat
4703 rather than stat + fopen.
4704 (pbm_read_file) [0]: Remove unused code with stat race.
4705 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4706 Remove ineffective code with stat race.
4707
4708 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4709
4710 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4711
4712 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4713
4714 * nsterm.m (hold_event_q): New static variable.
4715 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4716 ! q_event_ptr.
4717 (hold_event): New function.
4718 (ns_read_socket): If hold_event_q have events, store them and
4719 return (Bug#12384).
4720 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4721 is zero (Bug#12384).
4722
4723 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
4724
4725 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4726
4727 2012-10-12 Eli Zaretskii <eliz@gnu.org>
4728
4729 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4730
4731 * fileio.c (check_existing): New function.
4732 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4733 instead of calling 'stat', when what's needed is to check whether
4734 a file exists. This avoids expensive system calls on MS-Windows.
4735 (Bug#12587)
4736
4737 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
4738
4739 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4740 determine whether a file exists and is not a directory.
4741
4742 * lisp.h (check_existing): Add prototype.
4743
4744 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4745
4746 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4747
4748 2012-10-12 Glenn Morris <rgm@gnu.org>
4749
4750 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4751
4752 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4753
4754 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4755
4756 * eval.c (Fautoload): Remember previous autoload status in load-history.
4757
4758 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4759
4760 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4761 * lread.c (load_each_byte, new_backquote_flag, readchar)
4762 (read_filtered_event, lisp_file_lexically_bound_p)
4763 (safe_to_load_version, Fload, complete_filename_p, openp)
4764 (build_load_history, readevalloop, read_escape, read1)
4765 (string_to_number, read_vector, read_list):
4766 * macros.c (Fstart_kbd_macro):
4767 * marker.c (CONSIDER):
4768 * menu.c (parse_single_submenu, digest_single_submenu)
4769 (find_and_return_menu_selection, Fx_popup_menu):
4770 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4771 (Ftry_completion):
4772 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4773 (ns_menu_show):
4774 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4775 (xmenu_show, xdialog_show):
4776 Use bool for booleans.
4777 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4778 as it's not a predicate. All uses changed. Omit unnecessary
4779 buffer termination.
4780
4781 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4782
4783 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4784 (save_excursion_restore): Do not restore mark if it was not saved.
4785
4786 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4787
4788 * marker.c (cached_modiff): EMACS_INT, not int.
4789
4790 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4791 instead of having a wrong decl.
4792 * nsmenu.m (waiting_for_input): Remove wrong decl.
4793
4794 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4795
4796 keyboard.c, keymap.c: Use bool for booleans.
4797 * dispnew.c (sit_for): Distinguish between 3-way display_option
4798 and boolean do_display.
4799 * keyboard.c (single_kboard, this_command_key_count_reset)
4800 (waiting_for_input, echoing, immediate_quit, input_pending)
4801 (interrupt_input, interrupts_deferred, pop_kboard)
4802 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4803 (command_loop_1, adjust_point_for_property)
4804 (safe_run_hooks_error, input_polling_used, read_char):
4805 (help_char_p, readable_events, kbd_buffer_events_waiting)
4806 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4807 (lucid_event_type_list_p, get_input_pending):
4808 (gobble_input, menu_separator_name_p, menu_bar_item)
4809 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4810 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4811 (keyremap_step, test_undefined, read_key_sequence)
4812 (detect_input_pending, detect_input_pending_ignore_squeezables)
4813 (detect_input_pending_run_timers, requeued_events_pending_p)
4814 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4815 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4816 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4817 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4818 (accessible_keymaps_1, Fkey_description, push_key_description):
4819 (shadow_lookup, struct where_is_internal_data)
4820 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4821 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4822 (describe_map, describe_vector):
4823 * menu.c (single_menu_item):
4824 * nsmenu.m (ns_update_menubar):
4825 * process.c (wait_reading_process_output):
4826 * search.c (scan_buffer, scan_newline):
4827 Use bool for boolean.
4828 * keyboard.c (timers_run, swallow_events)
4829 (detect_input_pending_run_timers):
4830 * process.c (wait_reading_process_output):
4831 Use unsigned for counter where wraparound-on-overflow is desired,
4832 since unsigned is guaranteed to have that behavior and signed is not.
4833 (read_char): Use ptrdiff_t for string length.
4834 (get_input_pending): Remove first argument, since it was always
4835 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4836 and behave as if it had that value. Return new value of
4837 input_pending. All callers changed.
4838 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4839 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4840 a string length.
4841 * keymap.c (push_key_description): Omit last arg, which was always 1.
4842 All callers changed.
4843
4844 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4845
4846 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
4847
4848 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4849 ($(BLD)/term.$(O)): Update dependencies.
4850
4851 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4852
4853 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4854 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4855 initializer for PVEC_NORMAL_VECTOR.
4856
4857 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4858
4859 Clean out old termopts cruft.
4860 * termopts.h (flow_control, meta_key): Remove unused decls.
4861 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4862 Don't include termopts.h.
4863
4864 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4865
4866 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4867
4868 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4869
4870 * commands.h (immediate_quit): Remove duplicate decl.
4871
4872 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4873
4874 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4875 caching.
4876 (nsfont_open): Remove setting of Vfonts_in_cache.
4877 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
4878
4879 2012-10-09 Eli Zaretskii <eliz@gnu.org>
4880
4881 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4882 match what GetLastError returns. Explain why the function is
4883 needed.
4884
4885 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4886 'is_tooltip_frame', to avoid confusion with its global namesake.
4887
4888 2012-10-08 Daniel Colascione <dancol@dancol.org>
4889
4890 * xdisp.c (start_hourglass): Call w32_note_current_window when
4891 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4892 build that caused Emacs to display the hourglass cursor forever.
4893
4894 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4895 which is broken under remote desktop, calculate the number of
4896 colors available for a display based on the display's number of
4897 planes and number of bits per pixel per plane. (bug#10397).
4898
4899 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
4900
4901 * nsfont.m (Vfonts_in_cache): New variable.
4902 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4903 are used. Add cached fonts to Vfonts_in_cache.
4904 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4905
4906 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
4907
4908 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4909 in nt/config.nt.
4910 (FONT_H): Define after FRAME_H.
4911 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4912 Update dependencies.
4913
4914 * w32term.c: Remove leftover declaration of keyboard_codepage.
4915
4916 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4917
4918 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4919 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4920 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4921 (GLOBAL_SOURCES): Add cygw32.c.
4922 ($(BLD)/unexw32.$(O)):
4923 ($(BLD)/w32.$(O)):
4924 ($(BLD)/w32console.$(O)):
4925 ($(BLD)/w32fns.$(O)):
4926 ($(BLD)/w32heap.$(O)):
4927 ($(BLD)/w32menu.$(O)):
4928 ($(BLD)/w32proc.$(O)): Add w32common.h.
4929
4930 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4931 'const char *'.
4932 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4933
4934 2012-10-08 Daniel Colascione <dancol@dancol.org>
4935
4936 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4937 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4938 accidental message numbering hole. Change other messages to
4939 match.
4940
4941 * w32select.h (HAVE_W32SELECT): Remove.
4942
4943 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
4944 w32common.h instead of w32heap.h.
4945
4946 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4947 (get_allocation_unit, get_processor_type, get_w32_major_version)
4948 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4949 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4950 (OS_NT, os_subtype, cache_system_info): Move declarations to
4951 w32common.
4952
4953 * w32heap.c: Include w32common.h.
4954 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
4955 (w32_minor_version, w32_build_number, w32_subtype):
4956 Remove duplicate definitions.
4957
4958 * w32fns.c: Include w32common.h; include w32heap.h only in
4959 WINDOWSNT.
4960
4961 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4962 Use `report_file_error' instead of `error' in order to better
4963 inform users of what went wrong. Increase NTGUI_UNICODE file
4964 dialog box file name length to 32k, the maximum allowed by the NT
4965 kernel.
4966
4967 * w32common.h: New file.
4968 (ROUND_UP, ROUND_DOWN, get_page_size)
4969 (get_allocation_unit, get_processor_type, get_w32_major_version)
4970 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4971 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4972 (OS_NT, os_subtype, cache_system_info): Move here.
4973
4974 * unexw32.c, unexcw.c: Include w32common.h.
4975
4976 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4977 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4978 to call syms_of_w32select.
4979
4980 * cygw32.h: Remove obsolete EXFUN declarations.
4981
4982 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4983
4984 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4985 of w32inevt.o from SOME_MACHINE_OBJECTS.
4986
4987 2012-10-08 Daniel Colascione <dancol@dancol.org>
4988
4989 * image.c: Permanent fix for JPEG compilation issue --- limit
4990 jpeglib `boolean' redefinition to Cygwin builds.
4991
4992 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4993
4994 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4995
4996 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4997 Cygwin.
4998
4999 2012-10-08 Daniel Colascione <dancol@dancol.org>
5000
5001 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5002 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5003 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5004 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5005 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5006 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5007 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5008 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5009 now a supported configuration.
5010
5011 * Makefile.in: consolidate image variables into LIBIMAGE; add
5012 W32_OBJ and W32_LIBS. Compile new files.
5013
5014 * conf_post.h:
5015 (_DebPrint) declare tracing facility for W32 debugging. We need
5016 to unify tracing later.
5017
5018 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5019 unconditional use of W32 Unicode functions. Cygwin runs only on
5020 100% Unicode operating systems.
5021
5022 * cygw32.c: New file. Define Cygwin-specific facilities.
5023 (Fcygwin_convert_path_to_windows)
5024 (Fcygwin_convert_path_from_windows): New user functions for
5025 accessing Cygwin path-munging routines.
5026
5027 * cygw32.h: New file.
5028 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5029 UTF-16LE strings temporarily inside non-Lisp-visible string
5030 objects.
5031
5032 (w32_strerror): Just what it says on the tin.
5033
5034 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5035 also run for Cygwin; both systems have the same problem with using
5036 GUI facilities in a forked child. Also call syms_of_cygw32,
5037 syms_of_w32select in correct places.
5038
5039 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5040 needs fork-then-exec for daemon launching.
5041
5042 * font.h: Include frame.h.
5043
5044 * image.c: Use the image library cache machinery only when we're
5045 compiling for native WINDOWSNT; Cygwin can use shared libraries
5046 like any other Unixlike system.
5047
5048 * keyboard.c: Clarify a comment regarding the input loop.
5049
5050 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5051 functions directly instead of trying to detect at runtime that our
5052 host operating system supports them. We make this change for two
5053 reasons: Cygwin lacks support for the multibyte character
5054 conversion functions used by the legacy menu code, and Cygwin
5055 never needs to rely on non-Unicode APIs.
5056
5057 * unexw32.c (hinst): Declare extern.
5058
5059 * w32.c: Change header order;
5060 (w32_strerror): Move to w32fns.c because we need it for
5061 non-WINDOWSNT builds.
5062
5063 * w32.h: Add #error macro to make sure we don't include w32.h for
5064 Cygwin builds. Remove w32select declarations.
5065
5066 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5067 w32fns.c. w32console.c is WINDOWSNT-only.
5068
5069 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5070 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5071 POSIXy alternative.
5072 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5073 (w32_major_version, w32_minor_version, w32_build_number)
5074 (os_subtype, sound_type): Define here
5075 (w32_defined_color): Make color parameter const for consistency
5076 with other _defined_color functions.
5077 (w32_createwindow): Unconditionally call w32_init_class instead of
5078 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5079 through the code is complex and unnecessary because class
5080 registration is practically free.
5081 (w32_name_of_message): New EMACSDEBUG-only function.
5082 (Fset_message_beep): Move here
5083 (Fx_open_connection): Require that the display name for Windows be
5084 "w32" for consistency, emacsclient disambiguation, and maybe, one
5085 day, multi-window-system support.
5086 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5087 Cygwin files for W32 GUI facilities, since these clearly don't
5088 expect Cygwin names.
5089 (_DebPrint): Define.
5090 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5091 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5092 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5093 (w32_last_error): Remove.
5094
5095 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5096
5097 * w32heap.c (syspage_mask): Declare here.
5098 (cache_system_info): Remove.
5099
5100 * w32inevt.c (faked_key): Define globally, not statically.
5101 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5102 (w32_console_toggle_lock_key): Move to w32fns.c.
5103
5104 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5105
5106 * w32proc.c (_DebPrint): Move to w32fns.c.
5107 * w32select.c: Include string.h, stdio.h for Cygwin.
5108 * w32select.h: New File.
5109
5110 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5111 get_osfhandle.
5112 (w32_message_fd): New variable. Under Cygwin, holds the file
5113 descriptor the system used to tell us about pending thread
5114 messages.
5115
5116 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5117 that prevented compilation under non-WINDOWSNT systems.
5118
5119 (w32_initialize): Open /dev/windows and assign it to
5120 w32_message_fd. Provide w32 feature.
5121
5122 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5123 (WM_EMACS_INPUT_READY): add.
5124 (prepend_msg, w32_message_fd): Declare globally.
5125
5126 * w32xfns.c:
5127 (keyboard_handle): Use only when WINDOWSNT.
5128 (notify_msg_ready): New function. Posts a message to the main
5129 thread's message queue under CYGWIN, which wakes up the main
5130 thread from select(2) by making the /dev/windows file descriptor
5131 ready. Under WINDOWSNT, it sets an event the same way the old
5132 code did.
5133
5134 (post, prepend_msg): Actually call notify_msg_ready instead of
5135 setting the input event directly.
5136
5137 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5138
5139 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5140 but it still has blocs in it, don't return it to the system,
5141 instead of aborting. (Bug#12402)
5142
5143 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5144
5145 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5146
5147 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5148 MAC_OS_X_VERSION_10_6.
5149 (syms_of_nsterm): Remove comment about Panther and above for
5150 ns-antialias-text.
5151 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5152 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5153 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5154
5155 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5156 MAC_OS_X_VERSION_10_4.
5157
5158 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5159 MAC_OS_X_VERSION_10_2.
5160
5161 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5162
5163 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5164 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5165
5166 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5167 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
5168 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5169 Remove ns_in_resize check.
5170 (ns_clear_frame_area): Remove resize handle code.
5171
5172 * nsfns.m (ns_in_resize): Remove.
5173 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5174 Remove ns_in_resize check.
5175
5176 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5177
5178 Improve sys_siglist detection.
5179 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5180 defined as a macro, as is done in Solaris.
5181 (sys_siglist_entries): New macro.
5182 (save_strsignal): Use it.
5183 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5184 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5185
5186 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5187
5188 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5189 fullscreen/Fullscreen.
5190
5191 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5192 tobar_height is new.
5193
5194 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5195 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5196 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5197 (windowDidResize:): Check for correct window if old style fullscreen.
5198 Capitalize word in comment. Remove incorrect comment.
5199 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5200 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5201 error in drawing background.
5202 (toggleFullScreen:): Remove comment. Rearrange calls.
5203 Set toolbar values to zero, save old height in tobar_height.
5204 Restore tool bar height when leaving fullscreen.
5205 (canBecomeMainWindow): New function.
5206
5207 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5208
5209 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5210
5211 2012-10-05 Eli Zaretskii <eliz@gnu.org>
5212
5213 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5214
5215 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
5216 that time stamps of directories could also be changed.
5217 Don't request the too broad GENERIC_WRITE, only the more restrictive
5218 FILE_WRITE_ATTRIBUTES access rights.
5219
5220 * fileio.c (Fset_file_times): Special-case ignoring errors for
5221 directories only on MSDOS, not on MS-Windows.
5222
5223 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
5224
5225 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5226
5227 2012-10-04 Eli Zaretskii <eliz@gnu.org>
5228
5229 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5230 see whether CreateFile failed.
5231
5232 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5233
5234 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5235 to avoid similar races.
5236 * keyboard.c (pending_signals): Now bool, not int.
5237
5238 Port timers to OpenBSD, plus check for timer failures.
5239 OpenBSD problem reported by Han Boetes.
5240 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5241 and/or setitimer.
5242 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5243 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5244 like OpenBSD, which has timer_settime but does not declare it.
5245 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5246 whether to use itimerspec-related primitives. All uses of
5247 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5248
5249 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5250
5251 * profiler.c (handle_profiler_signal): Fix a malloc race
5252 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5253
5254 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5255
5256 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5257
5258 2012-10-02 Eli Zaretskii <eliz@gnu.org>
5259
5260 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5261 consistent with the change in return value of 'safe_strsignal'.
5262
5263 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5264
5265 Prefer plain 'static' to 'static inline' (Bug#12541).
5266 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5267 (bidi_set_sor_type, bidi_push_embedding_level)
5268 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5269 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5270 (bidi_cache_search, bidi_cache_ensure_space)
5271 (bidi_cache_iterator_state, bidi_cache_find)
5272 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5273 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5274 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5275 Now 'static', not 'static inline'.
5276
5277 Count overruns when profiling; change units to ns.
5278 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5279 Give extra weight to samples after overruns, to attempt to count
5280 the time more accurately.
5281 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5282 the underlying primitives nominally do ns.
5283 (Fprofiler_cpu_start): Document the change. Mention that
5284 the sampling intervals are only approximate.
5285
5286 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5287
5288 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5289
5290 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5291 case for the special 0 coding-system.
5292
5293 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5294 (Fmake_overlay): Remove redundant tests.
5295 (fix_start_end_in_overlays): Remove redundant recentering.
5296
5297 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
5298
5299 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5300 Update dependencies.
5301
5302 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5303
5304 Fix a malloc race condition involving strsignal.
5305 A signal can arrive in the middle of a malloc, and Emacs's signal
5306 handler can invoke strsignal, which can invoke malloc, which is
5307 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5308 Fix it by altering the signal handler so that it does not invoke
5309 strsignal.
5310 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5311 * process.c (status_message): Use const pointer, in case strsignal
5312 is #defined to safe_strsignal.
5313 * sysdep.c (sys_siglist, init_signals): Always define and
5314 initialize a substitute sys_siglist if the system does not define
5315 one, even if HAVE_STRSIGNAL.
5316 (safe_strsignal): Rename from strsignal. Always define,
5317 using sys_siglist. Return a const pointer.
5318 * syssignal.h (safe_strsignal): New decl.
5319 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5320
5321 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5322
5323 * w32proc.c (timer_loop): Fix code that waits for timer
5324 expiration, to avoid high CPU usage.
5325
5326 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5327
5328 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5329 (sweep_weak_table): Remove redundant prototypes.
5330
5331 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5332
5333 * emacs.c: Move the inclusion of TERM_HEADER after including
5334 windows.h on WINDOWSNT. This avoids compilation problems with
5335 MSVC.
5336
5337 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5338
5339 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5340 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5341 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5342 as the previous version used 'void *'.
5343
5344 * ralloc.c (ROUNDUP): Fix last change.
5345 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5346 'size_t'.
5347
5348 * w32proc.c <disable_itimers>: New static flag.
5349 (init_timers): Initialize it to zero, after creating the critical
5350 sections used by the timer threads.
5351 (term_timers): Set to 1 before deleting the critical sections.
5352 (getitimer, setitimer): If disable_itimers is non-zero, return an
5353 error indication without doing anything. Reported by Fabrice
5354 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
5355 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5356 return results.
5357 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5358 support timers.
5359
5360 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5361 term_ntproc after all the other bookkeeping, to get timers working
5362 as long as possible.
5363
5364 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5365
5366 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5367 Suggested by Juri Linkov in
5368 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5369
5370 Prefer plain 'static' to 'static inline' (Bug#12541).
5371 With static functions, modern compilers inline pretty well by
5372 themselves; advice from programmers often hurts as much as it helps.
5373 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5374 this change shrinks the text size of the Emacs executable by 1.1%
5375 without affecting CPU significantly in my benchmark.
5376 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5377 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5378 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5379 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5380 (bset_auto_fill_function, bset_auto_save_file_format)
5381 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5382 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5383 (bset_cache_long_line_scans, bset_case_fold_search)
5384 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5385 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5386 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5387 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5388 (bset_header_line_format, bset_indicate_buffer_boundaries)
5389 (bset_indicate_empty_lines, bset_invisibility_spec)
5390 (bset_left_fringe_width, bset_major_mode, bset_mark)
5391 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5392 (bset_name, bset_overwrite_mode, bset_pt_marker)
5393 (bset_right_fringe_width, bset_save_length)
5394 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5395 (bset_scroll_up_aggressively, bset_selective_display)
5396 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5397 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5398 (set_buffer_overlays_after):
5399 * category.c (bset_category_table):
5400 * charset.c (read_hex):
5401 * coding.c (produce_composition, produce_charset)
5402 (handle_composition_annotation, handle_charset_annotation)
5403 (char_encodable_p):
5404 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5405 (assign_row, set_frame_matrix_frame, make_current)
5406 (add_row_entry):
5407 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5408 * fns.c (maybe_resize_hash_table):
5409 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5410 * gmalloc.c (register_heapinfo):
5411 * image.c (lookup_image_type):
5412 * intervals.c (set_interval_object, set_interval_left)
5413 (set_interval_right, copy_interval_parent, rotate_right)
5414 (rotate_left, balance_possible_root_interval):
5415 * keyboard.c (kset_echo_string, kset_kbd_queue)
5416 (kset_keyboard_translate_table, kset_last_prefix_arg)
5417 (kset_last_repeatable_command, kset_local_function_key_map)
5418 (kset_overriding_terminal_local_map, kset_real_last_command)
5419 (kset_system_key_syms, clear_event, set_prop):
5420 * lread.c (digit_to_number):
5421 * marker.c (attach_marker, live_buffer, set_marker_internal):
5422 * nsterm.m (ns_compute_glyph_string_overhangs):
5423 * process.c (pset_buffer, pset_command)
5424 (pset_decode_coding_system, pset_decoding_buf)
5425 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5426 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5427 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5428 * syntax.c (bset_syntax_table, dec_bytepos):
5429 * terminal.c (tset_param_alist):
5430 * textprop.c (interval_has_some_properties)
5431 (interval_has_some_properties_list):
5432 * window.c (wset_combination_limit, wset_dedicated)
5433 (wset_display_table, wset_hchild, wset_left_fringe_width)
5434 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5435 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5436 (wset_right_fringe_width, wset_right_margin_cols)
5437 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5438 (wset_vertical_scroll_bar_type, wset_window_parameters):
5439 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5440 (wset_column_number_displayed, wset_region_showing)
5441 (window_box_edges, run_window_scroll_functions)
5442 (append_glyph_string_lists, prepend_glyph_string_lists)
5443 (append_glyph_string, set_glyph_string_background_width)
5444 (append_glyph, append_composite_glyph)
5445 (take_vertical_position_into_account):
5446 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5447 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5448 (lface_hash, lface_same_font_attributes_p, lookup_face):
5449 * xml.c (libxml2_loaded_p):
5450 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5451 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5452 Now 'static', not 'static inline'.
5453
5454 * bidi.c: Tune.
5455 (bidi_copy_it): Do the whole copy with a single memcpy.
5456 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5457
5458 Revert the FOLLOW-SYMLINKS change for file-attributes.
5459 Doing it right would require several changes to Tramp, and there's
5460 not enough time to get that tested before the freeze today.
5461 * dired.c (directory_files_internal, Ffile_attributes):
5462 Undo last change.
5463
5464 * frame.c (x_report_frame_params): Port better to wider ints.
5465 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5466 or that pointers can be printed in 15 decimal digits.
5467 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5468
5469 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5470
5471 Support x64 build on MS-Windows.
5472 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5473 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5474 compatibility with x64.
5475 (x_get_focus_frame): Add prototype.
5476
5477 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5478 defining an XRectangle structure.
5479
5480 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5481 arithmetics for compatibility with x64.
5482
5483 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5484 compatibility with x64.
5485
5486 * w32heap.h: Adjust prototypes and declarations.
5487
5488 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5489 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5490 DWORD, long, and unsigned long, for compatibility with x64.
5491 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5492 (sbrk): Argument is now of type ptrdiff_t.
5493
5494 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5495 less than 0x0500.
5496 (w32_msg_pump): Use WPARAM type for 'result'.
5497
5498 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5499 architecture.
5500 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5501 compatibility with x64.
5502
5503 * vm-limit.c (lim_data): Now size_t.
5504 (check_memory_limits): Adjust prototypes of real_morecore and
5505 __morecore to receive argument of type ptrdiff_t. Use size_t for
5506 five_percent and data_size.
5507
5508 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5509 variables, for compatibility with x64.
5510 (rva_to_section, offset_to_section, relocate_offset)
5511 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5512 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5513 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5514 for compatibility with x64.
5515
5516 * sysdep.c (STDERR_FILENO): Define if not already defined.
5517
5518 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5519 (__morecore): Argument type is now ptrdiff_t.
5520 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5521 (relinquish): Use ptrdiff_t type for 'excess'.
5522 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5523
5524 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5525 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5526 instead of a literal number.
5527
5528 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5529 (min): Define only if not already defined.
5530
5531 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5532 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5533 hosts.
5534
5535 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5536 'bitmaps' is a pointer.
5537
5538 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5539
5540 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5541
5542 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5543
5544 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5545 * dired.c (directory_files_internal, Ffile_attributes):
5546 New arg follow_symlinks. All uses changed.
5547
5548 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5549
5550 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5551
5552 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5553
5554 Support atimers and CPU profiler via profile.c on MS-Windows.
5555 * w32proc.c (sig_mask, crit_sig): New static variables.
5556 (sys_signal): Support SIGALRM and SIGPROF.
5557 (sigemptyset, sigaddset, sigfillset, sigprocmask)
5558 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
5559 sigfillset, and sigprocmask are no longer no-ops.
5560 (sigismember): New function.
5561 (struct itimer_data): New definition.
5562 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5563 (crit_prof): New static variables.
5564 (MAX_SINGLE_SLEEP): New definition.
5565 (timer_loop, stop_timer_thread, term_timers, init_timers)
5566 (start_timer_thread, getitimer, setitimer): New functions.
5567 (alarm): No longer a no-op, calls setitimer.
5568
5569 * w32.c (term_ntproc): Call term_timers.
5570 (init_ntproc): Make sure all signals are unblocked at startup, to
5571 erase any traces of dumping. Call init_timers.
5572
5573 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5574 Windows-specific code to display the hourglass mouse pointer is no
5575 longer used.
5576 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5577 to hourglass timer expiration.
5578 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5579 Remove, no longer used.
5580 (w32_note_current_window, show_hourglass, hide_hourglass):
5581 New functions, in support of hourglass cursor display similar to other
5582 window systems.
5583 (syms_of_w32fns): Don't initialize hourglass_timer.
5584
5585 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5586 WINDOWSNT as well.
5587 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5588
5589 * w32.h (init_timers, term_timers): Add prototypes.
5590
5591 2012-09-30 Kenichi Handa <handa@gnu.org>
5592
5593 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5594 to the buffer relocation which may be caused by ccl_driver.
5595
5596 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5597
5598 * xfns.c (Fx_file_dialog): Update comment.
5599
5600 * w32fns.c (Fx_file_dialog): Update comment.
5601
5602 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5603 Initialize panel name field if OSX >= 10.6.
5604
5605 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5606
5607 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5608
5609 * nsterm.m (NEW_STYLE_FS): New define.
5610 (ns_fullscreen_hook, windowWillEnterFullScreen)
5611 (windowDidEnterFullScreen, windowWillExitFullScreen)
5612 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5613 (setFSValue): New functions.
5614 (EmacsFSWindow): New implementation.
5615 (canBecomeKeyWindow): New function for EmacsFSWindow.
5616 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5617 (dealloc): Release nonfs_window if in fullscreen.
5618 (updateFrameSize:): Call windowDidMove to update top/left.
5619 (windowWillResize:toSize:): Check if frame is still maximized.
5620 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5621 next_maximized, maximized_width, maximized_height and nonfs_window.
5622 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5623 tbar_height.
5624 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
5625 fullscreen. Set maximized_width/height. Act on next_maximized.
5626
5627 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5628 (EmacsView): Add variables for fullscreen.
5629 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5630 (EmacsFSWindow): New interface for fullscreen.
5631
5632 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
5633
5634 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5635
5636 2012-09-30 Chong Yidong <cyd@gnu.org>
5637
5638 * fns.c (Frandom): Doc fix.
5639
5640 2012-09-30 Martin Rudalics <rudalics@gmx.at>
5641
5642 * window.c (Vwindow_combination_limit): New default value.
5643 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5644
5645 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5646
5647 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5648 Suggested by Eli Zaretskii in
5649 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5650
5651 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5652
5653 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5654 HAVE_TIMER_SETTIME is defined.
5655
5656 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5657
5658 Profiler improvements: more-accurate timers, overflow checks.
5659 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5660 signal.h, setjmp.h. Include systime.h instead.
5661 (saturated_add): New function.
5662 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5663 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5664 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5665 New static vars.
5666 (enum profiler_cpu_running): New enum.
5667 (profiler_cpu_running): Now of that enum type, not bool.
5668 All uses changed to store the new value.
5669 (handle_profiler_signal): Rename from sigprof_handler_1,
5670 for consistency with other handlers. Do not check whether
5671 cpu_log is a hash-table if garbage collecting, since it
5672 doesn't matter in that case.
5673 (deliver_profiler_signal): Rename from sigprof_handler,
5674 for consistency with other handlers.
5675 (setup_cpu_timer): New function, with much of what used to be in
5676 Fprofiler_cpu_start. Check for out-of-range argument.
5677 Prefer timer_settime if available, and prefer
5678 thread cputime clocks, then process cputime clocks, then
5679 monotonic clocks, to the old realtime clock. Use make_timeval
5680 to round more-correctly when falling back to setitimer.
5681 (Fprofiler_cpu_start): Use it.
5682 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5683 Don't assume that passing NULL as the 2nd argument of setitimer
5684 is the same as passing a pointer to all-zero storage.
5685 Ignore SIGPROF afterwards.
5686 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5687 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5688 non-fatal signal handlers. Ignore SIGPROF on startup.
5689 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5690 in profiler.c, since sysdep.c now uses it.
5691
5692 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5693 Suggested by Eli Zaretskii in
5694 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5695
5696 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
5697
5698 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5699
5700 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5701
5702 * lisp.h (struct backtrace): Remove indirection for `function' field.
5703 * xdisp.c (redisplay_internal):
5704 * profiler.c (record_backtrace, sigprof_handler_1):
5705 * alloc.c (Fgarbage_collect):
5706 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5707 (Fbacktrace_frame): Adjust accordingly.
5708
5709 2012-09-28 Glenn Morris <rgm@gnu.org>
5710
5711 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5712 (Frun_hook_with_args_until_failure): Doc fixes.
5713
5714 2012-09-28 Eli Zaretskii <eliz@gnu.org>
5715
5716 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5717 Qautomatic_redisplay and change the symbol name. All users changed.
5718
5719 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5720
5721 * profiler.c (sigprof_handler): Fix race condition.
5722
5723 2012-09-28 Glenn Morris <rgm@gnu.org>
5724
5725 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5726
5727 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5728
5729 Check more robustly for timer_settime.
5730 * Makefile.in (LIB_TIMER_TIME): New macro.
5731 (LIBES): Add it.
5732 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5733 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5734 call timer_settime.
5735
5736 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5737
5738 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5739
5740 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
5741
5742 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5743
5744 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5745
5746 * character.h (MAYBE_UNIFY_CHAR): Remove.
5747 * charset.c, charset.h (maybe_unify_char): Now static.
5748 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5749 Since this stuff is now private to charset.c, there's no need for
5750 a public macro and no need to inline by hand.
5751
5752 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5753 Stefan Monnier <monnier@iro.umontreal.ca>
5754 Juanma Barranquero <lekktu@gmail.com>
5755
5756 * profiler.c: New file.
5757 * Makefile.in (base_obj): Add profiler.o.
5758 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5759 ($(BLD)/profiler.$(O)): New target.
5760 * emacs.c (main): Call syms_of_profiler.
5761 * alloc.c (Qautomatic_gc): New constant.
5762 (MALLOC_PROBE): New macro.
5763 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5764 (total_bytes_of_live_objects): New function.
5765 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5766 Call malloc_probe for the memory profiler.
5767 (syms_of_alloc): Define Qautomatic_gc.
5768 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5769 race condition.
5770 (struct backtrace): Move definition...
5771 * lisp.h (struct backtrace): ..here.
5772 (Qautomatic_gc, profiler_memory_running): Declare vars.
5773 (malloc_probe, syms_of_profiler): Declare functions.
5774 * xdisp.c (Qautomatic_redisplay): New constant.
5775 (redisplay_internal): Record itself in backtrace_list.
5776 (syms_of_xdisp): Define Qautomatic_redisplay.
5777
5778 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5779 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5780
5781 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5782
5783 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5784
5785 Prefer POSIX timers if available.
5786 They avoid a race if the timer is too close to the current time.
5787 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5788 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
5789 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
5790
5791 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5792
5793 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5794 CHAR_STRING_ADVANCE.
5795 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5796 STRING_CHAR_ADVANCE.
5797
5798 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5799
5800 Move Vlibrary_cache to emacs.c and reset before dumping.
5801
5802 * lisp.h (reset_image_types): Declare.
5803 [WINDOWSNT] (Vlibrary_cache): Declare.
5804
5805 * image.c (reset_image_types): New function.
5806
5807 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5808 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5809 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5810
5811 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5812 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5813
5814 * w32.h (Vlibrary_cache): Do not declare.
5815
5816 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5817
5818 * w32proc.c (sys_signal): Handle all signals defined by the
5819 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5820 handlers for signals supported by Windows. Don't override
5821 term_ntproc as the handler for SIGABRT.
5822 (sigaction): Rewrite to call sys_signal instead of duplicating its
5823 code.
5824 (sys_kill): Improve commentary.
5825
5826 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5827 consistency with a signature of a signal handler. All callers
5828 changed.
5829 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5830 install term_ntproc as a signal handler for SIGABRT, as that
5831 should be done by the dumped Emacs.
5832
5833 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5834
5835 * w32select.c (term_w32select): Protect against repeated
5836 invocation by setting clipboard_owner to NULL after calling
5837 DestroyWindow.
5838
5839 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5840 and term_ntproc to their modified signatures.
5841
5842 * character.c (char_string, string_char): Remove calls to
5843 MAYBE_UNIFY_CHAR. See the discussion starting at
5844 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5845 for the details.
5846
5847 2012-09-25 Chong Yidong <cyd@gnu.org>
5848
5849 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5850
5851 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5852
5853 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5854 when encountering an unknown bytecode.
5855
5856 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5857
5858 image.c, indent.c: Use bool for booleans.
5859 * dispextern.h (struct image_type): Members valid_p, load, init
5860 now return bool, not int. All uses changed.
5861 * image.c: Omit unnecessary static decls.
5862 (x_create_bitmap_mask, x_build_heuristic_mask):
5863 Return void, not int, since callers don't care about the return value.
5864 (x_create_bitmap_mask, define_image_type, valid_image_p)
5865 (struct image_keyword, parse_image_spec, image_spec_value)
5866 (check_image_size, image_background)
5867 (image_background_transparent, x_clear_image_1)
5868 (postprocess_image, lookup_image, x_check_image_size)
5869 (x_create_x_image_and_pixmap, xbm_image_p)
5870 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5871 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5872 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5873 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5874 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5875 (png_image_p, init_png_functions, png_load_body, png_load)
5876 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5877 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5878 (init_gif_functions, gif_load, imagemagick_image_p)
5879 (imagemagick_load_image, imagemagick_load, svg_image_p)
5880 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5881 (gs_load):
5882 * nsimage.m (ns_load_image):
5883 * nsterm.m (ns_defined_color):
5884 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5885 * xfns.c (x_defined_color):
5886 * xterm.c (x_alloc_lighter_color_for_widget)
5887 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5888 (x_alloc_lighter_color):
5889 * indent.c (disptab_matches_widthtab, current_column)
5890 (scan_for_column, string_display_width, indented_beyond_p)
5891 (compute_motion, vmotion, Fvertical_motion):
5892 Use bool for booleans.
5893
5894 2012-09-24 Chong Yidong <cyd@gnu.org>
5895
5896 * chartab.c (Fset_char_table_default): Obsolete function removed.
5897
5898 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5899
5900 Move pid_t related decls out of lisp.h.
5901 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5902 (interruptible_wait_for_termination):
5903 Move these decls from lisp.h to syswait.h, since they use pid_t.
5904 Needed on FreeBSD; see Herbert J. Skuhra in
5905 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5906 * callproc.c: Include syswait.h.
5907
5908 gnutls.c, gtkutil.c: Use bool for boolean.
5909 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5910 (emacs_gnutls_handle_error):
5911 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5912 (xg_hide_tooltip, xg_create_frame_widgets)
5913 (create_dialog, xg_uses_old_file_dialog)
5914 (xg_get_file_with_chooser, xg_get_file_with_selection)
5915 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5916 (xg_item_label_same_p, xg_update_menubar)
5917 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5918 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5919 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5920 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5921 (update_frame_tool_bar, free_frame_tool_bar):
5922 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5923 * nsmenu.m (ns_update_menubar):
5924 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5925 * xfns.c (Fx_show_tip) [USE_GTK]:
5926 Use bool for boolean.
5927 * gtkutil.c (xg_update_frame_menubar):
5928 * xmenu.c (update_frame_menubar):
5929 Return void, not int, since caller ignores return value.
5930 * gtkutil.c (xg_change_toolbar_position):
5931 Return void, not 1.
5932
5933 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5934
5935 * makefile.w32-in (BLOCKINPUT_H): Remove.
5936 (SYSSIGNAL_H): New macro.
5937 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5938 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5939 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5940 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5941 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5942 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5943 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5944 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5945 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5946 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5947 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5948 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5949 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5950 ($(BLD)/w32xfns.$(O)): Update dependencies.
5951
5952 2012-09-23 Eli Zaretskii <eliz@gnu.org>
5953
5954 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5955 fatal_error_backtrace.
5956
5957 * w32proc.c (sys_kill): Undo last change: don't do anything when
5958 invoked to deliver SIGABRT to our own process. This is now
5959 handled by emacs_raise.
5960
5961 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5962
5963 * w32term.c (w32_read_socket): Remove leftover reference to
5964 interrupt_input_pending.
5965
5966 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5967
5968 Do not use SA_NODEFER.
5969 Problem reported by Dani Moncayo in
5970 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5971 * alloc.c (die):
5972 * sysdep.c (emacs_abort): Do not reset signal handler.
5973 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5974 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5975 wanted even on POSIXish hosts, and it doesn't work on Windows.
5976
5977 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5978
5979 * xterm.c (x_term_init): Call fixup_locale before and after calling
5980 gtk_init (Bug#12392).
5981
5982 2012-09-23 Chong Yidong <cyd@gnu.org>
5983
5984 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5985 Vdynamic_library_alist.
5986
5987 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5988 (Fgnutls_available_p): Caller changed.
5989
5990 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5991 (Flibxml_parse_xml_region): Likewise.
5992
5993 * dispextern.h (struct image_type): Remove arg from init function.
5994
5995 * image.c (Finit_image_library, lookup_image_type)
5996 (define_image_type): Remove now-unneeded second arg.
5997 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5998 (init_tiff_functions, init_gif_functions, init_svg_functions):
5999 Arglist and w32_delayed_load calling convention changed.
6000 (gs_type): Remove init_gs_functions; there is no such function.
6001 (valid_image_p, make_image): Fix caller to lookup_image_type.
6002
6003 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6004
6005 Simplify and avoid signal-handling races (Bug#12471).
6006 * alloc.c (die):
6007 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6008 Avoid recursive loop if there's a fatal error in the function itself.
6009 * atimer.c (pending_atimers):
6010 * blockinput.h: Don't include "atimer.h"; no longer needed.
6011 (interrupt_input_pending): Remove. All uses removed.
6012 pending_signals now counts both atimers and ordinary interrupts.
6013 This is less racy than having three separate pending-signal flags.
6014 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6015 (input_blocked_p):
6016 Rename from their upper-case counterparts BLOCK_INPUT,
6017 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6018 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6019 This makes it easier to access volatile variables more accurately.
6020 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6021 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6022 that's more reliable if the code is buggy and sets
6023 interrupt_input_blocked to a negative value. All uses changed.
6024 * atimer.c (deliver_alarm_signal):
6025 Remove. No need to deliver this to the parent; any thread can
6026 handle this signal now. All uses replaced by underlying handler.
6027 * atimer.c (turn_on_atimers):
6028 * dispnew.c (handle_window_change_signal):
6029 * emacs.c (handle_danger_signal):
6030 * keyboard.c (kbd_buffer_get_event):
6031 Don't reestablish signal handler; not needed with sigaction.
6032 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6033 (UNBLOCK_INPUT_TO):
6034 Rework to avoid unnecessary accesses to volatile variables.
6035 (UNBLOCK_INPUT_TO): Now a function.
6036 (totally_unblock_input, unblock_input): New decls.
6037 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6038 (init_data): Remove. Necessary stuff now done in init_signal.
6039 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6040 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6041 (fatal_error_code): Remove; no longer needed.
6042 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6043 it doesn't always backtrace. All uses changed. No need to reset
6044 signal to default, since sigaction and/or die does that for us now.
6045 Use emacs_raise (FOO), not kill (getpid (), FOO).
6046 (main): Check more-accurately whether we're dumping.
6047 Move fatal-error setup to sysdep.c
6048 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6049 * gtkutil.c (xg_get_file_name, xg_get_font):
6050 Remove no-longer-needed signal-mask manipulation.
6051 * keyboard.c, process.c (POLL_FOR_INPUT):
6052 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6053 * keyboard.c (read_avail_input): Remove.
6054 All uses replaced by gobble_input.
6055 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6056 (kbd_buffer_store_event_hold, gobble_input):
6057 (record_asynch_buffer_change) [USABLE_SIGIO]:
6058 (store_user_signal_events):
6059 No need to mess with signal mask.
6060 (gobble_input): If blocking input and there are terminals, simply
6061 set pending_signals to 1 and return. All hooks changed to not
6062 worry about whether input is blocked.
6063 (process_pending_signals): Clear pending_signals before processing
6064 them, in case a signal comes in while we're processing.
6065 By convention callers now test pending_signals before calling us.
6066 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6067 New functions, to support changes to blockinput.h.
6068 (handle_input_available_signal): Now extern.
6069 (reinvoke_input_signal): Remove. All uses replaced by
6070 handle_async_input.
6071 (quit_count): Now volatile, since a signal handler uses it.
6072 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6073 All callers changed. Block SIGINT only if not already blocked.
6074 Clear sigmask reliably, even if Fsignal returns, which it can.
6075 Omit unnecessary accesses to volatile var.
6076 (quit_throw_to_read_char): No need to restore sigmask.
6077 * keyboard.c (gobble_input, handle_user_signal):
6078 * process.c (wait_reading_process_output):
6079 Call signal-handling code rather than killing ourselves.
6080 * lisp.h: Include <float.h>, for...
6081 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6082 (pending_signals): Now volatile.
6083 (syms_of_data): Now const if IEEE floating point.
6084 (handle_input_available_signal) [USABLE_SIGIO]:
6085 (terminate_due_to_signal, record_child_status_change): New decls.
6086 * process.c (create_process): Avoid disaster if memory is exhausted
6087 while we're processing a vfork, by tightening the critical section
6088 around the vfork.
6089 (send_process_frame, process_sent_to, handle_pipe_signal)
6090 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6091 ignores SIGPIPE.
6092 (send_process): No need for setjmp/longjmp any more, since the
6093 SIGPIPE stuff is now gone. Instead, report an error if errno
6094 is EPIPE.
6095 (record_child_status_change): Now extern. PID and W are now args.
6096 Return void, not bool. All callers changed.
6097 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6098 Remove. All uses removed. This bug should be fixed now in a
6099 different way.
6100 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6101 and record the child status change directly. This avoids the
6102 need to futz with the signal mask.
6103 (process_fatal_action): Move here from emacs.c.
6104 (emacs_sigaction_flags): New function, containing
6105 much of what used to be in emacs_sigaction_init.
6106 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6107 caught by emacs, to make races less likely.
6108 (deliver_process_signal): Rename from handle_on_main_thread.
6109 All uses changed.
6110 (BACKTRACE_LIMIT_MAX): Now at top level.
6111 (thread_backtrace_buffer, threadback_backtrace_pointers):
6112 New static vars.
6113 (deliver_thread_signal, deliver_fatal_thread_signal):
6114 New functions, for more-accurate delivery of thread-specific signals.
6115 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6116 (deliver_arith_signal): Handle in this thread, not
6117 in the main thread, since it's triggered by this thread.
6118 (maybe_fatal_sig): New function.
6119 (init_signals): New arg DUMPING so that we can be more accurate
6120 about whether we're dumping. Caller changed.
6121 Treat thread-specific signals differently from process-general signals.
6122 Block all signals while handling fatal error; that's safer.
6123 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6124 on IEEE hosts.
6125 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6126 Ignore SIGPIPE unless batch.
6127 (emacs_backtrace): Output backtrace for the appropriate thread,
6128 which is not necessarily the main thread.
6129 * syssignal.h: Include <stdbool.h>.
6130 (emacs_raise): New macro.
6131 * xterm.c (x_connection_signal): Remove; no longer needed
6132 now that we use sigaction.
6133 (x_connection_closed): No need to mess with sigmask now.
6134 (x_initialize): No need to reset SIGPIPE handler here, since
6135 init_signals does this for us now.
6136
6137 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6138
6139 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6140 background rect may be larger (Bug#12245).
6141
6142 2012-09-23 Chong Yidong <cyd@gnu.org>
6143
6144 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6145
6146 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6147
6148 * .gdbinit: Just stop at fatal_error_backtrace.
6149 See Stefan Monnier's request in
6150 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6151 Remove no-longer-used query of system type.
6152
6153 2012-09-22 Chong Yidong <cyd@gnu.org>
6154
6155 * search.c (Freplace_match): Doc fix (Bug#12325).
6156
6157 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6158
6159 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6160 (Fline_end_position): Doc fix.
6161
6162 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6163
6164 2012-09-22 Chong Yidong <cyd@gnu.org>
6165
6166 * dispextern.h (struct image_type): Add new slot, storing a type
6167 initialization function.
6168
6169 * image.c (define_image_type): Call the image initializer function
6170 if it is defined. Arguments and return value changed.
6171 (valid_image_p, make_image): Callers changed.
6172 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
6173 (gif_type, imagemagick_type, svg_type, gs_type):
6174 Add initialization functions.
6175 (Finit_image_library): Call lookup_image_type.
6176 (CHECK_LIB_AVAILABLE): Macro deleted.
6177 (lookup_image_type): Call define_image_type here, rather than via
6178 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6179 (syms_of_image): Move define_image_type calls for xbm_type and
6180 pbm_type to lookup_image_type.
6181
6182 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6183
6184 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6185 'idle_timers' from here ...
6186 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6187 lists, to avoid infloops when the timer does something stupid,
6188 like reinvoke itself with the same or smaller time-out.
6189 (Bug#12447)
6190
6191 2012-09-22 Martin Rudalics <rudalics@gmx.at>
6192
6193 * window.c (Fsplit_window_internal): Handle only Qt value of
6194 Vwindow_combination_limit separately.
6195 (Qtemp_buffer_resize): New symbol.
6196 (Vwindow_combination_limit): New default value.
6197 Rewrite doc-string.
6198
6199 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6200
6201 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6202 the new overlay string. (Bug#10159)
6203
6204 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6205
6206 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6207 or that fprintf is async-signal-safe. POSIX doesn't require
6208 either assumption.
6209
6210 2012-09-22 Chong Yidong <cyd@gnu.org>
6211
6212 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6213 (Bug#8207).
6214
6215 2012-09-22 Kenichi Handa <handa@gnu.org>
6216
6217 * composite.c (composition_reseat_it): Handle the case that a
6218 grapheme cluster is not covered by a single font (Bug#12352).
6219
6220 2012-09-21 Chong Yidong <cyd@gnu.org>
6221
6222 * image.c (define_image_type): Avoid adding duplicate types to
6223 image_types (Bug#12463). Suggested by Jörg Walter.
6224
6225 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6226
6227 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6228 (print_load_command_name): Add case LC_DATA_IN_CODE.
6229 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6230
6231 2012-09-21 Glenn Morris <rgm@gnu.org>
6232
6233 * eval.c (Frun_hook_with_args_until_success)
6234 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6235
6236 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
6237
6238 * fileio.c (Ffile_selinux_context): Only call freecon when
6239 lgetfilecon succeeded.
6240 (Fset_file_selinux_context): Likewise. (Bug#12444)
6241
6242 2012-09-21 Eli Zaretskii <eliz@gnu.org>
6243
6244 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6245 reordering, locate the cursor by calling set_cursor_from_row; if
6246 that fails, clear the desired glyph matrix before returning a
6247 failure indication to the caller. Fixes leaving garbled display
6248 when fast scrolling with a down-key. (Bug#12403)
6249 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6250 scrolling through multibyte text.
6251
6252 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6253
6254 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6255 calling mark_vectorlike since that's the one that marks the window.
6256 (mark_discard_killed_buffers): Mark the final cdr.
6257 * window.h (struct window): Move prev/next_buffers to the
6258 non-standard fields.
6259 * window.c (make_window): Initialize prev/next_buffers manually.
6260
6261 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6262
6263 Omit unused arg EXPECTED from socket hooks.
6264 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6265 * nsterm.m (ns_term_init):
6266 * termhooks.h (struct terminal.read_socket_hook):
6267 * w32inevt.c (w32_console_read_socket):
6268 * w32term.c (w32_read_socket):
6269 * xterm.c (XTread_socket):
6270 Omit unused arg EXPECTED. All callers changed.
6271 (store_user_signal_events): Return void, not int, since callers no
6272 longer care about the return value. All uses changed.
6273
6274 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
6275
6276 * w32gui.h (XParseGeometry): Do not declare.
6277
6278 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6279
6280 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
6281 Ignore 'expected'. See Eli Zaretskii in
6282 <http://bugs.gnu.org/12471#8> (last line).
6283
6284 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6285 (XParseGeometry): Now static. Substitute extremal values for
6286 values that are out of range.
6287
6288 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6289
6290 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6291
6292 * nsfns.m (XParseGeometry): Remove.
6293 (Fx_create_frame): Call x_set_offset to correctly interpret
6294 top_pos in geometry.
6295
6296 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
6297 (Fx_parse_geometry): If there is a space in string, call
6298 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6299
6300 2012-09-17 Eli Zaretskii <eliz@gnu.org>
6301
6302 * search.c (scan_buffer): Use character positions in calls to
6303 region_cache_forward and region_cache_backward, not byte
6304 positions. (Bug#12196)
6305
6306 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6307 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6308
6309 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6310 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6311 emacs_blocked_malloc, now deleted.
6312
6313 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6314
6315 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6316 The workaround was for improving performance on Solaris 2.4, but
6317 is getting in the way now. Emacs will still work if someone is
6318 still running Solaris 2.4 in a museum somewhere; Sun dropped
6319 support for Solaris 2.4 in 2003.
6320 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6321 * process.c (create_process) [HAVE_WORKING_VFORK]:
6322 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6323 since Emacs no longer uses vfork on that platform.
6324
6325 2012-09-17 Glenn Morris <rgm@gnu.org>
6326
6327 * emacs.c: Use COPYRIGHT.
6328
6329 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6330
6331 Remove configure's --without-sync-input option (Bug#12450).
6332 When auditing signal-handling in preparation for cleaning it up,
6333 I found that SYNC_INPUT has race conditions and would be a real
6334 pain to fix. Since it's an undocumented and deprecated
6335 configure-time option, now seems like a good time to remove it.
6336 Also see <http://bugs.gnu.org/11080#16>.
6337 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6338 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6339 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6340 (malloc_hysteresis):
6341 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6342 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6343 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6344 (dont_register_blocks, bytes_used_when_reconsidered)
6345 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6346 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6347 [!SYSTEM_MALLOC && !SYNC_INPUT]:
6348 Remove. All uses removed.
6349 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6350 implementation, one that depends on whether the new macro
6351 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6352 is defined.
6353 * atimer.c (run_timers, handle_alarm_signal):
6354 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6355 (handle_async_input, process_pending_signals)
6356 (handle_input_available_signal, init_keyboard):
6357 * nsterm.m (ns_read_socket):
6358 * process.c (wait_reading_process_output):
6359 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6360 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6361 (emacs_write):
6362 * xterm.c (XTread_socket):
6363 Assume SYNC_INPUT.
6364 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6365 * eval.c (handling_signal): Remove. All uses removed.
6366 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6367 All uses replaced with the SYNC_INPUT version.
6368 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6369 Remove decls.
6370 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6371 Now static.
6372
6373 * font.c (Ffont_shape_gstring): Remove unused local.
6374
6375 2012-09-16 Glenn Morris <rgm@gnu.org>
6376
6377 * Makefile.in (clean): No longer run nextstep's clean.
6378
6379 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6380 (ns_frag): Remove.
6381 (ns-app): Move here from ns.mk, and simplify.
6382 (clean): Simplify nextstep entry.
6383 * ns.mk: Remove file.
6384
6385 2012-09-17 Kenichi Handa <handa@gnu.org>
6386
6387 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6388 not covert the last few charactes.
6389
6390 2012-09-16 Kenichi Handa <handa@gnu.org>
6391
6392 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6393 here, but just check the validity of glyphs in the glyph-string.
6394
6395 2012-09-16 Martin Rudalics <rudalics@gmx.at>
6396
6397 * window.c (Fwindow_parameter, Fset_window_parameter):
6398 Accept any window as argument (Bug#12452).
6399
6400 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6401
6402 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6403 to ns_term_init to avoid memory leak.
6404
6405 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6406 explicit retain/release.
6407 (ns_term_init): Only allow one display. Initialize outerpool and
6408 ns_*_types.
6409
6410 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6411
6412 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6413 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6414 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6415 the Microsoft problem in a different way, by altering ../nt/config.nt.
6416
6417 2012-09-15 Eli Zaretskii <eliz@gnu.org>
6418
6419 * w32xfns.c:
6420 * w32uniscribe.c:
6421 * w32term.c:
6422 * w32select.c:
6423 * w32reg.c:
6424 * w32proc.c:
6425 * w32menu.c:
6426 * w32inevt.c:
6427 * w32heap.c:
6428 * w32font.c:
6429 * w32fns.c:
6430 * w32console.c:
6431 * w32.c:
6432 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6433 by lisp.h. This completes removal of setjmp.h inclusion
6434 erroneously announced in the previous commit. (Bug#12446)
6435
6436 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6437 more accurate.
6438
6439 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6440 not defined as a macro. The latter happens on MS-Windows.
6441 (Bug#12446)
6442
6443 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6444
6445 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6446 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
6447 Some instances of '#include <setjmp.h>' removed, if the
6448 only reason for the instance was because "lisp.h" was included.
6449 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6450 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6451 and _longjmp with the new symbols. Emacs already uses _setjmp if
6452 available, so this change affects only POSIXish hosts that have
6453 sigsetjmp but not _setjmp, such as some versions of Solaris and
6454 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6455 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6456 (png_load_body) [HAVE_PNG]:
6457 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6458 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6459 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6460 since PNG requires jmp_buf. This is the only exception to the
6461 general rule that we now use sys_setjmp and sys_longjmp.
6462 This exception is OK since this code does not change the signal
6463 mask or longjmp out of a signal handler.
6464
6465 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6466
6467 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6468 Include "syssignal.h", for 'main_thread'.
6469
6470 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6471
6472 Avoid out-of-range marker position (Bug#12426).
6473 * insdel.c (replace_range, replace_range_2):
6474 Adjust markers before overlays, as suggested by comments.
6475 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6476 Remove redundant check before calling offset_intervals.
6477
6478 2012-09-14 Martin Rudalics <rudalics@gmx.at>
6479
6480 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6481 current buffer (Bug#12387).
6482
6483 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
6484
6485 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6486
6487 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6488
6489 Use a more backwards-compatible timer format (Bug#12430).
6490 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6491 vector element, not from the 4th, since PSECS is now at the end.
6492 (Fcurrent_idle_time): Doc fix.
6493
6494 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6495
6496 Function to mark objects and remove killed buffers at once.
6497 * alloc.c (discard_killed_buffers): Rename to ...
6498 (mark_discard_killed buffers) ... new name. Add marking
6499 of remaining objects. Fix comment. Adjust users.
6500 (mark_object): Do not touch frame buffer lists here.
6501 * frame.c (delete_frame): Reset frame buffer lists here.
6502
6503 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6504
6505 Better workaround for GNOME bug when --enable-gcc-warnings.
6506 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6507 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6508 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6509
6510 Simplify SIGIO usage (Bug#12408).
6511 The code that dealt with SIGIO was crufty and confusing, e.g., it
6512 played tricks like "#undef SIGIO" but these tricks were not used
6513 consistently. Simplify mostly by not #undeffing standard symbols,
6514 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6515 or not as we please) rather than "defined SIGIO" (standard symbol
6516 that we probably shouldn't #undef).
6517 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6518 Modules that need it can include it.
6519 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6520 * dispextern.h (ignore_sigio): New decl.
6521 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6522 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6523 * emacs.c (shut_down_emacs):
6524 * keyboard.c (kbd_buffer_store_event_hold):
6525 Use ignore_sigio rather than invoking 'signal' directly.
6526 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6527 for FIONREAD.
6528 (FIONREAD, SIGIO): Do not #undef.
6529 (tty_read_avail_input): Use #error rather than a syntax error.
6530 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6531 for I_PIPE, used by SETUP_SLAVE_PTY.
6532 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6533 * sysdep.c (croak): Remove; no longer needed. This bit of
6534 temporary code, with Fred N. Fish's comment that it's temporary,
6535 has been in Emacs since at least 1992!
6536 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6537 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6538 * syssignal.h (croak): Remove decl.
6539 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6540 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6541 now that we're termios-only.
6542 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6543 * term.c (dissociate_if_controlling_tty): Use #error rather than
6544 a run-time error.
6545
6546 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6547 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6548 to work around GNOME bug 683906.
6549 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6550 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6551 This works around GCC bug 54561.
6552
6553 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6554
6555 More fixes for 'volatile' and setjmp/longjmp.
6556 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6557 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6558 (png_load_body) [HAVE_PNG]:
6559 (jpeg_load_body) [HAVE_JPEG]:
6560 New function, with most of the old parent function's body.
6561 (png_load) [HAVE_PNG]:
6562 (jpeg_load) [HAVE_JPEG]:
6563 Invoke the new function, to avoid longjmp munging our locals.
6564 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6565 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6566 longjmp is passed 2, as the C standard doesn't guarantee this.
6567 Instead, store the failure code into mgr->failure_code.
6568
6569 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6570
6571 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6572 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6573 (syms_of_keyboard): Remove support for unread-command-char.
6574
6575 2012-09-12 Eli Zaretskii <eliz@gnu.org>
6576
6577 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6578 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6579 violation. (Bug#12426)
6580
6581 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6582
6583 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6584
6585 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6586
6587 * eval.c: Add `inhibit-debugger'.
6588 (Qinhibit_debugger): New symbol.
6589 (call_debugger): Bind it instead of Qdebug_on_error.
6590 (maybe_call_debugger): Test Vinhibit_debugger.
6591 (syms_of_eval): Define inhibit-debugger.
6592 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6593 (syms_of_xdisp): Remove inhibit-debug-on-message.
6594
6595 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6596
6597 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6598 If a nonvolatile local variable is written before a _longjmp to
6599 the frame containing the variable, and is read after the _longjmp,
6600 the value read is indeterminate. Some local variables of type
6601 'struct handler' and 'struct catchtag' are used in this way, so
6602 mark each of their slots as volatile if the slot can be set before
6603 _longjmp and read afterwards.
6604 * lisp.h (struct handler): var and chosen_clause are now volatile.
6605 (struct catchtag): val, next, and pdlcount are now volatile.
6606
6607 * bidi.c (bidi_push_it, bidi_pop_it):
6608 * fns.c (copy_hash_table):
6609 * image.c (define_image_type):
6610 * keyboard.c (kbd_buffer_store_event_hold):
6611 * process.c (Fprocess_send_eof):
6612 * xfaces.c (x_create_gc) [HAVE_NS]:
6613 * xgselect.c (xg_select):
6614 Prefer assignment to memcpy when either will do.
6615
6616 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6617 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6618 time an item is removed. No need to mark this function 'inline';
6619 the compiler knows better than we do.
6620
6621 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6622
6623 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6624 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6625 to change_frame_size (Bug#12388).
6626 (windowDidResize:): Pass YES to updateFrameSize.
6627
6628 * nsterm.h: Add delay parameter to updateFrameSize.
6629
6630 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6631
6632 Discard killed buffers from deleted window and frame objects.
6633 This reduces an amount of references to killed buffers and
6634 helps GC to reclaim them faster.
6635 * alloc.c (discard_killed_buffers): New function.
6636 (mark_object): Use it for deleted windows and frames.
6637 (mark_object): If symbol's value is set up for a killed buffer
6638 or deleted frame, restore its global binding.
6639 * data.c (swap_in_global_binding): Add GC notice.
6640 (swap_in_symval_forwarding): Use convenient set_blv_where.
6641 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6642 * window.h: ... to here.
6643
6644 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6645
6646 Convenient macro to check whether the buffer is live.
6647 * buffer.h (BUFFER_LIVE_P): New macro.
6648 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6649 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6650
6651 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6652
6653 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6654 composition cases (Bug#12364).
6655
6656 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6657 overhang of succeeding glyphs overlapping box cursor.
6658
6659 * w32term.c (x_draw_glyph_string): Likewise.
6660
6661 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6662
6663 Simplify, document, and port floating-point (Bug#12381).
6664 The porting part of this patch fixes bugs on non-IEEE platforms
6665 with frexp, ldexp, logb.
6666 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6667 Now static.
6668 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6669 support, by removing commented-out code and briefly listing the
6670 C89 functions excluded. The commented-out stuff was confusing
6671 maintenance, e.g., we thought we needed cbrt but it was commented out.
6672 (logb): Remove decl; no longer needed.
6673 (isfinite): New macro, if not already supplied.
6674 (isnan): Don't replace any existing macro.
6675 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6676 are present on all C89 platforms.
6677 (Ffrexp): Do not special-case zero, as frexp does the right thing
6678 for that case.
6679 (Flogb): Do not use logb, as it doesn't have the desired meaning
6680 on hosts that use non-base-2 floating point. Instead, stick with
6681 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6682 frexp, to avoid getting an unspecified result.
6683
6684 * xdisp.c (Qinhibit_debug_on_message): Now static.
6685
6686 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6687
6688 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6689 NSBezierPath (Bug#12131).
6690
6691 2012-09-10 Chong Yidong <cyd@gnu.org>
6692
6693 * fns.c (Fdelq, Fdelete): Doc fix.
6694
6695 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6696
6697 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6698 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6699
6700 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6701
6702 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6703 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6704 Use it.
6705
6706 2012-09-09 Eli Zaretskii <eliz@gnu.org>
6707
6708 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6709 left fringe if the window has a left margin. This avoids leaving
6710 traces of the cursor because its leftmost pixel is not drawn over.
6711
6712 * dispnew.c (update_window_line): When the left margin area of a
6713 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6714 that screen line. (Bug#12277)
6715
6716 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6717
6718 Assume C89 or later for math functions (Bug#12381).
6719 This simplifies the code, and makes it a bit smaller and faster,
6720 and (most important) makes it easier to clean up signal handling
6721 since we can stop worring about floating-point exceptions in
6722 library code. That was a problem before C89, but the problem
6723 went away many years ago on all practical Emacs targets.
6724 * data.c, image.c, lread.c, print.c:
6725 Don't include <math.h>; no longer needed.
6726 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6727 might be autoconfigured, as that never happens.
6728 * data.c (fmod):
6729 * doprnt.c (DBL_MAX_10_EXP):
6730 * print.c (DBL_DIG):
6731 Remove. C89 or later always defines these.
6732 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6733 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6734 (arith_error, domain_error, domain_error2):
6735 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6736 no longer needed -- we simply return what C returns. All uses removed.
6737 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6738 the wrapped code.
6739 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6740 Remove. All uses expanded, as these macros are no longer used
6741 more than once and are now more trouble than they're worth.
6742 (Ftan): Use tan, not sin / cos.
6743 (Flogb): Assume C89 frexp.
6744 (fmod_float): Assume C89 fmod.
6745 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6746 (init_floatfns): Remove. All uses removed.
6747
6748 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6749
6750 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6751 compositeToPoint for OSX < 10.6 (Bug#12390).
6752
6753 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6754
6755 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6756 This produces more-accurate results.
6757
6758 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6759
6760 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6761 changes (Bug#12088).
6762
6763 2012-09-08 Chong Yidong <cyd@gnu.org>
6764
6765 * syntax.c (Fstring_to_syntax): Doc fix.
6766
6767 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6768
6769 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6770 in the internal border.
6771 (x_set_window_size): Remove static variables and their usage.
6772 (ns_redraw_scroll_bars): Fix NSTRACE arg.
6773 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6774 Remove fringe/internal border adjustment (Bug#11052).
6775 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6776 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6777 (ns_fix_rect_ibw): Remove.
6778 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6779 (ns_dumpglyphs_box_or_relief): Ditto.
6780 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6781 adjustment.
6782 (ns_dumpglyphs_image): Ditto.
6783 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
6784 border adjustment.
6785 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6786 their usage. Add fringe_extended_p and its use as in other terms.
6787 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6788 scroll bar was removed.
6789 (updateFrameSize): New function.
6790 (windowDidResize): Move code to updateFrameSize and call it.
6791
6792 * nsterm.h (EmacsView): Add updateFrameSize.
6793
6794 2012-09-07 Chong Yidong <cyd@gnu.org>
6795
6796 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6797
6798 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6799
6800 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6801
6802 More signal-handler cleanup (Bug#12327).
6803 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6804 Problem introduced when merging patches. Noted by Eli Zaretskii in
6805 <http://bugs.gnu.org/12327#67>.
6806 * floatfns.c: Comment fix.
6807 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6808 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6809 and anyway the declaration is harmless even if SIGDANGER is not defined.
6810 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6811 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6812 source files not surprisingly expected syssignal.h to define, or
6813 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6814 Include <sys/ioctl.h>, for FIONREAD.
6815 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6816 This eliminates a problem whereby other files mysteriously had
6817 to include "syssignal.h" before including "systty.h" if they
6818 wanted to use "#ifdef SIGIO".
6819
6820 2012-09-07 Eli Zaretskii <eliz@gnu.org>
6821
6822 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6823
6824 * w32.c (sigemptyset): Empty the set.
6825 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6826
6827 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6828
6829 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6830
6831 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6832 (mark_object): Likewise for frame objects.
6833
6834 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6835
6836 * syssignal.h (handle_on_main_thread): Always declare,
6837 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6838 This ports to platforms without HAVE_PTHREAD.
6839
6840 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6841
6842 Signal-handler cleanup (Bug#12327).
6843 Emacs's signal handlers were written in the old 4.2BSD style with
6844 sigblock and sigmask and so forth, and this led to some
6845 inefficiencies and confusion. Rewrite these to use
6846 pthread_sigmask etc. without copying signal sets around. Also,
6847 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6848 'signal', and instead use functions that do not attempt to take
6849 over the system name space. This patch causes Emacs's text
6850 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6851 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6852 Do not include <signal.h> or "syssignal.h", as these
6853 modules do not use signals.
6854 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6855 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6856 Do not include <signal.h>, as "syssignal.h" does that for us now.
6857 * atimer.c (sigmask_atimers): New function.
6858 (block_atimers, unblock_atimers): New functions,
6859 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6860 All uses replaced.
6861 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6862 no longer needed here.
6863 * emacs.c (main): Inspect existing signal handler with sigaction,
6864 so that there's no need to block and unblock SIGHUP.
6865 * sysdep.c (struct save_signal): New member 'action', replacing
6866 old member 'handler'.
6867 (save_signal_handlers, restore_signal_handlers):
6868 Use sigaction instead of 'signal' to save and restore.
6869 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6870 New function. All users of 'signal' modified to use set_sighandler
6871 if they're writeonly, and to use sys_signal if they're read+write.
6872 (emacs_sigaction_init, forwarded_signal): New functions.
6873 (sys_signal): Remove. All uses replaced by calls to sigaction
6874 and emacs_sigaction_init, or by direct calls to 'signal'.
6875 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6876 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6877 all uses replaced by pthread_sigmask etc. calls.
6878 * syssignal.h: Include <signal.h>.
6879 (emacs_sigaction_init, forwarded_signal): New decls.
6880 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6881 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6882 (sigmask, sys_sigmask): Remove; no longer needed.
6883 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6884 (sigblock, sigunblock, sigfree):
6885 (sigsetmask) [!defined sigsetmask]:
6886 Remove. All uses replaced by pthread_sigmask.
6887 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6888 no longer need to be replaced, and its typical old uses
6889 are now done via emacs_sigaction_init and sigaction.
6890 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6891 (sys_sigdel): Remove; unused.
6892 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6893
6894 2012-09-06 Eli Zaretskii <eliz@gnu.org>
6895
6896 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6897 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6898
6899 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6900
6901 Explicitly mark buffer_defaults and buffer_local_symbols.
6902 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6903 mark_local_symbols here.
6904 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6905 since special buffers aren't marked here any more.
6906 (allocate_buffer): Chain new buffer with all_buffers here...
6907 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6908 not here.
6909 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6910 (syms_of_buffer): Remove staticpro of the above.
6911 (init_buffer_once): Set names for buffer_defaults and
6912 buffer_local_symbols.
6913
6914 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6915
6916 Use bool for booleans in font-related modules.
6917 * font.c (font_intern_prop, font_style_to_value)
6918 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6919 (generate_otf_features, font_check_otf_features, font_check_otf)
6920 (font_match_p, font_list_entities, font_at):
6921 * fontset.c (fontset_id_valid_p, reorder_font_vector
6922 (fontset_find_font, Fset_fontset_font)
6923 (face_suitable_for_char_p) [0]:
6924 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6925 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6926 (m17n_flt_initialized, ftfont_shape_by_flt):
6927 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6928 * nsfont.m (nsfont_draw):
6929 * w32font.c (w32font_draw):
6930 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6931 Use bool for booleans.
6932 * font.h: Adjust to above API changes.
6933 (struct font, struct font_driver, struct font_driver_list):
6934 Use bool for booleans.
6935 (struct font): Remove useless member encoding_type.
6936 All users removed.
6937 * fontset.c, xftfont.c: Omit unnecessary static decls.
6938
6939 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6940
6941 * alloc.c (mark_object): Revert window marking code
6942 since it's unsafe for the Fset_window_configuration.
6943
6944 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6945
6946 Fix race conditions with signal handlers and errno (Bug#12327).
6947 Be more systematic about preserving errno whenever a signal
6948 handler returns, even if it's not in the main thread. Do this by
6949 renaming signal handlers to distinguish between signal delivery
6950 and signal handling. All uses changed.
6951 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6952 * data.c (deliver_arith_signal): Rename from arith_error.
6953 * dispnew.c (deliver_window_change_signal): Rename from
6954 window_change_signal.
6955 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6956 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6957 * keyboard.c (deliver_input_available_signal): Rename from
6958 input_available_signal.
6959 (deliver_user_signal): Rename from handle_user_signal.
6960 (deliver_interrupt_signal): Rename from interrupt_signal.
6961 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6962 (deliver_child_signal): Rename from sigchld_handler.
6963 * atimer.c (handle_alarm_signal):
6964 * data.c (handle_arith_signal):
6965 * dispnew.c (handle_window_change_signal):
6966 * emacs.c (handle_fatal_signal, handle_danger_signal):
6967 * keyboard.c (handle_input_available_signal):
6968 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6969 * process.c (handle_pipe_signal, handle_child_signal):
6970 New functions, with the actual signal-handling code taken from the
6971 original respective signal handlers, sans the sporadic attempts to
6972 preserve errno, since that's now done by handle_on_main_thread.
6973 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6974 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6975 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6976 Move to sysdep.c.
6977 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6978 Move initialization of main_thread to sysdep.c's init_signals.
6979 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6980 our usage, and simplifies the mainline code.
6981 (record_child_status_change): New static function, as a helper
6982 for handle_child_signal, and with most of the old child handler's
6983 contents.
6984 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6985 (handle_child_signal): Use the above.
6986 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6987 Moved here from emacs.c.
6988 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6989 code moved here from emacs.c's main function.
6990 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
6991 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6992 This lets callers save and restore errno properly.
6993
6994 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6995
6996 Remove redundant or unused things here and there.
6997 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6998 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6999 * editfns.c (Fcompare_buffer_substrings): Likewise.
7000 * frame.h (struct terminal, struct font_driver_list):
7001 Remove redundant declarations.
7002 * window.h (Qleft, Qright): Likewise.
7003
7004 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7005
7006 Do not mark objects from deleted buffers, windows and frames.
7007 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7008 (mark_object): Likewise for windows and frames.
7009
7010 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7011
7012 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7013 buffer_defaults and buffer_local_symbols as valid objects.
7014 Return special value to denote them.
7015
7016 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7017
7018 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7019 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7020 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7021 (file_name_absolute_p, Fsubstitute_in_file_name):
7022 (check_executable, check_writable, Ffile_accessible_directory_p)
7023 (Fset_file_selinux_context, Fdefault_file_modes)
7024 (Finsert_file_contents, choose_write_coding_system)
7025 (Fwrite_region, build_annotations, a_write, e_write)
7026 (Fdo_auto_save):
7027 * filelock.c (boot_time_initialized, get_boot_time)
7028 (get_boot_time_1, lock_file_1, within_one_second):
7029 * floatfns.c (in_float):
7030 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7031 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7032 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7033 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7034 * window.c (compare_window_configurations):
7035 Use bool for booleans.
7036 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7037 (Fdefault_file_modes): Now mode_t, not int, for modes.
7038 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7039 (internal_delete_file): Now returns void, not a (boolean) int,
7040 since nobody was looking at the return value.
7041 * lisp.h, window.h: Adjust to above API changes.
7042
7043 * xdisp.c (set_message): Simplify and reindent last change.
7044
7045 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7046
7047 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7048
7049 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7050
7051 * eval.c (call_debugger): Make the function non-static so that we
7052 can call it from set_message.
7053
7054 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7055 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7056
7057 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7058
7059 Give more-useful info on a fatal error (Bug#12328).
7060 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7061 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7062 of doing the work ourselves.
7063 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7064 do most of the work.
7065 (fatal_error_backtrace): New function, taken from the guts
7066 of the old fatal_error_signal, but with a new option to output
7067 a backtrace.
7068 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7069 info about the signal than just its number.
7070 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7071 * sysdep.c: Include <execinfo.h>
7072 (emacs_backtrace): New function, taken partly from the previous
7073 code of the 'die' function.
7074 (emacs_abort): Call fatal_error_backtrace rather than abort.
7075
7076 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7077
7078 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7079 eager (load-time) macro-expansion.
7080 * lisp.mk (lisp): Add macroexp.
7081
7082 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7083
7084 Simplify redefinition of 'abort' (Bug#12316).
7085 Do not try to redefine the 'abort' function. Instead, redo
7086 the code so that it calls 'emacs_abort' rather than 'abort'.
7087 This removes the need for the NO_ABORT configure-time macro
7088 and makes it easier to change the abort code to do a backtrace.
7089 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7090 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7091 Remove; sysdep.c's emacs_abort now takes its place.
7092 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7093 'abort' changed to use 'emacs_abort'.
7094 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7095 (abort) [!defined abort]: Rename to ...
7096 (emacs_abort): ... new name.
7097 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7098 the place of the old 'abort' in emacs.c.
7099 * w32.c, w32fns.c (abort): Do not #undef.
7100 * w32.c (emacs_abort): Rename from w32_abort.
7101
7102 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7103
7104 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7105 offsets[j].dv, since the y axis of the screen coordinates points
7106 down, while the y axis of the font definition coordinates points
7107 up. This fixes display of Arabic diacritics such as KASRA and
7108 KASRATAN. (Bug#11860)
7109
7110 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7111
7112 Be more systematic about _setjmp vs setjmp.
7113 * alloc.c (test_setjmp, mark_stack):
7114 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7115 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7116 (png_load, my_error_exit, jpeg_load):
7117 * process.c (send_process_trap, send_process):
7118 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7119 The underscored versions are up to 30x faster on some hosts.
7120 Formerly, the code used setjmp+longjmp sometimes and
7121 _setjmp+_longjmp at other times, with no particular reason to
7122 prefer setjmp+longjmp.
7123
7124 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7125
7126 Fix minor problem found by static checking.
7127 * buffer.c (Fdelete_all_overlays): Return nil.
7128
7129 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7130
7131 * buffer.c (Fdelete_all_overlays): New function.
7132
7133 2012-09-03 Chong Yidong <cyd@gnu.org>
7134
7135 * gtkutil.c: Add extern decl for Qxft.
7136
7137 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7138
7139 * emacs.c, eval.c: Use bool for boolean.
7140 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7141 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7142 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7143 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7144 (main, decode_env_path, Fdaemon_initialized):
7145 * eval.c (call_debugger, Finteractive_p, interactive_p):
7146 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7147 (maybe_call_debugger, Fbacktrace):
7148 * process.c (read_process_output, exec_sentinel):
7149 Use bool for booleans.
7150 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7151 All callers changed.
7152 * eval.c (interactive_p): Omit always-true boolean argument
7153 EXCLUDE_SUBRS_P. All callers changed.
7154 * dispextern.h, lisp.h: Reflect above API changes.
7155 * firstfile.c (dummy): Use the address of 'main', whose signature
7156 won't change, instead of the address of 'initialize', whose
7157 signature just changed from int to bool.
7158 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7159 * msdos.c (fatal_error_in_progress): ... from here.
7160 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7161 of incrementing it.
7162 (redisplay_internal, unwind_redisplay): Simply clear
7163 REDISPLAYING_P when unwinding, instead of saving its previous,
7164 always-false value and then restoring it.
7165
7166 Clean up some extern decls.
7167 Mostly, this hoists extern decls out of .c files and into .h files.
7168 That way, we're more likely to catch errors if the interfaces change.
7169 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7170 declare xg_mark_data.
7171 * dispextern.h (x_frame_parm_handlers):
7172 * font.h (Qxft):
7173 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7174 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7175 (Qultra_bold, Qoblique, Qitalic):
7176 Move extern decl here from .c file.
7177 * alloc.c (xg_mark_data) [USE_GTK]:
7178 * doc.c (Qclosure):
7179 * eval.c (Qlexical_binding):
7180 * fns.c (time) [!HAVE_UNISTD_H]:
7181 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7182 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7183 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7184 * lread.c (Qinternal_interpreter_environment):
7185 * minibuf.c (Qbuffer):
7186 * process.c (QCfamily, QCfilter):
7187 * widget.c (free_frame_faces):
7188 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7189 * xfont.c (x_clear_errors):
7190 * xterm.c (x_frame_parm_handlers):
7191 Remove now-redundant extern decls.
7192 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7193 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7194 Now static.
7195 * xfaces.c: Remove unnecessary static decls.
7196 * xterm.c (updating_frame): Remove decl of nonexistent object.
7197
7198 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7199 when building globals.h, as the objects that are not built on
7200 this host are not needed to compile C files on this host.
7201
7202 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7203
7204 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7205
7206 * frame.h: Add missing prototype for x_wm_set_size_hint.
7207
7208 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7209
7210 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7211 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7212 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7213 (Fsubstitute_command_keys):
7214 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7215 (save_excursion_save, save_excursion_restore)
7216 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7217 (format_time_string, general_insert_function)
7218 (make_buffer_string, make_buffer_string_both)
7219 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7220 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7221 (copy_text, insert_1, insert_1_both, insert_from_string)
7222 (insert_from_string_before_markers, insert_from_string_1)
7223 (insert_from_buffer, insert_from_buffer_1, replace_range)
7224 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7225 (del_range_2, modify_region):
7226 * intervals.c (intervals_equal, balance_possible_root_interval)
7227 (adjust_intervals_for_insertion, merge_properties_sticky)
7228 (graft_intervals_into_buffer, lookup_char_property)
7229 (adjust_for_invis_intang, set_point_both)
7230 (get_property_and_range, compare_string_intervals)
7231 (set_intervals_multibyte_1, set_intervals_multibyte):
7232 * keyboard.c (decode_timer):
7233 Use bool for boolean.
7234 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7235 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7236
7237 2012-09-02 Chong Yidong <cyd@gnu.org>
7238
7239 * keymap.c (push_key_description): Print M-TAB as C-M-i
7240 (Bug#11758).
7241
7242 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
7243
7244 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7245 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7246 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7247 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7248 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7249 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7250 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7251
7252 2012-09-01 Eli Zaretskii <eliz@gnu.org>
7253
7254 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7255 more than one grapheme cluster passed to the shaper: compute the
7256 offset adjustment values separately for each cluster. (Bug#11860)
7257
7258 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7259 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7260 about implicit conversions from integer to pointer.
7261
7262 2012-09-01 Daniel Colascione <dancol@dancol.org>
7263
7264 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7265 system used too early.
7266
7267 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7268
7269 Better seed support for (random).
7270 * emacs.c (main): Call init_random.
7271 * fns.c (Frandom): Set the seed from a string argument, if given.
7272 Remove long-obsolete Gentzel cruft.
7273 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7274 (init_random): New function.
7275
7276 2012-09-01 Daniel Colascione <dancol@dancol.org>
7277
7278 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7279 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7280 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7281 x_wm_set_size_hint, x_query_colors, x_real_positions,
7282 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7283 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7284 all of which have been moved to common code.
7285
7286 * xfaces.c: Include TERM_HEADER instead of listing all possible
7287 window-system headers.
7288
7289 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7290 to match header.
7291
7292 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7293 directly accessing frame internals.
7294
7295 * w32font.h: Include font.h. Define syms_of_w32font and
7296 globals_of_w32font.
7297
7298 * process.c: Include TERM_HEADER instead of listing all possible
7299 window-system headers.
7300
7301 * nsterm.h: Remove declarations now in frame.h.
7302 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
7303
7304 * menu.c: Include TERM_HEADER instead of listing all possible
7305 window-system headers.
7306
7307 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7308 window system.
7309
7310 * keyboard.c: Include TERM_HEADER instead of listing all possible
7311 window-system headers.
7312
7313 * image.c: Include TERM_HEADER instead of listing all possible
7314 window-system headers. Declare Vlibrary_cache when compiling for
7315 Windows.
7316
7317 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7318 window system declarations.
7319
7320 * frame.h: Move common functions here: set_frame_menubar,
7321 x_set_window_size, x_sync, x_get_focus_frame,
7322 x_set_mouse_position, x_set_mouse_pixel_position,
7323 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7324 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7325 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7326 x_activate_menubar, x_real_positions, x_bitmap_icon,
7327 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7328 and x_query_colors.
7329
7330 * frame.c: Include TERM_HEADER instead of listing all possible
7331 window-system headers.
7332
7333 * font.c: Include TERM_HEADER instead of listing all possible
7334 window-system headers.
7335
7336 * emacs.c: Include TERM_HEADER.
7337
7338 * dispnew.c: Include TERM_HEADER instead of listing all possible
7339 window-system headers.
7340
7341 * ccl.h: Include character.h.
7342
7343 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7344 the current window system; include in list of objects to link into
7345 Emacs.
7346
7347 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7348
7349 Remove mark_ttys function and fix tty_display_info initialization.
7350 * lisp.h (mark_ttys): Remove prototype.
7351 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7352 to mark_ttys because all possible values of 'top_frame' slot are
7353 the frames which are reachable from Vframe_list.
7354 * term.c (mark_ttys): Remove.
7355 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7356
7357 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7358
7359 Change struct frame bitfields from unsigned char to unsigned.
7360 * frame.h (struct frame): Change type of 'display_preempted',
7361 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7362 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7363 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7364 bitfields from unsigned char to unsigned.
7365
7366 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7367
7368 Remove unused member of struct x_output and struct w32_output.
7369 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7370 * w32term.h (struct w32_output): Likewise.
7371
7372 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7373
7374 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7375 does not become zero (Bug#12234).
7376
7377 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7378
7379 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7380 for GCC 4.7.1 x86-64.
7381
7382 2012-08-30 Glenn Morris <rgm@gnu.org>
7383
7384 * lread.c (init_lread): For out-of-tree builds, only add the
7385 source directory's site-lisp dir to the load-path if it exists,
7386 consistent with in-tree builds. (Bug#12302)
7387
7388 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7389
7390 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
7391 button_values to NULL. Call setStykeMask so dialogs get a close button.
7392 (windowShouldClose:): Set window_closed.
7393 (dealloc): New member, free button_values.
7394 (process_dialog:): Make member function. Remove window argument,
7395 replace window with self. Count buttons and allocate and store values
7396 in button_values.
7397 (addButton:value:row:): value is int with the name tag. Call setTag
7398 with tag. Remove return self, declare return value as void.
7399 (addString:row:): Remove return self, declare return value as void.
7400 (addSplit): Remove return self, declare return value as void.
7401 (clicked:): Remove return self, declare return value as void.
7402 Set dialog_return to button_values[seltag]. Code formatting change.
7403 (initFromContents:isQuestion:): Adjust call to process_dialog.
7404 Code formatting change.
7405 (timeout_handler:): Set timer_fired to YES.
7406 (runDialogAt:): Set timer_fired to NO.
7407 Handle click on close button as quit.
7408
7409 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7410 Add window_closed and button_values. Add void as return value for
7411 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7412 Add process_dialog as new member.
7413
7414 2012-08-28 Eli Zaretskii <eliz@gnu.org>
7415
7416 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7417 is not one of the heaps we manage. (Bug#12242)
7418
7419 2012-08-28 Glenn Morris <rgm@gnu.org>
7420
7421 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7422
7423 2012-08-28 Martin Rudalics <rudalics@gmx.at>
7424
7425 * window.c (Fset_window_configuration): Remove handling of
7426 auto-buffer-name window parameter. Install revision of reverted
7427 fix.
7428
7429 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7430
7431 Do not allow to set major mode for a dead buffer.
7432 * buffer.c (Fset_buffer_major_mode): Signal an error
7433 if the buffer is dead.
7434 (Fother_buffer, other_buffer_safely): Remove redundant
7435 nested declaration.
7436
7437 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7438
7439 Always use set_buffer_if_live to restore original buffer at unwind.
7440 * buffer.h (record_unwind_current_buffer): New function.
7441 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7442 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7443 * undo.c, window.c: Adjust users.
7444 * buffer.c (set_buffer_if_live): Fix comment.
7445
7446 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7447
7448 Fix usage of set_buffer_internal.
7449 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7450 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7451 * coding.c (decode_coding): Omit redundant test.
7452 * fileio.c (decide_coding_unwind): Likewise.
7453 * fns.c (secure_hash): Likewise.
7454 * insdel.c (modify_region): Likewise.
7455 * keyboard.c (command_loop_1): Likewise.
7456 * print.c (PRINTFINISH): Likewise.
7457 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7458
7459 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7460
7461 * dispnew.c: Use bool for boolean.
7462 (frame_garbaged, display_completed, delayed_size_change)
7463 (fonts_changed_p, add_window_display_history)
7464 (add_frame_display_history, verify_row_hash)
7465 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7466 (row_equal_p, realloc_glyph_pool)
7467 (allocate_matrices_for_frame_redisplay)
7468 (showing_window_margins_p)
7469 (adjust_frame_glyphs_for_frame_redisplay)
7470 (build_frame_matrix_from_leaf_window, make_current)
7471 (mirrored_line_dance, mirror_line_dance, update_frame)
7472 (update_window_tree, update_single_window)
7473 (check_current_matrix_flags, update_window, update_text_area)
7474 (update_window_line, set_window_update_flags, scrolling_window)
7475 (update_frame_1, scrolling, buffer_posn_from_coords)
7476 (do_pending_window_change, change_frame_size)
7477 (change_frame_size_1, sit_for):
7478 Use bool for boolean.
7479 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7480 and remove last int (actually boolean) argument, which was always 0.
7481 All callers changed.
7482 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7483 * dispextern.h (struct composition_it): Use bool for boolean.
7484 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7485 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7486 * dired.c (file_name_completion):
7487 Use bool for boolean. (This was missed in an earlier change.)
7488
7489 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7490
7491 * window.c (Fset_window_configuration): Revert first part of
7492 last change.
7493
7494 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7495
7496 * nsterm.h (NSPanel): New class variable dialog_return.
7497
7498 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7499 Initialize dialog_return.
7500 (windowShouldClose:): Use stop instead of stopModalWithCode.
7501 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7502 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7503 event.
7504 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7505 modal loop returns.
7506
7507 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7508
7509 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7510 * composite.c (find_composition, composition_gstring_p)
7511 (composition_reseat_it, find_automatic_composition):
7512 * data.c (let_shadows_buffer_binding_p)
7513 (let_shadows_global_binding_p, set_internal, make_blv)
7514 (Fmake_variable_buffer_local, Fmake_local_variable)
7515 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7516 (cons_to_signed, arith_driver):
7517 * dbusbind.c (xd_in_read_queued_messages):
7518 * dired.c (directory_files_internal, file_name_completion):
7519 Use bool for booleans.
7520 * dired.c (file_name_completion):
7521 * process.h (fd_callback):
7522 Omit int (actually boolean) argument. It wasn't being used.
7523 All uses changed.
7524 * composite.h, lisp.h: Reflect above API changes.
7525
7526 * cmds.c, coding.c: Use bool for booleans.
7527 * cmds.c (move_point, Fself_insert_command):
7528 * coding.h (struct composition status, struct coding_system):
7529 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7530 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7531 (emacs_mule_char, decode_coding_emacs_mule)
7532 (encode_coding_emacs_mule, detect_coding_iso_2022)
7533 (decode_coding_iso_2022, encode_invocation_designation)
7534 (encode_designation_at_bol, encode_coding_iso_2022)
7535 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7536 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7537 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7538 (encode_coding_raw_text, detect_coding_charset)
7539 (decode_coding_charset, encode_coding_charset, detect_eol)
7540 (detect_coding, get_translation_table, produce_chars)
7541 (consume_chars, reused_workbuf_in_use)
7542 (make_conversion_work_buffer, code_conversion_save)
7543 (decode_coding_object, encode_coding_object)
7544 (detect_coding_system, char_encodable_p)
7545 (Funencodable_char_position, code_convert_region)
7546 (code_convert_string, code_convert_string_norecord)
7547 (Fset_coding_system_priority):
7548 * fileio.c (Finsert_file_contents):
7549 Use bool for booleans.
7550 * coding.h, lisp.h: Reflect above API changes.
7551 * coding.c: Remove unnecessary static function decls.
7552 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7553 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7554 not a boolean 'int', since callers never look at the return value.
7555 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7556 * coding.h (decoding_buffer_size, encoding_buffer_size)
7557 (emacs_mule_string_char): Remove unused extern decls.
7558 (struct iso_2022_spec, struct coding_system):
7559 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7560 (struct emacs_mule_spec): Remove unused field 'full_support'.
7561 All initializations removed.
7562 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7563
7564 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7565
7566 Fix spare memory change (Bug#12286).
7567 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7568 (valid_lisp_object_p): Likewise.
7569
7570 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7571
7572 * window.c (Fset_window_configuration): Record any window's old
7573 buffer if it's replaced (see Bug#8789). If the new current
7574 buffer doesn't appear in the selected window, go to its old
7575 point (Bug#12208).
7576
7577 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7578
7579 Special MEM_TYPE_SPARE to denote reserved memory.
7580 * alloc.c (enum mem_type): New memory type.
7581 (refill_memory_reserve): Use new type for spare memory.
7582 This prevents live_cons_p and live_string_p from incorrect
7583 detection of uninitialized objects from spare memory as live.
7584
7585 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7586
7587 Spelling fixes.
7588 * Makefile.in (.PHONY): versioclean -> versionclean.
7589
7590 Remove unused external symbols.
7591 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7592 * window.c (Qwindow_valid_p, decode_valid_window):
7593 Now static, not extern.
7594 * data.c (Qinterval): Remove; unused.
7595 (syms_of_data): Do not define 'interval'.
7596 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7597 * window.h (decode_valid_window):
7598 Remove decls.
7599
7600 * character.c, charset.c, chartab.c: Use bool for booleans.
7601 * character.c (lisp_string_width, string_count_byte8)
7602 (string_escape_byte8):
7603 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7604 (load_charset_map_from_file, map_charset_chars)
7605 (Fdefine_charset_internal, define_charset_internal)
7606 (Fdeclare_equiv_charset, find_charsets_in_text)
7607 (Ffind_charset_region, char_charset, Fiso_charset):
7608 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7609 (sub_char_table_set, sub_char_table_set_range)
7610 (char_table_set_range, optimize_sub_char_table)
7611 (map_sub_char_table):
7612 Use bool for boolean.
7613 * character.c (str_to_unibyte): Omit last boolean argument; it was
7614 always 0. All callers changed.
7615 * character.h, charset.h: Adjust to match previous changes.
7616 * character.h (char_printable_p): Remove decl of nonexistent function.
7617 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7618 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7619 are all boolean, so make them single-bit bitfields.
7620
7621 * lisp.h (ASET): Remove attempt to detect side effects.
7622 It was meant to be temporary and it often doesn't work,
7623 because when IDX has side effects the behavior of IDX==IDX
7624 is undefined. See Stefan Monnier in
7625 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7626
7627 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7628
7629 * lisp.h (functionp): New function (extracted from Ffunctionp).
7630 (FUNCTIONP): Use it.
7631 * eval.c (Ffunctionp): Use it.
7632
7633 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7634
7635 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7636 as that's faster and simpler than static storage. Don't bother
7637 with the g_main_context_query overhead if g_main_context_pending
7638 says no events are pending.
7639 (gfds, gfds_size): Remove these static vars.
7640 (xgselect_initialize): Remove; no longer needed.
7641 All uses and decls removed.
7642
7643 * emacs.c (fatal_error_signal_hook): Remove.
7644 All uses removed. This leftover from old code was always 0.
7645
7646 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7647 * casefiddle.c (casify_object, casify_region):
7648 * casetab.c (set_case_table):
7649 * category.c, category.h (word_boundary_p):
7650 * category.h (CHAR_HAS_CATEGORY):
7651 Use bool for booleans, instead of int.
7652
7653 2012-08-25 Eli Zaretskii <eliz@gnu.org>
7654
7655 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7656
7657 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7658
7659 On assertion failure, print backtrace if available.
7660 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7661 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7662 * Makefile.in (LIB_EXECINFO): New macro.
7663 (LIBES): Use it.
7664
7665 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7666 * bytecode.c (exec_byte_code):
7667 * callint.c (check_mark, Fcall_interactively):
7668 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7669 (getenv_internal, sync_process_alive, call_process_exited):
7670 * lisp.h (USE_SAFE_ALLOCA):
7671 Use bool for booleans, instead of int.
7672 * lisp.h, process.h: Adjust prototypes to match above changes.
7673 * callint.c (Fcall_interactively): Don't assume the mark's
7674 offset fits in 'int'.
7675
7676 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7677
7678 * buffer.c, buffer.h: Use bool for boolean.
7679 * buffer.c (reset_buffer_local_variables)
7680 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7681 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7682 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7683 (overlay_touches_p, overlay_strings, Foverlay_put)
7684 (report_overlay_modification, call_overlay_mod_hooks):
7685 (mmap_enlarge, mmap_set_vars):
7686 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7687 Use bool for booleans, instead of int.
7688 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7689 since the 1-or-0 return value is always ignored anyway.
7690 (mmap_initialized_p):
7691 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7692 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7693
7694 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7695
7696 * bidi.c: Use bool for boolean.
7697 This is a bit more readable, and makes the text segment of bidi.o
7698 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7699 Presumably it's faster too.
7700 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7701 Now bool.
7702 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7703 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7704 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7705 (bidi_explicit_dir_char, bidi_level_of_next_char)
7706 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7707 Use bool for booleans, instead of int.
7708 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7709 (bidi_unshelve_cache): Adjust decls to match code.
7710
7711 2012-08-23 Martin Rudalics <rudalics@gmx.at>
7712
7713 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7714 argument.
7715
7716 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7717
7718 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7719 * atimer.h: Include <stdbool.h>.
7720
7721 2012-08-22 Dan Nicolaescu <dann@gnu.org>
7722
7723 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7724 compile time tests instead of run time tests on systems that do
7725 not use them.
7726 (FRAME_MAC_P): Remove leftover from deleted code.
7727 * frame.c (syms_of_frame): Remove leftover from deleted code.
7728
7729 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7730
7731 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7732
7733 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7734
7735 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7736 Otherwise, the compiler complains about (A?B:C) where B is void
7737 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
7738 (fontset_add): Return void, for FONTSET_ADD.
7739
7740 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7741
7742 * alloc.c: Use bool for booleans.
7743 (gc_in_progress, abort_on_gc)
7744 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7745 (dont_register_blocks) [GC_MALLOC_CHECK]:
7746 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7747 (check_string_bytes, make_specified_string, memory_full)
7748 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7749 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7750 (mark_stack, valid_pointer_p, make_pure_string)
7751 (Fgarbage_collect, survives_gc_p, gc_sweep):
7752 Use bool for booleans, instead of int.
7753 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7754 Remove unused local.
7755 * alloc.c (PURE_POINTER_P):
7756 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7757 * editfns.c (Fformat):
7758 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7759 (Fdo_auto_save):
7760 * fns.c (sweep_weak_table):
7761 * lisp.h (suppress_checking, push_message, survives_gc_p)
7762 (make_pure_string, gc_in_progress, abort_on_gc):
7763 * lread.c (readchar, read1):
7764 * print.c (Fprin1_to_string):
7765 * xdisp.c (push_message):
7766 Use bool for booleans affected directly or indirectly by
7767 alloc.c's changes.
7768
7769 Make recently-introduced setters macros.
7770 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7771 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7772 (set_fontset_default, set_fontset_fallback): Rename from their
7773 upper-case counterparts, and make them functions rather than macros.
7774 This is more consistent with the other recently-introduced setters.
7775 These don't need to be inline, since they're local.
7776
7777 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7778
7779 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7780 the loop (Bug#12247).
7781
7782 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7783
7784 * lisp.h (vcopy): Use memcpy rather than our own loop.
7785 This fixes a performance regression introduced by the recent
7786 addition of vcopy. This means 'vcopy' will need to be modified
7787 for a copying collector, but that's OK. Also, tighten the
7788 checking in the assertion.
7789
7790 2012-08-21 Eli Zaretskii <eliz@gnu.org>
7791
7792 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7793 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7794 non-base glyph for the width of the base character, according to
7795 what x_draw_composite_glyph_string_foreground expects.
7796 Generate WADJUST value according to composition_gstring_width's
7797 expectations, to produce correct width of the composed character.
7798 Reverse the sign of the DU offset produced by ScriptPlace.
7799
7800 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7801
7802 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7803
7804 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7805
7806 Avoid direct writes to contents member of struct Lisp_Vector.
7807 * lisp.h (vcopy): New function to copy data into vector.
7808 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7809 * fns.c (Ffillarray): Use ASET.
7810 * keyboard.c (timer_check_2): Use AREF and ASET.
7811 (append_tool_bar_item, Frecent_keys): Use vcopy.
7812 * lread.c (read_vector): Use ASET.
7813 * msdos.c (Frecent_doskeys): Use vcopy.
7814 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7815 (Finternal_merge_in_global_face): Use ASET and vcopy.
7816 * xfont.c (xfont_list_pattern): Likewise.
7817
7818 2012-08-21 Martin Rudalics <rudalics@gmx.at>
7819
7820 * window.c (Fwindow_point): For the selected window always return
7821 the position of its buffer's point.
7822 (Fset_window_point): For the selected window always go in its
7823 buffer to the specified position.
7824
7825 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7826
7827 Setter macros for fontsets.
7828 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7829 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7830 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7831 Adjust users.
7832
7833 2012-08-20 Glenn Morris <rgm@gnu.org>
7834
7835 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7836 Don't assume that `ln -f' works.
7837
7838 2012-08-20 Eli Zaretskii <eliz@gnu.org>
7839
7840 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7841 and later about non-assignments with no effect. See discussion at
7842 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7843 details.
7844
7845 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7846
7847 Inline setter functions for Lisp_Objects slots of struct specbinding.
7848 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7849 Adjust users.
7850
7851 2012-08-20 Martin Rudalics <rudalics@gmx.at>
7852
7853 * window.c (select_window): Always make selected window's buffer
7854 current.
7855
7856 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7857
7858 Use AREF and ASET for docstrings of category tables.
7859 * category.h (CATEGORY_DOCSTRING): Use AREF.
7860 (SET_CATEGORY_DOCSTRING): Use ASET.
7861 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7862
7863 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7864
7865 Inline setter functions for hash table members.
7866 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7867 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7868 (set_hash_key_and_value, set_hash_index, set_hash_next)
7869 (set_hash_hash): New functions.
7870 * charset.c, fns.c: Adjust users.
7871
7872 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7873
7874 Inline getter and setter functions for per-buffer values.
7875 * buffer.h (per_buffer_default, set_per_buffer_default)
7876 (per_buffer_value, set_per_buffer_value): New functions.
7877 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7878 * buffer.c, data.c: Adjust users.
7879
7880 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
7881
7882 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7883
7884 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7885
7886 Rely on <config.h> + <unistd.h> to declare 'environ',
7887 as gnulib does this if the system doesn't.
7888 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
7889 Remove declaration. MS-Windows declares it on stdlib.h which is
7890 included by conf_post.h.
7891 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7892 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7893 * vm-limit.c: Include <unistd.h>, for 'environ'.
7894
7895 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7896 (start_of_data): Remove decl; mem-limits.h provides it.
7897
7898 * xdisp.c (handle_invisible_prop): Make it a bit faster
7899 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7900
7901 2012-08-19 Chong Yidong <cyd@gnu.org>
7902
7903 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7904 ends (Bug#3874).
7905
7906 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7907
7908 * .gdbinit: Use call instead of set when calling a function in the
7909 inferior.
7910
7911 * data.c (set_internal): Don't use set_blv_found.
7912 (Fkill_local_variable): Likewise.
7913
7914 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7915
7916 * nsfont.m (ns_ascii_average_width): Ensure the string
7917 ascii_printable is initialized with a null-terminated character
7918 array. Otherwise, it can contain undesired extra characters.
7919
7920 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7921
7922 port new setting code to Sun C 5.8 2005/10/13
7923 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7924 Return void, not Lisp_Object. Otherwise, the compiler
7925 complains about (A?B:C) where B is void and C is Lisp_Object
7926 when compiling CHAR_TABLE_SET, due to the recent change to
7927 the API of sub_char_table_set_contents.
7928
7929 2012-08-18 Chong Yidong <cyd@gnu.org>
7930
7931 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7932 for the string case (Bug#3874).
7933
7934 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7935
7936 * buffer.h (BSET): Remove (Bug#12215).
7937 Replace all uses with calls to new setter functions.
7938 (bset_bidi_paragraph_direction, bset_case_canon_table)
7939 (bset_case_eqv_table, bset_directory, bset_display_count)
7940 (bset_display_time, bset_downcase_table)
7941 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7942 (bset_last_selected_window, bset_local_var_alist)
7943 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7944 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7945 (bset_width_table):
7946 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7947 (bset_auto_fill_function, bset_auto_save_file_format)
7948 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7949 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7950 (bset_cache_long_line_scans, bset_case_fold_search)
7951 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7952 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7953 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7954 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7955 (bset_header_line_format, bset_indicate_buffer_boundaries)
7956 (bset_indicate_empty_lines, bset_invisibility_spec)
7957 (bset_left_fringe_width, bset_major_mode, bset_mark)
7958 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7959 (bset_name, bset_overwrite_mode, bset_pt_marker)
7960 (bset_right_fringe_width, bset_save_length)
7961 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7962 (bset_scroll_up_aggressively, bset_selective_display)
7963 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7964 (bset_word_wrap, bset_zv_marker):
7965 * category.c (bset_category_table):
7966 * syntax.c (bset_syntax_table):
7967 New setter functions.
7968
7969 * process.h (PSET): Remove (Bug#12215).
7970 Replace all uses with calls to new setter functions.
7971 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7972 (PROCESS_INLINE): New macro.
7973 (pset_childp): New setter function.
7974 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7975 * process.c (PROCESS_INLINE):
7976 Define to EXTERN_INLINE, so that the corresponding functions
7977 are compiled into code.
7978 (pset_buffer, pset_command, pset_decode_coding_system)
7979 (pset_decoding_buf, pset_encode_coding_system)
7980 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7981 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7982 (pset_type, pset_write_queue): New setter functions.
7983
7984 * window.h (WSET): Remove (Bug#12215).
7985 Replace all uses with calls to new setter functions.
7986 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7987 (WINDOW_INLINE): New macro.
7988 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7989 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7990 (wset_total_lines, wset_vertical_scroll_bar)
7991 (wset_window_end_pos, wset_window_end_valid)
7992 (wset_window_end_vpos): New setter functions.
7993 * window.c (WINDOW_INLINE):
7994 Define to EXTERN_INLINE, so that the corresponding functions
7995 are compiled into code.
7996 (wset_combination_limit, wset_dedicated, wset_display_table)
7997 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7998 (wset_new_normal, wset_new_total, wset_next_buffers)
7999 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8000 (wset_prev_buffers, wset_right_fringe_width)
8001 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8002 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8003 (wset_window_parameters):
8004 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8005 (wset_column_number_displayed, wset_region_showing):
8006 New setter functions.
8007
8008 * termhooks.h (TSET): Remove (Bug#12215).
8009 Replace all uses with calls to new setter functions.
8010 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8011 (TERMHOOKS_INLINE): New macro.
8012 (tset_charset_list, tset_selection_alist): New setter functions.
8013 * terminal.c (TERMHOOKS_INLINE):
8014 Define to EXTERN_INLINE, so that the corresponding functions
8015 are compiled into code.
8016 (tset_param_alist): New setter function.
8017
8018 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8019
8020 * keyboard.h (KSET): Remove (Bug#12215).
8021 Replace all uses with calls to new setter functions.
8022 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8023 (KEYBOARD_INLINE): New macro.
8024 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8025 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8026 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8027 New setter functions.
8028 * keyboard.c (KEYBOARD_INLINE):
8029 Define to EXTERN_INLINE, so that the corresponding functions
8030 are compiled into code.
8031 (kset_echo_string, kset_kbd_queue)
8032 (kset_keyboard_translate_table, kset_last_prefix_arg)
8033 (kset_last_repeatable_command, kset_local_function_key_map)
8034 (kset_overriding_terminal_local_map, kset_real_last_command)
8035 (kset_system_key_syms): New setter functions.
8036
8037 * frame.h (FSET): Remove (Bug#12215).
8038 Replace all uses with calls to new setter functions.
8039 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8040 (FRAME_INLINE): New macro.
8041 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8042 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8043 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8044 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8045 (fset_param_alist, fset_root_window, fset_scroll_bars)
8046 (fset_selected_window, fset_title, fset_tool_bar_items)
8047 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8048 * frame.c (FRAME_INLINE):
8049 Define to EXTERN_INLINE, so that the corresponding functions
8050 are compiled into code.
8051 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8052
8053 A few more naming-convention fixes for getters and setters.
8054 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8055 and rename from buffer_overlays_set_before.
8056 (set_buffer_overlays_after): Move here from buffer.h, and rename
8057 from buffer_overlays_set_after.
8058 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8059 All uses changed.
8060 (set_buffer_intervals): Rename from buffer_set_intervals.
8061 * intervals.c (set_interval_object): Move here from intervals.h,
8062 and rename from interval_set_object.
8063 (set_interval_left): Move here from intervals.h, and rename from
8064 interval_set_left.
8065 (set_interval_right): Move here from intervals.h, and rename from
8066 interval_set_right.
8067 (copy_interval_parent): Move here from intervals.h, and rename from
8068 interval_copy_parent.
8069 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8070 (set_interval_plist): Rename from interval_set_plist.
8071 Return void, not Lisp_Object, since no caller uses the result.
8072 * lisp.h (string_intervals): Rename from string_get_intervals.
8073 (set_string_intervals): Rename from string_set_intervals.
8074
8075 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8076 (set_char_table_contents): Rename from char_table_set_contents.
8077 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8078 All uses changed. See the end of
8079 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8080
8081 * lisp.h (CSET): Remove (Bug#12215).
8082 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8083 (set_char_table_purpose): New functions,
8084 replacing CSET. All uses changed. For example, replace
8085 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8086 "set_char_table_parent (char_table, parent);".
8087 The old version was confusing because it used the same name
8088 'parent' for two different things.
8089
8090 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8091
8092 Functions to get and set Lisp_Object fields of buffer-local variables.
8093 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8094 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8095 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8096 * data.c, eval.c, frame.c: Adjust users.
8097
8098 2012-08-17 Chong Yidong <cyd@gnu.org>
8099
8100 * xfaces.c (merge_face_vectors): If the target font specfies a
8101 font spec, make the font's attributes take precedence over
8102 directly-specified attributes.
8103 (merge_face_ref): Recognize :font.
8104
8105 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8106
8107 Do not use memcpy for copying intervals.
8108 * intervals.c (reproduce_interval): New function.
8109 (reproduce_tree, reproduce_tree_obj): Use it.
8110 (reproduce_tree_obj): Remove prototype.
8111
8112 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8113
8114 * lisp.h (duration_to_sec_usec): Remove unused decl.
8115
8116 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8117
8118 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8119 to an allocated instance of NSString, not to the class itself.
8120
8121 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8122
8123 * makefile.w32-in (C_CTYPE_H): New macro.
8124 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8125 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8126 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8127
8128 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8129
8130 Use ASCII tests for character types.
8131 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8132 * xfns.c, xterm.c:
8133 Don't include <ctype.h>; was not needed.
8134 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8135 * sysdep.c, xfaces.c:
8136 Include <c-ctype.h> instead of <ctype.h>.
8137 * nsterm.m: Include <c-ctype.h>.
8138 * charset.c (read_hex):
8139 * doc.c (Fsnarf_documentation):
8140 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8141 (DRIVE_LETTER) [DOS_NT]:
8142 (Ffile_name_directory, Fexpand_file_name)
8143 (Fsubstitute_in_file_name):
8144 * font.c (font_parse_xlfd, font_parse_fcname):
8145 * frame.c (x_set_font_backend):
8146 * gtkutil.c (xg_get_font):
8147 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8148 * nsimage.m (hexchar):
8149 * nsterm.m (ns_xlfd_to_fontname):
8150 * sysdep.c (system_process_attributes):
8151 * xfaces.c (hash_string_case_insensitive):
8152 Use C-locale tests instead of locale-specific tests for character
8153 types, since we want the ASCII interpretation here, not the
8154 interpretation suitable for whatever happens to be the current locale.
8155
8156 2012-08-16 Martin Rudalics <rudalics@gmx.at>
8157
8158 Consistently check windows for validity/liveness
8159 (Bug#11984, Bug#12025, Bug#12026).
8160 * lisp.h (CHECK_VALID_WINDOW): New macro.
8161 * window.c (decode_window): Rename to decode_live_window.
8162 (decode_valid_window, Fwindow_valid_p): New functions.
8163 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8164 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8165 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8166 (Fwindow_prev_sibling, Fwindow_combination_limit)
8167 (Fset_window_combination_limit, Fwindow_use_time)
8168 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8169 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8170 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8171 (Fwindow_hscroll, Fset_window_hscroll)
8172 (Fwindow_redisplay_end_trigger)
8173 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8174 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8175 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8176 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8177 (Fwindow_end, Fset_window_point, Fset_window_start)
8178 (Fpos_visible_in_window_p, Fwindow_line_height)
8179 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8180 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8181 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8182 (Fset_window_parameter, Fwindow_display_table)
8183 (Fset_window_display_table, Fdelete_other_windows_internal)
8184 (Fset_window_buffer, Fset_window_new_total)
8185 (Fset_window_new_normal, Fdelete_window_internal)
8186 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8187 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8188 (Fwindow_scroll_bars): Check whether argument window is a valid or
8189 live window. Update doc-strings.
8190 (syms_of_window): New symbol Qwindow_valid_p.
8191 * keyboard.c (Fposn_at_x_y): Check whether argument
8192 frame_or_window denotes a valid window.
8193
8194 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8195
8196 Fix previous char table change.
8197 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8198 * chartab.c (optimize_sub_char_table): Likewise.
8199
8200 2012-08-16 Chong Yidong <cyd@gnu.org>
8201
8202 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8203
8204 * xfont.c (xfont_open):
8205 * xftfont.c (xftfont_open): Set the font's max_width field.
8206
8207 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8208 min_width to space_width and average_width to the average over
8209 printable ASCII characters.
8210 (ns_char_width): Code cleanup.
8211 (ns_ascii_average_width): New utility function.
8212
8213 * font.h (struct font): Update comments.
8214
8215 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8216
8217 Simple interface to set Lisp_Object fields of character tables.
8218 * lisp.h (CSET): New macro.
8219 (char_table_set_extras, char_table_set_contents)
8220 (sub_char_table_set_contents): New function.
8221 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8222 * syntax.c: Adjust users.
8223
8224 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8225
8226 * eval.c (eval_sub): Bind lexical-binding.
8227 * lread.c (Qlexical_binding): Make non-static.
8228
8229 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8230
8231 * nsmenu.m (popupSession): Remove.
8232 (pop_down_menu): Remove endModalSession.
8233 (timeout_handler:): New method.
8234 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8235 Call runModalForWindow. Check timer_fired when it returns.
8236 If not set, cancel timer and break out of loop.
8237 Otherwise loop again, with a new timeout.
8238
8239 * nsterm.m: Include fcntl.h if present.
8240 (fd_entry, t_readfds, inNsSelect): Remove.
8241 (select_writefds, select_valid, select_timeout, selfds)
8242 (select_mutex, apploopnr): Add.
8243 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8244 Otherwise call kbd_buffer_store_event.
8245 (ns_send_appdefined): Remove release of fd_entry.
8246 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8247 Increment and decrement apploopnr.
8248 (ns_select): If no file descriptors, just do a NSTimer.
8249 Otherwise copy read/write masks and start select thread (fd_handler).
8250 Start main loop and wait for application defined event.
8251 Inform select thread to stop selecting after main loop is exited.
8252 (ns_term_init): Create selfds pipe and set non-blocking.
8253 Initialize select_mutex. Start the select thread (fd_handler).
8254 (fd_handler:): Loop forever, wait for info from the main thread
8255 to either start or stop selecting. When select returns, send
8256 and appdefined event.
8257 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8258 If not call kbd_buffer_store_event.
8259
8260 * nsterm.h (EmacsApp): fd_handler takes id argument.
8261 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8262
8263 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8264
8265 2012-08-15 Eli Zaretskii <eliz@gnu.org>
8266
8267 * region-cache.c (move_cache_gap): Update gap_len using the actual
8268 growth of the boundaries array. Do not change cache_len.
8269 (Bug#12196)
8270
8271 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8272
8273 Generalize and cleanup font subsystem checks.
8274 * font.h (FONT_DEBUG, font_assert): Remove.
8275 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8276 Change font_assert to eassert. Use eassert where appropriate.
8277
8278 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8279
8280 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8281
8282 2012-08-15 Chong Yidong <cyd@gnu.org>
8283
8284 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8285 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8286 extract the font descriptor instead of just the font name.
8287 In that case, return a font spec instead of a string.
8288 (x_last_font_name): Move to this file from xfns.c.
8289
8290 * xfns.c (Fx_select_font): The return value can also be a font
8291 spec. Move x_last_font_name management to gtkutil.c.
8292
8293 * xfaces.c: Make font weight and style symbols non-static.
8294
8295 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8296
8297 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8298 (bug#12117).
8299
8300 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8301
8302 * alloc.c (Fgarbage_collect): Use plural form consistently.
8303
8304 2012-08-14 Eli Zaretskii <eliz@gnu.org>
8305
8306 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8307 iteration through the command loop. Fixes a problem whereby mouse
8308 movements are ignored until the first mouse click.
8309
8310 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8311
8312 Use bool, not int, for Lisp booleans.
8313 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8314 makes Emacs a bit smaller and presumably a bit faster.
8315 * lisp.h: Include <stdbool.h>.
8316 (struct Lisp_Boolfwd, defvar_bool):
8317 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8318 * regex.c [!emacs]: Include <stdbool.h>.
8319 (false, true): Remove; <stdbool.h> does this for us now.
8320
8321 2012-08-14 Chong Yidong <cyd@gnu.org>
8322
8323 * character.c (Fcharacterp): Doc fix (Bug#12076).
8324
8325 * data.c (Findirect_variable): Doc fix (Bug#11040).
8326
8327 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8328
8329 * editfns.c (Fformat): Doc fix (Bug#12059).
8330 (Fsave_current_buffer): Doc fix (Bug#11542).
8331
8332 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8333
8334 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8335 (bug#12022).
8336
8337 2012-08-14 Martin Rudalics <rudalics@gmx.at>
8338
8339 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8340 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8341 * minibuf.c (choose_minibuf_frame, read_minibuf):
8342 * w32fns.c (x_create_tip_frame):
8343 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8344 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8345
8346 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8347
8348 * intervals.c (offset_intervals): Remove obsolete comment.
8349
8350 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8351
8352 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8353
8354 2012-08-14 Gergely Risko <gergely@risko.hu>
8355
8356 * coding.c (decode_coding): Record buffer modification before
8357 disabling undo_list (Bug#11773).
8358
8359 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8360
8361 Revert and cleanup some recent overlay changes.
8362 * buffer.h (enum overlay_type): Remove.
8363 (buffer_get_overlays, buffer_set_overlays): Likewise.
8364 (buffer_set_overlays_before, buffer_set_overlays_after):
8365 New function. Adjust users.
8366 (unchain_both): Add eassert.
8367
8368 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8369
8370 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8371
8372 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8373
8374 * gtkutil.c (xg_mark_data): Don't assume C99.
8375
8376 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8377
8378 * gtkutil.c (xg_frame_tb_info): New struct.
8379 (TB_INFO_KEY): New define.
8380 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8381 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8382 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8383 if not present.
8384 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
8385 is up to date. Otherwise store new data.
8386 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8387
8388 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8389
8390 Use KSET for write access to Lisp_Object members of struct kboard.
8391 * keyboard.h (KSET): New macro.
8392 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8393 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8394 * xterm.c: Adjust users.
8395
8396 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8397
8398 Use BSET for write access to Lisp_Object members of struct buffer.
8399 * buffer.h (BSET): New macro.
8400 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8401 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8402 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8403 * window.c, xdisp.c, xfns.c: Adjust users.
8404
8405 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8406
8407 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8408
8409 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8410
8411 * nsterm.m (not_in_argv): New function.
8412 (application:openFile, application:openTempFile:):
8413 (application:openFileWithoutUI:, application:openFiles:): Open file
8414 if not_in_argv returns non-zero (bug#12171).
8415
8416 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
8417 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8418 Define for Gtk+ versions less than 3.2.
8419 (xg_get_font_name): Use those functions/macros here.
8420 Reported by Frans Oilinki <moilinki@gmail.com>.
8421
8422 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8423
8424 * unexmacosx.c (copy_data_segment): Copy initialized data in
8425 statically linked libraries from input file rather than memory.
8426
8427 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8428 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8429 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8430
8431 2012-08-10 Glenn Morris <rgm@gnu.org>
8432
8433 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8434 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8435
8436 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8437
8438 Fix last change to allow compilation with low optimization levels.
8439 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8440 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8441
8442 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8443
8444 Use common inline syntax in intervals.h.
8445 * intervals.h (INTERVALS_INLINE): New macro.
8446 Change all users from LISP_INLINE.
8447
8448 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8449
8450 Define Qnone once for all platforms.
8451 * frame.c (Qnone): Define here.
8452 (syms_of_frame): DEFSYM it.
8453 * lisp.h (Qnone): New declaration.
8454 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8455 * xfns.c: Remove duplication. Adjust users.
8456
8457 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8458
8459 Remove unused macros from intervals.h.
8460 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8461 * intervals.c: Adjust comment.
8462
8463 2012-08-10 Eli Zaretskii <eliz@gnu.org>
8464
8465 * w32fns.c <w32_unicode_gui>: New static variable.
8466 (globals_of_w32fns): Initialize it according to os_subtype.
8467 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8468 testing os_subtype.
8469
8470 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
8471 Eli Zaretskii <eliz@gnu.org>
8472
8473 Fix bug #10299 with Unicode characters sent by customized
8474 keyboards created by MSKLC.
8475 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8476 (w32_init_class): Use it to initialize the Emacs class with either
8477 ANSI or Unicode API calls.
8478 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8479 later.
8480 (w32_wnd_proc): If the character code sent by WM_CHAR or
8481 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8482 original message. Call DefWindowProcW on NT and later.
8483
8484 2012-08-10 Glenn Morris <rgm@gnu.org>
8485
8486 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8487
8488 * lisp.h (DIRECTORY_SEP): Let configure set it.
8489
8490 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8491
8492 Use TSET for write access to Lisp_Object slots of struct terminal.
8493 * termhooks.h (TSET): New macro.
8494 * coding.c, terminal.c, xselect.c: Adjust users.
8495
8496 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8497
8498 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8499 the failing expression, include them in the error message.
8500 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8501 * lisp.h (internal_condition_case_n): Update declaration.
8502
8503 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8504
8505 Inline functions to examine and change buffer overlays.
8506 * buffer.c (unchain_both): New function.
8507 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8508 (buffer_has_overlays): New function.
8509 (enum overlay_type): New enum.
8510 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8511 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8512
8513 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8514
8515 Inline functions to examine and change buffer intervals.
8516 * alloc.c (mark_interval_tree): Remove.
8517 (MARK_INTERVAL_TREE): Simplify.
8518 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8519 * intervals.c (buffer_balance_intervals): New function.
8520 (graft_intervals_into_buffer): Adjust indentation.
8521 (set_intervals_multibyte): Simplify.
8522 * buffer.h (BUF_INTERVALS): Remove.
8523 (buffer_get_intervals, buffer_set_intervals): New function.
8524 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8525 * intervals.c, textprop.c: Adjust users.
8526
8527 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8528
8529 Inline functions to examine and change string intervals.
8530 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8531 (string_get_intervals, string_set_intervals): New function.
8532 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8533 * lread.c, print.c, textprop.c: Adjust users.
8534
8535 2012-08-08 Glenn Morris <rgm@gnu.org>
8536
8537 * lisp.mk (lisp): Remove language/persian.elc.
8538
8539 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8540
8541 Cleanup intervals.
8542 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8543 (NULL_INTERVAL_P): Likewise. Adjust users.
8544 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8545 Adjust comment. Move under #if 0.
8546 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8547 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8548
8549 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8550
8551 Check total length of intervals with eassert.
8552 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8553 * intervals.c: Change all users to eassert.
8554
8555 2012-08-07 Eli Zaretskii <eliz@gnu.org>
8556
8557 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8558 Rename fields to match removal of FGET and WGET and disuse of
8559 INTERNAL_FIELD in Lisp_Cons.
8560
8561 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8562
8563 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8564 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8565 name since all xname users are fixed long time ago. Do not
8566 use INTERNAL_FIELD.
8567 (set_symbol_name, set_symbol_function, set_symbol_plist):
8568 (set_symbol_next, set_overlay_plist): New function.
8569 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8570 (struct Lisp_Overlay): Likewise.
8571 (CVAR, MVAR, SVAR): Remove.
8572 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8573 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8574 * xterm.c: Adjust users.
8575 * .gdbinit: Change to use name field of struct Lisp_Symbol
8576 where appropriate.
8577
8578 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8579
8580 Basic functions to set Lisp_Object and pointer slots of intervals.
8581 * intervals.h (interval_set_parent, interval_set_object):
8582 (interval_set_left, interval_set_right, interval_set_plist):
8583 (interval_copy_parent): New function.
8584 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
8585 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8586 Adjust indentation.
8587 (INTERVAL_SIZE): Remove. Adjust users.
8588 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8589
8590 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8591
8592 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8593 * process.h (PGET): Remove.
8594 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8595 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8596
8597 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8598
8599 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8600 * window.h (WGET): Remove.
8601 (struct window): Do not use INTERNAL_FIELD.
8602 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8603 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8604 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8605 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8606 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8607 Adjust users.
8608
8609 2012-08-07 Chong Yidong <cyd@gnu.org>
8610
8611 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8612 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8613 (Fdelete_window_internal): Signal an error if the window is not on
8614 a live frame (Bug#12025).
8615
8616 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8617
8618 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8619 * frame.h (FGET): Remove.
8620 (struct frame): Do not use INTERNAL_FIELD.
8621 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8622 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8623 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8624 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8625
8626 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
8627
8628 * w32.c: Silence compiler warnings.
8629 (map_w32_filename): Remove unused variable `is_fat'.
8630 (chase_symlinks): Add parentheses around expression.
8631
8632 2012-08-06 Glenn Morris <rgm@gnu.org>
8633
8634 * sysdep.c: Respect BROKEN_GETWD.
8635
8636 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8637 Let configure handle it.
8638 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8639
8640 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8641
8642 Use GCALIGNMENT where appropriate.
8643 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8644 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8645 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8646
8647 2012-08-06 Eli Zaretskii <eliz@gnu.org>
8648
8649 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8650 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
8651
8652 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8653
8654 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8655 that should be sufficient for everyone.
8656
8657 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8658
8659 * keyboard.c (timer_check_2): Add break so timer_check returns next
8660 timeout.
8661
8662 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8663
8664 Fix Windows build errors introduced after converting to WGET and WSET.
8665 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8666 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8667
8668 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8669
8670 * nsterm.m (ns_frame_rehighlight): Use FSET.
8671
8672 * nsmenu.m (ns_update_menubar): Use FSET.
8673
8674 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8675
8676 Separate read and write access to Lisp_Object slots of Lisp_Process.
8677 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8678 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8679
8680 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8681
8682 Separate read and write access to Lisp_Object slots of struct window.
8683 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8684 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8685 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8686 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8687 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8688 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8689 Adjust users.
8690
8691 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8692
8693 Fix Windows build errors introduced after converting to FGET and FSET.
8694 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8695 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8696 (w32_judge_scroll_bars): Change to use FSET.
8697 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8698
8699 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8700
8701 Fix replacement typo.
8702 * window.c (replace_window): Set root_window instead of
8703 selected_window. This fixes a total window subsystem
8704 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8705
8706 2012-08-06 Glenn Morris <rgm@gnu.org>
8707
8708 * lisp.mk (lisp): Add language/persian.elc.
8709
8710 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8711
8712 Separate read and write access to Lisp_Object slots of struct frame.
8713 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8714 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8715 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8716 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8717 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8718
8719 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8720
8721 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8722
8723 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8724
8725 Generalize common compile-time constants.
8726 * lisp.h (header_size, bool_header_size, word_size): Now here.
8727 (struct Lisp_Vector): Add comment.
8728 (struct Lisp_Bool_Vector): Move up to define handy constants.
8729 (VECSIZE, PSEUDOVECSIZE): Simplify.
8730 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8731 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8732 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8733 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8734 * xfont.c, xmenu.c: Use word_size where appropriate.
8735
8736 2012-08-05 Lawrence Mitchell <wence@gmx.li>
8737
8738 * search.c (Freplace_match): Treat \? in the replacement text
8739 literally (Bug#8161).
8740
8741 2012-08-05 Chong Yidong <cyd@gnu.org>
8742
8743 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8744 * frame.c (Vdelete_frame_functions):
8745 * emacs.c (Vkill_emacs_hook): Doc fix.
8746
8747 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8748
8749 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8750 --with-x-toolkit=no builds.
8751 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8752
8753 2012-08-04 Chong Yidong <cyd@gnu.org>
8754
8755 * syntax.c (Fmodify_syntax_entry): Doc fix.
8756
8757 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8758
8759 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8760 * w32.c (init_environment): Change the default values of many
8761 environment variables in dflt_envvars[] to NULL, to avoid pushing
8762 them into environment when they were not already defined.
8763 Remove the code that deletes site-lisp subdirectories from the default
8764 value of EMACSLOADPATH, as it is no longer needed.
8765 (check_windows_init_file): Now external, not static.
8766 Use Vload_path as is, without adding anything, as this function is now
8767 called when Vload_path is already set up.
8768
8769 * w32.h (check_windows_init_file): Add prototype.
8770
8771 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8772 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8773 compatibility with Posix platforms.
8774 (main): Move the call to check_windows_init_file to here from
8775 w32.c.
8776 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8777 any, in the DEFALT argument into the root of the Emacs build or
8778 installation tree, as appropriate.
8779
8780 * callproc.c (init_callproc_1): Call decode_env_path instead of
8781 doing its equivalent by hand.
8782 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8783 the code that sets Vexec_path run on MS-Windows.
8784
8785 * lread.c (init_lread): Add comments to #ifdef's.
8786
8787 * msdos.c (dos_set_window_size, IT_update_begin)
8788 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8789 instead of direct references.
8790
8791 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8792
8793 Export DEFAULT_REHASH_* to GDB.
8794 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8795 Now constants, not macros.
8796
8797 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8798
8799 Remove unnecessary casts involving pointers.
8800 These casts are no longer needed now that we assume C89 or later,
8801 since they involve casting to or from void *.
8802 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8803 (make_pure_float, make_pure_vector):
8804 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8805 * macros.c (Fstart_kbd_macro):
8806 * menu.c (find_and_return_menu_selection):
8807 * minibuf.c (read_minibuf_noninteractive):
8808 * sysdep.c (closedir):
8809 * xdisp.c (x_produce_glyphs):
8810 * xfaces.c (compare_fonts_by_sort_order):
8811 * xfns.c (x_real_positions, select_visual):
8812 * xselect.c (x_stop_queuing_selection_requests)
8813 (x_get_window_property, x_get_window_property_as_lisp_data):
8814 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8815 Remove unnecessary pointer casts.
8816 * alloc.c (record_xmalloc): New function.
8817 * lisp.h (record_xmalloc): New decl.
8818 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8819 more like a function. This is because the pointer cast is not
8820 needed. All uses changed.
8821 * print.c (print_string, print_error_message): Avoid length recalc.
8822
8823 Improve fix for macroexp crash with debugging (Bug#12118).
8824 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8825 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8826 not supposed to be invoked from the garbage collector.
8827 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8828 (gc_aset): New function, which is like ASET but can be
8829 used in the garbage collector.
8830 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8831 (set_hash_index): Use it instead of ASET.
8832
8833 2012-08-03 Eli Zaretskii <eliz@gnu.org>
8834
8835 Support symlinks on latest versions of MS-Windows.
8836 * w32.c: Include winioctl.h and aclapi.h.
8837 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8838 (revert_to_self): Forward declarations of static functions.
8839 <static BOOL g_b_init_get_security_info>:
8840 <g_b_init_create_symbolic_link>: New static flags.
8841 (globals_of_w32): Initialize them to zero.
8842 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8843 (map_w32_filename): Improve commentary. Simplify switch.
8844 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8845 headers (most versions of MinGW w32api don't).
8846 (get_security_info, create_symbolic_link)
8847 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8848 New functions.
8849 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8850 in the argument file name.
8851 (sys_access): Call unc_volume_file_attributes only if
8852 GetFileAttributes fails with network-related error codes.
8853 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8854 have the required privileges.
8855 (get_file_security_desc_by_name): Rename from
8856 get_file_security_desc.
8857 (stat_worker): New function, with most of the guts of 'stat', and
8858 with addition of handling of symlinks and support for 'lstat'.
8859 If possible, get file's attributes and security information by
8860 handle, not by name. Produce S_IFLNK bit for symlinks, when
8861 called from 'lstat'.
8862 (stat, lstat): New functions, call 'stat_worker'.
8863 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8864 symlinks when the underlying filesystem supports them.
8865
8866 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8867
8868 Fix macroexp crash on Windows with debugging (Bug#12118).
8869 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8870 checking subscripts; problem introduced with the recent
8871 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8872 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8873 since it's used in non-static inline functions now.
8874
8875 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8876 Don't assume buffer size fits in 'int'. Remove unused local.
8877
8878 Use C99-style 'extern inline' if available.
8879 * buffer.h (BUFFER_INLINE):
8880 * category.h (CATEGORY_INLINE):
8881 * character.h (CHARACTER_INLINE):
8882 * charset.h (CHARSET_INLINE):
8883 * composite.h (COMPOSITE_INLINE):
8884 * dispextern.h (DISPEXTERN_INLINE):
8885 * lisp.h (LISP_INLINE):
8886 * systime.h (SYSTIME_INLINE):
8887 New macro, replacing 'static inline' in this header.
8888 * buffer.h, category.h, character.h, charset.h, composite.h:
8889 * dispextern.h, lisp.h, systime.h:
8890 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8891 * alloc.c (LISP_INLINE):
8892 * buffer.c (BUFFER_INLINE):
8893 * category.c (CATEGORY_INLINE):
8894 * character.c (CHARACTER_INLINE):
8895 * charset.c (CHARSET_INLINE):
8896 * composite.c (COMPOSITE_INLINE):
8897 * dispnew.c (DISPEXTERN_INLINE):
8898 * sysdep.c (SYSTIME_INLINE):
8899 Define to EXTERN_INLINE, so that the corresponding functions
8900 are compiled into code.
8901 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8902 (INLINE_HEADER_END): New macros.
8903 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8904 since it's used in non-static inline functions now.
8905 (VALMASK) [!USE_LSB_TAG]: Likewise.
8906
8907 2012-08-02 Glenn Morris <rgm@gnu.org>
8908
8909 * s/: Remove empty directory.
8910
8911 * s/ms-w32.h: Move to ../nt/inc.
8912 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8913 Update for new ms-w32.h location.
8914
8915 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8916
8917 Port to Solaris 8.
8918 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8919
8920 2012-08-02 Glenn Morris <rgm@gnu.org>
8921
8922 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8923 hard-coding the path separator.
8924
8925 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8926
8927 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8928 This how ASET and AREF are supposed to work, and makes
8929 it easier to think about future improvements. See
8930 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8931 * charset.h (set_charset_attr): New function.
8932 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8933 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8934 (aref_addr): New function. All uses of &AREF(...) changed.
8935 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8936 (set_hash_index): New functions. All lvalue-style uses of
8937 HASH_KEY etc. changed.
8938 * keyboard.c (set_prop): New function. All lvalue-style uses
8939 of PROP changed.
8940
8941 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8942
8943 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8944 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
8945 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
8946 * nsfns.m (ns_set_name_as_filename): Likewise.
8947 * nsmenu.m (ns_update_menubar): Likewise.
8948 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8949
8950 2012-08-01 Eli Zaretskii <eliz@gnu.org>
8951
8952 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8953 Adapt to latest changes in field names of the corresponding Lisp
8954 objects.
8955
8956 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8957
8958 2012-08-01 Glenn Morris <rgm@gnu.org>
8959
8960 * s/msdos.h: Remove file.
8961 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8962 * Makefile.in (S_FILE): Remove.
8963 (config_h): Remove S_FILE.
8964
8965 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8966
8967 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8968 Remove; moved to nt/config.nt.
8969
8970 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8971
8972 Use INTERNAL_FIELD for conses and overlays.
8973 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8974 Remove obsolete comment.
8975 (MVAR): New macro.
8976 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8977 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8978
8979 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8980
8981 Use INTERNAL_FIELD for symbols.
8982 * lisp.h (SVAR): New macro. Adjust users.
8983 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8984 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8985
8986 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8987
8988 Use INTERNAL_FIELD for processes.
8989 * process.h (PVAR): New macro. Adjust style.
8990 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8991 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8992
8993 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8994
8995 Use INTERNAL_FIELD for windows.
8996 * window.h (WVAR): New macro.
8997 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8998 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8999 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9000 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9001 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9002 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9003
9004 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9005
9006 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9007
9008 2012-08-01 Glenn Morris <rgm@gnu.org>
9009
9010 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9011 Move to configure.ac.
9012
9013 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9014
9015 * makefile.w32-in (CONFIG_H): Update dependencies.
9016 (CONF_POST_H): New macro.
9017
9018 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9019
9020 2012-07-31 Glenn Morris <rgm@gnu.org>
9021
9022 * Makefile.in (S_FILE): No longer set by configure.
9023
9024 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9025 is available.
9026 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9027
9028 * process.h (NULL_DEVICE):
9029 * emacs.c (SEPCHAR):
9030 * editfns.c (USER_FULL_NAME): Let configure set them.
9031
9032 * s/README, s/template.h: Remove files.
9033
9034 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9035
9036 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9037 Move to configure.ac.
9038
9039 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9040
9041 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9042 resulting renaming of 'struct frame' members.
9043
9044 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9045
9046 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9047 after introduction of FVAR.
9048
9049 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9050
9051 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9052
9053 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9054 instead of compositeToPoint.
9055 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9056
9057 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9058
9059 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9060
9061 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9062 * lisp.h (INTERNAL_FIELD): New macro.
9063 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9064 (BVAR): Change to use INTERNAL_FIELD.
9065 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9066 (KVAR): Change to use INTERNAL_FIELD.
9067 * frame.h (FVAR): New macro.
9068 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9069 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9070 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9071 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9072 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9073
9074 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9075
9076 Miscellaneous fixes for non-default X toolkits.
9077 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9078 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9079 Move under #ifdef USE_LUCID.
9080 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9081 definition and usage to avoid warnings.
9082
9083 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9084
9085 * nsterm.m (openFiles): Fix previous checkin.
9086
9087 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9088
9089 * indent.c (compute_motion): Remove unused local.
9090
9091 2012-07-31 Glenn Morris <rgm@gnu.org>
9092
9093 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9094
9095 * conf_post.h [USG5_4]:
9096 Move remaining contents of s/usg5-4-common.h here.
9097 * s/usg5-4-common.h: Remove file.
9098
9099 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9100 * s/irix6-5.h: Remove file.
9101
9102 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9103 * s/darwin.h: Remove file.
9104
9105 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9106 * s/hpux10-20.h: Remove file, which is now empty.
9107
9108 2012-07-30 Glenn Morris <rgm@gnu.org>
9109
9110 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9111 * Makefile.in (config_h): Add conf_post.h.
9112 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9113
9114 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9115
9116 * nsterm.m (ns_do_open_file): New variable.
9117 (ns_term_init): Set ns_do_open_file to YES after run returns.
9118 (openFile, openTempFile, openFileWithoutUI, openFiles):
9119 Open files only if ns_do_open_file.
9120
9121 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9122
9123 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9124 This no-op macro hasn't been needed for many years.
9125 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9126
9127 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9128 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9129 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9130 gdb_make_enums_visible.
9131 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9132 (DIRECTORY_SEP): Now a constant, not a macro.
9133
9134 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9135
9136 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9137 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9138
9139 * w32term.c <w32_keyboard_codepage>: Renamed from
9140 keyboard_codepage and now external. All users changed.
9141
9142 * w32term.h: Add declaration of w32_keyboard_codepage.
9143
9144 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9145 the codepage to translate keys to Unicode. If this argument is
9146 -1, use the value returned by GetConsoleCP. All callers changed.
9147
9148 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9149
9150 Update .PHONY listings in makefiles.
9151 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9152 bootstrap-clean, distclean, maintainer-clean, versioclean,
9153 extraclean, frc.
9154
9155 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9156 This is a bit clearer. Fix some commentary typos.
9157
9158 2012-07-30 Glenn Morris <rgm@gnu.org>
9159
9160 * s/netbsd.h: Let configure include signal.h if needed.
9161 Remove file, which is now empty.
9162
9163 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9164 Let configure set them.
9165 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9166 No more need to undefine.
9167
9168 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9169
9170 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9171 non-single-byte char when adding meta modifier. (Bug#12090)
9172
9173 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9174
9175 Convert safe_call to use variable number of arguments.
9176 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9177 (safe_call2): Fix comment.
9178 * lisp.h (safe_call): Adjust prototype.
9179 * coding.c (encode_coding_object): Change to use safe_call2.
9180 * xfaces.c (merge_face_heights): Change to use safe_call1.
9181
9182 2012-07-30 Glenn Morris <rgm@gnu.org>
9183
9184 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
9185 does that unconditionally. Remove file, which is now empty.
9186
9187 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9188 Remove empty files.
9189
9190 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9191
9192 Export to GDB most of lisp.h's remaining object-like macros.
9193 * lisp.h (min, max): Move earlier, because they're used earlier now.
9194 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9195 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9196 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9197 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9198 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9199 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9200 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9201 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9202 Now constants, for GDB. They need not be macros.
9203 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9204 Now constants, for GDB, as well as macros, for static initializers.
9205 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9206 Move to after the definition of struct Lisp_Char_Table,
9207 since the former now needs that type defined.
9208 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9209 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9210 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9211 New enums, for gdb_make_enums_visible.
9212 (GLYPH_MODE_LINE_FACE): Remove; unused.
9213 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
9214 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9215 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9216 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9217 enum maxargs, enum MAX_ALLOCA.
9218 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9219 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9220 no longer needed, now that they are done in lisp.h.
9221
9222 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9223
9224 Cleanup string bytes checking.
9225 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9226 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9227 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9228 (check_sblock, compact_small_strings): Simplify.
9229
9230 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9231
9232 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9233 These macros are confusing and no longer need to be defined, as
9234 the enum values now suffice. All uses replaced with definiens.
9235 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9236
9237 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
9238
9239 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9240 ($(BLD)/w32console.$(O)): Update dependencies.
9241
9242 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9243
9244 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9245 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9246 time. Adjust users.
9247 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9248
9249 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9250
9251 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9252 setting sitelisp (Bug#12010).
9253
9254 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9255
9256 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
9257
9258 * w32heap.c (cache_system_info):
9259 * w32.c (sys_rename):
9260 * w32proc.c (find_child_console, sys_kill): All users changed.
9261
9262 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9263
9264 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9265
9266 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9267
9268 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9269
9270 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9271
9272 Cleanup statistics calculation in Fgarbage_collect.
9273 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9274 Fix zombies percentage calculation. Simplify elapsed time calculation.
9275
9276 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9277
9278 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9279 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9280 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9281 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9282 (replace_range, replace_range_2, del_range_2): Change to eassert.
9283 * marker.c (byte_char_debug_check): Adjust style.
9284
9285 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9286
9287 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9288 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9289 long-ago-commented-out code that talks about "WIN32".
9290 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9291 All uses changed.
9292
9293 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9294
9295 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9296 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9297 Simplify by using alignof.
9298 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9299 * lisp.h: Include <stdalign.h>.
9300 (GCALIGNMENT): New macro and constant.
9301 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9302 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9303 (stdalign): New macro, if not already defined.
9304
9305 2012-07-28 Eli Zaretskii <eliz@gnu.org>
9306
9307 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9308 * w32inevt.c: Include w32inevt.h.
9309 (w32_read_console_input): New inline function, calls either
9310 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9311 w32_console_unicode_input.
9312 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9313 (w32_kbd_patch_key, key_event): Use the codepage returned by
9314 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9315 (key_event): use uChar.UnicodeChar only if
9316 w32_console_unicode_input is non-zero.
9317
9318 * w32console.c: Include w32heap.h.
9319 <w32_console_unicode_input>: New global variable.
9320 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9321 family of Windows, zero otherwise.
9322
9323 * w32inevt.h: Declare w32_console_unicode_input.
9324
9325 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9326 --without-x. (Bug#11742)
9327
9328 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9329
9330 Adjust GDB to reflect pvec_type changes (Bug#12036).
9331 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
9332 2012-07-04 changes to pseudovector representation.
9333 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
9334
9335 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
9336
9337 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9338 bus address.
9339 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9340
9341 2012-07-27 Eli Zaretskii <eliz@gnu.org>
9342
9343 * alloc.c (listn): Fix the order the arguments are consed onto the
9344 list.
9345
9346 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9347 enumeration constants, as PURE and HEAP are too general, and clash
9348 with other headers and sources, such as gmalloc.c and the
9349 MS-Windows system headers. All users changed.
9350
9351 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9352
9353 Revert last save_excursion_save and save_excursion_restore changes.
9354 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9355 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9356
9357 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9358
9359 Fix recently-introduced typos in Windows port.
9360 Reported by Martin Rudalics <rudalics@gmx.at>.
9361 * w32.c (init_environment): Replace comma with semicolon.
9362 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
9363
9364 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9365
9366 Improve GDB symbol export (Bug#12036).
9367 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9368 arms of an 'if', not using conditional expressions; otherwise GDB
9369 complains about the types in the unevaluated arm when the argument
9370 is an integer literal.
9371 (xgetint): Simplify expression.
9372 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9373 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9374 Zaretskii in <http://bugs.gnu.org/12036#13>.
9375 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9376 needed now that we have gdb_make_enums_visible.
9377 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9378 (enum enum_USE_LSB_TAG):
9379 New enum types, packaging up enums that need to be exported to GDB.
9380
9381 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9382
9383 Utility function to make a list from specified amount of objects.
9384 * lisp.h (enum constype): New datatype.
9385 (listn): New prototype.
9386 * alloc.c (listn): New function.
9387 (Fmemory_use_count, syms_of_alloc): Use it.
9388 * buffer.c (syms_of_buffer): Likewise.
9389 * callint.c (syms_of_callint): Likewise.
9390 * charset.c (define_charset_internal): Likewise.
9391 * coding.c (syms_of_coding): Likewise.
9392 * keymap.c (syms_of_keymap): Likewise.
9393 * search.c (syms_of_search): Likewise.
9394 * syntax.c (syms_of_syntax): Likewise.
9395 * w32.c (init_environment): Likewise.
9396 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9397 * xdisp.c (syms_of_xdisp): Likewise.
9398 * xfns.c (syms_of_xfns): Likewise.
9399
9400 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9401
9402 Fast save_excursion_save and save_excursion_restore.
9403 * lisp.h (struct Lisp_Excursion): New data type.
9404 (PVEC_EXCURSION): New pseudovector type.
9405 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9406 to deal with it. Adjust comments.
9407 (init_marker, attach_marker): New prototype.
9408 (unchain_marker): Adjust prototype.
9409 * marker.c (attach_marker): Change to global.
9410 (init_marker): New function.
9411 * alloc.c (Fmake_marker, build_marker): Use it.
9412 (build_marker): More easserts.
9413 (mark_object): Handle struct Lisp_Excursion.
9414 * editfns.c (save_excursion_save, save_excursion_restore):
9415 Reimplement to use struct Lisp_Excursion. Add comments.
9416
9417 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9418
9419 Fix export of symbols to GDB (Bug#12036).
9420 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9421 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9422 emacs.c, as this is a more-suitable home. Had this been done earlier
9423 the fix for 12036 would have avoided some of the problems noted in
9424 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9425 would have been more obvious.
9426 * emacs.c: Do not include <verify.h>; no longer needed.
9427 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
9428 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9429 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9430 Remove; now done in lisp.h.
9431 * lisp.h (PUBLISH_TO_GDB): New macro.
9432 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9433 (DATA_SEG_BITS): Use it.
9434 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9435 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9436 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9437 not be usable in #if. This simplifies things.
9438
9439 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
9440
9441 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9442
9443 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9444
9445 Simplify export of symbols to GDB (Bug#12036).
9446 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9447 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9448 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9449 Adjust to changes in lisp.h and emacs.c, by using
9450 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9451 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9452 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9453 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9454 instead of gdb_valbits.
9455 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9456 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9457 instead of gdb_array_mark_flag.
9458 (xboolvector): Get size from $->size, not $->header.size.
9459 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9460 (xreload, hook-run, hookpost-run): Remove.
9461 * emacs.c: Include <verify.h>.
9462 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9463 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9464 Remove.
9465 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9466 (gdb_USE_LSB_TAG): New enum constants.
9467 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9468 Also define these as enum constants, so they're visible to GDB.
9469 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9470 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9471 as constants, so they're visible to GDB.
9472 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9473 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9474 Now enum constants, not macros, so they're visible to GDB.
9475 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9476 more convenient now. All uses changed.
9477 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9478 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9479
9480 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9481
9482 Explicitly free restriction data that are not needed anymore.
9483 * editfns.c (save_restriction_restore): Free restriction data.
9484
9485 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9486
9487 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9488 add argument, tune behavior, and adjust all callers.
9489
9490 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9491
9492 Use typedef for EMACS_INT, EMACS_UINT.
9493 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9494 than macros. This simplifies debugging in the usual case, since
9495 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9496 and it allows expressions involving EMACS_INT casts.
9497 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9498
9499 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9500
9501 * nsterm.m (ns_read_socket): Return early if there is a modal
9502 window (Bug#12043).
9503
9504 2012-07-25 Martin Rudalics <rudalics@gmx.at>
9505
9506 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9507 that FOCUS-FRAME can be omitted.
9508
9509 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9510
9511 Adjust buffer text indirection counters at the end of Fkill_buffer.
9512 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9513 buffer is definitely dead. This should really fix an issue reported
9514 by Christoph Scholtes again. (Bug#12007).
9515 (init_buffer_once): Initialize indirection counters of
9516 buffer_defaults and buffer_local_symbols (for sanity and safety).
9517
9518 2012-07-24 Eli Zaretskii <eliz@gnu.org>
9519
9520 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9521 and continuation glyphs on tooltip frames, leave them at zero.
9522 Avoids continued lines in tooltips. (Bug#11832)
9523
9524 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9525
9526 Simplify copy_overlay.
9527 * buffer.c (copy_overlay): Simplify. Use build_marker.
9528 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9529
9530 2012-07-23 Eli Zaretskii <eliz@gnu.org>
9531
9532 * print.c (print_object): Don't crash when a frame's name is nil
9533 or invalid. (Bug#12025)
9534
9535 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9536 it signals an error when a tooltip frame is being created.
9537
9538 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9539
9540 Cleanup miscellaneous objects allocation and initialization.
9541 * alloc.c (allocate_misc): Change to static. Add argument to
9542 specify the subtype. Adjust comment and users.
9543 (build_overlay): New function.
9544 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9545 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9546 (allocate_misc): Remove prototype.
9547 (build_overlay): Add prototype.
9548
9549 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9550
9551 Swap buffer text indirection counters in Fbuffer_swap_text.
9552 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9553 This avoids crash reported by Christoph Scholtes at
9554 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9555
9556 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9557
9558 * nsmenu.m (Popdown_data): New struct.
9559 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9560 free Popdown_data.
9561 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9562 (initWithContentRect): Make imgView and contentView non-static
9563 and autorelease them. Also autorelease img and matrix (Bug#12005).
9564 (dealloc): Remove (Bug#12005).
9565
9566 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9567
9568 Adjust consing_since_gc when objects are explicitly freed.
9569 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9570 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9571 (free_cons, free_misc): Subtract object size from consing_since_gc.
9572
9573 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9574
9575 Simplify and cleanup markers positioning code.
9576 * marker.c (attach_marker): More useful eassert.
9577 (live_buffer, set_marker_internal): New function.
9578 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9579 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9580
9581 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9582
9583 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9584 as it's limited by the amount of memory, not by INT_MAX.
9585
9586 2012-07-21 Eli Zaretskii <eliz@gnu.org>
9587
9588 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9589 in special-event-map. See the discussion at
9590 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9591 for the reasons.
9592
9593 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
9594 info.dwItemData. Fixes crashes on 64-bit Windows.
9595 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
9596
9597 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9598
9599 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
9600 (conversationIdentifier): Return value is NSInteger.
9601 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
9602
9603 2012-07-21 Chong Yidong <cyd@gnu.org>
9604
9605 * window.c (decode_any_window): Signal an error if the window is
9606 on a dead frame (Bug#11984).
9607
9608 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9609
9610 Add indirection counting to speed up Fkill_buffer.
9611 * buffer.h (struct buffer): New member.
9612 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9613 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9614 base buffer indirection counter.
9615 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9616 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9617 through buffer list if indirection counter is 0.
9618
9619 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9620
9621 Extend the value returned by Fgarbage_collect with heap statistics.
9622 * alloc.c (Qheap): New symbol.
9623 (syms_of_alloc): DEFSYM it.
9624 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9625 (Fmemory_free): Remove.
9626 (syms_of_alloc): Don't defsubr it.
9627 * buffer.c (Fcompact_buffer): Remove.
9628 (syms_of_buffer): Don't defsubr it.
9629
9630 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9631
9632 Make maybe_gc inline.
9633 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9634 * lisp.h (consing_since_gc, gc_relative_threshold)
9635 (memory_full_cons_threshold): Revert declaration.
9636 (maybe_gc): Remove prototype, define as inline.
9637 * alloc.c: Remove old commented-out code.
9638 (consing_since_gc, gc_relative_threshold)
9639 (memory_full_cons_threshold): Revert to global.
9640 (maybe_gc): Remove.
9641
9642 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9643
9644 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9645 * lisp.h (build_unibyte_string): New function.
9646 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9647 * sysdep.c, w32fns.c, xfns.c: Use it.
9648 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9649 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9650 Adjust users accordingly.
9651 * font.h (font_open_by_name): Adjust prototype.
9652
9653 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9654
9655 Cleanup calls to Fgarbage_collect.
9656 * lisp.h (maybe_gc): New prototype.
9657 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9658 Remove declarations.
9659 * alloc.c (maybe_gc): New function.
9660 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9661 Make them static.
9662 * bytecode.c (MAYBE_GC): Use maybe_gc.
9663 * eval.c (eval_sub, Ffuncall): Likewise.
9664 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9665 to avoid dependency from auto-save feature.
9666
9667 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9668
9669 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9670 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9671 'for_each_per_buffer_object_at'.
9672 All uses changed. It's better to use upper-case for macros that
9673 cannot be implemented as functions, to give the reader a clue
9674 that they're special.
9675
9676 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9677
9678 * alloc.c (Fgarbage_collect): Tweak docstring.
9679
9680 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9681
9682 Tweak the value returned from Fgarbage_collect again.
9683 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9684 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9685 Adjust documentation.
9686 (total_vector_bytes): Rename to total_vector_slots, adjust
9687 accounting.
9688 (total_free_vector_bytes): Rename to total_free_vector_slots,
9689 adjust accounting.
9690 (Qstring_bytes, Qvector_slots): New symbols.
9691 (syms_of_alloc): DEFSYM them.
9692
9693 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9694
9695 Buffer compaction primitive which may be used from Lisp.
9696 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9697 (syms_of_buffer): Register Fcompact_buffer.
9698 * alloc.c (Fgarbage_collect): Use compact_buffer.
9699 * buffer.h (compact_buffer): New prototype.
9700 (struct buffer_text): New member.
9701
9702 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9703
9704 New macro to iterate over all buffers, miscellaneous cleanups.
9705 * lisp.h (all_buffers): Remove declaration.
9706 * buffer.h (all_buffers): Add declaration, with comment.
9707 (for_each_buffer): New macro.
9708 * alloc.c (Fgarbage_collect, mark_object): Use it.
9709 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9710 (init_buffer): Likewise.
9711 * data.c (Fset_default): Likewise.
9712 * coding.c (code_conversion_restore): Remove redundant check
9713 for dead buffer.
9714 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9715
9716 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9717
9718 Fix bug that created negative-length intervals.
9719 * intervals.c (merge_interval_right, merge_interval_left):
9720 Do not zero out this interval if it is absorbed by its children,
9721 as this interval's total length doesn't change in that case. See
9722 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9723
9724 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9725
9726 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9727 when invoking (make-bool-vector N t) and N is a positive
9728 multiple of 8 -- the last 8 bits were mistakenly cleared.
9729
9730 Remove some struct layout assumptions in bool vectors.
9731 * alloc.c (bool_header_size): New constant.
9732 (header_size, word_size): Move earlier, as they're now used earlier.
9733 Use 'word_size' in a few more places, where it's appropriate.
9734 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9735 padding before the data member of a bool vector.
9736 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9737 than doing the check by hand with an abort ().
9738
9739 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9740
9741 * eval.c (Fdefvar): Don't check constants since we only set the var if
9742 it's not yet defined anyway (bug#11904).
9743
9744 * lisp.h (last_undo_boundary): Declare new var.
9745 * keyboard.c (command_loop_1): Set it.
9746 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9747 were auto-added by the command loop (bug#11774).
9748
9749 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9750
9751 * w32font.c (Qsymbol): Remove local definition.
9752 (syms_of_w32font): Don't DEFSYM it.
9753
9754 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9755
9756 Fix sweep_vectors to handle large bool vectors correctly.
9757 * alloc.c (sweep_vectors): Account total_vector_bytes for
9758 bool vectors larger than VBLOCK_BYTES_MAX.
9759
9760 2012-07-18 Chong Yidong <cyd@gnu.org>
9761
9762 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9763 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9764
9765 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9766
9767 Return more descriptive data from Fgarbage_collect.
9768 Suggested by Stefan Monnier in
9769 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9770 * alloc.c (bounded_number): New function.
9771 (total_buffers, total_vectors): New variable.
9772 (total_string_size): Rename to total_string_bytes, adjust users.
9773 (total_vector_size): Rename to total_vector_bytes, adjust users.
9774 (sweep_vectors): Account total_vectors and total_vector_bytes.
9775 (Fgarbage_collect): New return value. Adjust documentation.
9776 (gc_sweep): Account total_buffers.
9777 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9778 (VECTOR_SIZE): Remove.
9779 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9780 (Qinterval, Qmisc): New symbols.
9781 (syms_of_data): Initialize them.
9782 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9783 (Qcons, Qbuffer): New declarations.
9784
9785 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9786
9787 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9788 Round up, not down. Improve doc.
9789
9790 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9791
9792 Restore old code in allocate_string_data to avoid Faset breakage.
9793 Reported by Julien Danjou <julien@danjou.info> in
9794 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9795 * alloc.c (allocate_string_data): Restore old code with minor
9796 adjustments, fix comment to explain this subtle issue.
9797
9798 2012-07-17 Eli Zaretskii <eliz@gnu.org>
9799
9800 Remove FILE_SYSTEM_CASE.
9801 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9802
9803 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9804 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9805 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9806 call-process-region passes it through expand-file-name.
9807
9808 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9809
9810 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9811
9812 Fix crash when creating indirect buffer (Bug#11917)
9813 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9814 Don't handle unbound variables specially if non-zero.
9815 (Fbuffer_local_variables): Pass zero.
9816 (clone_per_buffer_values): Pass non-zero.
9817
9818 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9819
9820 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9821 to make the loop interruptible.
9822
9823 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9824
9825 * gnutls.c (emacs_gnutls_handshake): Only retry if
9826 GNUTLS_E_INTERRUPTED.
9827
9828 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9829
9830 Cleanup and convert miscellaneous checks to eassert.
9831 * alloc.c (mark_interval): Fix comment, partially rephrase
9832 old comment from intervals.h (see below).
9833 * intervals.c (find_interval, adjust_intervals_for_insertion)
9834 (delete_interval, adjust_intervals_for_deletion)
9835 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9836 Convert to eassert.
9837 (adjust_intervals_for_insertion, make_new_interval):
9838 Remove obsolete and unused code.
9839 * intervals.h (struct interval): Remove obsolete comment.
9840 * textprotp.c (erase_properties): Remove unused code.
9841 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9842 (Fremove_list_of_text_properties): Convert to eassert.
9843
9844 2012-07-17 Chong Yidong <cyd@gnu.org>
9845
9846 * editfns.c (Finsert_char): Doc fix.
9847
9848 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9849
9850 Fix previous change to make Fmemory_free always accurate.
9851 * alloc.c (make_interval): Update total_free_intervals.
9852 (make_float): Likewise for total_free_floats.
9853 (free_cons, Fcons): Likewise for total_free_conses.
9854 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9855 Likewise for total_free_vector_bytes.
9856 (Fmake_symbol): Likewise for total_free_symbols.
9857 (bytes_free): Remove.
9858
9859 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9860
9861 Simple free memory accounting feature.
9862 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9863 (sweep_vectors): Accumulate size of free vectors.
9864 (Fgarbage_collect): Setup bytes_free.
9865 (Fmemory_free): New function.
9866 (syms_of_alloc): Register it.
9867
9868 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9869
9870 Cleanup overlays checking.
9871 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9872 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9873 eassert and OVERLAYP.
9874 (sort_overlays): Change to use OVERLAYP.
9875
9876 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9877
9878 * editfns.c (Finsert_char): Make it interactive, and make the
9879 second arg optional. Copy interactive spec and docstring from
9880 ucs-insert.
9881
9882 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9883
9884 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9885 Unlike the other wrapped functions, fabs has an unspecified
9886 effect on errno.
9887
9888 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9889
9890 * nsterm.m (keyDown): Interpret flags without left/right bits
9891 as the left key (Bug#11670).
9892
9893 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9894
9895 Remove empty and useless init functions.
9896 * lisp.h (init_character_once, init_fns, init_image)
9897 (init_filelock, init_sound): Remove prototype.
9898 * character.c (init_character_once): Remove.
9899 * filelock.c (init_filelock): Likewise.
9900 * fns.c (init_fns): Likewise.
9901 * image.c (init_image): Likewise.
9902 * sound.c (init_sound): Likewise.
9903 * emacs.c (main): Adjust accordingly.
9904
9905 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9906
9907 * gtkutil.h: Tiny cleanups.
9908 (use_old_gtk_file_dialog): Remove useless declaration.
9909 (xg_uses_old_file_dialog): Add suggested const attribute.
9910
9911 2012-07-15 Eli Zaretskii <eliz@gnu.org>
9912
9913 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9914 (bidi_paragraph_init): Use it to limit search forward for a strong
9915 directional character in abnormally large paragraphs full of
9916 neutral or weak characters. (Bug#11943)
9917
9918 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9919
9920 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9921 the toolbar (Bug#9451).
9922 (xg_make_tool_item): Give the widget event box a transparent
9923 background.
9924
9925 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9926
9927 Cleanup basic allocation variables and functions.
9928 * alloc.c (ignore_warnings, init_intervals, init_float)
9929 (init_cons, init_symbol, init_marker): Remove.
9930 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9931 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9932 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9933 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9934 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9935 (staticidx, init_alloc_once, init_strings, free_ablock):
9936 Remove redundant initialization.
9937 * fns.c (init_weak_hash_tables): Remove.
9938 * lisp.h (init_weak_hash_tables): Remove prototype.
9939
9940 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9941
9942 Use zero_vector where appropriate.
9943 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9944 accordingly.
9945 * lisp.h (zero_vector): New declaration.
9946 * font.c (null_vector): Remove.
9947 (syms_of_font): Remove initialization and staticpro.
9948 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9949 * keymap.c (Faccessible_keymaps): Likewise.
9950
9951 2012-07-15 Leo Liu <sdl.web@gmail.com>
9952
9953 * fringe.c: Fix typo in comments.
9954
9955 2012-07-14 Leo Liu <sdl.web@gmail.com>
9956
9957 * fringe.c: Add a new bitmap exclamation-mark.
9958
9959 2012-07-14 Eli Zaretskii <eliz@gnu.org>
9960
9961 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9962
9963 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9964 (HAVE_MENUS): Don't define, defined by editing config.in with
9965 msdos/sed2v2.inp.
9966 (GMALLOC_INHIBIT_VALLOC): Don't define.
9967 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9968
9969 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
9970
9971 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9972
9973 2012-07-14 Glenn Morris <rgm@gnu.org>
9974
9975 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9976 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9977 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9978
9979 2012-07-13 Glenn Morris <rgm@gnu.org>
9980
9981 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9982
9983 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9984 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9985
9986 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9987
9988 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9989 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9990 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9991 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9992 where appropriate.
9993 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9994 as boolean expression.
9995 (x_set_window_size): Remove unused variable toolbar.
9996 (ns_get_color_default, ns_mod_to_lisp): Remove.
9997 (ns_mouse_position): Remove unused variables xchar and ychar.
9998 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9999 (ns_set_vertical_scroll_bar): Remove unused variable count.
10000 (ns_delete_terminal): Remove unused variable i.
10001 (ns_term_init): Remove unused variables r, g and b.
10002 (mouseDown): Remove unused variable window.
10003 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10004 (initFrameFromEmacs): Remove unused variable vbextra.
10005 (mouseEntered): Remove unused variables p and dpyinfo.
10006 (mouseExited): Remove unused variables p and r.
10007 (ns_define_frame_cursor, ns_clear_frame_area)
10008 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10009 (menuDown): Assign [sender tag] to variable and cast the variable.
10010
10011 * nsterm.h (menuDown): Add id as type to argument sender.
10012 (ns_display_info_for_name): Add Lisp_Object argument.
10013 (ns_term_init): Add Lisp_Object argument.
10014 (ns_map_event_to_object): Add void argument.
10015 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10016 prototype with arguments and only declare if __OBJC__.
10017 (nxatoms_of_nsselect): Add void argument.
10018 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10019 (ns_alloc_autorelease_pool): Add void argument.
10020 (ns_release_autorelease_pool): Add void* argument.
10021 (ns_get_defaults_value): Add const char* argument.
10022
10023 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10024 (initFromContents): Use SSDATA where appropriate.
10025 (ns_update_menubar): Add braces to ambigous if-else.
10026 (initWithTitle): Put () around assignment in if statement.
10027 (ns_menu_show): Remove unused variables window and keymap.
10028 (update_frame_tool_bar): Remove unused variable selected_p.
10029 (initWithContentRect): Remove unused variable this_cmd_name.
10030
10031 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10032 appropriate.
10033 (setXBMColor): Remove unused variable len.
10034 (setPixmapData): Put () around assignment in loop statement.
10035
10036 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10037 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10038 where appropriate.
10039 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10040 around assignment in loop statement.
10041 (nsfont_open): Remove unused variable i.
10042 (nsfont_open): Remove unused variable len.
10043 (nsfont_draw): Remove unused variable cs.
10044
10045 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10046 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10047 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10048 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10049 (Fns_font_name, Fns_perform_service)
10050 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10051 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10052 (ns_set_name): Remove unused variable view.
10053 (x_set_menu_bar_lines): Remove unused variable olines.
10054 (x_set_tool_bar_lines): Remove unused variable root_window.
10055 (Fns_list_colors): Put () around assignment in while statement.
10056 (Fns_perform_service): Remove unused variable len.
10057 (Fns_display_usable_bounds): Remove unused variable top.
10058 (syms_of_nsfns): Remove unused variable i.
10059
10060 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10061 memcpy (Bug#11907).
10062
10063 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10064
10065 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10066 and free it with DestroyExceptionInfo (Bug#11558).
10067
10068 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10069
10070 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10071 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10072 Set here, not in nt/config.nt.
10073
10074 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10075
10076 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10077 cursor overflow into the last glyph on display line when the right
10078 fringe is off. (Bug#11832)
10079
10080 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10081
10082 * xdisp.c (produce_special_glyphs): Now static.
10083 * dispextern.h (produce_special_glyphs): Remove decl.
10084
10085 2012-07-13 Glenn Morris <rgm@gnu.org>
10086
10087 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10088 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10089
10090 * s/usg5-4-common.h (USG, USG5):
10091 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10092 * s/sol2-6.h (SOLARIS2):
10093 * s/irix6-5.h (IRIX6_5):
10094 * s/hpux10-20.h (USG, USG5, HPUX):
10095 * s/gnu-linux.h (USG, GNU_LINUX):
10096 * s/freebsd.h (BSD_SYSTEM):
10097 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10098 * s/cygwin.h (CYGWIN):
10099 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10100 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10101
10102 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10103
10104 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10105
10106 2012-07-13 Glenn Morris <rgm@gnu.org>
10107
10108 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10109
10110 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10111
10112 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10113 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10114
10115 2012-07-12 Glenn Morris <rgm@gnu.org>
10116
10117 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10118
10119 * process.c (init_process_emacs): Rename from init_process.
10120 The old name is also the name of a Mach system call.
10121 * lisp.h, emacs.c: Update for this name change.
10122 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10123 longer needed.
10124
10125 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10126
10127 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10128 memmove call that removes glyphs covered by the left truncation
10129 glyph. Improve commentary.
10130 (display_line): Fix display of continuation glyphs on GUI frames
10131 when the right fringe is turned off and variable-size fonts are
10132 used in the window. Move the code that appends a stretch glyph to
10133 produce_special_glyphs, so that it could be used for truncation
10134 and continuation glyphs alike.
10135 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10136 glyph of a suitably computed width, to align the special glyphs at
10137 the window margin. Code moved from display_line. (Bug#11832)
10138
10139 2012-07-12 Glenn Morris <rgm@gnu.org>
10140
10141 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10142
10143 * s/gnu-linux.h, s/hpux10-20.h:
10144 Do not unconditionally define HAVE_XRMSETDATABASE.
10145
10146 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10147
10148 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10149
10150 Fix typos that broke OS X build.
10151 Reported by Randal L. Schwartz in
10152 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10153 * nsterm.m (ns_timeout): Add missing local decl.
10154 (ns_get_color): snprintf -> sprintf, to fix typo.
10155
10156 2012-07-12 Glenn Morris <rgm@gnu.org>
10157
10158 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10159 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10160 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10161 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10162
10163 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10164 Move PTY_OPEN to configure.
10165
10166 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10167 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10168 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10169
10170 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10171
10172 Use empty_unibyte_string where applicable.
10173 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10174 * lread.c (read1): Likewise.
10175 * xsettings.c (syms_of_xsettings): Likewise.
10176
10177 2012-07-12 Glenn Morris <rgm@gnu.org>
10178
10179 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10180 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
10181 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10182 * s/hpux10-20.h (RUN_TIME_REMAP):
10183 * s/bsd-common.h (TABDLY): Move to configure.
10184
10185 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10186
10187 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10188
10189 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10190 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
10191
10192 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
10193
10194 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10195 * s/template.h: Move NARROWPROTO to configure.
10196
10197 2012-07-11 Glenn Morris <rgm@gnu.org>
10198
10199 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10200 unused since 2011-01-17 change to systty.h.
10201
10202 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10203 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10204 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10205
10206 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10207
10208 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10209
10210 2012-07-11 Glenn Morris <rgm@gnu.org>
10211
10212 * s/darwin.h, s/gnu-linux.h, s/template.h:
10213 Move INTERRUPT_INPUT to configure.
10214
10215 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10216
10217 Minor adjustments to interning code.
10218 * lisp.h (intern, intern_c_string): Redefine as static inline
10219 wrappers for intern_1 and intern_c_string_1, respectively.
10220 (intern_1, intern_c_string_1): Rename prototypes.
10221 * lread.c (intern_1, intern_c_string_1, oblookup):
10222 Simplify Vobarray checking.
10223 * font.c (font_intern_prop): Likewise. Adjust comment.
10224 * w32font.c (intern_font_name): Likewise.
10225
10226 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10227
10228 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10229
10230 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10231 of Fcar/Fcdr if possible.
10232 * font.c (check_otf_features): Likewise.
10233 * fontset.c (Fnew_fontset): Likewise.
10234 * gnutls.c (Fgnutls_boot): Likewise.
10235 * minibuf.c (read_minibuf): Likewise.
10236 * msdos.c (IT_set_frame_parameters): Likewise.
10237 * xmenu.c (Fx_popup_dialog): Likewise.
10238 * w32menu.c (Fx_popup_dialog): Likewise.
10239
10240 2012-07-11 Glenn Morris <rgm@gnu.org>
10241
10242 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10243 since nothing has defined it on these platforms.
10244
10245 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10246 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10247
10248 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10249 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10250 Move CLASH_DETECTION to configure.
10251
10252 * s/gnu.h: Remove file, which is now empty.
10253
10254 * s/gnu.h, s/gnu-linux.h:
10255 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10256
10257 2012-07-11 John Wiegley <johnw@newartisans.com>
10258
10259 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10260 function attribute, so we only use it if it exists in the
10261 compiler.
10262
10263 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10264
10265 Avoid call to strlen in fast_c_string_match_ignore_case.
10266 * search.c (fast_c_string_match_ignore_case): Change to use
10267 length argument. Adjust users accordingly.
10268 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10269
10270 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10271
10272 Assume mkdir, rmdir.
10273 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10274 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10275
10276 Assume rename.
10277 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10278
10279 Assume perror.
10280 * s/hpux10-20.h (HAVE_PERROR): Remove.
10281 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10282 Remove dummy definition, as this problem was obsolete long ago.
10283
10284 Assume strerror.
10285 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10286
10287 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10288
10289 Avoid calls to strlen in font processing functions.
10290 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
10291 (font_open_by_name): Change to use length argument.
10292 Adjust users accordingly.
10293 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10294 Adjust prototypes.
10295 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10296 Change to return ptrdiff_t.
10297 (xfont_list_pattern, xfont_match): Use length returned by
10298 xfont_decode_coding_xlfd.
10299 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10300
10301 2012-07-11 Glenn Morris <rgm@gnu.org>
10302
10303 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10304 Move DONT_REOPEN_PTY to configure.
10305
10306 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10307 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10308
10309 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10310
10311 Remove "#define unix" that is no longer needed (Bug#11905).
10312 * s/aix4-2.h (unix): Remove; no longer needed.
10313
10314 EMACS_TIME simplification (Bug#11875).
10315 This replaces macros (which typically do not work in GDB)
10316 with functions, typedefs and enums, making the code easier to debug.
10317 The functional style also makes code easier to read and maintain.
10318 * systime.h: Include <sys/time.h> on all hosts, not just if
10319 WINDOWSNT, since 'struct timeval' is needed in general.
10320 (EMACS_TIME): Now a typedef, not a macro.
10321 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10322 not macros.
10323 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10324 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10325 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10326 (EMACS_TIME_LE): Now functions, not macros.
10327 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10328 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10329 which are not functions. All uses rewritten to use:
10330 (make_emacs_time): New function.
10331 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10332 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10333 not functions. All uses rewritten to use the following, respectively:
10334 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10335 (add_emacs_time, sub_emacs_time): New functions.
10336 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
10337 * fileio.c (Fcopy_file):
10338 * xterm.c (XTflash): Get the current time closer to when it's used.
10339 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10340
10341 * bytecode.c (targets): Suppress -Woverride-init warnings.
10342
10343 Simplify by avoiding confusing use of strncpy etc.
10344 * doc.c (Fsnarf_documentation):
10345 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10346 * frame.c (Fmake_terminal_frame):
10347 * gtkutil.c (get_utf8_string):
10348 * lread.c (openp):
10349 * nsmenu.m (ns_update_menubar):
10350 * regex.c (regerror):
10351 Prefer memcpy to strncpy and strncat when either will do.
10352 * fileio.c (Fsubstitute_in_file_name):
10353 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10354 (menu_separator_name_p):
10355 * nsmenu.m (ns_update_menubar):
10356 Prefer memcmp to strncmp when either will do.
10357 * nsterm.m: Include <ftoastr.h>.
10358 (ns_get_color):
10359 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10360 Prefer snprintf to strncpy.
10361 * nsterm.m (ns_term_init):
10362 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10363 * nsterm.m (ns_term_init):
10364 Avoid the need for strncpy, by using build_string or
10365 make_unibyte_string directly. Use dtoastr, not snprintf.
10366 * process.c (Fmake_network_process): Diagnose service names that
10367 are too long, rather than silently truncating them or creating
10368 non-null-terminated names.
10369 (Fnetwork_interface_info): Likewise, for interface names.
10370 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10371 Prefer sprintf to strncat.
10372 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10373 Prefer vsnprintf to vsprintf + strncpy.
10374
10375 2012-07-10 Glenn Morris <rgm@gnu.org>
10376
10377 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10378 Clarify fallback case.
10379
10380 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10381
10382 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10383 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10384 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
10385 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
10386 where argument type is known to be a Lisp_Cons.
10387
10388 2012-07-10 Tom Tromey <tromey@redhat.com>
10389
10390 * bytecode.c (BYTE_CODE_THREADED): New macro.
10391 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10392 (enum byte_code_op): New type.
10393 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10394 (exec_byte_code): Use them. Use token threading when applicable.
10395
10396 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10397
10398 Optimize pure C strings initialization.
10399 * lisp.h (make_pure_string): Fix prototype.
10400 (build_pure_c_string): New function, defined as static inline. This
10401 provides a better opportunity to optimize away calls to strlen when
10402 the function is called with compile-time constant argument.
10403 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10404 argument, adjust users accordingly. Use build_pure_c_string where
10405 appropriate.
10406 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10407 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10408 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10409
10410 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10411
10412 Avoid calls to strlen in miscellaneous functions.
10413 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10414 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10415 * lread.c (openp): Likewise.
10416
10417 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10418
10419 Avoid calls to strlen in path processing functions.
10420 * fileio.c (file_name_as_directory): Add comment. Change to add
10421 srclen argument and return the length of result. Adjust users
10422 accordingly.
10423 (directory_file_name): Fix comment. Change to add srclen argument,
10424 swap 1st and 2nd arguments to obey the common convention.
10425 Adjust users accordingly.
10426 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10427
10428 2012-07-10 Glenn Morris <rgm@gnu.org>
10429
10430 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10431 Move PENDING_OUTPUT_COUNT definition to configure.
10432
10433 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10434 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10435 * s/gnu.h (DATA_START): Move definitions to configure.
10436
10437 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10438 We include usg5-4-common.h, which defines them both.
10439
10440 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10441 O_RDONLY already includes it).
10442
10443 Stop ns builds setting the EMACSLOADPATH environment variable.
10444 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10445 Now it does not set EMACSLOADPATH, just returns the load-path string.
10446 * nsterm.h: Update accordingly.
10447 * lread.c [HAVE_NS]: Include nsterm.h.
10448 (init_lread) [HAVE_NS]: Use ns_load_path.
10449 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10450
10451 2012-07-09 Glenn Morris <rgm@gnu.org>
10452
10453 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10454 since the included bsd-common.h does so.
10455
10456 Stop ns builds setting the EMACSPATH environment variable.
10457 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10458 (ns_init_paths): Do not set EMACSPATH.
10459 * nsterm.h (ns_exec_path): Add it.
10460 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10461 Use ns_exec_path.
10462
10463 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10464
10465 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10466
10467 * process.c (wait_reading_process_output): 'waitchannels' was unset
10468 when read_kbd || !NILP (wait_for_cell); fix this.
10469
10470 Add GCC-style 'const' attribute to functions that can use it.
10471 * character.h (char_resolve_modifier_mask):
10472 * keyboard.h (make_ctrl_char):
10473 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10474 (init_character_once, next_almost_prime, init_fns, init_image)
10475 (flush_pending_output, init_sound):
10476 * mem-limits.h (start_of_data):
10477 * menu.h (finish_menu_items):
10478 Add ATTRIBUTE_CONST.
10479 * emacs.c (DEFINE_DUMMY_FUNCTION):
10480 Declare the dummy function with ATTRIBUTE_CONST.
10481 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10482 Add decls with ATTRIBUTE_CONST.
10483
10484 Minor improvements to make_formatted_string.
10485 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10486 where int is good enough, as vsprintf returns an int.
10487 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10488
10489 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10490
10491 Use make_formatted_string to avoid double length calculation.
10492 * lisp.h (make_formatted_string): New prototype.
10493 * alloc.c (make_formatted_string): New function.
10494 * buffer.c (Fgenerate_new_buffer_name): Use it.
10495 * dbusbind.c (syms_of_dbusbind): Likewise.
10496 * editfns.c (Fcurrent_time_zone): Likewise.
10497 * filelock.c (get_boot_time): Likewise.
10498 * frame.c (make_terminal_frame, set_term_frame_name)
10499 (x_report_frame_params): Likewise.
10500 * image.c (gs_load): Likewise.
10501 * minibuf.c (get_minibuffer): Likewise.
10502 * msdos.c (dos_set_window_size): Likewise.
10503 * process.c (make_process): Likewise.
10504 * xdisp.c (ensure_echo_area_buffers): Likewise.
10505 * xsettings.c (apply_xft_settings): Likewise.
10506
10507 2012-07-09 Glenn Morris <rgm@gnu.org>
10508
10509 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10510 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10511 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10512 * nsterm.h (ns_etc_directory): Add it.
10513 * callproc.c [HAVE_NS]: Include nsterm.h.
10514 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10515
10516 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10517
10518 Move marker debugging code under MARKER_DEBUG.
10519 * marker.c (MARKER_DEBUG): Move marker debugging code under
10520 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10521 for bootstrap with --enable-checking (~3x slowdown reported
10522 by Juanma Barranquero <lekktu@gmail.com>).
10523 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10524
10525 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10526
10527 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10528 See <http://bugs.gnu.org/11825#29>.
10529
10530 2012-07-08 Eli Zaretskii <eliz@gnu.org>
10531
10532 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10533 has no font, use the frame's font. (Bug#11813)
10534 (display_line): Add commentary about displaying truncation glyphs
10535 on GUI frames.
10536 (produce_special_glyphs): Move here from term.c.
10537
10538 * term.c (produce_special_glyphs): Move to xdisp.c.
10539
10540 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10541 section.
10542
10543 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10544
10545 * xdisp.c (display_line): Avoid warning about implicit declaration
10546 of FRAME_FONT.
10547
10548 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10549
10550 * lisp.h: Remove empty conditional.
10551
10552 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10553
10554 * lread.c (load_path_check): Now static.
10555
10556 Fix some minor --with-ns problems found by static checking.
10557 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10558 (x_set_font) [!HAVE_X_WINDOWS]:
10559 * image.c (xpm_load_image) [HAVE_NS]:
10560 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10561 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10562 Remove unused local.
10563 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10564 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10565 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10566 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10567 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10568 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10569 Fix pointer signedness problem.
10570 * xfaces.c (FRAME_X_FONT_TABLE):
10571 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10572
10573 2012-07-07 Glenn Morris <rgm@gnu.org>
10574
10575 * lread.c (load_path_check): New function, split from init_lread.
10576 (init_lread): Reorganize. Motivation:
10577 If EMACSLOADPATH is set, check/warn about that rather than the
10578 defaults, which we are not going to use. Hence we can remove
10579 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10580 Don't warn if site-lisp directories are missing.
10581 If not installed, start from a blank load-path, since
10582 PATH_LOADSEARCH refers to the eventual installation directories.
10583
10584 2012-07-07 Eli Zaretskii <eliz@gnu.org>
10585
10586 Support truncation and continuation glyphs on GUI frames, when
10587 fringes are disabled. (Bug#11832)
10588 * xdisp.c (init_iterator): Get dimensions of truncation and
10589 continuation glyphs even if on GUI frames.
10590 Adjust it->last_visible_x on GUI frames when the left or right fringes,
10591 or both, are absent.
10592 (start_display, move_it_in_display_line_to): Handle the case of a
10593 GUI frame without a fringe to display continuation or truncation
10594 glyphs.
10595 (insert_left_trunc_glyphs): Support GUI frames: make sure
10596 truncation glyphs overwrite enough glyphs from the current line to
10597 have sufficient space in pixels.
10598 (display_line): Support truncation and continuation glyphs on GUI
10599 frames. If some spare pixels are left on the line after inserting
10600 the truncation glyphs, fill that space with a stretch glyph of a
10601 suitably computed width.
10602
10603 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10604 produce_glyphs, to support GUI sessions.
10605
10606 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10607
10608 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10609
10610 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10611
10612 Do not require float-time's arg to fit in time_t (Bug#11825).
10613 This works better on hosts where time_t is unsigned, and where
10614 float-time is applied to the (negative) difference between two times.
10615 * editfns.c (decode_time_components): Last arg is now double *,
10616 not int *, and means to store all the result as a double, without
10617 worrying about whether the seconds part fits in time_t.
10618 All callers changed.
10619 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10620 All callers changed.
10621 (Ffloat_time): Do not fail merely because the specified time falls
10622 outside of time_t range.
10623
10624 2012-07-07 Glenn Morris <rgm@gnu.org>
10625
10626 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10627 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10628 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10629
10630 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
10631
10632 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10633 Update dependencies.
10634
10635 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10636
10637 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10638
10639 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10640 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10641 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10642 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10643 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10644 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10645
10646 * xfont.c (compare_font_names): Redo to omit the need for casts.
10647
10648 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10649
10650 * xfns.c (Fx_change_window_property): Doc fix.
10651 * w32fns.c (Fx_change_window_property): Doc fix.
10652
10653 * w32fns.c (Fx_window_property): Accept the same arguments as the
10654 X Windows version. Doc fix.
10655 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10656
10657 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
10658 Eli Zaretskii <eliz@gnu.org>
10659
10660 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10661 Windows-specific code from nt/config.nt moved here.
10662 Obsolete settings removed.
10663
10664 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10665
10666 * process.c: Avoid unnecessary calls to gettime.
10667 (wait_reading_process_output): Don't get the time of day
10668 when gobbling data immediately and not waiting, as there's no need
10669 for it in that case. This removes a FIXME.
10670
10671 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10672
10673 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10674 is defined (Bug#11768).
10675
10676 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10677
10678 Fix marker debugging code.
10679 * marker.c (byte_char_debug_check): Do not perform the check
10680 if buffer is not multibyte.
10681 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10682 Call byte_char_debug_check with correct arguments.
10683
10684 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10685
10686 Compile marker debugging code only if ENABLE_CHECKING is defined.
10687 * marker.c (byte_char_debug_check, count_markers):
10688 Use only if ENABLE_CHECKING is defined.
10689 (byte_debug_flag): Remove.
10690 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10691 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10692
10693 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10694
10695 Avoid code repetition in marker-related functions.
10696 * marker.c (attach_marker): New function.
10697 (Fset_marker, set_marker_restricted, set_marker_both)
10698 (set_marker_restricted_both): Use it.
10699 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10700 Consistently rename charno to charpos.
10701 (marker_position): Add eassert.
10702 (marker_byte_position): Convert to eassert.
10703
10704 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10705
10706 Simplify list operations in unchain_overlay and unchain_marker.
10707 * buffer.c (unchain_overlay): Simplify. Add comment.
10708 * marker.c (unchain_marker): Simplify. Fix comments.
10709
10710 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10711
10712 Introduce fast path for the widely used marker operation.
10713 * alloc.c (build_marker): New function.
10714 * lisp.h (build_marker): New prototype.
10715 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10716 * composite.c (autocmp_chars): Likewise.
10717 * editfns.c (buildmark): Remove.
10718 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10719 (save_restriction_save): Use build_marker.
10720 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10721 * window.c (save_window_save): Likewise.
10722
10723 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10724
10725 Do not use Fdelete_overlay in delete_all_overlays
10726 to avoid redundant calls to unchain_overlay.
10727 * buffer.c (drop_overlay): New function.
10728 (delete_all_overlays, Fdelete_overlay): Use it.
10729 * minibuf.c (get_minibuffer): Fix comment.
10730
10731 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10732
10733 Port to OpenBSD 5.1 amd64.
10734 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10735 This is needed for OpenBSD, and should be harmless on all BSD systems.
10736 Also, include <sys/sysctl.h>, as it should be available on all
10737 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10738 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10739 use p_pid member, not kp_proc.pid.
10740
10741 2012-07-06 Glenn Morris <rgm@gnu.org>
10742
10743 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10744
10745 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10746
10747 More xmalloc and related cleanup.
10748 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10749 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10750 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10751 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10752 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10753 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10754 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10755 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10756 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10757 * xterm.c:
10758 Omit needless casts involving void * pointers and allocation.
10759 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10760 as the former is more robust if P's type is changed.
10761 Prefer xzalloc to xmalloc + memset 0.
10762 Simplify malloc-or-realloc to realloc.
10763 Don't worry about xmalloc returning a null pointer.
10764 Prefer xstrdup to xmalloc + strcpy.
10765 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10766 growing it.
10767 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10768 alloca of a constant.
10769
10770 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10771
10772 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10773 hscroll is larger than the line width. Fixes long and futile
10774 looping inside extend_face_to_end_of_line (on a TTY) producing
10775 glyphs that are not needed and thrown away.
10776
10777 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10778
10779 * marker.c (set_marker_restricted_both): Simplify by using
10780 clip_to_bounds.
10781
10782 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10783
10784 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10785
10786 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10787
10788 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10789 not defined (Bug#11768).
10790 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10791 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10792 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10793 followed by gtk_box_set_homogeneous (Bug#11768).
10794 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
10795 (update_theme_scrollbar_width, xg_create_scroll_bar):
10796 Use gtk_scrollbar_new (Bug#11768).
10797 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10798 (is_box_type): New function (Bug#11768).
10799 (xg_tool_item_stale_p): Call is_box_type.
10800 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
10801 with default display (Bug#11768).
10802
10803 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10804
10805 * xdisp.c (window_hscroll_limited): New function.
10806 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10807 coordinates when window's hscroll is set to insanely large
10808 values. (Bug#11857)
10809
10810 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
10811
10812 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10813 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10814
10815 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10816
10817 Cleanup xmalloc.
10818 * lisp.h (xzalloc): New prototype. Omit needless casts.
10819 * alloc.c (xzalloc): New function. Omit needless casts.
10820 * charset.c: Omit needless casts. Convert all calls to
10821 xmalloc with following memset to xzalloc.
10822 * dispnew.c: Likewise.
10823 * fringe.c: Likewise.
10824 * image.c: Likewise.
10825 * sound.c: Likewise.
10826 * term.c: Likewise.
10827 * w32fns.c: Likewise.
10828 * w32font.c: Likewise.
10829 * w32term.c: Likewise.
10830 * xfaces.c: Likewise.
10831 * xfns.c: Likewise.
10832 * xterm.c: Likewise.
10833 * atimer.c: Omit needless casts.
10834 * buffer.c: Likewise.
10835 * callproc.c: Likewise.
10836 * ccl.c: Likewise.
10837 * coding.c: Likewise.
10838 * composite.c: Likewise.
10839 * doc.c: Likewise.
10840 * doprnt.c: Likewise.
10841 * editfns.c: Likewise.
10842 * emacs.c: Likewise.
10843 * eval.c: Likewise.
10844 * filelock.c: Likewise.
10845 * fns.c: Likewise.
10846 * gtkutil.c: Likewise.
10847 * keyboard.c: Likewise.
10848 * lisp.h: Likewise.
10849 * lread.c: Likewise.
10850 * minibuf.c: Likewise.
10851 * msdos.c: Likewise.
10852 * print.c: Likewise.
10853 * process.c: Likewise.
10854 * region-cache.c: Likewise.
10855 * search.c: Likewise.
10856 * sysdep.c: Likewise.
10857 * termcap.c: Likewise.
10858 * terminal.c: Likewise.
10859 * tparam.c: Likewise.
10860 * w16select.c: Likewise.
10861 * w32.c: Likewise.
10862 * w32reg.c: Likewise.
10863 * w32select.c: Likewise.
10864 * w32uniscribe.c: Likewise.
10865 * widget.c: Likewise.
10866 * xdisp.c: Likewise.
10867 * xmenu.c: Likewise.
10868 * xrdb.c: Likewise.
10869 * xselect.c: Likewise.
10870
10871 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10872
10873 * fileio.c (time_error_value): Check the right error number.
10874 Problem reported by Troels Nielsen in
10875 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10876
10877 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10878
10879 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10880 This should be fixed in a better way; see Eli Zaretskii in
10881 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10882 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10883
10884 * fileio.c (time_error_value): Rename from special_mtime.
10885 The old name's problems were noted by Eli Zaretskii in
10886 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10887
10888 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10889 This variable's comment says Emacs needs at least one GDB-visible
10890 symbol of type enum pvec_type, to work around GDB problems.
10891 The symbol's value doesn't matter.
10892
10893 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10894 that causes compilation to fail on pre-C99 compilers.
10895
10896 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
10897
10898 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10899 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10900
10901 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10902
10903 * buffer.c (init_buffer_once): Fix initialization of
10904 headers for buffer_defaults and buffer_local_symbols.
10905 Reported by Juanma Barranquero <lekktu@gmail.com>.
10906
10907 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10908
10909 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10910 * lisp.h (enum pvec_type): Use fewer bits.
10911 (PSEUDOVECTOR_SIZE_BITS): New constant.
10912 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10913 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10914 change in pvec_type.
10915 (PSEUDOVECTOR_TYPEP): New macro.
10916 (TYPED_PSEUDOVECTORP): Use it.
10917 * fns.c (internal_equal): Adapt code to extract pvectype.
10918 * emacs.c (gdb_pvec_type): Update type.
10919 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10920 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10921 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10922 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10923 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10924 abusing vector->header.next.nbytes.
10925 (live_vector_p): Use PVEC_TYPE.
10926 (mark_object): Adapt code to extract pvectype. Use switch.
10927
10928 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10929
10930 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10931 Tighten new eassert a bit.
10932
10933 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10934
10935 Fix compilation with --enable-gcc-warnings and -O1
10936 optimization level.
10937 * doprnt.c (doprnt): Change type of tem to int, initialize
10938 to avoid compiler warning. Add eassert.
10939 * search.c (simple_search): Initialize match_byte to avoid
10940 compiler warning. Add eassert.
10941
10942 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10943
10944 Avoid weird behavior with large horizontal scrolls.
10945 Without this change, for example, large hscroll values would
10946 mess up Emacs's display on Fedora 15 x86, presumably due to
10947 overflows in int calculations in the display code.
10948 Also, if buffers had long lines, Emacs would freeze.
10949 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10950 (set_window_hscroll): New function, containing the old guts of
10951 Fset_window_hscroll. Return the clipped value.
10952 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10953 This avoids the need to check against PTRDIFF_MAX.
10954
10955 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10956
10957 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10958
10959 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10960
10961 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10962
10963 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10964 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10965 since GCC 4.4.6 issues a bogus warning for them.
10966
10967 Fix bugs in file timestamp newness comparisons.
10968 * fileio.c (Ffile_newer_than_file_p):
10969 * lread.c (Fload): Use full timestamp resolution of files,
10970 not just the 1-second resolution, so that files that are only
10971 slightly newer still count as newer.
10972 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10973 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10974
10975 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10976
10977 * fileio.c: Improve handling of file time marker. (Bug#11852)
10978 (special_mtime): New function.
10979 (Finsert_file_contents, Fverify_visited_file_modtime):
10980 Use it to set special mtime values consistently.
10981
10982 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10983
10984 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10985 marker for non-existing file. (Bug#11852)
10986
10987 2012-07-03 Glenn Morris <rgm@gnu.org>
10988
10989 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10990 and did not make it into globals.h).
10991
10992 2012-07-03 Tom Tromey <tromey@redhat.com>
10993
10994 * window.c (Fset_window_margins, Fset_window_fringes)
10995 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10996 * textprop.c (Fprevious_property_change): No longer static.
10997 * syntax.c (Fsyntax_table_p): No longer static.
10998 * process.c (Fget_process, Fprocess_datagram_address): No longer
10999 static.
11000 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11001 * keyboard.c (Fcommand_execute): No longer static.
11002 Remove EXFUN.
11003 * insdel.c (Fcombine_after_change_execute): No longer static.
11004 * image.c (Finit_image_library): No longer static.
11005 * fileio.c (Fmake_symbolic_link): No longer static.
11006 * eval.c (Ffetch_bytecode): No longer static.
11007 * editfns.c (Fuser_full_name): No longer static.
11008 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11009 No longer static.
11010 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11011 static.
11012 * dired.c (Ffile_attributes): No longer static.
11013 * composite.c (Fcomposition_get_gstring): No longer static.
11014 * callproc.c (Fgetenv_internal): No longer static.
11015
11016 * ccl.h: Remove EXFUNs.
11017 * buffer.h: Remove EXFUNs.
11018 * dispextern.h: Remove EXFUNs.
11019 * intervals.h: Remove EXFUNs.
11020 * fontset.h: Remove EXFUN.
11021 * font.h: Remove EXFUNs.
11022 * dosfns.c (system_process_attributes): Remove EXFUN.
11023 * keymap.h: Remove EXFUNs.
11024 * lisp.h: Remove EXFUNs.
11025 * w32term.h: Remove EXFUNs.
11026 * window.h: Remove EXFUNs.
11027 * xsettings.h: Remove EXFUN.
11028 * xterm.h: Remove EXFUN.
11029
11030 2012-07-03 Glenn Morris <rgm@gnu.org>
11031
11032 * lisp.h (Frandom): Make it visible to C.
11033 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11034 buffer for invisible buffers. (Bug#1229)
11035
11036 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11037
11038 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11039 values which aren't power of 2.
11040 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11041 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11042 accordingly.
11043
11044 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11045
11046 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11047
11048 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11049
11050 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11051
11052 * alloc.c (allocate_vector_block): Remove redundant
11053 calls to mallopt if DOUG_LEA_MALLOC is defined.
11054 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11055 avoid calls to mallopt if zero_vector is returned.
11056
11057 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11058
11059 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11060 is enabled, avoid dereferencing NULL current_sblock if
11061 running undumped.
11062
11063 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11064
11065 Cleanup basic buffer management.
11066 * buffer.h (struct buffer): Change layout to use generic vector
11067 marking code. Fix some comments. Change type of 'clip_changed'
11068 to bitfield. Remove unused #ifndef old.
11069 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11070 (GET_OVERLAYS_AT): Fix indentation.
11071 (for_each_per_buffer_object_at): New macro.
11072 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11073 (Fbuffer_local_variables): Use it.
11074 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11075 * alloc.c (allocate_buffer): Adjust to match new layout of
11076 struct buffer. Fix comment.
11077 (mark_overlay): New function.
11078 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11079 Lisp area of struct buffer.
11080 (mark_object): Use it. Adjust marking of misc objects
11081 and related comments.
11082
11083 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11084
11085 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11086 wrapper that is not needed because the wrapped code is a no-op (zero
11087 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11088 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11089
11090 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11091
11092 * alloc.c (mark_buffer): Simplify. Remove prototype.
11093 (mark_object): Add comment. Reorganize marking of vector-like
11094 objects. Use CHECK_LIVE for all vector-like objects except buffers
11095 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11096 Avoid redundant calls to mark_vectorlike for bool vectors.
11097
11098 2012-06-30 Glenn Morris <rgm@gnu.org>
11099
11100 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11101
11102 * epaths.in (PATH_SITELOADSEARCH): New.
11103 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11104 This is rather than relying on --enable-locallisppath elements
11105 having "site-lisp" in their names. (Bug#10208#25, 11658)
11106
11107 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11108
11109 * w32proc.c (sys_select): Accept and ignore one more argument.
11110
11111 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11112
11113 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11114 (pselect) [!MS_DOS]: Redirect to sys_select.
11115
11116 * sysdep.c: Don't include dos.h and dosfns.h.
11117
11118 * process.c (sys_select):
11119 * msdos.c (sys_select): Accept one more argument and ignore it.
11120
11121 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11122 adapt data types and code to that.
11123
11124 * dosfns.c:
11125 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11126 which clashes with the gnulib function of the same name.
11127
11128 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11129
11130 * font.c (font_style_to_value, font_style_symbolic)
11131 (font_prop_validate_style): Add type checks for values in
11132 font_style_table.
11133
11134 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11135 argument.
11136 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11137 uses.
11138
11139 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11140
11141 * xdisp.c (try_window_id): Undo last change.
11142
11143 * w32.c (getwd): Adjust commentary about startup_dir.
11144 (init_environment): Always call sys_access, even in non-MSVC
11145 builds. Don't chdir to the directory of the Emacs executable.
11146 This undoes code from 1997 which was justified by the need to
11147 "avoid conflicts when removing and renaming directories". But its
11148 downside was that every relative file name was being interpreted
11149 relative to the directory of the Emacs executable, which can never
11150 be TRT. In particular, it broke sys_access when called with
11151 relative file names.
11152 (sys_access): Map GetLastError to errno.
11153
11154 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11155
11156 * window.h (struct window): Change type of 'fringes_outside_margins'
11157 to bitfield. Fix comment. Adjust users accordingly.
11158 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
11159 Adjust comment.
11160 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11161 to ptrdiff_t.
11162
11163 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
11164
11165 * gnutls.c (emacs_gnutls_handshake):
11166 Add QUIT to make the loop interruptible.
11167
11168 2012-06-29 Glenn Morris <rgm@gnu.org>
11169
11170 * charset.c (init_charset): Make lack of etc/charsets fatal.
11171
11172 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11173
11174 * editfns.c (region_limit): Fix type mismatch.
11175
11176 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11177
11178 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11179 undefined. Convert from xassert to eassert.
11180 * nsmenu.m: Convert from xassert to eassert.
11181 * nsterm.m: Likewise.
11182
11183 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11184
11185 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11186
11187 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11188
11189 Avoid integer overflow on scroll-left and scroll-right.
11190 * window.c (HSCROLL_MAX): New macro.
11191 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11192 overflow when requested scroll falls outside ptrdiff_t range.
11193
11194 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11195
11196 * window.h (struct window): Change type of 'hscroll',
11197 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11198 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11199 Adjust users accordingly.
11200 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11201 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11202 from EMACS_INT to ptrdiff_t.
11203 (make_window): Omit redundant initialization.
11204
11205 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
11206
11207 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11208
11209 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11210
11211 * window.h (struct window): Change type of 'use_time' and
11212 'sequence_number' from Lisp_Object to int.
11213 * frame.c (make_frame): Adjust users accordingly.
11214 * print.c (print_object): Likewise.
11215 * window.c (select_window, Fwindow_use_time, make_parent_window)
11216 (make_window): Likewise.
11217
11218 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11219
11220 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11221 enabled with --enable-checking=[all,glyphs] configure option.
11222 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11223 adjust comments accordingly.
11224 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11225 undefined, adjust comments accordingly.
11226 * image.c: Likewise.
11227 * scroll.c: Likewise.
11228 * w32fns.c: Likewise.
11229 * w32term.c: Likewise.
11230 * xdisp.c: Likewise.
11231 * xfaces.c: Likewise.
11232 * xfns.c: Likewise.
11233 * xterm.c: Likewise.
11234
11235 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11236
11237 Generalize run-time debugging checks.
11238 * dispextern.h (XASSERTS): Remove.
11239 * fontset.c (xassert): Remove.
11240 Convert from xassert to eassert.
11241 * alloc.c: Convert from xassert to eassert.
11242 * bidi.c: Likewise.
11243 * dispnew.c: Likewise.
11244 * fns.c: Likewise.
11245 * fringe.c: Likewise.
11246 * ftfont.c: Likewise.
11247 * gtkutil.c: Likewise.
11248 * image.c: Likewise.
11249 * keyboard.c: Likewise.
11250 * menu.c: Likewise.
11251 * process.c: Likewise.
11252 * scroll.c: Likewise.
11253 * sound.c: Likewise.
11254 * term.c: Likewise.
11255 * w32console.c: Likewise.
11256 * w32fns.c: Likewise.
11257 * w32term.c: Likewise.
11258 * window.c: Likewise.
11259 * xdisp.c: Likewise.
11260 * xfaces.c: Likewise.
11261 * xfns.c: Likewise.
11262 * xselect.c: Likewise.
11263 * xterm.c: Likewise.
11264
11265 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11266
11267 * fns.c (maybe_resize_hash_table): Output message when growing the
11268 purify-hashtable.
11269
11270 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11271
11272 * alloc.c (allocate_string_data): Remove dead code.
11273 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11274 avoid GCC warning about unused macro.
11275
11276 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11277
11278 * alloc.c (allocate_string): Omit intervals initialization.
11279 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11280 as in make_pure_string and make_pure_c_string.
11281
11282 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11283
11284 * alloc.c (allocate_string): Fix last change.
11285
11286 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11287
11288 * alloc.c (allocate_string): Remove two redundant calls
11289 to memset, add explicit initialization where appropriate.
11290
11291 2012-06-27 Glenn Morris <rgm@gnu.org>
11292
11293 * lisp.mk (lisp): Remove paths.elc.
11294
11295 2012-06-27 Chong Yidong <cyd@gnu.org>
11296
11297 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11298
11299 2012-06-26 John Wiegley <johnw@newartisans.com>
11300
11301 * unexmacosx.c (copy_data_segment): Add two section names used
11302 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11303
11304 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11305 when building with Clang.
11306
11307 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11308
11309 * eval.c (Fapply): Allow calling it with a single argument.
11310
11311 2012-06-26 Eli Zaretskii <eliz@gnu.org>
11312
11313 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11314 _stricmp and _strnicmp.
11315 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11316
11317 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11318
11319 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11320 allocated window.
11321 (allocate_process): Likewise for new process.
11322 (allocate_terminal): Change to use offsetof.
11323 (allocate_frame): Likewise.
11324 * frame.c (make_frame): Omit redundant initialization.
11325 * window.c (make_parent_window): Use memset.
11326 (make_window): Omit redundant initialization.
11327 * process.c (make_process): Omit redundant initialization.
11328 * terminal.c (create_terminal): Likewise.
11329
11330 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11331
11332 * term.c (delete_tty): Remove redundant call to memset.
11333
11334 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11335
11336 * alloc.c: Remove build_string.
11337 * lisp.h: Define build_string as static inline. This provides
11338 a better opportunity to optimize away calls to strlen when the
11339 function is called with compile-time constant argument.
11340 * image.c (imagemagick_error): Convert to build_string.
11341 * w32proc.c (sys_spawnve): Likewise.
11342 * xterm.c (x_term_init): Likewise.
11343
11344 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11345
11346 Use sprintf return value instead of invoking strlen on result.
11347 In the old days this wasn't portable, since some sprintf
11348 implementations returned char *. But they died out years ago and
11349 Emacs already assumes sprintf returns int.
11350 Similarly for float_to_string.
11351 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11352 * ccl.c (ccl_driver):
11353 * character.c (string_escape_byte8):
11354 * data.c (Fnumber_to_string):
11355 * doprnt.c (doprnt):
11356 * print.c (print_object):
11357 * xdisp.c (message_dolog):
11358 * xfns.c (syms_of_xfns):
11359 Use sprintf or float_to_string result to avoid need to call strlen.
11360 * data.c (Fnumber_to_string):
11361 Use make_unibyte_string, since the string must be ASCII.
11362 * lisp.h, print.c (float_to_string): Now returns int length.
11363 * term.c (produce_glyphless_glyph):
11364 Use sprintf result rather than recomputing it.
11365
11366 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11367 * Makefile.in (ALL_CFLAGS):
11368 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11369 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11370
11371 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11372
11373 * dispextern.h (xstrcasecmp): Define to library function
11374 strcasecmp if available.
11375 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11376
11377 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11378
11379 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11380 Avoid comma operator.
11381 * menu.c (push_submenu_start, push_submenu_end)
11382 (push_left_right_boundary, push_menu_pane): Likewise.
11383 * msdos.c (dos_rawgetc): Likewise.
11384
11385 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11386
11387 * xfns.c (xic_create_fontsetname): Remove redundant calls
11388 to memset.
11389
11390 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11391
11392 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11393 sprintf already null-terminates its output.
11394
11395 * xfns.c (x_window): Remove redundant cast.
11396
11397 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11398
11399 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11400 `const char *' to `char *' to avoid compiler warning.
11401
11402 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11403
11404 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11405 instead of truncating it to 63 (admittedly a generous limit).
11406
11407 * process.c: Fix spelling and caps in comments.
11408
11409 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11410
11411 * emacs.c (setpgrp): Remove definition, unused.
11412 * sysdep.c (setpgrp): Remove definition, not used in this file.
11413
11414 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
11415
11416 * makefile.w32-in: Update dependencies.
11417
11418 2012-06-24 Eli Zaretskii <eliz@gnu.org>
11419
11420 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11421 (SYSTIME_H): Add nt/inc/sys/time.h.
11422
11423 * systime.h [WINDOWSNT]: Include sys/time.h.
11424
11425 * s/ms-w32.h (struct timespec): Definition moved from
11426 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11427
11428 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11429
11430 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11431 * buffer.h (buffer_slot_type_mismatch):
11432 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11433 * eval.c (unwind_to_catch):
11434 * image.c (my_png_error, my_error_exit):
11435 * keyboard.c (quit_throw_to_read_char, user_error)
11436 (Fexit_recursive_edit, Fabort_recursive_edit):
11437 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11438 (wrong_type_argument, buffer_overflow, __executable_start)
11439 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11440 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11441 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11442 (fatal):
11443 (child_setup) [!DOS_NT]:
11444 * lread.c (end_of_file_error, invalid_syntax):
11445 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11446 * puresize.h (pure_write_error):
11447 * search.c (matcher_overflow):
11448 * sound.c (sound_perror, alsa_sound_perror):
11449 * sysdep.c, syssignal.h (croak):
11450 * term.c (maybe_fatal, vfatal):
11451 * textprop.c (text_read_only):
11452 * undo.c (user_error):
11453 * unexmacosx.c (unexec_error):
11454 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11455 Use _Noreturn rather than NO_RETURN.
11456 No need for separate decl merely because of _Noreturn.
11457 * sound.c (sound_warning, parse_sound):
11458 Remove unnecessary forward decls.
11459
11460 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11461
11462 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11463 * lisp.h (WAIT_READING_MAX): New macro.
11464 * dispnew.c (Fsleep_for, sit_for):
11465 * keyboard.c (kbd_buffer_get_event):
11466 * process.c (Faccept_process_output):
11467 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11468 This improves on the previous patch, which introduced a bug
11469 when time_t is unsigned and as wide as intmax_t.
11470 See <http://bugs.gnu.org/9000#51>.
11471
11472 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11473
11474 * dispnew.c (sit_for, Fsleep_for):
11475 * keyboard.c (kbd_buffer_get_event):
11476 * process.c (Faccept_process_output): Avoid compiler warnings when
11477 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11478
11479 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
11480
11481 * makefile.w32-in: Update dependencies.
11482
11483 * w32.c (ltime): Add return type and declare static.
11484 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11485
11486 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11487
11488 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11489 Privately reported by Herbert J. Skuhra.
11490 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11491 All uses changed.
11492 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11493 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11494
11495 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11496
11497 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11498 last argument of make_unibyte_string.
11499
11500 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11501 language ID in the event parameters.
11502
11503 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11504 event.code, not the obscure "character set ID".
11505
11506 2012-06-23 Chong Yidong <cyd@gnu.org>
11507
11508 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11509
11510 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11511
11512 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11513 * w32.c (fdutimens): New function.
11514
11515 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11516
11517 * s/ms-w32.h (pselect): Redirect to sys_select.
11518
11519 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11520
11521 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11522 in the logic of incrementing and decrementing the value of
11523 use_relocatable_buffers.
11524
11525 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11526
11527 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11528 Privately reported by Herbert J. Skuhra.
11529 [__FreeBSD__]: Remove "*/" typo after "#include".
11530 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11531 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11532 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11533 Don't assume EMACS_TIME and struct timeval are the same type.
11534
11535 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11536
11537 Support higher-resolution time stamps (Bug#9000).
11538 The time stamps are only nanosecond-resolution at the C level,
11539 since that's the best that any real-world system supports now.
11540 But they are picosecond-resolution at the Lisp level, as that's
11541 easy, and leaves room for future OS improvements.
11542
11543 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11544 (LIBES): Use it.
11545
11546 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11547 Don't get current time unless it's needed.
11548
11549 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11550 now provides it if it's absent.
11551 (start_atimer): Port to higher-res time stamps.
11552 Check for time stamp overflow. Don't get current time more
11553 often than is needed.
11554
11555 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11556 Include systime.h, not time.h.
11557 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11558
11559 * dired.c: Include stat-time.h.
11560 (Ffile-attributes): File times now have higher resolution.
11561
11562 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11563 (struct image): Timestamp now has higher resolution.
11564
11565 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11566 has at least microseconds now. All uses removed.
11567 (update_frame, update_single_window, update_window, update_frame_1)
11568 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
11569 (duration_to_sec_usec): Remove; no longer needed.
11570
11571 * editfns.c (time_overflow): Now extern.
11572 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11573 (float-time, Fformat_time_string, Fcurrent_time_string)
11574 (Fcurrent_time_zone): Accept and generate higher-resolution
11575 time stamps.
11576 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11577 (decode_time_components, lisp_seconds_argument): New functions.
11578 (make_time): Now static.
11579 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11580 Report an error if the time is invalid, rather than having the caller
11581 do that.
11582
11583 * fileio.c: Include <stat-time.h>
11584 (Fcopy_file): Copy higher-resolution time stamps.
11585 Prefer to set the time stamp via a file descriptor if that works.
11586 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11587 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11588 (Fvisited_file_modtime, Fset_visited_file_modtime):
11589 Support higher-resolution time stamps.
11590
11591 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11592
11593 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11594
11595 * image.c (prepare_image_for_display, clear_image_cache)
11596 (lookup_image): Port to higer-resolution time stamps.
11597
11598 * keyboard.c (start_polling, bind_polling_period):
11599 Check for time stamp overflow.
11600 (read_char, kbd_buffer_get_event, timer_start_idle)
11601 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11602 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11603 Port to higher-resolution time stamps. Do not assume time_t is signed.
11604 (decode_timer): New function. Timers are now vectors of length 9,
11605 not 8, to accommodate the picosecond component.
11606 (timer_check_2): Use it.
11607
11608 * nsterm.m (select_timeout, timeval_subtract): Remove.
11609 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11610 as they're a bit more accurate and handle overflow better.
11611 (ns_select): Change prototype to be compatible with pselect.
11612 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11613 * nsterm.h (ns_select): Adjust prototype.
11614
11615 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11616 us-resolution time stamps.
11617 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11618
11619 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11620
11621 * lisp.h (time_overflow): New decl.
11622 (wait_reading_process_output): First arg is now intmax_t, not int,
11623 to accommodate larger waits.
11624
11625 * process.h (struct Lisp_Process.read_output_delay):
11626 Now counts nanoseconds, not microseconds.
11627 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11628 EMACS_HAS_USECS.
11629 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11630 (wait_reading_process_output):
11631 Port to ns-resolution time stamps.
11632 (Faccept_process_output, wait_reading_process_output):
11633 Check for time stamp overflow. Do not assume time_t is signed.
11634 (select_wrapper): Remove; we now use pselect.
11635 (Fprocess_attributes): Now generates ns-resolution time stamps.
11636
11637 * sysdep.c: Include utimens.h. Don't include utime.h
11638 or worry about struct utimbuf; gnulib does that for us now.
11639 (gettimeofday): Remove; gnulib provides a substitute.
11640 (make_timeval): New function.
11641 (set_file_times): Now sets ns-resolution time stamps.
11642 New arg FD; all uses changed.
11643 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11644 (system_process_attributes):
11645 Now returns ns-resolution time stamp. All uses changed.
11646 Check for time stamp overflow.
11647
11648 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11649 provides a substitute now.
11650
11651 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11652 since it guarantees struct timespec.
11653 (EMACS_TIME): Now struct timespec, so that we can support
11654 ns-resolution time stamps.
11655 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11656 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11657 (EMACS_USECS): Remove.
11658 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11659 so multiply the arg by 1000 before storing it.
11660 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11661 New macros.
11662 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11663 Port to ns-resolution time stamps.
11664 (EMACS_TIME_NEG_P): Remove; replaced by....
11665 (EMACS_TIME_SIGN): New macro.
11666 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11667 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11668 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11669 (make_timeval, make_lisp_time, decode_time_components): New decls.
11670 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11671 that it mishandled time_t overflow. You can't compare by subtracting!
11672 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11673 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11674
11675 * term.c: Include <sys/time.h>.
11676 (timeval_to_Time): New function, for proper overflow wraparound.
11677 (term_mouse_position, term_mouse_click): Use it.
11678
11679 * undo.c (record_first_change): Support higher-resolution time stamps
11680 in the undo buffer.
11681 (Fprimitive_undo): Use them when restoring time stamps.
11682
11683 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11684 (w32_get_internal_run_time):
11685 Port to higher-resolution Emacs time stamps.
11686 (ltime): Now accepts single 64-bit integer, as that's more convenient
11687 for callers.
11688
11689 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11690
11691 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11692 for compatibility with pselect. Support ns-resolution time stamps.
11693
11694 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11695
11696 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11697 Check for time stamp overflow, and support ns-resolution time stamps.
11698
11699 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11700 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11701 (timeval_subtract): Remove; no longer needed.
11702 (XTflash, XTring_bell, x_wait_for_event):
11703 Port to ns-resolution time stamps. Don't assume time_t is signed.
11704
11705 2012-06-22 Chong Yidong <cyd@gnu.org>
11706
11707 * xdisp.c (x_consider_frame_title): Revert last change.
11708
11709 2012-06-22 Eli Zaretskii <eliz@gnu.org>
11710
11711 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11712 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11713 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11714 staticidx goes up to 1597 out of 1600 = 0x640.)
11715
11716 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11717
11718 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11719 Otherwise, the umask might be mistakenly 0 while handling input signals.
11720
11721 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11722
11723 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11724
11725 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11726
11727 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11728 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11729 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11730 access to `contents' member of Lisp_Vector objects with AREF and ASET
11731 where appropriate.
11732
11733 2012-06-19 Chong Yidong <cyd@gnu.org>
11734
11735 * frame.c (delete_frame): When selecting a frame on a different
11736 text terminal, do not alter the terminal's top-frame.
11737
11738 * xdisp.c (format_mode_line_unwind_data): Record the target
11739 frame's selected window and its terminal's top-frame.
11740 (unwind_format_mode_line): Restore them.
11741 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11742 Callers changed.
11743 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11744 since tty frames can be explicitly named.
11745 (prepare_menu_bars): Likewise.
11746
11747 * term.c (Ftty_top_frame): New function.
11748
11749 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11750
11751 Port byte-code-meter to modern targets.
11752 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11753 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
11754 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
11755 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11756 (METER_1, METER_2): Simplify.
11757
11758 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11759
11760 * data.c (Fdefalias): Return `symbol' (bug#11686).
11761
11762 2012-06-18 Martin Rudalics <rudalics@gmx.at>
11763
11764 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
11765 gets killed during executing of this function (Bug#11665).
11766 Try to always return Qt when the buffer has been actually killed.
11767 (Vkill_buffer_query_functions): In doc-string say that functions
11768 run by this hook should not change the current buffer.
11769
11770 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11771
11772 Fix recently-introduced process.c problems found by static checking.
11773 * process.c (write_queue_push, write_queue_pop, send_process):
11774 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11775 (write_queue_pop): Fix pointer signedness problem.
11776 (send_process): Remove unused local.
11777
11778 2012-06-17 Chong Yidong <cyd@gnu.org>
11779
11780 * xdisp.c (redisplay_internal): No need to redisplay terminal
11781 frames that are not on top.
11782
11783 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
11784
11785 * process.c (make_process): Initialize write_queue.
11786 (write_queue_push, write_queue_pop): New functions.
11787 (send_process): Use them to maintain correct ordering of process
11788 writes (Bug#10815).
11789
11790 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11791
11792 * lisp.h (eassert): Assume C89 or later.
11793 This removes the need for CHECK.
11794 (CHECK): Remove. Its comments about always evaluating its
11795 argument were confusing, as 'eassert' typically does not evaluate
11796 its argument.
11797
11798 * coding.c (produce_chars): Use ptrdiff_t, not int.
11799
11800 * xterm.c (x_draw_underwave): Check for integer overflow.
11801 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11802
11803 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
11804
11805 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11806 referenced (Bug#11583).
11807
11808 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11809
11810 Implement wave-style variant of underlining.
11811 * dispextern.h (face_underline_type): New enum.
11812 (face): Add field for underline type.
11813 * nsterm.m (ns_draw_underwave): New function.
11814 (ns_draw_text_decoration): Use it.
11815 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11816 New functions.
11817 (x_draw_glyph_string): Use them.
11818 * xfaces.c (Qline, Qwave): New Lisp objects.
11819 (check_lface_attrs, merge_face_ref)
11820 (Finternal_set_lisp_face_attribute, realize_x_face):
11821 Handle wave-style underline face attributes.
11822 * xterm.c (x_draw_underwave): New function.
11823 (x_draw_glyph_string): Use it.
11824
11825 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
11826
11827 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11828 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11829 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11830 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11831 ($(BLD)/w32select.$(O)): Update dependencies.
11832
11833 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11834
11835 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11836 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11837 * character.c (_fetch_multibyte_char_p): Remove.
11838 * alloc.c: Include "character.h" before "buffer.h".
11839 * bidi.c: Likewise.
11840 * buffer.c: Likewise.
11841 * bytecode.c: Likewise.
11842 * callint.c: Likewise.
11843 * callproc.c: Likewise.
11844 * casefiddle.c: Likewise.
11845 * casetab.c: Likewise.
11846 * category.c: Likewise.
11847 * cmds.c: Likewise.
11848 * coding.c: Likewise.
11849 * composite.c: Likewise.
11850 * dired.c: Likewise.
11851 * dispnew.c: Likewise.
11852 * doc.c: Likewise.
11853 * dosfns.c: Likewise.
11854 * editfns.c: Likewise.
11855 * emacs.c: Likewise.
11856 * fileio.c: Likewise.
11857 * filelock.c: Likewise.
11858 * font.c: Likewise.
11859 * fontset.c: Likewise.
11860 * fringe.c: Likewise.
11861 * indent.c: Likewise.
11862 * insdel.c: Likewise.
11863 * intervals.c: Likewise.
11864 * keyboard.c: Likewise.
11865 * keymap.c: Likewise.
11866 * lread.c: Likewise.
11867 * macros.c: Likewise.
11868 * marker.c: Likewise.
11869 * minibuf.c: Likewise.
11870 * nsfns.m: Likewise.
11871 * nsmenu.m: Likewise.
11872 * print.c: Likewise.
11873 * process.c: Likewise.
11874 * regex.c: Likewise.
11875 * region-cache.c: Likewise.
11876 * search.c: Likewise.
11877 * syntax.c: Likewise.
11878 * term.c: Likewise.
11879 * textprop.c: Likewise.
11880 * undo.c: Likewise.
11881 * unexsol.c: Likewise.
11882 * w16select.c: Likewise.
11883 * w32fns.c: Likewise.
11884 * w32menu.c: Likewise.
11885 * window.c: Likewise.
11886 * xdisp.c: Likewise.
11887 * xfns.c: Likewise.
11888 * xmenu.c: Likewise.
11889 * xml.c: Likewise.
11890 * xselect.c: Likewise.
11891
11892 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11893
11894 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11895 If all the glyphs of the glyph row came from strings, and we have no
11896 cursor positioning clues, put the cursor on the first glyph of the
11897 row.
11898 (handle_face_prop): Use chunk-relative overlay string index when
11899 indexing into it->string_overlays array. (Bug#11653)
11900 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11901 the rightmost. (Bug#11720)
11902
11903 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11904
11905 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11906 (CATEGORY_MEMBER): Enforce 1/0 value.
11907 * category.c (_temp_category_set): Remove.
11908
11909 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11910
11911 * window.c (Fdelete_other_windows_internal)
11912 (Fdelete_window_internal): Don't access frame's mouse highlight
11913 info of the initial frame. (Bug#11677)
11914
11915 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11916
11917 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11918 Assume USE_2_TAGS_FOR_INTS.
11919 (xreload): Adjust $tagmask width to match recent lisp.h change.
11920
11921 Simplify lisp.h in minor ways that should not affect code.
11922 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11923 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11924 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11925 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11926 (INTTYPEBITS): New macro, for clarity.
11927 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
11928 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11929 Simplify now that USE_LSB_TAG is always defined.
11930 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11931 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11932
11933 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
11934
11935 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11936
11937 2012-06-13 Glenn Morris <rgm@gnu.org>
11938
11939 * s/bsd-common.h (BSD4_3):
11940 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11941
11942 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11943
11944 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11945 instead of union.
11946 (XLI, XIL): Define.
11947 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11948 Use them.
11949 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
11950 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
11951 * alloc.c (widen_to_Lisp_Object): Remove.
11952 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11953 * frame.c (delete_frame): Remove outdated comment.
11954 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11955 USE_LISP_UNION_TYPE.
11956 (Fw32_unregister_hot_key): Likewise.
11957 (Fw32_toggle_lock_key): Likewise.
11958 * w32menu.c (add_menu_item): Likewise.
11959 (w32_menu_display_help): Use XIL instead of checking
11960 USE_LISP_UNION_TYPE.
11961 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11962 (init_heap): Likewise.
11963 * w32term.c (w32_read_socket): Update comment.
11964
11965 2012-06-13 Glenn Morris <rgm@gnu.org>
11966
11967 * s/usg5-4-common.h, src/s/unixware.h:
11968 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11969
11970 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11971
11972 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11973
11974 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11975 * alloc.c (make_number) [!defined make_number]:
11976 Remove, as lisp.h always defines this now.
11977 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11978 (roundup_size): Verify that it is a power of 2.
11979 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11980 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11981 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11982 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11983 USE_LSB_TAG now is always defined to be either 0 or 1.
11984 All uses changed.
11985 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11986 code works fine either way, and efficiency is not a concern here,
11987 as the union type is for debugging, not for production.
11988 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11989 Use an inline function on all platforms when using the union type,
11990 since this is simpler and 'static inline' can be used portably
11991 within Emacs now.
11992 (LISP_INITIALLY_ZERO): New macro.
11993 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11994 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11995
11996 2012-06-12 Glenn Morris <rgm@gnu.org>
11997
11998 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11999
12000 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12001
12002 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12003 Move BROKEN_SIGIO to configure.
12004
12005 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12006 Move NO_TERMIO to configure.
12007
12008 2012-06-12 Chong Yidong <cyd@gnu.org>
12009
12010 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12011 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12012 MagickExportImagePixels is undefined.
12013
12014 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12015
12016 * image.c (imagemagick_load_image): Remove unused label.
12017
12018 2012-06-11 Glenn Morris <rgm@gnu.org>
12019
12020 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12021 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12022 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12023 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12024
12025 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12026
12027 * alloc.c (make_byte_code): New function.
12028 (Fmake_byte_code): Use it. Don't purify here.
12029 * lread.c (read1): Use it as well to avoid extra allocation.
12030
12031 2012-06-11 Chong Yidong <cyd@gnu.org>
12032
12033 * image.c (imagemagick_load_image): Implement transparency.
12034
12035 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12036
12037 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12038 account for preceding backslashes. (Bug#11663)
12039
12040 2012-06-09 Chong Yidong <cyd@gnu.org>
12041
12042 * term.c: Support italics in capable terminals (Bug#9652).
12043 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12044 (turn_on_face): Output using TS_enter_italic_mode if available.
12045 Don't handle unused blinking and alt-charset cases.
12046 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12047 and tty_alt_charset_p cases.
12048 (tty_capable_p, init_tty): Support italics.
12049
12050 * termchar.h (struct tty_display_info): Add field for italics.
12051 Remove unused blink field.
12052
12053 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12054 Handle slant.
12055
12056 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12057 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12058 tty_alt_charset_p. Add tty_italic_p.
12059
12060 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12061
12062 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12063 dbus_type_is_basic if available.
12064 (xd_extract_signed, xd_extract_unsigned): Rename from
12065 extract_signed and extract_unsigned, respectively. Adapt callers.
12066
12067 2012-06-09 Chong Yidong <cyd@gnu.org>
12068
12069 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12070
12071 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12072 case (Bug#9752).
12073
12074 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12075
12076 * xdisp.c (vmessage): Treat frame message as multibyte.
12077 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12078 would generate the diagnostic "Making \302\247 buffer-local while
12079 let-bound!".
12080
12081 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12082
12083 * dispnew.c (showing_window_margins_p): Undo last change, which
12084 was done due to an inadvertent commit.
12085 (adjust_frame_glyphs_for_frame_redisplay): Do call
12086 showing_window_margins_p.
12087
12088 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12089
12090 * eval.c (Fmake_var_non_special): New primitive.
12091 (syms_of_eval): Defsubr it.
12092 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12093
12094 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12095
12096 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12097 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12098
12099 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12100
12101 * alloc.c (allocate_vectorlike): Fix last change.
12102
12103 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12104
12105 Block-based vector allocation of small vectors.
12106 * lisp.h (struct vectorlike_header): New field `nbytes',
12107 adjust comment accordingly.
12108 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12109 to denote vector blocks. Adjust users (live_vector_p,
12110 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12111 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12112 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12113 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12114 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12115 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12116 (roundup_size): New constant.
12117 (struct vector_block): New data type.
12118 (vector_blocks, vector_free_lists, zero_vector): New variables.
12119 (all_vectors): Rename to `large_vectors'.
12120 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12121 (sweep_vectors): New functions.
12122 (allocate_vectorlike): Return `zero_vector' as the only vector of
12123 0 items. Allocate new vector from block if vector size is less than
12124 or equal to VBLOCK_BYTES_MAX.
12125 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12126 (init_alloc_once): Add call to init_vectors.
12127
12128 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12129
12130 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12131
12132 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12133
12134 * doprnt.c (doprnt): Truncate multibyte char correctly.
12135 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12136 would mishandle a string argument "Xc" if X was a multibyte
12137 character of length 2: it would truncate after X's first byte
12138 rather than including all of X.
12139
12140 2012-06-06 Chong Yidong <cyd@gnu.org>
12141
12142 * buffer.c (word_wrap): Doc fix.
12143
12144 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12145
12146 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12147
12148 2012-06-03 Glenn Morris <rgm@gnu.org>
12149
12150 * xdisp.c (tool-bar-style): Doc fix.
12151
12152 2012-06-03 Ulrich Müller <ulm@gentoo.org>
12153
12154 * Makefile.in (PAXCTL): Define.
12155 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12156 binary via PaX flags if the paxctl utility is available.
12157 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12158 Restore PaX flags to their default. (Bug#11398)
12159
12160 2012-06-03 Chong Yidong <cyd@gnu.org>
12161
12162 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12163 buffer (Bug#11226).
12164
12165 2012-06-03 Chong Yidong <cyd@gnu.org>
12166
12167 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12168 (note_mode_line_or_margin_highlight): If there is no help echo,
12169 use mode-line-default-help-echo. Handle the case where the mouse
12170 position is past the end of the mode line string.
12171
12172 * buffer.c (buffer_local_value_1): New function, split from
12173 Fbuffer_local_value; can return Qunbound.
12174 (Fbuffer_local_value): Use it.
12175 (Vmode_line_format): Docstring tweaks.
12176
12177 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12178
12179 * sysdep.c (system_process_attributes): Improve comment.
12180
12181 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12182
12183 * keyboard.c: Export real-this-command to Elisp.
12184 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12185 and DEFVAR it. Update all users.
12186
12187 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12188
12189 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12190
12191 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12192 Convert pctcpu and pctmem to Lisp float properly.
12193 Let the compiler fold better, as 100.0/0x8000 is exact.
12194
12195 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12196
12197 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12198 cons_block.
12199
12200 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12201
12202 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12203
12204 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12205
12206 For a 'struct window', replace some Lisp_Object fields to
12207 bitfields where appropriate, remove unused fields.
12208 * window.h (struct window): Remove unused 'last_mark_x' and
12209 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
12210 change its type from Lisp_Object to bitfield.
12211 Change type of 'force_start', 'optional_new_start',
12212 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
12213 fields from Lisp_Object to bitfield. Adjust users accordingly.
12214
12215 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12216
12217 Pacify gcc -Wdouble-precision when using Xaw.
12218 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12219 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12220 Use 'float' consistently, rather than 'float' in most places
12221 and 'double' in a couple of places.
12222
12223 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12224
12225 * xdisp.c (handle_stop): Detect whether we have overlay strings
12226 loaded by testing it->current.overlay_string_index to be
12227 non-negative, instead of checking whether n_overlay_strings is
12228 positive. (Bug#11587)
12229
12230 2012-05-31 Chong Yidong <cyd@gnu.org>
12231
12232 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12233
12234 * doc.c (Fsubstitute_command_keys): Doc fix.
12235
12236 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12237
12238 * search.c (search_buffer): Remove calls to
12239 r_alloc_inhibit_buffer_relocation, as it is now called by
12240 maybe_unify_char, which was the cause of relocation of buffer text
12241 in bug#11519.
12242
12243 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12244
12245 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12246 for the duration of call to load_charset, to avoid problems with
12247 callers of maybe_unify_char that access buffer text through C
12248 pointers.
12249
12250 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12251 decrement the inhibition flag, instead of just setting or
12252 resetting it.
12253
12254 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12255
12256 Remove obsolete '#define static' cruft.
12257 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12258 This #undef was "temporary" in 2000; it is no longer needed
12259 now that '#define static' has gone away.
12260 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12261 (gray_bitmap_bits): Remove; no longer needed.
12262 All uses replaced with definiens.
12263 * xterm.c: Include "bitmaps/gray.xbm".
12264
12265 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12266
12267 Clean up __executable_start, monstartup when --enable-profiling.
12268 The following changes affect the code only when profiling.
12269 * dispnew.c (__executable_start): Rename from safe_bcopy.
12270 Define only on platforms that need it.
12271 * emacs.c: Include <sys/gmon.h> when profiling.
12272 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12273 (__executable_start): Remove decl, since lisp.h does it now.
12274 (safe_bcopy): Remove decl; no longer has that name.
12275 (main): Coalesce #if into single bit of code, for simplicity.
12276 Cast pointers to uintptr_t, since standard libraries want integers
12277 and not pointers.
12278 * lisp.h (__executable_start): New decl.
12279
12280 2012-05-31 Glenn Morris <rgm@gnu.org>
12281
12282 * image.c (Fimagemagick_types): Doc fix.
12283
12284 2012-05-30 Jim Meyering <meyering@redhat.com>
12285
12286 * callproc.c (Fcall_process_region): Include directory component
12287 in mkstemp error message (Bug#11586).
12288
12289 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12290
12291 * alloc.c, lisp.h (make_pure_vector): Now static.
12292
12293 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12294
12295 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12296 Move to byte-run.el.
12297 (Fautoload): Do the hash-doc more carefully.
12298 * data.c (Fdefalias): Purify definition, except for keymaps.
12299 (Qdefun): Move from eval.c.
12300 * lisp.h (Qdefun): Remove.
12301 * lread.c (read1): Tiny simplification.
12302
12303 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
12304
12305 Do not create empty overlays with the evaporate property (Bug#9642).
12306 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12307 Bug#9642, but explicitly check that the buffer the overlay would
12308 be moved to is live and rearrange lines to make sure that errors
12309 will not put the overlay in an inconsistent state.
12310 (Fdelete_overlay): Cosmetics.
12311
12312 2012-05-28 Eli Zaretskii <eliz@gnu.org>
12313
12314 * w32term.c (my_bring_window_to_top): New function.
12315 (x_raise_frame): Use handle returned by DeferWindowPos, which
12316 could be different from the original one.
12317 Call my_bring_window_to_top instead of my_set_foreground_window.
12318 (Bug#11513)
12319
12320 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12321 by calling BringWindowToTop.
12322
12323 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12324 (WM_EMACS_END): Increase by one.
12325
12326 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12327
12328 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12329 This avoids undefined behavior that might cause the eassert
12330 to not catch an out-of-range value.
12331
12332 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
12333
12334 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12335 Update dependencies.
12336
12337 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12338
12339 * bidi.c (bidi_mirror_char): Fix last change.
12340
12341 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12342
12343 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12344 when referring to sectname field in printf format.
12345
12346 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12347
12348 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12349 Only r_alloc_inhibit_buffer_relocation needed to be added;
12350 the others were already declared.
12351
12352 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12353 before checking whether it's out of range. Put the check inside
12354 eassert. See
12355 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12356
12357 2012-05-27 Ken Brown <kbrown@cornell.edu>
12358
12359 * callproc.c (Fcall_process): Restore a line that was accidentally
12360 commented out in the 2011-02-13 change (bug#11547).
12361
12362 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12363
12364 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12365 defined on ralloc.c.
12366
12367 * buffer.c [REL_ALLOC]: Remove prototypes of
12368 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12369 they are now on lisp.h.
12370
12371 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12372
12373 * search.c (search_buffer): Use it to inhibit relocation of buffer
12374 text while re_search_2 is doing its job, because re_search_2 is
12375 passed C pointers to buffer text. (Bug#11519)
12376
12377 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12378 Update value to 24.
12379
12380 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12381 state after an additional call to move_it_in_display_line_to, keep
12382 the values of it->max_ascent and it->max_descent found for the
12383 entire line.
12384 (pos_visible_p): Revert the comparison against bottom_y to what it
12385 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12386 (Bug#11464)
12387
12388 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12389
12390 Fix coding-related core dumps with gcc -ftrapv.
12391 The code was computing A - B, where A and B are pointers, and B is
12392 random garbage. This can lead to core dumps on platforms that
12393 have special pointer registers, and it also leads to core dumps on
12394 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12395 A - B only when B is initialized properly.
12396 * coding.c (coding_set_source, coding_set_destination): Return void.
12397 (coding_change_source, coding_change_destinations): New functions,
12398 with the old behaviors of coding_set_source and coding_set_destination.
12399 All callers that need an offset changed to use these new functions.
12400
12401 2012-05-26 Glenn Morris <rgm@gnu.org>
12402
12403 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12404
12405 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12406
12407 Extend mouse support on W32 text-mode console.
12408 * xdisp.c (draw_row_with_mouse_face):
12409 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
12410
12411 * w32console.c: Include window.h.
12412 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12413 New functions.
12414 (initialize_w32_display): Initialize mouse-highlight data.
12415
12416 * w32inevt.c: Include termchar.h and window.h.
12417 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12418 moves, call note_mouse_highlight. If help_echo changed, call
12419 gen_help_event to produce help-echo message in the echo area.
12420 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12421 highlight info.
12422
12423 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12424
12425 * lread.c (read1): Simplify slightly to avoid an overflow warning
12426 with GCC 4.7.0 on x86-64.
12427
12428 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12429
12430 * bidi.c (bidi_mirror_char): Revert last change: an int is
12431 definitely wide enough here.
12432
12433 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
12434
12435 Fix integer width and related bugs (Bug#9874).
12436 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
12437 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12438 (string_bytes, check_sblock, allocate_string_data):
12439 (compact_small_strings, Fmake_bool_vector, make_string)
12440 (make_unibyte_string, make_multibyte_string)
12441 (make_string_from_bytes, make_specified_string)
12442 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12443 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12444 (mark_vectorlike):
12445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12446 (allocate_pseudovector):
12447 Use int, not EMACS_INT, where int is wide enough.
12448 (inhibit_garbage_collection, Fgarbage_collect):
12449 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12450 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12451 int might not be wide enough.
12452 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12453 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12454 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12455 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12456 (bidi_level_of_next_char, bidi_move_to_visually_next):
12457 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12458 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12459 (Fkill_buffer, Fset_buffer_major_mode)
12460 (advance_to_char_boundary, Fbuffer_swap_text)
12461 (Fset_buffer_multibyte, overlays_at, overlays_in)
12462 (overlay_touches_p, struct sortvec, record_overlay_string)
12463 (overlay_strings, recenter_overlay_lists)
12464 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12465 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12466 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12467 (Foverlay_recenter, last_overlay_modification_hooks_used)
12468 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12469 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12470 (validate_region): Omit unnecessary test for b <= e,
12471 since that's guaranteed by the previous test.
12472 (adjust_overlays_for_delete): Avoid pos + length overflow.
12473 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12474 (report_overlay_modification):
12475 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12476 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12477 Omit pointer cast, which isn't needed anyway, and doesn't work
12478 after the EMACS_INT -> ptrdiff_t change.
12479 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
12480 * buffer.h: Adjust decls to match defn changes elsewhere.
12481 (struct buffer_text, struct buffer):
12482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12483 Use EMACS_INT, not int, where int might not be wide enough.
12484 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12485 not int, to avoid needless 32-bit limit on 64-bit hosts.
12486 (exec_byte_code): Use tighter memory-full test, one that checks
12487 for alloca overflow. Don't compute the address of the object just
12488 before an array, as that's not portable. Use EMACS_INT, not
12489 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
12490 * callint.c (Fcall_interactively):
12491 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12492 * callproc.c (call_process_kill, Fcall_process):
12493 Don't assume pid_t fits into an Emacs fixnum.
12494 (call_process_cleanup, Fcall_process, child_setup):
12495 Don't assume pid_t fits into int.
12496 (call_process_cleanup, Fcall_process, delete_temp_file)
12497 (Fcall_process_region):
12498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12499 (Fcall_process): Simplify handling of volatile integers.
12500 Use int, not EMACS_INT, where int will do.
12501 * casefiddle.c (casify_object, casify_region, operate_on_word)
12502 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12503 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12504 (casify_object): Avoid integer overflow when overallocating buffer.
12505 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
12506 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
12507 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12508 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12509 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12510 integers are now checked earlier. All uses replaced with XINT.
12511 (ccl_driver):
12512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12513 For CCL_MapSingle, check that content and value are in int range.
12514 (ccl_driver, Fregister_code_conversion_map):
12515 Check that Vcode_version_map_vector is a vector.
12516 (resolve_symbol_ccl_program): Check that vector header is in range.
12517 Always copy the vector, so that we can check its contents reliably
12518 now rather than having to recheck each instruction as it's being
12519 executed. Check that vector words fit in 'int'.
12520 (ccl_get_compiled_code, Fregister_ccl_program)
12521 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12522 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12523 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12524 contents are in range.
12525 (Fccl_execute_on_string): Check that status is in range.
12526 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12527 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12528 Accept and return EMACS_INT, not int, because callers can pass values
12529 out of 'int' range.
12530 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12531 (multibyte_chars_in_text, parse_str_as_multibyte)
12532 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12533 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12534 (string_escape_byte8, Fget_byte):
12535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12536 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
12537 avoid mishandling large integers.
12538 * character.h: Adjust decls to match defn changes elsewhere.
12539 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12540 (Ffind_charset_region):
12541 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12542 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12543 (load_charset_map_from_vector, Fdefine_charset_internal):
12544 Don't assume fixnum fits in int.
12545 (load_charset_map_from_vector, Fmap_charset_chars):
12546 Remove now-unnecessary CHECK_NATNUMs.
12547 (Fdefine_charset_internal): Check ranges here, more carefully.
12548 Don't rely on undefined behavior with signed left shift overflow.
12549 Don't assume unsigned int fits into fixnum, or that fixnum fits
12550 into unsigned int. Don't require max_code to be a valid fixnum;
12551 that's not true for gb10830 4-byte on a 32-bit host. Allow
12552 invalid_code to be a cons, for the same reason. Require code_offset
12553 to be a character. Avoid int overflow if max_char is close
12554 to INT_MAX.
12555 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12556 this is intended anyway and avoids some undefined behavior.
12557 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12558 INDEX_TO_CODE_POINT, as that's what it expects.
12559 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
12560 * charset.h (DECODE_CHAR): Return int, not unsigned;
12561 this is what was intended anyway, and it avoids undefined behavior.
12562 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12563 integer-overflow issues.
12564 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12565 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12566 where the argument is EMACS_INT, and this behavior is not intended.
12567 * chartab.c (Fmake_char_table, Fset_char_table_range)
12568 (uniprop_get_decoder, uniprop_get_encoder):
12569 Don't assume fixnum fits in int.
12570 * cmds.c (move_point): New function, that does the gist of
12571 Fforward_char and Fbackward_char, but does so while checking
12572 for integer overflow more accurately.
12573 (Fforward_char, Fbackward_char): Use it.
12574 (Fforward_line, Fend_of_line, internal_self_insert)
12575 (internal_self_insert):
12576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12577 Fix a FIXME, by checking for integer overflow when calculating
12578 target_clm and actual_clm.
12579 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
12580 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
12581 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12582 (coding_alloc_by_making_gap, alloc_destination)
12583 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12584 (encode_coding_utf_16, detect_coding_emacs_mule)
12585 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12586 (detect_coding_iso_2022, decode_coding_iso_2022)
12587 (encode_invocation_designation, encode_designation_at_bol)
12588 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12589 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12590 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12591 (encode_coding_ccl, encode_coding_raw_text)
12592 (detect_coding_charset, decode_coding_charset)
12593 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12594 (produce_composition, produce_charset, produce_annotation)
12595 (decode_coding, handle_composition_annotation)
12596 (handle_charset_annotation, consume_chars, decode_coding_gap)
12597 (decode_coding_object, encode_coding_object, detect_coding_system)
12598 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12599 (code_convert_region, code_convert_string)
12600 (Fdefine_coding_system_internal)
12601 (coding_set_source, coding_set_destination):
12602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12603 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12604 (Fdefine_coding_system_internal):
12605 Don't assume fixnums fit in int.
12606 (decode_coding_gap, decode_coding_object, encode_coding_object)
12607 (Fread_coding_system, Fdetect_coding_region)
12608 (Funencodable_char_position, Fcheck_coding_systems_region)
12609 (get_translation, handle_composition_annotation, consume_chars):
12610 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12611 (consume_chars): Rewrite to not calculate an address outside buffer.
12612 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
12613 Don't access memory outside of the args array.
12614 (Fdefine_coding_system_internal): Check for charset-id overflow.
12615 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12616 result of ENCODE_CHAR.
12617 * coding.h: Adjust decls to match defn changes elsewhere.
12618 (struct coding_system):
12619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12620 * composite.c (get_composition_id, find_composition)
12621 (run_composition_function, update_compositions)
12622 (compose_text, composition_gstring_put_cache)
12623 (composition_gstring_p, composition_gstring_width)
12624 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12625 (composition_compute_stop_pos, composition_reseat_it)
12626 (composition_update_it, struct position_record)
12627 (find_automatic_composition, composition_adjust_point)
12628 (Fcomposition_get_gstring, Ffind_composition_internal):
12629 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12630 (update_compositions):
12631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12632 * composite.h: Adjust decls to match defn changes elsewhere.
12633 (struct composition):
12634 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12635 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12636 Do not attempt to compute the address of the object just before a
12637 buffer; this is not portable.
12638 (Faref, Faset):
12639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12640 (Faset): Use int, not EMACS_INT, where int is wide enough.
12641 (Fstring_to_number): Don't assume fixnums fit in int.
12642 (Frem): Don't assume arg is nonnegative.
12643 * dbusbind.c (xd_append_arg): Check for integers out of range.
12644 (Fdbus_call_method): Don't overflow the timeout int.
12645 (extract_signed, extract_unsigned): New functions.
12646 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12647 (xd_get_connection_references): Return ptrdiff_t, not int.
12648 All uses changed.
12649 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12650 (xd_read_message_1):
12651 Use int, not unsigned, where the dbus API uses int.
12652 (Fdbus_message_internal): Don't overflow mtype.
12653 (syms_of_dbusbind): Allocate right-sized buffer for integers.
12654 * dired.c (directory_files_internal, file_name_completion, scmp)
12655 (file_name_completion_stat):
12656 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12657 (file_name_completion): Don't overflow matchcount.
12658 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12659 * dispextern.h: Adjust decls to match defn changes elsewhere.
12660 (struct text_pos, struct glyph, struct bidi_saved_info)
12661 (struct bidi_string_data, struct bidi_it, struct composition_it)
12662 (struct it):
12663 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12664 (struct display_pos, struct composition_it, struct it):
12665 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12666 * dispnew.c (increment_matrix_positions)
12667 (increment_row_positions, mode_line_string)
12668 (marginal_area_string):
12669 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12670 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
12671 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12672 (duration_to_sec_usec): New function, to check for overflow better.
12673 (Fsleep_for, sit_for): Use it.
12674 * doc.c (get_doc_string, store_function_docstring):
12675 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12676 (get_doc_string, Fsnarf_documentation):
12677 Use int, not EMACS_INT, where int is wide enough.
12678 (get_doc_string):
12679 Use SAFE_ALLOCA, not alloca.
12680 Check for overflow when converting EMACS_INT to off_t.
12681 * doprnt.c (doprnt):
12682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12683 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12684 Don't assume uid_t fits into fixnum.
12685 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12686 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12687 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12688 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12689 (general_insert_function)
12690 (Finsert_char, make_buffer_string, make_buffer_string_both)
12691 (update_buffer_properties, Fbuffer_substring)
12692 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12693 (Fsubst_char_in_region, check_translation)
12694 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12695 (transpose_markers, Ftranspose_regions):
12696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12697 (clip_to_bounds): Move to lisp.h as an inline function).
12698 (Fconstrain_to_field): Don't assume integers are nonnegative.
12699 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12700 (Fsubst_char_in_region, Fsave_restriction):
12701 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12702 (Femacs_pid): Don't assume pid_t fits into fixnum.
12703 (lo_time): Use int, not EMACS_INT, when int suffices.
12704 (lisp_time_argument): Check for usec out of range.
12705 (Fencode_time): Don't assume fixnum fits in int.
12706 (Fuser_login_name, Fuser_full_name): Signal an error
12707 if a uid argument is out of range, rather than relying on
12708 undefined behavior.
12709 (Fformat_time_string): Remove now-unnecessary check.
12710 lisp_time_argument checks for out-of-range usec now.
12711 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
12712 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12713 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12714 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12715 (init_cmdargs, Fdump_emacs):
12716 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12717 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12718 the bottom (typically) 32 bits of the fixnum.
12719 * eval.c (specpdl_size, call_debugger):
12720 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12721 (when_entered_debugger, Fbacktrace_debug):
12722 Don't assume fixnum can fit in int.
12723 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12724 the object just before a buffer; this is not portable.
12725 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12726 (grow_specpdl, unbind_to):
12727 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12728 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12729 (grow_specpdl): Simplify allocation by using xpalloc.
12730 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
12731 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12732 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12733 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12734 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12735 (a_write, e_write):
12736 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12737 (Fcopy_file, non_regular_nbytes, read_non_regular)
12738 (Finsert_file_contents):
12739 Use int, not EMACS_INT, where int is wide enough.
12740 (READ_BUF_SIZE): Verify that it fits in int.
12741 (Finsert_file_contents): Check that counts are in proper range,
12742 rather than assuming fixnums fit into ptrdiff_t etc.
12743 Don't assume fixnums fit into int.
12744 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
12745 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12746 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
12747 (string_char_to_byte, string_byte_to_char)
12748 (string_make_multibyte, string_to_multibyte)
12749 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12750 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12751 (substring_both, Fdelete, internal_equal, Ffillarray)
12752 (Fclear_string, mapcar1)
12753 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12754 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12755 (larger_vector, make_hash_table, maybe_resize_hash_table)
12756 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12757 (Fmaphash, secure_hash):
12758 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12759 (concat): Check for string index and length overflow.
12760 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12761 (Frequire):
12762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12763 (larger_vector): New API (vec, incr_min, size_max) replaces old
12764 one (vec, new_size, init). This catches size overflow.
12765 INIT was removed because it was always Qnil.
12766 All callers changed.
12767 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12768 the upper bound on a hash table index size.
12769 (make_hash_table, maybe_resize_hash_table): Use it.
12770 (secure_hash): Computer start_byte and end_byte only after
12771 they're known to be in ptrdiff_t range.
12772 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12773 (Ffont_get_glyphs, Ffont_at):
12774 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12775 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12776 (Flist_fonts, Fopen_font):
12777 Don't assume fixnum can fit in int.
12778 (check_gstring): Don't assume index can fit in int.
12779 (font_match_p): Check that fixnum is a character, not a nonnegative
12780 fixnum, since the later code needs to stuff it into an int.
12781 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12782 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12783 conversion overflow issues.
12784 (Fopen_font): Check for integer out of range.
12785 (Ffont_get_glyphs): Don't assume index can fit in int.
12786 * font.h: Adjust decls to match defn changes elsewhere.
12787 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12788 integer overflow.
12789 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12790 printmax_t, where ptrdiff_t is wide enough.
12791 (Finternal_char_font):
12792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12793 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12794 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12795 (Fset_frame_position, x_set_frame_parameters)
12796 (x_set_line_spacing, x_set_border_width)
12797 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12798 Check that fixnums are in proper range for system types.
12799 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12800 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12801 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12802 Use SAFE_ALLOCA_LISP, not alloca.
12803 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12804 intptr_t is wide enough.
12805 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12806 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12807 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12808 Check for fixnum out of range.
12809 * ftfont.c (ftfont_list): Don't assume index fits in int.
12810 Check that fixnums are in proper range for system types.
12811 (ftfont_shape_by_flt):
12812 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12813 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12815 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12816 Check that fixnums are in proper range for system types.
12817 * gnutls.h: Adjust decls to match defn changes elsewhere.
12818 * gtkutil.c (xg_dialog_run):
12819 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12820 (update_frame_tool_bar):
12821 Check that fixnums are in proper range for system types.
12822 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
12823 (lookup_image): Check that fixnums are in range for system types.
12824 * indent.c (last_known_column, last_known_column_point):
12825 (current_column_bol_cache):
12826 (skip_invisible, current_column, check_display_width):
12827 (check_display_width, scan_for_column, current_column_1)
12828 (Findent_to, Fcurrent_indentation, position_indentation)
12829 (indented_beyond_p, Fmove_to_column, compute_motion):
12830 (Fcompute_motion, Fvertical_motion):
12831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12832 (last_known_column_modified): Use EMACS_INT, not int.
12833 (check_display_width):
12834 (Fcompute_motion):
12835 Check that fixnums and floats are in proper range for system types.
12836 (compute_motion): Don't assume index or fixnum fits in int.
12837 (compute_motion, Fcompute_motion):
12838 Use int, not EMACS_INT, when it is wide enough.
12839 (vmotion): Omit local var start_hpos that is always 0; that way
12840 we don't need to worry about overflow in expressions involving it.
12841 * indent.h: Adjust decls to match defn changes elsewhere.
12842 (struct position):
12843 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12844 Use int, not EMACS_INT, where int is wide enough.
12845 Remove unused members ovstring_chars_done and tab_offset;
12846 all uses removed.
12847 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12848 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12849 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12850 (make_gap, copy_text, insert, insert_and_inherit)
12851 (insert_before_markers, insert_before_markers_and_inherit)
12852 (insert_1, count_combining_before, count_combining_after)
12853 (insert_1_both, insert_from_string)
12854 (insert_from_string_before_markers, insert_from_string_1)
12855 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12856 (adjust_after_replace, adjust_after_insert, replace_range)
12857 (replace_range_2, del_range, del_range_1, del_range_byte)
12858 (del_range_both, del_range_2, modify_region)
12859 (prepare_to_modify_buffer, signal_before_change)
12860 (signal_after_change, Fcombine_after_change_execute):
12861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12862 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12863 (balance_an_interval, split_interval_right, split_interval_left)
12864 (find_interval, next_interval, update_interval)
12865 (adjust_intervals_for_insertion, delete_node, delete_interval)
12866 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12867 (static_offset_intervals, offset_intervals)
12868 (merge_interval_right, merge_interval_left, make_new_interval)
12869 (graft_intervals_into_buffer, temp_set_point_both)
12870 (temp_set_point, set_point, adjust_for_invis_intang)
12871 (set_point_both, move_if_not_intangible, get_property_and_range)
12872 (get_local_map, copy_intervals, copy_intervals_to_string)
12873 (compare_string_intervals, set_intervals_multibyte_1):
12874 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12875 * intervals.h: Adjust decls to match defn changes elsewhere.
12876 (struct interval):
12877 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12878 * keyboard.c (this_command_key_count, this_single_command_key_start)
12879 (before_command_key_count, before_command_echo_length, echo_now)
12880 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12881 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12882 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12883 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12884 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12885 (last_non_minibuf_size, last_point_position, echo_truncate)
12886 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12887 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12888 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12889 (stuff_buffered_input):
12890 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12891 (last_auto_save, command_loop_1, read_char):
12892 Use EMACS_INT, not int, to avoid integer overflow.
12893 (record_char): Avoid overflow in total_keys computation.
12894 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12895 * keyboard.h: Adjust decls to match defn changes elsewhere.
12896 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12897 (Fkey_description, Fdescribe_vector, Flookup_key):
12898 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12899 (click_position): New function, to check that positions are in range.
12900 (Fcurrent_active_maps):
12901 (describe_command):
12902 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12903 (Faccessible_keymaps, Fkey_description):
12904 (preferred_sequence_p):
12905 Don't assume fixnum can fit into int.
12906 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12907 Check for integer overflow in size calculations.
12908 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12909 avoid mishandling large integers.
12910 * lisp.h: Adjust decls to match defn changes elsewhere.
12911 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12912 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12913 (struct Lisp_Marker):
12914 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12915 (clip_to_bounds): Now an inline function, moved here from editfns.c.
12916 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12917 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12918 All callers changed.
12919 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12920 Assume the arg has valid form, since it always does.
12921 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12922 unsigned integer system type.
12923 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12924 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12925 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12926 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12927 (duration_to_sec_usec): New decl.
12928 * lread.c (read_from_string_index, read_from_string_index_byte)
12929 (read_from_string_limit, readchar, unreadchar, openp)
12930 (read_internal_start, read1, oblookup):
12931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12932 (Fload, readevalloop, Feval_buffer, Feval_region):
12933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12934 (openp): Check for out-of-range argument to 'access'.
12935 (read1): Use int, not EMACS_INT, where int is wide enough.
12936 Don't assume fixnum fits into int.
12937 Fix off-by-one error that can read outside a buffer.
12938 (read_filtered_event): Use duration_to_sec_usec
12939 to do proper overflow checking on durations.
12940 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12941 in size calculation.
12942 (Fexecute_kbd_macro):
12943 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12944 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12945 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12946 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12947 (set_marker_both, set_marker_restricted_both, marker_position)
12948 (marker_byte_position, Fbuffer_has_markers_at):
12949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12950 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
12951 * menu.c (ensure_menu_items): Rename from grow_menu_items.
12952 It now merely ensures that the menu is large enough, without
12953 necessarily growing it, as this avoids some integer overflow issues.
12954 All callers changed.
12955 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12956 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12957 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12958 Use SAFE_ALLOCA_LISP, not alloca.
12959 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12960 to EMACS_INT. Check that fixnums are in proper range for system types.
12961 * minibuf.c (minibuf_prompt_width, string_to_object)
12962 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12963 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12964 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12965 (get_minibuffer, read_minibuf_unwind):
12966 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12967 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12968 this simplifies overflow checking. All callers changed.
12969 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12970 (Ftest_completion):
12971 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12972 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12973 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12974 Check that fixnums are in proper range for system types.
12975 (Fx_create_frame, Fx_show_tip):
12976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12977 * nsfont.m (ns_findfonts, nsfont_list_family):
12978 Don't assume fixnum fits in long.
12979 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12980 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12981 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12982 wide enough.
12983 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
12984 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12985 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12986 (PRINTDECLARE, PRINTPREPARE):
12987 (strout, print_string):
12988 (print, print_preprocess, print_check_string_charset_prop)
12989 (print_object):
12990 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12991 (PRINTDECLARE):
12992 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12993 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12994 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
12995 (printchar, strout): Use xpalloc to catch size calculation overflow.
12996 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
12997 (print_error_message): Use SAFE_ALLOCA, not alloca.
12998 (print_object): Use int, not EMACS_INT, where int is wide enough.
12999 (print_depth, new_backquote_output, print_number_index):
13000 Use ptrdiff_t, not int, where int might not be wide enough.
13001 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13002 (Fset_process_window_size, Fformat_network_address)
13003 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13004 (sigchld_handler):
13005 Check that fixnums are in proper range for system types.
13006 (Fsignal_process): Simplify by avoiding a goto.
13007 Check for process-ids out of pid_t range rather than relying on
13008 undefined behavior.
13009 (process_tick, update_tick): Use EMACS_INT, not int.
13010 (Fformat_network_address, read_process_output, send_process)
13011 (Fprocess_send_region, status_notify):
13012 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13013 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13014 (wait_reading_process_output, read_process_output, exec_sentinel):
13015 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13016 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13017 (Faccept_process_output): Use duration_to_sec_usec to do proper
13018 overflow checking on durations.
13019 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13020 Don't assume pid_t fits in int.
13021 * process.h (struct Lisp_Process): Members tick and update_tick
13022 are now of type EMACS_INT, not int.
13023 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13024 configured --with-wide-int.
13025 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13026 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13027 * search.c (looking_at_1, string_match_1):
13028 (fast_string_match, fast_c_string_match_ignore_case)
13029 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13030 (scan_newline, find_before_next_newline, search_command)
13031 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13032 (set_search_regs, wordify):
13033 (Freplace_match):
13034 (Fmatch_data):
13035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13036 (string_match_1, search_buffer, set_search_regs):
13037 (Fmatch_data):
13038 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13039 (wordify): Check for overflow in size calculation.
13040 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13041 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13042 Check that fixnums are in proper range for system types.
13043 * sound.c (struct sound_device)
13044 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13045 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13046 (Fplay_sound_internal):
13047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13048 * syntax.c (struct lisp_parse_state, find_start_modiff)
13049 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13050 (Fparse_partial_sexp):
13051 Don't assume fixnums can fit in int.
13052 (struct lisp_parse_state, find_start_pos, find_start_value)
13053 (find_start_value_byte, find_start_begv)
13054 (update_syntax_table, char_quoted, dec_bytepos)
13055 (find_defun_start, prev_char_comend_first, back_comment):
13056 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13057 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13058 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13059 (Finternal_describe_syntax_value): Check that match_lisp is a
13060 character, not an integer, since the code stuffs it into int.
13061 (scan_words, scan_sexps_forward):
13062 Check that fixnums are in proper range for system types.
13063 (Fforward_word):
13064 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13065 (scan_sexps_forward):
13066 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13067 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13068 * syntax.h: Adjust decls to match defn changes elsewhere.
13069 (struct gl_state_s):
13070 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13071 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13072 MOST_POSITIVE_FIXNUM.
13073 * sysdep.c (wait_for_termination_1, wait_for_termination)
13074 (interruptible_wait_for_termination, mkdir):
13075 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13076 (emacs_read, emacs_write):
13077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13078 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13079 and double all fit in int.
13080 * term.c (set_tty_color_mode):
13081 Check that fixnums are in proper range for system types.
13082 * termhooks.h (struct input_event):
13083 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13084 * textprop.c (validate_interval_range, interval_of)
13085 (Fadd_text_properties, set_text_properties_1)
13086 (Fremove_text_properties, Fremove_list_of_text_properties)
13087 (Ftext_property_any, Ftext_property_not_all)
13088 (copy_text_properties, text_property_list, extend_property_ranges)
13089 (verify_interval_modification):
13090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13091 (Fnext_single_char_property_change)
13092 (Fprevious_single_char_property_change):
13093 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13094 (copy_text_properties):
13095 Check for integer overflow in index calculation.
13096 * undo.c (last_boundary_position, record_point, record_insert)
13097 (record_delete, record_marker_adjustment, record_change)
13098 (record_property_change):
13099 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13100 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13101 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13102 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13103 (Fx_hide_tip, Fx_file_dialog):
13104 * w32menu.c (set_frame_menubar):
13105 Use ptrdiff_t, not int, for consistency with rest of code.
13106 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13107 (select_window, Fdelete_other_windows_internal)
13108 (window_scroll_pixel_based, window_scroll_line_based)
13109 (Frecenter, Fset_window_configuration):
13110 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13111 (Fset_window_hscroll, run_window_configuration_change_hook)
13112 (set_window_buffer, temp_output_buffer_show, scroll_command)
13113 (Fscroll_other_window, Frecenter):
13114 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13115 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13116 Don't assume fixnum fits in int.
13117 (Fset_window_scroll_bars):
13118 Check that fixnums are in proper range for system types.
13119 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13120 (string_pos, c_string_pos, number_of_chars, init_iterator)
13121 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13122 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13123 (compute_display_string_end, handle_face_prop)
13124 (face_before_or_after_it_pos, handle_invisible_prop)
13125 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13126 (display_prop_intangible_p, string_buffer_position_lim)
13127 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13128 (get_overlay_strings_1, get_overlay_strings)
13129 (iterate_out_of_display_property, forward_to_next_line_start)
13130 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13131 (get_next_display_element, set_iterator_to_next)
13132 (get_visually_first_element, compute_stop_pos_backwards)
13133 (handle_stop_backwards, next_element_from_buffer)
13134 (move_it_in_display_line_to, move_it_in_display_line)
13135 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13136 (add_to_log, message_dolog, message_log_check_duplicate)
13137 (message2, message2_nolog, message3, message3_nolog
13138 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13139 (current_message_1, truncate_echo_area, truncate_message_1)
13140 (set_message, set_message_1, store_mode_line_noprop)
13141 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13142 (text_outside_line_unchanged_p, check_point_in_composition)
13143 (reconsider_clip_changes)
13144 (redisplay_internal, set_cursor_from_row, try_scrolling)
13145 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13146 (redisplay_window, find_last_unchanged_at_beg_row)
13147 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13148 (trailing_whitespace_p, find_row_edges, display_line)
13149 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13150 (display_mode_element, store_mode_line_string)
13151 (pint2str, pint2hrstr, decode_mode_spec)
13152 (display_count_lines, display_string, draw_glyphs)
13153 (x_produce_glyphs, x_insert_glyphs)
13154 (rows_from_pos_range, mouse_face_from_buffer_pos)
13155 (fast_find_string_pos, mouse_face_from_string_pos)
13156 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13157 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13158 (safe_call, init_from_display_pos, handle_fontified_prop)
13159 (handle_single_display_spec, load_overlay_strings)
13160 (with_echo_area_buffer, setup_echo_area_for_printing)
13161 (display_echo_area, echo_area_display)
13162 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13163 (update_tool_bar, hscroll_window_tree, redisplay_internal)
13164 (redisplay_window, dump_glyph_row, display_mode_line)
13165 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
13166 (handle_display_spec, display_prop_string_p):
13167 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13168 (handle_single_display_spec, build_desired_tool_bar_string)
13169 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13170 (get_specified_cursor_type):
13171 Check that fixnums are in proper range for system types.
13172 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13173 (Flookup_image_map):
13174 Don't assume fixnums fit in int.
13175 (compare_overlay_entries):
13176 Avoid mishandling comparisons due to subtraction overflow.
13177 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13178 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13179 (handle_tool_bar_click):
13180 Use int, not unsigned, since we prefer signed and the signedness
13181 doesn't matter here.
13182 (get_next_display_element, next_element_from_display_vector):
13183 Use int, not EMACS_INT, when int is wide enough.
13184 (start_hourglass): Use duration_to_sec_usec to do proper
13185 overflow checking on durations.
13186 * xfaces.c (Fbitmap_spec_p):
13187 Check that fixnums are in proper range for system types.
13188 (compare_fonts_by_sort_order):
13189 Avoid mishandling comparisons due to subtraction overflow.
13190 (Fx_family_fonts, realize_basic_faces):
13191 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13192 (Fx_family_fonts):
13193 Don't assume fixnum fits in int.
13194 Use SAFE_ALLOCA_LISP, not alloca.
13195 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13196 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13197 (face_at_buffer_position, face_for_overlay_string)
13198 (face_at_string_position):
13199 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13200 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13201 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13202 (Fx_show_tip):
13203 Check that fixnums are in proper range for system types.
13204 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13205 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13206 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13207 (Fx_change_window_property): Don't assume fixnums fit in int.
13208 * xfont.c (xfont_chars_supported):
13209 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13210 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13211 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13212 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13213 * xml.c (parse_region):
13214 * xrdb.c (magic_file_p):
13215 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13216 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13217 (x_get_local_selection, x_reply_selection_request)
13218 (x_handle_selection_request, wait_for_property_change):
13219 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13220 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13221 short is wide enough.
13222 (x_send_client_event): Don't assume fixnum fits in int.
13223 * xterm.c (x_x_to_emacs_modifiers):
13224 Don't assume EMACS_INT overflows nicely into int.
13225 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13226 may come from Lisp.
13227 (handle_one_xevent): NATNUMP can eval its arg twice.
13228 (x_connection_closed):
13229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13230 * xterm.h: Adjust decls to match defn changes elsewhere.
13231 (struct scroll_bar): Use struct vectorlike_header
13232 rather than rolling our own approximation.
13233 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13234
13235 2012-05-25 Glenn Morris <rgm@gnu.org>
13236
13237 * lisp.mk (lisp): Update for more files being compiled now.
13238
13239 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13240
13241 * lread.c: Remove `read_pure' which makes no difference.
13242 (read_pure): Remove var.
13243 (unreadpure): Remove function.
13244 (readevalloop): Don't call read_list with -1 flag.
13245 (read1, read_vector): Don't test read_pure any more.
13246 (read_list): Simplify.
13247
13248 * fileio.c, character.h: Minor style tweaks.
13249
13250 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13251
13252 * window.h (clip_changed): Remove useless declaration.
13253
13254 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
13255
13256 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13257 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13258
13259 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13260
13261 Remove src/m/*.
13262 This directory predates autoconf and is no longer needed nowadays.
13263 Move its few remaining bits of functionality to where they're needed.
13264 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13265 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13266 * m/template.h: Remove.
13267 * Makefile.in (M_FILE): Remove. All uses removed.
13268 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13269 * lisp.h (USE_LSB_TAG):
13270 * mem-limits.h (EXCEEDS_LISP_PTR):
13271 Use VAL_MAX, not VALBITS, in #if.
13272 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13273 (EMACS_UINT): Define unconditionally now.
13274 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13275 (BITS_PER_EMACS_INT): New constants, replacing
13276 what used to be in config.h, but not useful in #if.
13277 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13278 define them any more.
13279 (VAL_MAX): New macro.
13280 (VALMASK): Use it.
13281 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13282 BITS_PER_EMACS_INT, in #if.
13283 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13284 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13285 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13286 * s/ms-w32.h (DATA_START):
13287 Move here from removed file m/intel386.h.
13288 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13289 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13290
13291 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13292
13293 Assume C89 or later.
13294 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13295 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13296 (xrealloc):
13297 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13298 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13299 * textprop.c, tparam.c (NULL): Remove.
13300 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13301 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13302 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13303 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13304 * xterm.c (input_signal_count): Assume volatile works.
13305
13306 2012-05-21 Ken Brown <kbrown@cornell.edu>
13307
13308 * xgselect.c (xg_select): Fix first argument in call to 'select'
13309 (bug#11508).
13310
13311 2012-05-20 Ken Brown <kbrown@cornell.edu>
13312
13313 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
13314 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
13315
13316 2012-05-19 Ken Brown <kbrown@cornell.edu>
13317
13318 * xfns.c (x_in_use): Remove `static' qualifier.
13319 * xterm.h (x_in_use): Declare.
13320 * xgselect.c: Include xterm.h.
13321 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13322 and `display_arg' (bug#9754).
13323
13324 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13325
13326 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13327
13328 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13329 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13330
13331 2012-05-18 Eli Zaretskii <eliz@gnu.org>
13332
13333 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13334
13335 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
13336 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
13337
13338 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13339 reference to image_cache->refcount.
13340 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13341
13342 2012-05-17 Juri Linkov <juri@jurta.org>
13343
13344 * search.c (Fword_search_regexp, Fword_search_backward)
13345 (Fword_search_forward, Fword_search_backward_lax)
13346 (Fword_search_forward_lax): Move functions to isearch.el
13347 (bug#10145, bug#11381).
13348
13349 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13350
13351 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13352
13353 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13354
13355 * lread.c (init_obarray): Declare Qt and Qnil as special.
13356
13357 2012-05-14 Glenn Morris <rgm@gnu.org>
13358
13359 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
13360 Put "libexec" before "bin", for the sake of init_callproc_1.
13361
13362 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13363
13364 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13365
13366 * unexaix.c: Port to more-recent AIX compilers.
13367 (report_error, report_error_1, make_hdr, copy_sym)
13368 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13369 Make arguments const char *, not char *, to avoid violations of C
13370 standard and to fix some AIX warnings reported by Gilles Pion.
13371
13372 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13373
13374 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13375 already have overlays loaded.
13376 (handle_single_display_spec): Before returning without displaying
13377 fringe bitmap, synchronize the bidi iterator with the main display
13378 iterator, by calling iterate_out_of_display_property.
13379 (iterate_out_of_display_property): Detect buffer iteration by
13380 testing that it->string is a Lisp string.
13381 (get_next_display_element): When the current object is exhausted,
13382 and there's something on it->stack, call set_iterator_to_next to
13383 proceed with what's on the stack, instead of returning zero.
13384 (set_iterator_to_next): If called at the end of a Lisp string,
13385 proceed to consider_string_end without incrementing string
13386 position. Don't increment display vector index past the end of
13387 the display vector. (Bug#11417)
13388 (pos_visible_p): Don't report a position visible when move_it_to
13389 stopped at the last line of window, which happens to be scanned
13390 backwards by the bidi iteration. (Bug#11464)
13391
13392 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13393
13394 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13395 and right-margin display specs even if the spec is invalid or we
13396 are on a TTY, and thus unable to display on the fringes.
13397 That's because the text with the property will not be displayed anyway,
13398 so we need to signal to the caller that this is a "replacing"
13399 display spec. This fixes display when the spec is invalid or we
13400 are on a TTY.
13401
13402 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13403
13404 * unexaix.c (make_hdr): Fix typo in prototype.
13405 This bug broke the build on AIX. Problem reported by Gilles Pion.
13406
13407 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
13408
13409 * keyboard.c (kbd_buffer_get_event): Read special events also in
13410 batch mode. (Bug#11415)
13411
13412 2012-05-12 Glenn Morris <rgm@gnu.org>
13413
13414 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13415
13416 2012-05-12 Eli Zaretskii <eliz@gnu.org>
13417
13418 * lisp.mk (lisp): Add newcomment.elc.
13419
13420 2012-05-12 Glenn Morris <rgm@gnu.org>
13421
13422 * Makefile.in (MKDIR_P): New, set by configure.
13423 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13424
13425 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13426
13427 Remove unused function hourglass_started.
13428 * dispextern.h (hourglass_started):
13429 * w32fns.c (hourglass_started):
13430 * xdisp.c (hourglass_started): Remove.
13431
13432 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
13433
13434 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13435 Update dependencies.
13436
13437 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13438
13439 * xgselect.c (xg_select): Put maxfds+1 into a var.
13440 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13441
13442 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13443
13444 2012-05-10 Dave Abrahams <dave@boostpro.com>
13445
13446 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13447 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13448
13449 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
13450
13451 * dbusbind.c (xd_registered_buses): New internal Lisp object.
13452 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
13453 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13454 Initialize xd_registered_buses.
13455
13456 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13457
13458 Untag more efficiently if USE_LSB_TAG.
13459 This is based on a proposal by YAMAMOTO Mitsuharu in
13460 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13461 For an admittedly artificial (nth 8000 longlist) benchmark on
13462 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13463 Emacs's overall text size by 1%.
13464 * lisp.h (XUNTAG): New macro.
13465 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13466 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13467 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13468 * eval.c (Fautoload):
13469 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13470 * frame.h (XFRAME): Use XUNTAG.
13471
13472 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13473 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13474 Remove unportable assumptions about print widths of types like
13475 dbus_uint32_t.
13476 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13477 intptr_t when converting between pointer and integer, to avoid GCC
13478 warnings about wrong width.
13479
13480 2012-05-09 Eli Zaretskii <eliz@gnu.org>
13481
13482 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13483 stack for each reader_thread, instead of defaulting to 8MB
13484 determined by the linker. This avoids failures in creating
13485 subprocesses on Windows 7, see the discussion in this thread:
13486 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13487
13488 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13489
13490 Fix up display of the *Minibuf-0* buffer in the mini window.
13491 * keyboard.c (read_char): Don't clear the echo area if there's no
13492 message to clear.
13493 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
13494 contents of *Minibuf-0*) if there's no message displayed in its stead.
13495
13496 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
13497
13498 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13499 batch mode.
13500
13501 2012-05-06 Chong Yidong <cyd@gnu.org>
13502
13503 * lisp.mk (lisp): Update.
13504
13505 2012-05-05 Jim Meyering <meyering@redhat.com>
13506
13507 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13508
13509 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13510
13511 * data.c (PUT_ERROR): New macro.
13512 (syms_of_data): Use it. Add new error type `user-error'.
13513 * undo.c (user_error): New function.
13514 (Fprimitive_undo): Use it.
13515 * print.c (print_error_message): Adjust print style for `user-error'.
13516 * keyboard.c (user_error): New function.
13517 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13518
13519 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13520
13521 Do not limit current-time-string to years 1000..9999.
13522 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13523 (Fcurrent_time_string): Support any year that is supported by the
13524 underlying localtime representation. Don't use asctime, as it
13525 has undefined behavior for years outside the range -999..9999.
13526
13527 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13528
13529 Fix race conditions involving setenv, gmtime, localtime, asctime.
13530 Without this fix, interrupts could mess up code that uses these
13531 nonreentrant functions, since setting TZ invalidates existing
13532 tm_zone or tzname values, and since most of these functions return
13533 pointers to static storage.
13534 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13535 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13536 Grow the critical sections to include not just invoking
13537 localtime/gmtime, but also accessing these functions' results
13538 including their tm_zone values if any, and any related TZ setting.
13539 (format_time_string): Last arg is now struct tm *, not struct tm **,
13540 so that the struct tm is saved in the critical section.
13541 All callers changed. Simplify allocation of initial buffer, partly
13542 motivated by the fact that memory allocation needs to be outside
13543 the critical section.
13544
13545 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13546
13547 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13548 with RESET_INTERVAL.
13549
13550 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13551 Remove duplicated buffer name initialization.
13552
13553 2012-05-02 Jim Meyering <jim@meyering.net>
13554
13555 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13556
13557 * xfns.c (x_window): Use xstrdup (Bug#11375).
13558
13559 2012-05-02 Eli Zaretskii <eliz@gnu.org>
13560
13561 * xdisp.c (pos_visible_p): If already at a newline from the
13562 display string before the 'while' loop, don't walk back the glyphs
13563 from it3.glyph_row. Solves assertion violation when the display
13564 string begins with a newline (egg.el). (Bug#11367)
13565
13566 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13567
13568 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13569 Move to simple.el.
13570
13571 2012-05-01 Glenn Morris <rgm@gnu.org>
13572
13573 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13574 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13575 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13576 All were removed before 23.1.
13577
13578 * dispnew.c: Remove HAVE_LIBNCURSES test;
13579 it is always true on relevant platforms.
13580
13581 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13582 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13583
13584 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13585
13586 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13587
13588 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13589 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13590 Remove.
13591
13592 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13593
13594 Do not avoid creating empty evaporating overlays (Bug#9642).
13595 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13596 That is, do not delete an evaporating overlay if it becomes
13597 empty after its bounds are adjusted to fit within its buffer.
13598 This fix caused other problems, and I'm reverting it until we get
13599 to the bottom of them.
13600
13601 2012-04-27 Chong Yidong <cyd@gnu.org>
13602
13603 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13604
13605 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13606
13607 * xdisp.c (pos_visible_p): If the window start position is beyond
13608 ZV, start the display from buffer beginning. Prevents assertion
13609 violation in init_iterator when the minibuffer window is scrolled
13610 via the scroll bar.
13611
13612 * window.c (window_scroll_pixel_based): Likewise.
13613
13614 2012-04-27 Chong Yidong <cyd@gnu.org>
13615
13616 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13617
13618 2012-04-27 Glenn Morris <rgm@gnu.org>
13619
13620 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13621 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13622
13623 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13624
13625 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13626 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
13627
13628 2012-04-26 Eli Zaretskii <eliz@gnu.org>
13629
13630 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13631 display element, check also the underlying string or buffer
13632 character. (Bug#11341)
13633
13634 * w32menu.c: Include w32heap.h.
13635 (add_menu_item): If the call to AppendMenuW (via
13636 unicode_append_menu) fails, disable Unicode menus only if we are
13637 running on Windows 9X/Me.
13638
13639 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13640
13641 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13642 (xgetint): Add missing shift for LSB tags.
13643
13644 2012-04-24 Martin Rudalics <rudalics@gmx.at>
13645
13646 * keyboard.c (read_char): Don't wipe echo area for select window
13647 events: These might get delayed via `mouse-autoselect-window'
13648 (Bug#11304).
13649
13650 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
13651
13652 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13653 manipulation of :loaded-from data.
13654
13655 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
13656
13657 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13658 now a cons (bug#11311).
13659
13660 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13661
13662 Do not create empty overlays with the evaporate property (Bug#9642).
13663 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13664 if it becomes empty after its bounds are adjusted to fit within
13665 its buffer. Without this fix, in a nonempty buffer (let ((o
13666 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13667 yields an empty overlay that has the evaporate property, which is
13668 not supposed to happen.
13669
13670 Fix minor GTK3 problems found by static checking.
13671 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13672 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13673 (struct _EmacsFixedClass, emacs_fixed_get_type):
13674 Move decls here from emacsgtkfixed.h, since they needn't be public.
13675 (emacs_fixed_get_type): Now static.
13676 (emacs_fixed_class_init): Omit unused local.
13677 (emacs_fixed_child_type): Remove; unused.
13678 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13679 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13680 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13681 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13682 (EMACS_FIXED_GET_CLASS): Remove; unused.
13683 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13684
13685 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13686 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13687
13688 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13689
13690 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
13691 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
13692 (__malloc_size_t, __malloc_ptrdiff_t):
13693 Remove. All uses removed, replaced by the definiens if needed,
13694 since we can assume C89 or better now.
13695 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13696 (protect_malloc_state, align, get_contiguous_space)
13697 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13698 (malloc_atfork_handler_child, malloc_enable_thread)
13699 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13700 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13701 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13702 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13703 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13704 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13705 Define using prototypes, not old style.
13706 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13707 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13708 (align): Don't assume that signed integer overflow wraps around.
13709 Omit unused local var.
13710 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13711 (_free_internal_nolock, memalign, mallochook, reallochook):
13712 Omit no-longer-needed casts.
13713 (valloc): Use getpagesize, not __getpagesize.
13714 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13715 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13716
13717 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13718
13719 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
13720
13721 Move functions from C to Lisp. Make non-blocking method calls
13722 the default. Implement further D-Bus standard interfaces.
13723
13724 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13725 (QCdbus_request_name_allow_replacement)
13726 (QCdbus_request_name_replace_existing)
13727 (QCdbus_request_name_do_not_queue)
13728 (QCdbus_request_name_reply_primary_owner)
13729 (QCdbus_request_name_reply_in_queue)
13730 (QCdbus_request_name_reply_exists)
13731 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13732 (QCdbus_registered_serial, QCdbus_registered_method)
13733 (QCdbus_registered_signal): New Lisp objects.
13734 (XD_DEBUG_MESSAGE): Use sizeof.
13735 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13736 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13737 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13738 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13739 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13740 (xd_signature, xd_append_arg): Allow float for integer types.
13741 (xd_get_connection_references): New function.
13742 (xd_get_connection_address): Rename from xd_initialize.
13743 Return cached address.
13744 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13745 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13746 level.
13747 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
13748 Return number of refcounts.
13749 (Fdbus_get_unique_name): Make stronger parameter check.
13750 (Fdbus_message_internal): New defun.
13751 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13752 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13753 (Fdbus_send_signal, Fdbus_register_service)
13754 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13755 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13756 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13757 (Vdbus_compiled_version, Vdbus_runtime_version)
13758 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13759 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13760 (Vdbus_message_type_signal): New defvars.
13761 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13762 Adapt docstring.
13763
13764 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13765
13766 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13767 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13768 Do not assume ptrdiff_t is the same width as 'int'.
13769
13770 * alloc.c: Handle unusual debugging option combinations.
13771 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13772 since the two debugging options are incompatible.
13773 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13774 is defined.
13775 (mem_init, mem_insert, mem_insert_fixup):
13776 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13777 (NEED_MEM_INSERT): Remove; no longer needed.
13778
13779 2012-04-22 Leo Liu <sdl.web@gmail.com>
13780
13781 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13782
13783 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13784
13785 * sysdep.c [__FreeBSD__]: Minor cleanups.
13786 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13787 Use Emacs indenting style more consistently. Avoid some casts.
13788 Use 'double' consistently rather than mixing 'float' and 'double'.
13789
13790 2012-04-21 Eduard Wiebe <usenet@pusto.de>
13791
13792 * sysdep.c (list_system_processes, system_process_attributes):
13793 Add implementation for FreeBSD (Bug#5243).
13794
13795 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13796
13797 * lisp.mk (lisp): Update.
13798
13799 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13800
13801 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13802 It is never used otherwise.
13803
13804 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13805
13806 * print.c (print_preprocess): Only check print_depth if print-circle
13807 is nil.
13808 (print_object): Check for cycles even when print-circle is nil and
13809 print-gensym is t, but only check print_depth if print-circle is nil.
13810
13811 2012-04-20 Chong Yidong <cyd@gnu.org>
13812
13813 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13814 set the status to "failed" and ensure that sentinel is run.
13815
13816 2012-04-20 Glenn Morris <rgm@gnu.org>
13817
13818 * process.c (Fset_process_inherit_coding_system_flag)
13819 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
13820 (Fmake_network_process, Fmake_serial_process): Doc fix.
13821
13822 2012-04-20 Eli Zaretskii <eliz@gnu.org>
13823
13824 * xdisp.c (string_buffer_position_lim): Limit starting position to
13825 BEGV.
13826 (set_cursor_from_row): If called for a mode-line or header-line
13827 row, return zero immediately.
13828 (try_cursor_movement): If inside continuation line, don't back up
13829 farther than the first row after the header line, if any.
13830 Don't consider the header-line row as "partially visible", even if
13831 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13832
13833 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13834
13835 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13836 (bug#11238).
13837
13838 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
13839 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
13840
13841 configure: new option --enable-gcc-warnings (Bug#11207)
13842 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13843 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13844 (ALL_CFLAGS): Use new macros rather than old.
13845 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13846 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13847 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13848 -Wunused-result, -Wunused-variable. This should go away once
13849 the Emacs and Gnulib regex code is merged.
13850 (xmalloc, xrealloc): Now static.
13851
13852 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13853
13854 * dired.c (Fsystem_groups): Remove unused local.
13855
13856 2012-04-17 Glenn Morris <rgm@gnu.org>
13857
13858 * dired.c (Fsystem_users): Doc fix.
13859
13860 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13861
13862 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13863 (syms_of_dired): Add them.
13864
13865 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13866
13867 Fix minor alloc.c problems found by static checking.
13868 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13869 New extern decls, to avoid calling undeclared functions.
13870 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13871 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13872 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13873 (NEED_MEM_INSERT): New macro.
13874 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
13875 Remove one incorrect comment and fix another.
13876
13877 Fix minor ralloc.c problems found by static checking.
13878 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13879 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13880 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13881 (r_alloc_sbrk): Now static.
13882
13883 Improve ralloc.c interface checking.
13884 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13885 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13886 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13887 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13888 [REL_ALLOC]: ... to here, to check interface.
13889 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13890 Remove decls. This fixes an "It stinks!".
13891
13892 * alloc.c (which_symbols): Fix alignment issue / type clash.
13893
13894 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13895
13896 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13897 (struct Lisp_Misc_Any): Likewise.
13898 (struct Lisp_Free): Likewise.
13899 * alloc.c (union aligned_Lisp_Symbol): Define.
13900 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13901 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13902 (union aligned_Lisp_Misc): Define.
13903 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13904 aligned_Lisp_Misc instead of union Lisp_Misc.
13905 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
13906
13907 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13908
13909 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13910 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13911 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13912 * s/netbsd.h, s/sol2-6.h:
13913 Remove definition of GC_MARK_STACK, since the default now works.
13914 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13915 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13916 no longer the default.
13917 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13918
13919 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13920
13921 * lread.c (lisp_file_lexically_bound_p):
13922 Fix hang at ";-*-\n" (bug#11238).
13923
13924 2012-04-14 Eli Zaretskii <eliz@gnu.org>
13925
13926 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13927 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13928
13929 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13930
13931 * nsterm.m (constrainFrameRect): Always constrain when there is only
13932 one screen (Bug#10962).
13933
13934 2012-04-13 Ken Brown <kbrown@cornell.edu>
13935
13936 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13937
13938 2012-04-13 Reuben Thomas <rrt@sc3d.org>
13939
13940 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13941
13942 2012-04-11 Daniel Colascione <dancol@dancol.org>
13943
13944 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13945 against is gone. It's better to use vfork now so that when Cygwin
13946 gains a new, working vfork, we use it automatically (bug#10398).
13947
13948 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13949
13950 * window.c (save_window_save): Obey window-point-insertion-type.
13951
13952 2012-04-11 Glenn Morris <rgm@gnu.org>
13953
13954 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13955
13956 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13957
13958 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13959
13960 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
13961
13962 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13963 (force_quit_count): New var.
13964 (handle_interrupt): Use it.
13965
13966 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
13967
13968 * w32.c (w32_delayed_load): Record the full path of the library
13969 being loaded (bug#10424).
13970
13971 2012-04-09 Glenn Morris <rgm@gnu.org>
13972
13973 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13974 not just in the obarray, before snarfing them. (Bug#11036)
13975
13976 * Makefile.in ($(leimdir)/leim-list.el):
13977 Pass EMACS rather than BUILT_EMACS.
13978
13979 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13980
13981 * process.c (make_process):
13982 * process.h: Add integer `gnutls_handshakes_tried' member to
13983 process struct.
13984
13985 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13986 Add convenience `GNUTLS_LOG2i' macro.
13987
13988 * gnutls.c (gnutls_log_function2i): Convenience log function.
13989 (emacs_gnutls_read): Use new log functions,
13990 `gnutls_handshakes_tried' process member, and
13991 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13992 attempts per process (connection).
13993
13994 2012-04-09 Chong Yidong <cyd@gnu.org>
13995
13996 * eval.c (Fuser_variable_p, user_variable_p_eh)
13997 (lisp_indirect_variable): Functions deleted.
13998 (Fdefvar): Caller changed.
13999
14000 * callint.c (Finteractive, Fcall_interactively):
14001 * minibuf.c (Fread_variable): Callers changed.
14002
14003 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14004
14005 * xdisp.c (set_cursor_from_row): If the display string appears in
14006 the buffer at position that is closer to point than the position
14007 after the display string, display the cursor on the first glyph of
14008 the display string. Fixes cursor display when a 'display' text
14009 property immediately follows invisible text. (Bug#11094)
14010
14011 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14012
14013 composite.c: use 'double' consistently
14014 * composite.c (get_composition_id): Use 'double' consistently
14015 instead of converting 'float' to 'double' and vice versa; this is
14016 easier to understand and avoids a GCC warning.
14017
14018 2012-04-09 Glenn Morris <rgm@gnu.org>
14019
14020 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14021 preparation for dumping it with emacs. (Bug#4789)
14022 (leimdir): New variable.
14023 ($(leimdir)/leim-list.el): New rule.
14024 (emacs$(EXEEXT)): Depend on leim-list.el.
14025
14026 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14027 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14028 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14029
14030 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14031
14032 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14033 proper alignment.
14034
14035 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14036
14037 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14038 Remove unused local variable.
14039
14040 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14041
14042 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14043 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14044 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14045 objects, as mark_maybe_pointer will catch them otherwise.
14046 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14047 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14048
14049 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14050
14051 Fix typo that broke non-Windows builds.
14052 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14053
14054 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14055
14056 Support building on MS-Windows with libxml2.
14057
14058 * makefile.w32-in (OBJ2): Add xml.$(O).
14059 (GLOBAL_SOURCES): Add xml.c.
14060 ($(BLD)/xml.$(O)): New dependency list.
14061
14062 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14063 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14064 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14065 [!WINDOWSNT]: New macros.
14066 (init_libxml2_functions, libxml2_loaded_p): New functions.
14067 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14068 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14069 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14070 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14071 linked in).
14072 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14073 Call init_libxml2_functions before calling libxml2 functions.
14074 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14075
14076 * emacs.c: Don't include libxml/parser.h.
14077 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14078 xmlCleanupParser directly.
14079
14080 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14081
14082 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14083
14084 * indent.c (Fvertical_motion): If there is a display string at
14085 point, use it.vpos to compute how many lines to backtrack after
14086 move_it_to point. (Bug#11133)
14087
14088 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14089
14090 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14091 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14092 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14093 macros related to unification of CJK characters. For the details,
14094 see the discussion following the message here:
14095 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14096
14097 2012-04-04 Chong Yidong <cyd@gnu.org>
14098
14099 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14100
14101 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14102
14103 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14104 instead of alloca. (Bug#11138)
14105
14106 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14107
14108 * w32menu.c (is_simple_dialog): Properly check lisp types.
14109 (Bug#11141)
14110
14111 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14112
14113 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14114 position we get to after a call to move_it_to fails the
14115 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14116 only if we wind up in a string from display property. (Bug#11063)
14117
14118 * window.c (Fdelete_other_windows_internal): Invalidate the row
14119 and column information about mouse highlight, so that redisplay
14120 restores it after reallocating the glyph matrices. (Bug#7464)
14121
14122 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14123 string comes from a `display' text property, use the buffer
14124 position of that property as if we actually saw that position in
14125 the row's glyphs.
14126 (move_it_by_lines): Remove the assertion that
14127 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14128 violated when there's a before-string at the beginning of a line.
14129 (Bug#11063)
14130
14131 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14132
14133 * xdisp.c (append_space_for_newline): If the default face was
14134 remapped, use the remapped face for the appended newline.
14135 (extend_face_to_end_of_line): Use the remapped default face for
14136 extending the face to the end of the line.
14137 (display_line): Call extend_face_to_end_of_line when the default
14138 face was remapped. (Bug#11068)
14139
14140 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14141
14142 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14143
14144 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14145
14146 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14147
14148 2012-03-27 Glenn Morris <rgm@gnu.org>
14149
14150 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14151 Doc fixes.
14152
14153 2012-03-26 Kenichi Handa <handa@m17n.org>
14154
14155 * dispextern.h (struct glyph): Fix previous change. Change the
14156 bit length of glyphless.ch to 25 (Bug#11082).
14157
14158 2012-03-26 Chong Yidong <cyd@gnu.org>
14159
14160 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14161 (command_loop_1): Use it; inhibit selection update for
14162 handle-select-window too (Bug#8996).
14163
14164 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14165
14166 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
14167
14168 2012-03-25 Kenichi Handa <handa@m17n.org>
14169
14170 * dispextern.h (struct glyph): Change the bit length of
14171 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14172
14173 2012-03-24 Eli Zaretskii <eliz@gnu.org>
14174
14175 * s/ms-w32.h (tzname): Include time.h before redirecting to
14176 _tzname. Fixes the MSVC build. (Bug#9960)
14177
14178 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14179
14180 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14181 characters.
14182
14183 * xterm.c (XTread_socket): Only modify handling_signal if
14184 !SYNC_INPUT. (Bug#11080)
14185
14186 2012-03-23 Eli Zaretskii <eliz@gnu.org>
14187
14188 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14189 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14190 when fetching a multibyte character consumes more bytes than
14191 CHAR_BYTES returns, due to unification of CJK characters in
14192 string_char. (Bug#11073)
14193
14194 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14195
14196 * process.c (wait_reading_process_output): Handle pty disconnect
14197 by refraining from sending oneself a SIGCHLD (bug#10933).
14198
14199 2012-03-22 Chong Yidong <cyd@gnu.org>
14200
14201 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14202
14203 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
14204 Mark string as coming from a prefix property.
14205 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14206 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14207
14208 2012-03-21 Chong Yidong <cyd@gnu.org>
14209
14210 * xfaces.c (Vface_remapping_alist): Doc fix.
14211
14212 2012-03-20 Eli Zaretskii <eliz@gnu.org>
14213
14214 * w32proc.c (Fw32_set_console_codepage)
14215 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14216 Doc fixes.
14217
14218 2012-03-20 Chong Yidong <cyd@gnu.org>
14219
14220 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14221 to reflect default non-nil value of redisplay-dont-pause.
14222
14223 2012-03-19 Kenichi Handa <handa@m17n.org>
14224
14225 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14226 it fit in a valid range (Bug#11003).
14227
14228 2012-03-18 Eli Zaretskii <eliz@gnu.org>
14229
14230 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14231 that is not from display property, accept the row as a "cursor
14232 row" if one of the string's character has a non-nil `cursor'
14233 property. Fixes cursor positioning when there are newlines in
14234 overlay strings, e.g. in icomplete.el. (Bug#11035)
14235
14236 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14237
14238 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14239
14240 2012-03-12 Chong Yidong <cyd@gnu.org>
14241
14242 * eval.c (inhibit_lisp_code): Rename from
14243 inhibit_window_configuration_change_hook; move from window.c.
14244
14245 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14246 * window.c (run_window_configuration_change_hook)
14247 (syms_of_window): Callers changed.
14248
14249 2012-03-11 Chong Yidong <cyd@gnu.org>
14250
14251 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14252
14253 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14254
14255 2012-03-10 Chong Yidong <cyd@gnu.org>
14256
14257 * frame.c (other_visible_frames): Don't assume the selected frame
14258 is visible (Bug#10955).
14259
14260 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14261
14262 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14263
14264 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14265
14266 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14267 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14268 zero (Bug#10954).
14269
14270 2012-03-03 Glenn Morris <rgm@gnu.org>
14271
14272 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
14273
14274 2012-03-02 Eli Zaretskii <eliz@gnu.org>
14275
14276 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14277 position past the first glyph_row that ends at ZV. (Bug#10902)
14278 (redisplay_window, next_element_from_string): Fix typos in
14279 comments.
14280 (redisplay_window): Pass to move_it_vertically the margin in
14281 pixels, not in screen lines.
14282
14283 2012-03-02 Glenn Morris <rgm@gnu.org>
14284
14285 * buffer.c (buffer-list-update-hook): Doc fix.
14286
14287 2012-02-29 Eli Zaretskii <eliz@gnu.org>
14288
14289 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14290 push_it before setting up the iterator for the first overlay
14291 string, even if we have an empty string loaded.
14292 (next_overlay_string): If there's an empty string on the iterator
14293 stack, pop the stack. (Bug#10903)
14294
14295 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14296
14297 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14298 Suggested by Stefan Monnier in
14299 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14300 * alloc.c (widen_to_Lisp_Object): New static function.
14301 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14302 and widening them to Lisp_Objects. This would work even if
14303 USE_LSB_TAG is defined and wide integers are used, which might
14304 happen in a future version of Emacs.
14305
14306 2012-02-25 Chong Yidong <cyd@gnu.org>
14307
14308 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14309 Doc fix.
14310
14311 * xselect.c (Fx_selection_exists_p): Doc fix.
14312 (x_clipboard_manager_save_all): Print an informative message
14313 before saving to clipboard manager.
14314
14315 2012-02-24 Chong Yidong <cyd@gnu.org>
14316
14317 * keyboard.c (process_special_events): Handle all X selection
14318 requests in kbd_buffer, not just the next one (Bug#8869).
14319
14320 2012-02-23 Chong Yidong <cyd@gnu.org>
14321
14322 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14323 call when setting menu-bar-lines and tool-bar-lines parameters.
14324 (unwind_create_frame_1): New helper function.
14325
14326 * window.c (inhibit_window_configuration_change_hook): New var.
14327 (run_window_configuration_change_hook): Obey it.
14328 (syms_of_window): Initialize it.
14329
14330 2012-02-22 Chong Yidong <cyd@gnu.org>
14331
14332 * xterm.c (x_draw_image_relief): Add missing type check for
14333 Vtool_bar_button_margin (Bug#10743).
14334
14335 2012-02-21 Chong Yidong <cyd@gnu.org>
14336
14337 * fileio.c (Vfile_name_handler_alist): Doc fix.
14338
14339 * buffer.c (Fget_file_buffer): Protect against invalid file
14340 handler return value.
14341
14342 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14343
14344 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14345 when computing $valmask.
14346
14347 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14348 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14349 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14350 It's useless in that case, and it can cause problems on hosts
14351 that allocate halves of EMACS_INT values separately.
14352 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14353 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14354 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14355 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14356 it avoids undefined behavior on hosts where shifting right by more
14357 than the word width has undefined behavior.
14358
14359 2012-02-19 Chong Yidong <cyd@gnu.org>
14360
14361 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14362 (Funhandled_file_name_directory, Ffile_name_as_directory)
14363 (Fdirectory_file_name, Fexpand_file_name)
14364 (Fsubstitute_in_file_name): Protect against invalid file handler
14365 return values (Bug#10845).
14366
14367 2012-02-18 Eli Zaretskii <eliz@gnu.org>
14368
14369 * .gdbinit (pitx): Fix incorrect references to fields of the
14370 iterator stack.
14371
14372 2012-02-17 Chong Yidong <cyd@gnu.org>
14373
14374 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14375
14376 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14377
14378 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14379 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14380
14381 2012-02-15 Chong Yidong <cyd@gnu.org>
14382
14383 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14384 marked as special. Also, starting docstrings with * is obsolete.
14385
14386 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14387
14388 * gnutls.c (emacs_gnutls_write): Fix last change.
14389
14390 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14391
14392 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14393 send_process.
14394
14395 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14396
14397 * keymap.c (Fsingle_key_description): Handle char ranges.
14398
14399 2012-02-12 Chong Yidong <cyd@gnu.org>
14400
14401 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14402 as that creates a dangerous corner case.
14403
14404 * window.c (Fdelete_window_internal): Invalidate the mouse
14405 highlight (Bug#9904).
14406
14407 2012-02-12 Glenn Morris <rgm@gnu.org>
14408
14409 * xselect.c (Fx_own_selection_internal)
14410 (Fx_get_selection_internal, Fx_disown_selection_internal)
14411 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14412 * nsselect.m (Fx_own_selection_internal)
14413 (Fx_disown_selection_internal, Fx_selection_exists_p)
14414 (Fx_selection_owner_p, Fx_get_selection_internal):
14415 Sync docs and argument specs with the xselect.c versions.
14416
14417 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14418
14419 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14420
14421 2012-02-11 Eli Zaretskii <eliz@gnu.org>
14422
14423 * w32select.c (Fx_selection_exists_p): Sync doc string and
14424 argument list with xselect.c. (Bug#10783)
14425
14426 * w16select.c (Fx_selection_exists_p): Sync doc string and
14427 argument list with xselect.c. (Bug#10783)
14428
14429 2012-02-10 Glenn Morris <rgm@gnu.org>
14430
14431 * fns.c (Fsecure_hash): Doc fix.
14432
14433 2012-02-09 Kenichi Handa <handa@m17n.org>
14434
14435 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14436
14437 2012-02-07 Chong Yidong <cyd@gnu.org>
14438
14439 * buffer.c (Fbuffer_local_variables)
14440 (buffer_lisp_local_variables): Handle unbound vars correctly;
14441 don't let Qunbound leak into Lisp.
14442
14443 2012-02-07 Glenn Morris <rgm@gnu.org>
14444
14445 * image.c (Fimagemagick_types): Doc fix.
14446
14447 * image.c (imagemagick-render-type): Change it from a lisp object
14448 to an integer. Move the doc here from the lisp manual.
14449 Treat all values not equal to 0 the same.
14450
14451 2012-02-06 Chong Yidong <cyd@gnu.org>
14452
14453 * doc.c (store_function_docstring): Avoid applying docstring of
14454 alias to base function (Bug#2603).
14455
14456 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14457
14458 * .gdbinit (pp1, pv1): Remove redundant defines.
14459 (pr): Use pp.
14460
14461 2012-02-04 Chong Yidong <cyd@gnu.org>
14462
14463 * nsterm.m: Declare a global (Bug#10694).
14464
14465 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14466
14467 * w32.c (get_emacs_configuration_options):
14468 Include --enable-checking, if specified, in the return value.
14469
14470 2012-02-04 Martin Rudalics <rudalics@gmx.at>
14471
14472 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14473 after rounding frame sizes. (Bug#9723)
14474
14475 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14476
14477 * keyboard.c (adjust_point_for_property): Don't position point
14478 before BEGV. (Bug#10696)
14479
14480 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14481
14482 Handle overflow when computing char display width (Bug#9496).
14483 * character.c (char_width): Return EMACS_INT, not int.
14484 (char_width, c_string_width): Check for overflow when
14485 computing the width; this is possible now that individual
14486 characters can have unbounded width. Problem introduced
14487 by merge from Emacs 23 on 2012-01-19.
14488
14489 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
14490
14491 * dbusbind.c (Fdbus_register_method): Mention the return value
14492 :ignore in the docstring.
14493
14494 2012-02-02 Glenn Morris <rgm@gnu.org>
14495
14496 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14497
14498 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14499 Unconditionally set to t. (Bug#10673)
14500 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14501 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14502 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14503
14504 2012-02-02 Kenichi Handa <handa@m17n.org>
14505
14506 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14507 0, do not call append_composite_glyph.
14508
14509 2012-02-02 Kenichi Handa <handa@m17n.org>
14510
14511 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14512 NULL (Bug#6988).
14513 (x_produce_glyphs): If the component of a composition is a null
14514 string, set it->pixel_width to 1 to avoid zero-width glyph.
14515
14516 2012-02-01 Eli Zaretskii <eliz@gnu.org>
14517
14518 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14519 first 2 arguments are identical. This makes inserting large
14520 output from a subprocess an order of magnitude faster on
14521 MS-Windows, where all sbrk'ed memory is always contiguous.
14522
14523 2012-01-31 Glenn Morris <rgm@gnu.org>
14524
14525 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14526 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14527 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14528
14529 2012-01-29 Glenn Morris <rgm@gnu.org>
14530
14531 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14532
14533 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14534
14535 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14536
14537 2012-01-28 Chong Yidong <cyd@gnu.org>
14538
14539 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14540
14541 2012-01-26 Chong Yidong <cyd@gnu.org>
14542
14543 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14544
14545 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14546 repeat counts (Bug#10507).
14547
14548 2012-01-26 Glenn Morris <rgm@gnu.org>
14549
14550 * lread.c (syms_of_lread): Doc fix.
14551
14552 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14553
14554 * coding.c (encode_designation_at_bol): Change return value to
14555 EMACS_INT.
14556
14557 2012-01-25 Chong Yidong <cyd@gnu.org>
14558
14559 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14560
14561 2012-01-21 Chong Yidong <cyd@gnu.org>
14562
14563 * floatfns.c (Fcopysign): Make the second argument non-optional,
14564 since nil is not allowed anyway.
14565
14566 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14567
14568 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14569 (send_process): Likewise.
14570
14571 2012-01-19 Martin Rudalics <rudalics@gmx.at>
14572
14573 * window.c (save_window_save, Fcurrent_window_configuration)
14574 (Vwindow_persistent_parameters): Do not use Qstate.
14575 Rewrite doc-strings.
14576
14577 2012-01-19 Kenichi Handa <handa@m17n.org>
14578
14579 * character.c (char_width): New function.
14580 (Fchar_width, c_string_width, lisp_string_width):
14581 Use char_width (Bug#9496).
14582
14583 2012-01-16 Martin Rudalics <rudalics@gmx.at>
14584
14585 * window.c (Vwindow_persistent_parameters): New variable.
14586 (Fset_window_configuration, save_window_save): Handle persistent
14587 window parameters.
14588
14589 2012-01-14 Eli Zaretskii <eliz@gnu.org>
14590
14591 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14592 thrashing the stack of the thread. (Bug#9087)
14593
14594 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14595
14596 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14597
14598 2012-01-11 Eli Zaretskii <eliz@gnu.org>
14599
14600 * xdisp.c (rows_from_pos_range): Handle the case where the
14601 highlight ends on a newline. (Bug#10464)
14602 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14603 he end column for display of highlight that ends on a newline
14604 before a R2L line.
14605
14606 2012-01-11 Glenn Morris <rgm@gnu.org>
14607
14608 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14609 from load-path also when installation-directory is nil. (Bug#10208)
14610
14611 2012-01-10 Glenn Morris <rgm@gnu.org>
14612
14613 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14614
14615 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14616 Update template values to be closer to their typical values these days.
14617
14618 2012-01-09 Eli Zaretskii <eliz@gnu.org>
14619
14620 * xdisp.c (rows_from_pos_range): Accept additional argument
14621 DISP_STRING, and accept any glyph in a row whose object is that
14622 string as eligible for mouse highlight. Fixes mouse highlight of
14623 display strings from overlays. (Bug#10464)
14624
14625 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
14626
14627 emacs: fix an auto-save permissions race condition (Bug#10400)
14628 * fileio.c (auto_saving_dir_umask): New static var.
14629 (Fmake_directory_internal): Use it.
14630 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14631 creating the directory. The old code temporarily assigns
14632 too-generous permissions to the directory.
14633 (do_auto_save_eh): Clear it.
14634 (Fdo_auto_save): Catch all errors, not just file errors, so
14635 that the var is always cleared.
14636
14637 2012-01-07 Eli Zaretskii <eliz@gnu.org>
14638
14639 * search.c (scan_buffer): Pass character positions to
14640 know_region_cache, not byte positions. (Bug#6540)
14641
14642 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
14643
14644 * w32.c (sys_rename): Report EXDEV when rename of a directory
14645 fails because the target is on another logical disk. (Bug#10284)
14646
14647 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14648
14649 * xterm.c (x_embed_request_focus): New function.
14650
14651 * xterm.h: Add prototype.
14652
14653 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14654
14655 2012-01-05 Glenn Morris <rgm@gnu.org>
14656
14657 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14658
14659 2012-01-01 Eli Zaretskii <eliz@gnu.org>
14660
14661 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14662 Load gnutls_transport_set_lowat only if GnuTLS version is below
14663 2.11.1.
14664 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14665 GnuTLS versions below 2.11.1.
14666
14667 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14668
14669 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14670 to the doc string advising against its use for altering the way
14671 windows are scrolled.
14672
14673 2011-12-28 Kenichi Handa <handa@m17n.org>
14674
14675 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14676 coding-system ASCII compatible only when it does not produce BOM
14677 on encoding (Bug#10383).
14678
14679 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14680
14681 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14682 can scroll.
14683 (create_and_show_popup_menu): Always use menu_position_func for
14684 Gtk3 (Bug#10361).
14685
14686 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14687
14688 * callint.c (Fcall_interactively): Don't truncate prompt string.
14689
14690 2011-12-23 Eli Zaretskii <eliz@gnu.org>
14691
14692 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14693 property that ends at ZV, so that the bidi iteration could be
14694 resumed from there (after widening). (Bug#10360)
14695
14696 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14697
14698 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14699
14700 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14701
14702 * nsterm.m (x_free_frame_resources):
14703 Release f->output_data.ns->miniimage.
14704 (ns_index_color): Fix indentation. Do not retain
14705 color_table->colors[i].
14706
14707 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14708 before returning.
14709
14710 * nsfns.m (x_set_background_color): Assign return value from
14711 ns_index_color to face-background instead of NSColor*.
14712 (ns_implicitly_set_icon_type): Fix indentation.
14713 Change assignment in for loop to comparison.
14714
14715 * emacs.c (ns_pool): New variable.
14716 (main): Assign ns_pool.
14717 (Fkill_emacs): Call ns_release_autorelease_pool.
14718
14719 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14720 autorelease fdesc, release fdAttrs and tdict.
14721 (ns_get_covering_families): Release charset.
14722 (ns_findfonts): Release NSFontDescriptor created with new.
14723 (ns_uni_to_glyphs): Fix indentation.
14724 (setString): Release attrStr before assigning new value.
14725
14726 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14727
14728 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14729 and NS_IMPL_COCOA.
14730 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14731 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14732
14733 2011-12-18 David Reitter <reitter@cmu.edu>
14734
14735 * nsterm.m (ns_term_init): Subscribe for notifications
14736 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14737 to method trackingNotification in EmacsMenu.
14738
14739 * nsmenu.m (trackingMenu): New variable.
14740 (trackingNotification): New method (from Aquamacs).
14741 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
14742 from Aquamacs (Bug#7030).
14743
14744 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14745
14746 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14747 (symbol_to_nsstring): Fix indentation.
14748 (ns_symbol_to_pb): New function.
14749 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14750 (Fns_rotate_cut_buffers_internal): Remove.
14751 (Fns_store_selection_internal): Rename from
14752 Fns_store_cut_buffer_internal.
14753 (ns_get_foreign_selection, Fx_own_selection_internal)
14754 (Fx_disown_selection_internal, Fx_selection_exists_p)
14755 (Fns_get_selection_internal, Fns_store_selection_internal):
14756 Use ns_symbol_to_pb and check if return value is nil.
14757 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14758 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
14759 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14760 renamed to Sns_store_selection_internal.
14761 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14762 and remove this function.
14763 (ns_handle_selection_clear): Remove, never used.
14764 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14765 here.
14766
14767 2011-12-17 Ken Brown <kbrown@cornell.edu>
14768
14769 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14770 GID is unknown (Bug#10257).
14771
14772 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14773
14774 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14775 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14776 which caused a build failure on GNU/Linux IA-64. This problem was
14777 introduced by my 2011-10-07 patch.
14778
14779 2011-12-15 Juri Linkov <juri@jurta.org>
14780
14781 * image.c (imagemagick_error): New function. (Bug#10112)
14782 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14783 Use `imagemagick_error' where ImageMagick functions return
14784 `MagickFalse'.
14785 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14786 proper order.
14787
14788 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14789
14790 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14791 fill background (Bug#8992).
14792
14793 2011-12-13 Martin Rudalics <rudalics@gmx.at>
14794
14795 * window.c (Vwindow_combination_resize)
14796 (Vwindow_combination_limit): Use t instead of non-nil in
14797 doc-strings.
14798 (Vrecenter_redisplay): Add first sentence of doc-string on
14799 separate line.
14800 (Frecenter): Fix doc-string typo.
14801
14802 2011-12-11 Kenichi Handa <handa@m17n.org>
14803
14804 * coding.c (Funencodable_char_position): Pay attention to the
14805 buffer text relocation (Bug#9389).
14806
14807 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14808
14809 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14810 gtk_init (Bug#10100).
14811
14812 2011-12-10 Eli Zaretskii <eliz@gnu.org>
14813
14814 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14815 IT->string is nil. (Bug#10263)
14816
14817 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14818
14819 * nsterm.h (x_free_frame_resources): Declare.
14820
14821 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14822 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14823
14824 * nsterm.h (ns_get_defaults_value): Declare.
14825
14826 * nsterm.m (ns_default): Call ns_get_defaults_value.
14827
14828 2011-12-09 Eli Zaretskii <eliz@gnu.org>
14829
14830 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14831 (Bug#10170)
14832
14833 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14834
14835 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14836 that where the value of an _OBJC_* symbol points to is in the .bss
14837 section (Bug#10240).
14838
14839 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14840
14841 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
14842 after the loop to call ccl_driver at least once (Bug#8619).
14843
14844 2011-12-08 Kenichi Handa <handa@m17n.org>
14845
14846 * ftfont.c (get_adstyle_property): Fix previous change
14847 (Bug#10233).
14848
14849 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
14850
14851 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14852 dirs from the default value of EMACSLOADPATH (bug#10208).
14853
14854 2011-12-07 Glenn Morris <rgm@gnu.org>
14855
14856 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14857 installation and source directories as well. (Bug#10208)
14858
14859 2011-12-06 Chong Yidong <cyd@gnu.org>
14860
14861 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14862
14863 2011-12-06 Glenn Morris <rgm@gnu.org>
14864
14865 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14866 as an error, not just -1. (Bug#10217)
14867
14868 2011-12-05 Chong Yidong <cyd@gnu.org>
14869
14870 * keyboard.c (process_special_events): New function.
14871 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14872
14873 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14874
14875 * coding.c (encode_designation_at_bol): Don't use uninitialized
14876 local variable (Bug#9318).
14877
14878 2011-12-05 Kenichi Handa <handa@m17n.org>
14879
14880 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14881 return Qnil (Bug#8046, Bug#10193).
14882
14883 2011-12-05 Kenichi Handa <handa@m17n.org>
14884
14885 * coding.c (encode_designation_at_bol): New args charbuf_end and
14886 dst. Return the number of produced bytes. Callers changed.
14887 (coding_set_source): Return how many bytes coding->source was
14888 relocated.
14889 (coding_set_destination): Return how many bytes
14890 coding->destination was relocated.
14891 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
14892 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
14893
14894 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14895
14896 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14897 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14898 macro (Bug#9318).
14899
14900 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14901
14902 The following changes are to fix Bug#9318.
14903
14904 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
14905 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14906 (encode_coding_iso_2022, encode_coding_sjis)
14907 (encode_coding_big5, encode_coding_charset): Use the above macros.
14908
14909 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
14910
14911 * lisp.h (process_quit_flag): Fix external declaration.
14912
14913 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14914
14915 Don't macro-inline non-performance-critical code.
14916 * eval.c (process_quit_flag): New function.
14917 * lisp.h (QUIT): Use it.
14918
14919 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14920
14921 * nsfns.m (get_geometry_from_preferences): New function.
14922 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14923
14924 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14925
14926 * emacs.c (Qkill_emacs): Define.
14927 (syms_of_emacs): Initialize it.
14928 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14929 Qquit_flag to `kill-emacs' instead.
14930 (quit_throw_to_read_char): Add parameter `from_signal'.
14931 All callers changed. Call Fkill_emacs if requested and safe.
14932 * lisp.h (QUIT): Call Fkill_emacs if requested.
14933
14934 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14935
14936 * widget.c (update_wm_hints): Return if wmshell is null.
14937 (widget_update_wm_size_hints): New function.
14938
14939 * widget.h (widget_update_wm_size_hints): Declare.
14940
14941 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14942 widget_update_wm_size_hints (Bug#10104).
14943
14944 2011-12-03 Eli Zaretskii <eliz@gnu.org>
14945
14946 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14947 before a newline, prepare the bidi iterator for consuming the
14948 newline, and keep the current paragraph direction. (Bug#10183)
14949 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
14950
14951 2011-12-02 Juri Linkov <juri@jurta.org>
14952
14953 * search.c (Fword_search_regexp): New Lisp function created from
14954 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14955 (Fword_search_backward, Fword_search_forward)
14956 (Fword_search_backward_lax, Fword_search_forward_lax):
14957 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14958 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14959
14960 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14961
14962 * fileio.c (Finsert_file_contents): Move after-change-function call
14963 to before the "handled:" label, since all "goto handled" appear in
14964 cases where the *-change-functions have already been properly called
14965 (bug#10117).
14966
14967 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14968
14969 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14970 waiting for input. (Bug#10169)
14971
14972 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14973
14974 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14975 verifies glyph row's hash code--we have just reallocated the
14976 glyphs, so their contents can be complete garbage. (Bug#10164)
14977
14978 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
14979
14980 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14981
14982 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14983
14984 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14985 attributes are tested _before_ calling verify_row_hash, to protect
14986 against GCC re-ordering of the tests. (Bug#10164)
14987
14988 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14989
14990 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14991
14992 * xterm.c (handle_one_xevent): Only set async_visible and friends
14993 if net_wm_state_hidden_seen is non-zero (Bug#10002)
14994 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
14995 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14996
14997 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14998
14999 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15000 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15001 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15002 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15003 All uses changed to use GCPRO1 etc.
15004 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15005 Revert to old implementation (i.e., before 2011-03-11).
15006
15007 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15008
15009 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15010 of scroll runs so as to avoid assigning disabled bogus rows and
15011 unnecessary graphics copy operations.
15012
15013 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15014
15015 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15016 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15017 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15018 (malloc, free, realloc, calloc): Redirect to e_* only when
15019 compiling Emacs.
15020
15021 * lisp.h (GCTYPEBITS): Move before first use.
15022 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15023 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15024 this macro definition.
15025
15026 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15027 _MSC_VER.
15028
15029 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15030
15031 * gtkutil.c (xg_create_frame_widgets):
15032 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15033 present with Gtk+ 2.0.
15034
15035 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15036
15037 * fileio.c (Finsert_file_contents): Undo previous change; see
15038 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15039
15040 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15041
15042 Rename locals to avoid shadowing.
15043 * fileio.c (Finsert_file_contents):
15044 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15045 * process.c (wait_reading_process_output):
15046 Rename inner 'proc' to 'p' to avoid shadowing.
15047 Indent for consistency with usual Emacs style.
15048
15049 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15050
15051 * xdisp.c (redisplay_window): If cursor row is not fully visible
15052 after recentering, and scroll-conservatively is set to a large
15053 number, scroll window by a few more lines to make the cursor fully
15054 visible and out of scroll-margin. (Bug#10105)
15055 (start_display): Don't move to the next line if the display should
15056 start at a newline that is part of a display vector or an overlay
15057 string. (Bug#10119)
15058
15059 2011-11-24 Juri Linkov <juri@jurta.org>
15060
15061 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15062 after the `MagickPingImage' call. (Bug#10112)
15063
15064 2011-11-23 Chong Yidong <cyd@gnu.org>
15065
15066 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15067
15068 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15069
15070 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15071 making another buffer current. (Bug#10114)
15072
15073 2011-11-23 Glenn Morris <rgm@gnu.org>
15074
15075 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15076
15077 2011-11-23 Chong Yidong <cyd@gnu.org>
15078
15079 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15080 using it (Bug#5984).
15081
15082 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15083
15084 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15085 and header-lines, as they don't have one computed for them.
15086 (Bug#10098)
15087
15088 * .gdbinit (prow): Make displayed values more self-explaining.
15089 Add row's hash code.
15090
15091 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15092
15093 * process.c (wait_reading_process_output): Fix asynchrounous
15094 GnuTLS socket handling on some versions of the GnuTLS library.
15095 (wait_reading_process_output): Add comment and URL.
15096
15097 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15098
15099 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15100
15101 2011-11-21 Chong Yidong <cyd@gnu.org>
15102
15103 * window.c (Fnext_window, Fprevious_window): Doc fix.
15104
15105 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15106
15107 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15108
15109 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15110
15111 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15112
15113 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15114
15115 * window.c (Fset_window_combination_limit): Rename argument
15116 STATUS to LIMIT.
15117 (Vwindow_combination_limit): Remove "status" from doc-string.
15118
15119 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15120
15121 * m/ibms390.h: Remove.
15122 * m/ibms390x.h: Don't include "ibms390.h".
15123
15124 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15125
15126 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15127 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15128
15129 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15130
15131 * casetab.c (Fset_case_table):
15132 * charset.c (Fcharset_after): Fix typos.
15133
15134 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15135
15136 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15137 Otherwise, valgrind does not work on some platforms.
15138 Problem reported by Andreas Schwab in
15139 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15140 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15141 is set, removing the need for VIRT_ADDRESS_VARIES.
15142 (PURE_P): Use a more-efficient implementation that needs just one
15143 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15144 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15145 to 4 (xorl, subq, cmpq, setbe).
15146 * alloc.c (pure): Always extern now, since that's the
15147 VIRT_ADDR_VARIES behavior.
15148 (PURE_POINTER_P): Use a single comparison, not two, for
15149 consistency with the new puresize.h.
15150 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15151 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15152 Remove VIRT_ADDR_VARIES no longer needed.
15153
15154 2011-11-19 Eli Zaretskii <eliz@gnu.org>
15155
15156 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15157 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15158 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15159 behave as if the cursor position were at the window margin.
15160
15161 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15162 and the cursor position is out of bounds, behave as if the cursor
15163 position were at the window margin. (Bug#10075)
15164
15165 2011-11-18 Chong Yidong <cyd@gnu.org>
15166
15167 * window.c (Fwindow_combination_limit): Make first argument
15168 non-optional, since it is meaningless for live windows like the
15169 selected window.
15170
15171 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15172
15173 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15174
15175 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15176
15177 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15178 (graft_intervals_into_buffer): Simplify.
15179
15180 2011-11-18 Eli Zaretskii <eliz@gnu.org>
15181
15182 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15183 hash values of the two rows.
15184 (copy_row_except_pointers): Preserve the used[] arrays and the
15185 hash values of the two rows. (Bug#10035)
15186 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
15187
15188 * xdisp.c (row_hash): New function, body extracted from
15189 compute_line_metrics.
15190 (compute_line_metrics): Call row_hash, instead of computing the
15191 hash code inline.
15192
15193 * dispnew.c (verify_row_hash): Call row_hash for computing the
15194 hash code of a row, instead of duplicating code from xdisp.c.
15195
15196 * dispextern.h (row_hash): Add prototype.
15197
15198 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15199
15200 * frame.c (delete_frame): Don't delete the terminal when the last
15201 X frame is closed if emacs is built with GTK toolkit.
15202
15203 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
15204
15205 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15206
15207 2011-11-17 Martin Rudalics <rudalics@gmx.at>
15208
15209 * window.c (Vwindow_splits): Rename to
15210 Vwindow_combination_resize. Suggested by Juri Linkov.
15211 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15212 of Vwindow_splits.
15213
15214 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
15215
15216 * nsfns.m (Fns_font_name):
15217 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
15218
15219 2011-11-16 Martin Rudalics <rudalics@gmx.at>
15220
15221 * window.h (window): Rename slot "nest" to "combination_limit".
15222 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15223 (Fset_window_nest): Rename to Fset_window_combination_limit.
15224 (Vwindow_nest): Rename to Vwindow_combination_limit.
15225 (recombine_windows, make_parent_window, make_window)
15226 (Fsplit_window_internal, saved_window)
15227 (Fset_window_configuration, save_window_save): Rename all
15228 occurrences of window_nest to window_combination_limit.
15229
15230 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
15231
15232 * image.c (imagemagick_load_image): Fix typo.
15233
15234 2011-11-14 Eli Zaretskii <eliz@gnu.org>
15235
15236 * xdisp.c (display_line): Move the call to
15237 highlight_trailing_whitespace before the call to
15238 compute_line_metrics, since the latter needs to see the final
15239 faces of all the glyphs to compute ROW's hash value.
15240 Fixes assertion violations in row_equal_p. (Bug#10035)
15241
15242 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
15243
15244 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15245 just return (bug#10044).
15246
15247 2011-11-12 Eli Zaretskii <eliz@gnu.org>
15248
15249 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15250 with user-defined heap size. Bump the default size of the temacs
15251 heap to 27MB, to avoid memory warning when running temacs.
15252 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15253
15254 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15255 current_matrix and desired_matrix. (Bug#9990)
15256 (verify_row_hash) [XASSERTS]: New function.
15257 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15258 that the hash value of glyph rows is correct.
15259
15260 2011-11-12 Martin Rudalics <rudalics@gmx.at>
15261
15262 * window.h (window): Remove splits slot.
15263 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15264 (Fdelete_other_windows_internal, make_parent_window)
15265 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15266 (Fset_window_configuration, save_window_save): Don't deal with
15267 split status of windows.
15268 (saved_window): Remove splits slot.
15269 (Vwindow_splits): Rewrite doc-string.
15270
15271 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15272
15273 * xfns.c (unwind_create_frame):
15274 * nsfns.m (unwind_create_frame):
15275 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15276 Vframe_list (Bug#9999).
15277
15278 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15279
15280 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
15281
15282 2011-11-11 Kenichi Handa <handa@m17n.org>
15283
15284 * callproc.c (Fcall_process): Set the member dst_multibyte of
15285 process_coding.
15286
15287 2011-11-11 Johan Bockgård <bojohan@gnu.org>
15288
15289 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15290 avoid a crash (bug#9496).
15291
15292 2011-11-09 Chong Yidong <cyd@gnu.org>
15293
15294 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15295 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15296
15297 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15298
15299 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15300
15301 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15302
15303 Avoid some portability problems by eschewing 'extern inline' functions.
15304 The trivial performance wins aren't worth the portability hassles; see
15305 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15306 et seq.
15307 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15308 (window_box_width, window_box_left, window_box_left_offset)
15309 (window_box_right, window_box_right_offset): Undo previous change,
15310 by removing the "extern"s.
15311 * intervals.c (adjust_intervals_for_insertion)
15312 (adjust_intervals_for_deletion): Undo previous change,
15313 making these static again.
15314 (offset_intervals, temp_set_point_both, temp_set_point)
15315 (copy_intervals_to_string): No longer inline.
15316 * xdisp.c (window_text_bottom_y, window_box_width)
15317 (window_box_height, window_box_left_offset)
15318 (window_box_right_offset, window_box_left, window_box_right)
15319 (window_box): No longer inline.
15320
15321 2011-11-08 Chong Yidong <cyd@gnu.org>
15322
15323 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
15324 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15325 Signal an error if not a live window.
15326 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15327 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15328
15329 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
15330
15331 * lisp.h (syms_of_abbrev): Remove declaration.
15332 Reported by CHENG Gao <chenggao@royau.me>.
15333
15334 2011-11-07 Eli Zaretskii <eliz@gnu.org>
15335
15336 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15337 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15338 of temacs in GUI mode.
15339
15340 2011-11-07 Martin Rudalics <rudalics@gmx.at>
15341
15342 * window.h: Declare delete_all_child_windows instead of
15343 delete_all_subwindows.
15344 * window.c (Fwindow_nest, Fset_window_nest)
15345 (Fset_window_new_total, Fset_window_new_normal)
15346 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15347 (delete_all_subwindows): Rename to delete_all_child_windows.
15348 (Fdelete_other_windows_internal, Fset_window_configuration):
15349 Call delete_all_child_windows instead of delete_all_subwindows.
15350 * frame.c (delete_frame): Call delete_all_child_windows instead
15351 of delete_all_subwindows.
15352
15353 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15354
15355 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15356 This is also needed for porting to any host where GC_MARK_STACK is
15357 not GC_MAKE_GCPROS_NOOPS.
15358 (which_symbols): Use it.
15359
15360 2011-11-07 Kenichi Handa <handa@m17n.org>
15361
15362 * coding.c (coding_set_destination): Check coding->src_pos only
15363 when coding->src_object is a buffer (bug#9910).
15364
15365 * process.c (send_process): Set the member src_multibyte of coding
15366 to 0 (bug#9911) when sending a unibyte text.
15367
15368 * callproc.c (Fcall_process): Set the member src_multibyte of
15369 process_coding to 0 (bug#9912).
15370
15371 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15372
15373 * xmenu.c (cleanup_widget_value_tree): New function.
15374 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15375 calling free_menubar_widget_value_tree directly (Bug#9830).
15376
15377 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15378
15379 Fix some portability problems with 'inline'.
15380 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15381 (window_box_width, window_box_left, window_box_left_offset)
15382 (window_box_right, window_box_right_offset): Declare extern.
15383 Otherwise, these inline functions do not conform to C99 and
15384 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15385 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15386 * intervals.c (adjust_intervals_for_insertion)
15387 (adjust_intervals_for_deletion): Now extern, because otherwise the
15388 extern inline functions 'offset_intervals' couldn't refer to it.
15389 (static_offset_intervals): Remove.
15390 (offset_intervals): Rewrite using the old contents of
15391 static_offset_intervals. The old version didn't conform to C99
15392 because an extern inline function contained a reference to an
15393 identifier with static linkage.
15394
15395 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15396
15397 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15398 GC.
15399
15400 2011-11-06 Eli Zaretskii <eliz@gnu.org>
15401
15402 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15403 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15404 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15405 return Qleft_to_right.
15406
15407 2011-11-06 Chong Yidong <cyd@gnu.org>
15408
15409 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15410 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15411 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15412 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15413 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15414 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15415 (Fwindow_vscroll): Doc fix.
15416 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15417 argument, since it makes no sense to pass a live window and for
15418 consistency with window-child.
15419
15420 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15421
15422 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15423 support MSVC.
15424
15425 2011-11-05 Jason Rumney <jasonr@gnu.org>
15426
15427 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15428 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15429 fonts (Bug#6029).
15430 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15431 bitwise arithmetic preventing use of unicode-sip and non-truetype
15432 opentype fonts.
15433
15434 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15435
15436 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15437 "emacs"-only part.
15438
15439 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15440 initialization code to keep similarity to xfns.c after changes
15441 from 2011-11-05.
15442
15443 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15444
15445 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15446 (unwind_create_frame): New function (Bug#9943).
15447 (Fx_create_frame): Restructure code to be more similar to the one in
15448 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15449 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15450 Move terminal->reference_count++ just before making the frame official
15451 (Bug#9943).
15452
15453 * nsterm.m (x_free_frame_resources): New function.
15454 (x_destroy_window): Move code to x_free_frame_resources.
15455
15456 * xfns.c (unwind_create_frame): Fix comment.
15457 (Fx_create_frame, x_create_tip_frame):
15458 Move terminal->reference_count++ just before making the frame
15459 official. Move initialization of image_cache_refcount and
15460 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15461
15462 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15463
15464 Support MSVC build with newer versions of Visual Studio.
15465 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15466 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15467 nt/gmake.defs.
15468
15469 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15470 which are not supported by MSVC.
15471 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15472 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15473 bitfields.
15474 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15475 types in bitfields.
15476 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15477
15478 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15479
15480 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
15481
15482 Support MSVC build with newer versions of Visual Studio.
15483 * w32.c: Don't include w32api.h for MSVC.
15484 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15485
15486 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15487 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15488 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15489 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15490 e_* cousins.
15491 (alloca) [_MSC_VER]: Define to _alloca.
15492
15493 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15494
15495 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15496
15497 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15498
15499 * xdisp.c (note_mouse_highlight): If either of
15500 previous/next-single-property-change returns nil, treat that as
15501 the beginning or the end of the buffer. (Bug#9955)
15502
15503 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15504
15505 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
15506 label is not null (Bug#9951).
15507 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15508 may be NULL.
15509
15510 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15511
15512 * window.c (Fwindow_body_size): Mention in the doc string that the
15513 return value is in frame's canonical units. (Bug#9949)
15514
15515 2011-11-03 Eli Zaretskii <eliz@gnu.org>
15516
15517 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15518
15519 * w32fns.c (unwind_create_frame): If needed, free the glyph
15520 matrices of the partially constructed frame. (Bug#9943)
15521 * xfns.c (unwind_create_frame): Likewise.
15522
15523 2011-11-01 Eli Zaretskii <eliz@gnu.org>
15524
15525 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15526 Don't stop backward scan on the continuation glyph, even though
15527 its CHARPOS is positive.
15528 (mouse_face_from_buffer_pos, note_mouse_highlight):
15529 Rename cover_string to disp_string.
15530
15531 2011-11-01 Martin Rudalics <rudalics@gmx.at>
15532
15533 * window.c (temp_output_buffer_show): Don't use
15534 Vtemp_buffer_show_specifiers.
15535 (Vtemp_buffer_show_specifiers): Remove unused variable.
15536
15537 2011-10-30 Eli Zaretskii <eliz@gnu.org>
15538
15539 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15540 past the beginning of the current glyph matrix.
15541
15542 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
15543
15544 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15545 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15546 HAVE_GTK3 (Bug#9869).
15547
15548 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15549 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15550
15551 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15552
15553 * xterm.c: Declare x_handle_net_wm_state to return int.
15554 (handle_one_xevent): Check if we are iconified but don't have
15555 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15556 (get_current_wm_state): Return non-zero if not hidden,
15557 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15558 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15559 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15560 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15561
15562 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15563
15564 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15565 so that this new function doesn't get optimized away by a
15566 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15567
15568 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15569
15570 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15571
15572 2011-10-29 Eli Zaretskii <eliz@gnu.org>
15573
15574 Fix the `xbytecode' command.
15575 * .gdbinit (xprintbytestr): New command.
15576 (xwhichsymbols): Rename from `which'; all callers changed.
15577 (xbytecode): Print the byte-code string as well.
15578
15579 2011-10-29 Kim Storm <storm@cua.dk>
15580
15581 * alloc.c (which_symbols): New function.
15582
15583 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15584
15585 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15586 line. (Bug#9903)
15587
15588 2011-10-29 Glenn Morris <rgm@gnu.org>
15589
15590 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15591 Not clear what it was for, and it causes various bugs. (Bug#9839)
15592
15593 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15594
15595 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15596 possible random value that matches one of those tested as
15597 condition to clear the mouse face.
15598
15599 2011-10-28 Chong Yidong <cyd@gnu.org>
15600
15601 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15602
15603 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15604
15605 * window.c (make_window): Initialize phys_cursor_on_p.
15606
15607 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15608
15609 * lisp.h (struct Lisp_Symbol): Update comments.
15610
15611 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
15612
15613 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15614
15615 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15616
15617 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15618 <oslsachem@gmail.com> for helping to debug this.
15619
15620 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15621 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15622 (g_b_init_get_glyph_outline_w): New static variables.
15623 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15624 (GetGlyphOutlineW_Proc): New typedefs.
15625 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
15626 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15627 New functions.
15628 (w32font_open_internal, compute_metrics):
15629 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
15630 instead of calling the "wide" APIs directly.
15631
15632 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15633
15634 * w32.h (syms_of_w32font): Add prototype.
15635
15636 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15637
15638 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15639 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15640 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15641 (Fmove_to_window_line): Doc fix.
15642
15643 2011-10-27 Chong Yidong <cyd@gnu.org>
15644
15645 * process.c (make_process): Set gnutls_state to NULL.
15646
15647 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15648 non-NULL, regardless of GNUTLS_INITSTAGE.
15649 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15650 an error. Set process slots as soon as we allocate them.
15651
15652 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15653
15654 2011-10-27 Chong Yidong <cyd@gnu.org>
15655
15656 * gnutls.c (emacs_gnutls_deinit): New function.
15657 Deallocate credentials structures as well as calling gnutls_deinit.
15658 (Fgnutls_deinit, Fgnutls_boot): Use it.
15659
15660 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15661 (deactivate_process): Call emacs_gnutls_deinit.
15662
15663 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15664
15665 * image.c (x_create_x_image_and_pixmap):
15666 * w32.c (sys_rename, w32_delayed_load):
15667 * w32font.c (fill_in_logfont):
15668 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15669
15670 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
15671
15672 * w32fns.c (w32_default_color_map): New function,
15673 extracted from Fw32_default_color_map.
15674 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
15675
15676 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15677
15678 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15679
15680 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15681
15682 * keyboard.c (test_undefined): New function (bug#9751).
15683 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15684
15685 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15686
15687 * sysdep.c (init_sys_modes): Fix the check for the controlling
15688 terminal (Bug#6649).
15689
15690 2011-10-20 Eli Zaretskii <eliz@gnu.org>
15691
15692 * dispextern.h (struct bidi_it): New member next_en_type.
15693
15694 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15695 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15696 current character, check also for next_en_type being WEAK_EN.
15697 (bidi_resolve_weak): Don't enter the expensive loop if the current
15698 position is before next_en_pos. Record the bidi type of the first
15699 non-ET, non-BN character we find, in addition to its position.
15700 (bidi_level_of_next_char): Invalidate next_en_type when
15701 next_en_pos is over-stepped.
15702
15703 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15704
15705 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15706 * editfns.c: Rewrite current-time-zone so that it invokes
15707 the equivalent of (format-time-string "%Z") to get the time zone name.
15708 This fixes a bug when the time zone name contains characters that
15709 need converting from the system time locale to Emacs internal format.
15710 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15711 that patch fixed format-time-string to do the conversion, but
15712 I forgot to fix current-time-zone.
15713 (format_time_string): New function, containing most of
15714 what Fformat_time_string used to contain.
15715 (Fformat_time_string): Rewrite in terms of format_time_string.
15716 This doesn't change this function's behavior.
15717 (current-time-zone): Rewrite to use format_time_string.
15718 This fixes the bug reported by Michael Schierl in
15719 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15720 Jason Rumney's 2007-06-07 change worked around this bug, but
15721 didn't fix it.
15722 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15723
15724 2011-10-19 Eli Zaretskii <eliz@gnu.org>
15725
15726 * xdisp.c (start_display): If the character at POS is displayed
15727 via a display vector, reset IT->current.dpvec_index to zero.
15728 (try_window_reusing_current_matrix): If a line ends in a display
15729 vector or the next line starts in a display vector, continue
15730 redrawing the window even though the character position of
15731 start_row was reached.
15732 (Bug#9771, part 2)
15733
15734 2011-10-18 Chong Yidong <cyd@gnu.org>
15735
15736 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15737 with nobreak-char-display too.
15738
15739 2011-10-18 Eli Zaretskii <eliz@gnu.org>
15740
15741 Fix part 3 of bug#9771.
15742 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15743 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15744 non-neutral characters if the current character is a paragraph
15745 separator (a.k.a. Newline). This avoids running the same
15746 expensive loop twice, once when we consume the preceding newline
15747 and the other time when the line actually needs to be displayed.
15748 Avoid the loop when we see neutrals on the base embedding level
15749 following a character whose directionality is the same as the
15750 paragraph's. This avoids running the expensive loop when a line
15751 ends in a long sequence of neutrals, like control characters.
15752 Add assertion against STRONG_AL type. Slightly rearrange code
15753 that determines the type of a neutral given the first non-neutral
15754 that follows it.
15755 (bidi_level_of_next_char): Set next_en_pos to zero when
15756 invalidating its info.
15757
15758 2011-10-17 Eli Zaretskii <eliz@gnu.org>
15759
15760 * xdisp.c (push_display_prop): Determine whether to record string
15761 or buffer position by IT->string, not by IT->method. Allow
15762 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
15763 (move_it_vertically_backward): Don't look for character position
15764 immediately after the newline when in a continuation line.
15765 (Bug#9771, part 1)
15766
15767 2011-10-15 Martin Rudalics <rudalics@gmx.at>
15768
15769 * window.c (coordinates_in_window): Rewrite and delabelize
15770 vertical border check. (Bug#5357) (Bug#9618)
15771
15772 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15773
15774 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15775 errors in XSetWindowBorder (bug#9310).
15776
15777 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15778
15779 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15780 avoid crash when xmalloc overrun checking is enabled.
15781
15782 2011-10-13 Eli Zaretskii <eliz@gnu.org>
15783
15784 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15785 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15786 cursor motion with <left> and <right> arrow keys.
15787
15788 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15789 some callers set that themselves.
15790
15791 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15792
15793 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15794 display string and the previous row comes from the same string and
15795 is empty. (Bug#9739) (Bug#9738)
15796
15797 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15798
15799 * doc.c (get_doc_string): Encode file name (bug#9735).
15800
15801 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15802
15803 * bidi.c (bidi_level_of_next_char):
15804 * xdisp.c (get_visually_first_element): Remove old incorrect
15805 comments regarding the Unicode Line Separator character.
15806
15807 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15808
15809 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15810
15811 * alloc.c (Fgc_status): Do not access beyond zombies array
15812 boundary if nzombies > MAX_ZOMBIES.
15813 * alloc.c (dump_zombies): Add missing format specifier.
15814
15815 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15816
15817 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15818 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15819
15820 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15821 Some packages use them to denote characters with modifiers.
15822
15823 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15824
15825 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15826 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15827 matching a pp-number. Rename parameter var to var1.
15828
15829 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15830
15831 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15832
15833 2011-10-08 Glenn Morris <rgm@gnu.org>
15834
15835 * callint.c (Fcall_interactively): Give a more explicit error for the
15836 'c' case with a non-character input. (Bug#8479)
15837
15838 2011-10-08 Eli Zaretskii <eliz@gnu.org>
15839
15840 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15841 lines.
15842 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15843 lines that are hscrolled on the left.
15844
15845 * dispnew.c (buffer_posn_from_coords): Account for a possible
15846 presence of header-line. (Bug#4426)
15847
15848 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15849
15850 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15851 Don't advertise functionality which we discourage or doesn't work.
15852
15853 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15854
15855 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15856 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15857 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15858 this makes Emacs dump core during garbage collection on rare
15859 occasions. sizeof is obviously inferior to offsetof here, so
15860 stick with offsetof.
15861 (GC_POINTER_ALIGNMENT): New macro.
15862 (mark_memory): Omit 3rd (offset) arg; caller changed.
15863 Don't assume EMACS_INT alignment is the same as pointer alignment.
15864
15865 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15866
15867 * keyboard.c (read_key_sequence_remapped): New var.
15868 (read_key_sequence): Compute remapping in the right buffer.
15869 (command_loop_1): Use read_key_sequence's remapping directly.
15870
15871 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15872
15873 * dired.c (file_name_completion): Don't expand file name.
15874 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15875 before checking file name handler.
15876
15877 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15878 they've been requested explicitly (bug#9591).
15879
15880 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
15881
15882 * keymap.c (Fsingle_key_description): Use make_specified_string
15883 instead of build_string to build string from push_key_description.
15884 (Bug#5193)
15885
15886 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15887
15888 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15889 This fixes a Y2038 bug on 64-bit hosts.
15890 * buffer.c (reset_buffer):
15891 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15892 (Fclear_buffer_auto_save_failure):
15893 Use 0, not -1, to represent an unset failure time, since time_t
15894 might not be signed.
15895
15896 Remove dependency on glibc malloc internals.
15897 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15898 Move back here from lisp.h, but with their new implementations.
15899 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15900 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15901 * charset.c (charset_table_init): New static var.
15902 (syms_of_charset): Use it instead of xmalloc. This removes a
15903 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15904 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15905 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15906 Move back to alloc.c.
15907 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15908 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15909
15910 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15911
15912 * nsterm.m (windowDidResize): Call x_set_window_size only when
15913 ns_in_resize is true. Otherwise set pixelwidth/height and
15914 call change_frame_size (Bug#9628).
15915
15916 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15917
15918 Port --enable-checking=all to Fedora 14 x86-64.
15919 * charset.c (syms_of_charset): Also account for glibc malloc's
15920 internal overhead when calculating the initial malloc maximum.
15921
15922 Port --enable-checking=all to Fedora 14 x86.
15923 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15924 Move to lisp.h.
15925 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15926 (overrun_check_realloc, overrun_check_free):
15927 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15928 That way, xmalloc returns a properly-aligned pointer even if
15929 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15930 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15931 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15932 into account when calculating the initial malloc maximum.
15933 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15934 Move here from alloc.c, so that charset.c can use it too.
15935 Properly align; the old code wasn't right for common 32-bit hosts
15936 when configured with --enable-checking=all.
15937 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15938 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15939
15940 2011-09-29 Eli Zaretskii <eliz@gnu.org>
15941
15942 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
15943 use EDOM.
15944
15945 2011-09-28 Eli Zaretskii <eliz@gnu.org>
15946
15947 * xdisp.c (compute_display_string_end): If there's no display
15948 string at CHARPOS, return -1.
15949
15950 * bidi.c (bidi_fetch_char): When compute_display_string_end
15951 returns a negative value, treat the character as a normal
15952 character not covered by a display string. (Bug#9624)
15953
15954 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
15955
15956 * lread.c (Fread_from_string): Fix typo in docstring.
15957
15958 2011-09-27 Eli Zaretskii <eliz@gnu.org>
15959
15960 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15961 newline, reseat the iterator instead of bidi-iterating there one
15962 character at a time. (Bug#9610)
15963 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15964 TO_CHARPOS if the bidi iterator is at base embedding level.
15965
15966 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15967
15968 * lread.c (readevalloop): Use correct code for NBSP.
15969 (read1): Likewise. (Bug#9608)
15970
15971 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
15972
15973 * dbusbind.c (Fdbus_register_signal): When service is not
15974 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15975
15976 2011-09-25 Glenn Morris <rgm@gnu.org>
15977
15978 * buffer.c (truncate-lines): Doc fix.
15979
15980 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
15981
15982 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15983 (Fset_window_next_buffers): Doc fix.
15984
15985 2011-09-24 Glenn Morris <rgm@gnu.org>
15986
15987 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15988
15989 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15990
15991 Fix minor problems found by static checking.
15992 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
15993 * indent.c (Fvertical_motion): Fix == vs = typo.
15994
15995 2011-09-24 Eli Zaretskii <eliz@gnu.org>
15996
15997 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15998 Default value is now t. Doc fix.
15999
16000 * indent.c (Fvertical_motion): Compute and apply the overshoot
16001 logic when moving up, not only when moving down. Fix the
16002 confusing name and values of the it_overshoot_expected variable;
16003 logic changes accordingly. (Bug#9254) (Bug#9549)
16004
16005 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16006 CHARPOS is covered by a display string which includes newlines.
16007 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16008 is covered by a display string with embedded newlines.
16009
16010 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16011
16012 * dbusbind.c (Fdbus_register_signal): Add match rule to
16013 Vdbus_registered_objects_table. (Bug#9581)
16014 (Fdbus_register_method, Vdbus_registered_objects_table):
16015 Fix docstring.
16016
16017 2011-09-24 Jim Meyering <meyering@redhat.com>
16018
16019 do not ignore write error for any output size
16020 The previous change was incomplete.
16021 While it makes emacs --batch detect the vast majority of stdout
16022 write failures, errors were still ignored whenever the output size is
16023 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16024 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16025 && echo FAIL: ignored write error
16026 FAIL: ignored write error
16027 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16028 && echo FAIL: ignored write error
16029 FAIL: ignored write error
16030 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16031
16032 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16033
16034 * emacs.c (Fkill_emacs): In noninteractive mode exit
16035 non-successfully if a write error occurred on stdout. (Bug#9574)
16036
16037 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16038
16039 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16040 the xassert test.
16041
16042 * dispextern.h (struct it): Update the comment documenting what
16043 can it->OBJECT be.
16044
16045 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16046
16047 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16048 a display string, extend search for cursor position to end of row.
16049 (find_row_edges): If the row ends in a newline from a display
16050 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16051 Handle the case of a display string with multiple newlines.
16052 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16053 non-empty line. Fixes confusing cursor motion with arrow keys at
16054 the beginning of a line that starts with whitespace.
16055
16056 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16057
16058 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16059 (bug#9493).
16060
16061 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16062
16063 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16064 boolean (Bug#9154).
16065
16066 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16067
16068 * xdisp.c (display_line): Record maximum and minimum buffer
16069 positions even if no glyphs were produced (e.g., by a zero-width
16070 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16071 buffer positions that will be removed from the glyph row because
16072 they don't fit.
16073 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16074 column is beyond frame width: don't subtract 1 "pixel" when
16075 computing width of the stretch.
16076 (reseat_at_next_visible_line_start): Undo the change made on
16077 2011-09-17 that saved paragraph information and restored it after
16078 the call to `reseat'. (Bug#9545)
16079
16080 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16081
16082 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16083 and turn window cursor on if cleared (Bug#9415).
16084
16085 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16086
16087 * search.c (boyer_moore): Take unibyte characters from pattern
16088 literally. (Bug#9458)
16089
16090 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16091
16092 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16093
16094 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16095
16096 Fix minor problem found by static checking.
16097 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16098 initialized, to pacify gcc -Wuninitialized.
16099
16100 * fileio.c: Report proper errno when syscall falls.
16101 (Finsert_file_contents): Save and restore errno,
16102 so that report_file_error outputs the correct diagnostic.
16103 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16104
16105 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16106
16107 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16108
16109 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16110
16111 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16112 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16113
16114 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16115
16116 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16117 about the current paragraph and restore it after the call to reseat.
16118
16119 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16120 (bidi_find_paragraph_start): Search back for paragraph beginning
16121 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16122 (bidi_move_to_visually_next): Only trigger paragraph-related
16123 computations when the last character is a newline or at EOB, not
16124 just any NEUTRAL_B. (Bug#9470)
16125
16126 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16127 truncated lines if point is covered by a display string. (Bug#9524)
16128
16129 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16130
16131 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16132 (cons_to_x_long): New function.
16133 (lisp_data_to_selection_data): Use it. Correct the test for
16134 short-versus-long data; it was negated. Break out of vector
16135 loop, for efficiency, when a long datum is discovered.
16136
16137 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16138
16139 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16140
16141 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16142
16143 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16144 GCC PR/17406) by declaring this function with external scope.
16145
16146 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16147
16148 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16149 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16150
16151 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16152
16153 * editfns.c (Fformat): Correctly handle text properties on "%%".
16154
16155 2011-09-15 Eli Zaretskii <eliz@gnu.org>
16156
16157 * xterm.c (x_draw_composite_glyph_string_foreground):
16158 * w32term.c (x_draw_composite_glyph_string_foreground):
16159 * term.c (encode_terminal_code):
16160 * composite.c (composition_update_it, get_composition_id):
16161 * xdisp.c (get_next_display_element)
16162 (fill_composite_glyph_string): Add comments about special meaning
16163 of TAB characters in a composition.
16164
16165 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16166
16167 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
16168 This occurs when processing a multibyte format.
16169 Problem reported by Wolfgang Jenker.
16170
16171 2011-09-15 Johan Bockgård <bojohan@gnu.org>
16172
16173 * xdisp.c (try_cursor_movement): Only check for exact match if
16174 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16175
16176 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16177
16178 Remove unused external symbols.
16179 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16180 * xdisp.c (calc_pixel_width_or_height): Now static.
16181 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16182 * indent.c (check_display_width):
16183 * w32term.c: Fix comment to match code.
16184 * xterm.c, xterm.h (x_catching_errors): Remove.
16185
16186 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16187
16188 * xselect.c: Use signed conversions more consistently (Bug#9498).
16189 (selection_data_to_lisp_data): Assume incoming selection data are
16190 signed integers, not unsigned. This is to be consistent with
16191 outgoing selection data, which was modified to use signed integers
16192 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16193 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16194 expects long, not unsigned long.
16195
16196 2011-09-14 Eli Zaretskii <eliz@gnu.org>
16197
16198 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16199 computation of loop end. Reported by Johan Bockgård
16200 <bojohan@gnu.org>.
16201
16202 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
16203
16204 * frame.c (Fother_visible_frames_p): Function deleted.
16205
16206 2011-09-12 Eli Zaretskii <eliz@gnu.org>
16207
16208 * indent.c (compute_motion): Process display vector front to back
16209 rather than the other way around. (Bug#2496)
16210
16211 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16212
16213 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16214
16215 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
16216
16217 * minibuf.c (Fread_from_minibuffer): Doc fix.
16218
16219 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16220
16221 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16222 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16223
16224 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16225
16226 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16227 value for non-existent files.
16228
16229 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16230
16231 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16232 set its "size" to -1. This will set the modtime_size field of
16233 the corresponding buffer to -1, which is what
16234 verify-visited-file-modtime expects for files that do not exist.
16235 (Bug#9139)
16236
16237 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16238
16239 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16240 here ...
16241 * lisp.h: ... from here. push_key_description is no longer
16242 defined in keyboard.c, so its declaration should not be in
16243 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16244 logically belongs with push_key_description.
16245
16246 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16247
16248 * buffer.h: Include <sys/types.h> instead of <time.h>.
16249 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16250 Problem reported by Herbert J. Skuhra.
16251
16252 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16253
16254 * xml.c (parse_region): Make the parsing work for
16255 non-comment-starting XML files again (bug#9144).
16256
16257 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16258
16259 * image.c (gif_load): Fix calculation of bottom and right corner.
16260 (Bug#9468)
16261
16262 2011-09-10 Eli Zaretskii <eliz@gnu.org>
16263
16264 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16265 redisplay in small windows.
16266
16267 2011-09-09 Eli Zaretskii <eliz@gnu.org>
16268
16269 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16270
16271 2011-09-08 Martin Rudalics <rudalics@gmx.at>
16272
16273 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16274 Operate on live windows only.
16275
16276 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
16277
16278 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16279
16280 2011-09-07 Eli Zaretskii <eliz@gnu.org>
16281
16282 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16283 only under bidi iteration.
16284
16285 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16286
16287 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16288
16289 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16290
16291 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16292 Without this fix, the command to link temacs failed due to an
16293 undefined symbol __builtin_isnan. This is because
16294 /usr/include/iso/math_c99.h #defines isnan(x) to
16295 __builtin_isnan(x), but the bundled gcc, which identifies itself
16296 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16297 a __builtin_isnan.
16298 * floatfns.c (isnan): #undef, and then #define to a clone of
16299 what's in data.c.
16300 (Fisnan): Always define, since it's always available now.
16301 (syms_of_floatfns): Always define isnan at the Lisp level.
16302
16303 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16304
16305 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16306
16307 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16308
16309 * fileio.c: Fix bugs with large file offsets (Bug#9428).
16310 The previous code assumed that file offsets (off_t values) fit in
16311 EMACS_INT variables, which is not true on typical 32-bit hosts.
16312 The code messed up by falsely reporting buffer overflow in cases
16313 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16314 when "big" contains more than 2**29 bytes, even though this
16315 inserts just one byte and does not overflow the buffer.
16316 (Finsert_file_contents): Store file offsets as off_t
16317 values, not as EMACS_INT values. Check for overflow when
16318 converting between EMACS_INT and off_t. When checking for
16319 buffer overflow or for overlap, take the offsets into account.
16320 Don't use EMACS_INT for small values where int suffices.
16321 When checking for overlap, fix a typo: ZV was used where
16322 ZV_BYTE was intended.
16323 (Fwrite_region): Don't assume off_t fits into 'long'.
16324 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16325
16326 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
16327
16328 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16329
16330 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16331
16332 sprintf-related integer and memory overflow issues (Bug#9412).
16333
16334 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
16335 (esprintf, exprintf, evxprintf): New functions.
16336 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
16337 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
16338 (modify_event_symbol): Do not assume that the length of
16339 name_alist_or_stem is safe to alloca and fits in int.
16340 (Fexecute_extended_command): Likewise for function name and binding.
16341 (Frecursion_depth): Wrap around reliably on integer overflow.
16342 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16343 since some callers pass EMACS_INT values.
16344 (Fsingle_key_description): Don't crash if symbol name contains more
16345 than MAX_ALLOCA bytes.
16346 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16347 (get_minibuffer): Arg is now EMACS_INT, not int.
16348 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
16349 (esprintf, exprintf, evxprintf): New decls.
16350 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16351
16352 * dbusbind.c (signature_cat): New function.
16353 (xd_signature, Fdbus_register_signal):
16354 Do not overrun buffer; instead, report string overflow.
16355
16356 * dispnew.c (add_window_display_history): Don't overrun buffer.
16357 Truncate instead; this is OK since it's just a log.
16358
16359 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16360 even if the time zone offset is outlandishly large.
16361 Don't mishandle offset == INT_MIN.
16362
16363 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16364 when creating daemon; the previous buffer-overflow check was incorrect.
16365
16366 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16367 which has the guts of the old verror function.
16368
16369 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16370 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16371
16372 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16373 (font_unparse_xlfd): Don't blindly alloca long strings.
16374 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
16375 fits in int, when using sprintf. Use single snprintf to count
16376 length of string rather than counting it via multiple sprintfs;
16377 that's simpler and more reliable.
16378 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16379 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16380 sprintf, in case result does not fit in int.
16381
16382 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16383 (fontset_from_font): Print it.
16384
16385 * frame.c (tty_frame_count): Now printmax_t, not int.
16386 (make_terminal_frame, set_term_frame_name): Print it.
16387 (x_report_frame_params): In X, window IDs are unsigned long,
16388 not signed long, so print them as unsigned.
16389 (validate_x_resource_name): Check for implausibly long names,
16390 and don't assume name length fits in 'int'.
16391 (x_get_resource_string): Don't blindly alloca invocation name;
16392 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16393 not fit in int.
16394
16395 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16396 (xg_check_special_colors, xg_set_geometry):
16397 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16398
16399 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16400 Use esprintf, not sprintf, in case result does not fit in int.
16401
16402 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16403 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16404 it as a large positive number.
16405 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16406 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16407
16408 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16409 in case result does not fit in int.
16410
16411 * print.c (float_to_string): Detect width overflow more reliably.
16412 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16413 buffer overrun. Don't assume list length fits in 'int'. Treat
16414 print length of 0 as 0, not as infinity; to be consistent with other
16415 uses of print length in this function. Don't overflow print length
16416 index. Don't assume hash table size fits in 'long', or that
16417 vectorlike size fits in 'unsigned long'.
16418
16419 * process.c (make_process): Use printmax_t, not int, to format
16420 process-name gensyms.
16421
16422 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16423
16424 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16425 to avoid potential buffer overrun.
16426
16427 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16428 if X resource line is longer than 512 bytes.
16429
16430 * xfns.c (x_window): Make sprintf buffer a bit bigger
16431 to avoid potential buffer overrun.
16432
16433 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16434
16435 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16436
16437 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16438
16439 Integer overflow fixes for scrolling, etc.
16440 Without these, Emacs silently mishandles large integers sometimes.
16441 For example, "C-u 4294967297 M-x recenter" was treated as if
16442 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16443
16444 * xdisp.c (try_window_id): Check Emacs fixnum range before
16445 converting to 'int'.
16446
16447 * window.c (window_scroll_line_based, Frecenter):
16448 Check that an Emacs fixnum is in range before assigning it to 'int'.
16449 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16450 values converted from Emacs fixnums.
16451 (Frecenter): Don't wrap around a line count if it is out of 'int'
16452 range; instead, treat it as an extreme value.
16453 (Fset_window_configuration, compare_window_configurations):
16454 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16455
16456 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16457 that can exceed INT_MAX. Check that EMACS_INT value is in range
16458 before assigning it to the (possibly-narrower) index.
16459 (match_limit): Don't assume that a fixnum can fit in 'int'.
16460
16461 * print.c (print_object): Use ptrdiff_t, not int, for index that can
16462 exceed INT_MAX.
16463
16464 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
16465 (Fvertical_motion): Don't wrap around LINES values that don't fit
16466 in 'int'. Instead, treat them as extreme values. This is good
16467 enough for windows, which can't have more than INT_MAX lines anyway.
16468
16469 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16470
16471 * Require libxml/parser.h to avoid compilation warning.
16472
16473 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16474
16475 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16476 since this reportedly can destroy thread storage.
16477
16478 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
16479
16480 * syntax.c (find_defun_start): Update all cache variables if
16481 exiting early (Bug#9401).
16482
16483 2011-08-30 Eli Zaretskii <eliz@gnu.org>
16484
16485 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16486
16487 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16488 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16489 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16490
16491 * term.c (tty_append_glyph): New function.
16492 (produce_stretch_glyph): Static function and its prototype deleted.
16493
16494 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16495 Add prototypes.
16496
16497 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16498
16499 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16500 when checking :margin (Bug#9390).
16501 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
16502 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
16503 so that the name doesn't mislead. All uses changed.
16504
16505 2011-08-28 Johan Bockgård <bojohan@gnu.org>
16506
16507 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16508 set_tty_hooks.
16509
16510 2011-08-27 Eli Zaretskii <eliz@gnu.org>
16511
16512 * xdisp.c (move_it_to): Don't bail out early when reaching
16513 position beyond to_charpos, if we are scanning backwards.
16514 (move_it_vertically_backward): When DY == 0, make sure we get to
16515 the first character in the line after the newline.
16516
16517 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16518
16519 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16520 (ccl_driver): Do not generate an out-of-range pointer.
16521 (Fccl_execute_on_string): Remove unnecessary check for
16522 integer overflow, noted by Stefan Monnier in
16523 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16524 Remove a FIXME that didn't need fixing.
16525 Simplify the newly-introduced buffer reallocation code.
16526
16527 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
16528
16529 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16530
16531 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
16532
16533 Integer and memory overflow issues (Bug#9196).
16534
16535 * doc.c (get_doc_string): Rework so that
16536 get_doc_string_buffer_size is the actual buffer size, rather than
16537 being 1 less than the actual buffer size; this makes xpalloc more
16538 convenient.
16539
16540 * image.c (x_allocate_bitmap_record, cache_image):
16541 * xselect.c (Fx_register_dnd_atom):
16542 Simplify previous changes by using xpalloc.
16543
16544 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16545 since either will do and ptrdiff_t is convenient with xpalloc.
16546
16547 * charset.c (charset_table_size)
16548 (struct charset_sort_data.priority): Now ptrdiff_t.
16549 (charset_compare): Don't overflow if priorities differ greatly.
16550 (Fsort_charsets): Don't assume list length fits in int.
16551 Check for size-calculation overflow when allocating sort data.
16552 (syms_of_charset): Allocate an initial charset table that is
16553 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16554
16555 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16556
16557 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16558 The actual value is always <= INT_MAX, and leaving it unsigned made
16559 overflow checking harder.
16560
16561 * dispextern.h (struct glyph_matrix.rows_allocated)
16562 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16563 with xpalloc. The values are still always <= INT_MAX.
16564
16565 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16566
16567 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16568 (SAFE_NALLOCA): New macro.
16569
16570 * region-cache.c (struct boundary.pos, find_cache_boundary)
16571 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16572 (set_cache_region, invalidate_region_cache)
16573 (revalidate_region_cache, know_region_cache, region_cache_forward)
16574 (region_cache_backward, pp_cache):
16575 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16576 so that ptrdiff_t * can be passed to xpalloc.
16577 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16578 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16579 (pp_cache): Don't assume cache_len fits in int.
16580 * region-cache.h: Adjust extern decls to match.
16581
16582 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16583 EMACS_INT, since either will do, for xpalloc.
16584
16585 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16586 (xnmalloc, xnrealloc, xpalloc): New functions.
16587
16588 * bidi.c (bidi_shelve_header_size): New constant.
16589 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16590 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16591
16592 * bidi.c (bidi_cache_shrink):
16593 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16594 (overlay_strings):
16595 Don't update size of array until after memory allocation succeeds,
16596 because xmalloc/xrealloc may not return.
16597 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16598 now that we have proper integer overflow checking.
16599 (record_overlay_string, overlay_strings): Catch overflows when
16600 calculating size of overlay_str_buf.
16601
16602 * callproc.c (Fcall_process): Check for size overflow when
16603 calculating size of args2.
16604 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16605 Normally we prefer signed values, but sticking with ptrdiff_t would
16606 require adding more-complicated checks.
16607
16608 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16609 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16610 Redo buffer-overflow calculations to avoid integer overflow.
16611 Add a FIXME comment where memory seems to be over-allocated.
16612
16613 * character.c (Fstring): Check for size-calculation overflow.
16614
16615 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16616 unnecessary integer overflow. Check for size overflow.
16617 (encode_coding_object): Don't update size until xmalloc succeeds.
16618
16619 * composite.c (get_composition_id): Check for overflow in glyph
16620 length calculations.
16621
16622 Integer and memory overflow fixes for display code.
16623 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16624 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16625 (scrolling_window): Check for overflow in size calculations.
16626 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16627 Don't assume glyph table len fits in int.
16628 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16629 (row_table_size): Now ptrdiff_t, not int.
16630 (scrolling_window): Avoid overflow in size calculations.
16631 Don't update size until allocation succeeds.
16632 * fns.c (concat): Check for overflow in size calculations.
16633 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16634 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16635 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16636
16637 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16638 (get_doc_string): Check for size calculation overflow.
16639 Don't update size until allocation succeeds.
16640 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16641 EMACS_INT, where ptrdiff_t will do.
16642 (Fsubstitute_command_keys): Check for string overflow.
16643
16644 * editfns.c (set_time_zone_rule): Don't assume environment length
16645 fits in int.
16646 (message_length): Now ptrdiff_t, not int.
16647 (Fmessage_box): Don't update size until allocation succeeds.
16648 Don't assume message length fits in int.
16649 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16650
16651 * emacs.c (main): Do not reallocate argv, since there is a null at
16652 the end that can be overwritten, and this way there's no need to
16653 worry about size-calculation overflow.
16654 (sort_args): Check for size-calculation overflow.
16655
16656 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16657 alloc succeeds.
16658 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16659
16660 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16661 (x_set_scroll_bar_width, x_figure_window_size):
16662 Check for integer overflow.
16663 (x_set_alpha): Do not assume XINT fits in int.
16664
16665 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16666 This is for the members text_lines, text_cols, total_lines, total_cols,
16667 where the system imposes an 'int' limit.
16668
16669 * fringe.c (Fdefine_fringe_bitmap):
16670 Don't update size until alloc works.
16671
16672 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16673 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16674
16675 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16676 Check for size-calculation overflow.
16677 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16678 do, as we prefer signed integers.
16679 (id_to_widget.max_size, id_to_widget.used)
16680 (xg_store_widget_in_map, xg_remove_widget_from_map)
16681 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16682 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16683 Use and return ptrdiff_t, not int.
16684 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16685 * gtkutil.h: Change prototypes to match the above.
16686
16687 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16688 are duplicate now that they've been promoted to lisp.h.
16689 (x_allocate_bitmap_record, x_alloc_image_color)
16690 (make_image_cache, cache_image, xpm_load):
16691 Don't update size until alloc is done.
16692 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16693 (x_detect_edges):
16694 Check for size calculation overflow.
16695 (ct_colors_allocated_max): New constant.
16696 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16697 overflow.
16698
16699 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16700 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16701 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16702 Use ptrdiff_t, not int, to count maps.
16703 (read_char_minibuf_menu_prompt): Check for overflow in size
16704 calculations. Don't update size until allocation succeeds.
16705 Redo calculations to avoid overflow.
16706 * keyboard.h: Change prototypes to match the above.
16707
16708 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16709 to count maps.
16710 (current_minor_maps): Check for size calculation overflow.
16711 * keymap.h: Change prototypes to match the above.
16712
16713 * lread.c (read1, init_obarray): Don't update size until alloc done.
16714
16715 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16716 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16717
16718 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16719 Now ptrdiff_t, not int.
16720 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16721 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16722
16723 * process.c (Fnetwork_interface_list): Check for overflow
16724 in size calculation.
16725
16726 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16727
16728 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16729 overflow. Don't bother calling xmalloc when xrealloc will do.
16730
16731 * search.c (Freplace_match): Check for size calculation overflow.
16732 (Fset_match_data): Don't assume list lengths fit in 'int'.
16733
16734 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16735 for command line length. Do not attempt to address one before the
16736 beginning of an array, as that's not portable.
16737
16738 * term.c (max_frame_lines): Remove; unused.
16739 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16740 not int.
16741 (encode_terminal_code, calculate_costs): Check for size
16742 calculation overflow.
16743 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16744 table lengths and related sizes. Don't update size until alloc
16745 done. Redo calculations to avoid overflow.
16746 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16747
16748 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16749 subtracting pointers.
16750 (gobble_line): Check for overflow more carefully. Don't update size
16751 until alloc done.
16752
16753 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16754 Don't update size until alloc done.
16755 Redo size calculations to avoid overflow.
16756 Check for size calculation overflow.
16757 (main) [DEBUG]: Fix typo in invoking tparam1.
16758
16759 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16760 Use ptrdiff_t, not int, for sizes.
16761 (store_mode_line_noprop_char): Don't update size until alloc done.
16762
16763 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16764 Use ptrdiff_t, not int, for sizes.
16765 (Finternal_make_lisp_face, cache_face):
16766 Check for size calculation overflow.
16767 (cache_face): Treat size calculation overflows as if they were
16768 memory exhaustion (the usual treatment), rather than aborting.
16769
16770 * xfns.c (x_encode_text, x_set_name_internal)
16771 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16772 sizes, since they can exceed INT_MAX in size. Check for size
16773 calculation overflow.
16774
16775 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16776 (xg_select): Check for size calculation overflow.
16777 Don't update size until alloc done.
16778
16779 * xrdb.c (get_environ_db): Don't assume path length fits in int,
16780 as sprintf is limited to int lengths.
16781
16782 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16783 (X_LONG_MIN): New macros.
16784 Use them to make the following changes clearer.
16785 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16786 This change doesn't affect the value now, but it may help remind
16787 future maintainers not to raise the value too much later.
16788 (SELECTION_QUANTUM): Remove, replacing with ...
16789 (selection_quantum): ... new function, which avoids overflow.
16790 All uses changed.
16791 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16792 assumption that selection length fits in 'int'.
16793 (x_reply_selection_request, x_handle_selection_request)
16794 (x_get_window_property, receive_incremental_selection)
16795 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16796 (lisp_data_to_selection_data, clean_local_selection_data):
16797 Use ptrdiff_t, not int, to record length of selection.
16798 (x_reply_selection_request, x_get_window_property)
16799 (receive_incremental_selection, x_property_data_to_lisp):
16800 Redo calculations to avoid overflow.
16801 (x_reply_selection_request): When sending hint, ceiling it at
16802 X_LONG_MAX rather than relying on wraparound overflow to send
16803 something.
16804 (x_get_window_property, receive_incremental_selection)
16805 (lisp_data_to_selection_data, x_property_data_to_lisp):
16806 Check for size-calculation overflow.
16807 (x_get_window_property, receive_incremental_selection)
16808 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16809 Don't store size until memory allocation succeeds.
16810 (x_get_window_property): Plug memory leak on memory exhaustion.
16811 Don't double-block input; malloc is safe here. Don't assume 2**34
16812 - 4 fits in unsigned long. Add an xassert to check
16813 XGetWindowProperty overflow. Be more careful about overflow
16814 calculations, and distinguish size from memory overflow better.
16815 (receive_incremental_selection): When tracing, don't assume
16816 unsigned int is less than INT_MAX.
16817 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16818 harmful) conversions of unsigned short to int.
16819 (lisp_data_to_selection_data): Don't assume that integers
16820 in the range -65535 through -1 fit in an X unsigned short.
16821 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16822 result parameters unless successful. Rely on cons_to_unsigned
16823 to report problems with elements; the old code wasn't right anyway.
16824 (x_check_property_data): Check for int overflow; we cannot use
16825 a wider type due to X limits.
16826 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16827
16828 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
16829
16830 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16831 (x_term_init): Check for size calculation overflow.
16832 (x_color_cells): Don't store size until memory allocation succeeds.
16833 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
16834 Don't assume alloca size is less than MAX_ALLOCA.
16835 (x_term_init): Don't assume length fits in int (sprintf is limited
16836 to int size).
16837
16838 Use ptrdiff_t for composition IDs.
16839 * character.c (lisp_string_width):
16840 * composite.c (composition_table_size, n_compositions)
16841 (get_composition_id, composition_gstring_from_id):
16842 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16843 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16844 * window.c (Frecenter):
16845 Use ptrdiff_t, not int, for composition IDs.
16846 * composite.c (get_composition_id): Check for integer overflow.
16847 * composite.h: Adjust prototypes to match the above changes.
16848
16849 Use ptrdiff_t for hash table indexes.
16850 * category.c (hash_get_category_set):
16851 * ccl.c (ccl_driver):
16852 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16853 * coding.c (coding_system_charset_list, detect_coding_system):
16854 * coding.h (struct coding_system.id):
16855 * composite.c (get_composition_id, gstring_lookup_cache):
16856 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16857 * image.c (xpm_get_color_table_h):
16858 * lisp.h (hash_lookup, hash_put):
16859 * minibuf.c (Ftest_completion):
16860 Use ptrdiff_t for hash table indexes, not int (which is too
16861 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16862 32-bit --with-wide-int hosts).
16863
16864 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16865 Add a FIXME comment about memory leaks.
16866 (syms_of_charset): Don't assume xmalloc returns.
16867
16868 Don't assume that stated character widths fit in int.
16869 * character.c (Fchar_width, c_string_width, lisp_string_width):
16870 * character.h (CHAR_WIDTH):
16871 * indent.c (MULTIBYTE_BYTES_WIDTH):
16872 Use sanitize_char_width to avoid undefined and/or bad behavior
16873 with outlandish widths.
16874 * character.h (sanitize_tab_width): Rename from sanitize_width,
16875 now that we have two such functions. All uses changed.
16876 (sanitize_char_width): New inline function.
16877
16878 Don't assume that tab-width fits in int.
16879 * character.h (sanitize_width): New inline function.
16880 (SANE_TAB_WIDTH): New macro.
16881 (ASCII_CHAR_WIDTH): Use it.
16882 * indent.c (sane_tab_width): Remove. All uses replaced by
16883 SANE_TAB_WIDTH (current_buffer).
16884 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16885
16886 * fileio.c: Integer overflow issues with file modes.
16887 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16888
16889 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16890 Remove unreachable code.
16891 (read_hex, load_charset_map_from_file): Check for integer overflow.
16892
16893 * xterm.c: Don't go over XClientMessageEvent limit.
16894 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16895 (x_send_scroll_bar_event): Likewise. Check that the size does not
16896 exceed limits imposed by XClientMessageEvent, as well as the usual
16897 ptrdiff_t and size_t limits.
16898
16899 * keyboard.c: Overflow, signedness and related fixes.
16900 (make_lispy_movement): Use same integer type in forward decl
16901 that is used in the definition.
16902 (read_key_sequence, keyremap_step):
16903 Change bufsize argument back to int, undoing my 2011-03-30 change.
16904 We prefer signed types, and int is wide enough here.
16905 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16906 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16907 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16908 length, not size_t. Use ptrdiff_t for index, not int.
16909 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16910 possibility of integer overflow.
16911
16912 Overflow, signedness and related fixes for images.
16913
16914 * dispextern.h (struct it.stack[0].u.image.image_id)
16915 (struct_it.image_id, struct image.id, struct image_cache.size)
16916 (struct image_cache.used, struct image_cache.ref_count):
16917 * gtkutil.c (update_frame_tool_bar):
16918 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16919 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16920 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16921 * nsmenu.m (update_frame_tool_bar):
16922 * xdisp.c (calc_pixel_width_or_height):
16923 * xfns.c (image_cache_refcount):
16924 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16925 on typical 64-bit hosts.
16926
16927 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16928 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16929 Omit unnecessary casts to int.
16930 (parse_image_spec): Check that integers fall into 'int' range
16931 when the callers expect that.
16932 (image_ascent): Redo ascent calculation to avoid int overflow.
16933 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16934 (lookup_image): Remove unnecessary tests.
16935 (xbm_image_p): Locals are now of int, not EMACS_INT,
16936 since parse_image_check makes sure they fit into int.
16937 (png_load, gif_load, svg_load_image):
16938 Prefer int to unsigned where either will do.
16939 (tiff_handler): New function, combining the cores of the
16940 old tiff_error_handler and tiff_warning_handler.
16941 This function is rewritten to use vsnprintf and thereby avoid
16942 stack buffer overflows. It uses only the features of vsnprintf
16943 that are common to both POSIX and native Microsoft.
16944 (tiff_error_handler, tiff_warning_handler): Use it.
16945 (tiff_load, gif_load, imagemagick_load_image):
16946 Don't assume :index value fits in 'int'.
16947 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16948 (imagemagick_load_image): Check that crop parameters fit into
16949 the integer types that MagickCropImage accepts. Don't assume
16950 Vimagemagick_render_type has a nonnegative value. Don't assume
16951 size_t fits in 'long'.
16952 (gs_load): Use printmax_t to print the widest integers possible.
16953 Check for integer overflow when computing image height and width.
16954
16955 2011-08-26 Eli Zaretskii <eliz@gnu.org>
16956
16957 * xdisp.c (redisplay_window): Don't force window start if point
16958 will be invisible in the resulting window. (Bug#9324)
16959
16960 2011-08-25 Eli Zaretskii <eliz@gnu.org>
16961
16962 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16963 the display spec is of the form `(space ...)'.
16964 (handle_display_spec): Return the value returned by
16965 handle_single_display_spec, not just 1 or zero.
16966 (handle_single_display_spec): If the display spec is of the form
16967 `(space ...)', and specifies display in the text area, return 2
16968 rather than 1.
16969 (try_cursor_movement): Check for the need to scroll more
16970 accurately, and prefer exact match for point under bidi.
16971 Don't advance `row' beyond the last row of the window.
16972
16973 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16974 into disp_prop; all users changed.
16975
16976 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16977 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16978 for the text covered by the display property.
16979
16980 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
16981
16982 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16983 Change return value to nil.
16984 (Frecord_buffer): Delete unused function.
16985
16986 2011-08-24 Eli Zaretskii <eliz@gnu.org>
16987
16988 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16989 buffers, return left-to-right.
16990 (set_cursor_from_row): Consider candidate row a win if its glyph
16991 represents a newline and point is on that newline. Fixes cursor
16992 positioning on the newline at EOL of R2L text within L2R
16993 paragraph, and vice versa.
16994 (try_cursor_movement): Check continued rows, in addition to
16995 continuation rows. Fixes unwarranted scroll when point enters a
16996 continued line of R2L text within an L2R paragraph, or vice versa.
16997 (cursor_row_p): Consider the case of point being equal to
16998 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16999 from the end of a short line to the beginning of a continued line
17000 of R2L text within L2R paragraph.
17001 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17002 composed characters.
17003
17004 * bidi.c (bidi_check_type): Use xassert.
17005 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17006 members.
17007
17008 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17009
17010 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17011 a character.
17012
17013 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17014
17015 * nsfont.m (ns_otf_to_script): Fix typo.
17016
17017 2011-08-22 Kenichi Handa <handa@m17n.org>
17018
17019 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17020 extra slot even if the purpose is char-code-property-table.
17021
17022 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17023
17024 * xdisp.c (redisplay_window): When computing centering_position,
17025 account for the height of the header line. (Bug#8874)
17026
17027 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17028 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17029 candidate is selected by the mouse, and that candidate has a
17030 composed character under the mouse.
17031
17032 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17033 coordinates reported by pos-visible-in-window-p for a composed
17034 character in column zero.
17035
17036 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17037
17038 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17039
17040 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17041
17042 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17043 consider it a hit if to_charpos is anywhere in the range of the
17044 composed buffer positions.
17045
17046 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17047
17048 * image.c (gif_load): Don't assume that each subimage has the same
17049 dimensions as the base image. Handle disposal method that is
17050 "undefined" by the gif spec (Bug#9335).
17051
17052 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17053
17054 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17055 (Fcondition_case): Document `debug' symbol in error handler.
17056
17057 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17058
17059 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17060 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17061 from an Org mode buffer to a Speedbar frame.
17062
17063 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17064 a composition, take its buffer position from IT->cmp_it.charpos.
17065 Fixes cursor positioning at the beginning of a line that begins
17066 with a composed character.
17067
17068 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17069
17070 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17071 character bidirectional type, use STRONG_L instead. Fixes crashes
17072 in a buffer produced by `describe-categories'.
17073
17074 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17075 members before the level stack, so they would be saved and
17076 restored when copying iterator state. Fixes incorrect reordering
17077 around TABs covered by display properties.
17078
17079 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17080
17081 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17082
17083 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17084
17085 * eval.c (internal_condition_case, internal_condition_case_1)
17086 (internal_condition_case_2, internal_condition_case_n):
17087 Remove unnecessary aborts (Bug#9081).
17088
17089 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17090
17091 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17092 has no `load' handler, try opening the file locally. (Bug#9311)
17093
17094 2011-08-16 Ken Brown <kbrown@cornell.edu>
17095
17096 * gmalloc.c: Expand comment.
17097
17098 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17099
17100 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17101 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17102
17103 2011-08-16 Ken Brown <kbrown@cornell.edu>
17104
17105 Fix memory allocation problems in Cygwin build (Bug#9273).
17106
17107 * unexcw.c ( __malloc_initialized): Declare external variable.
17108 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17109
17110 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17111 New variables.
17112 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17113 dumped emacs.
17114 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17115 in the static heap.
17116 [CYGWIN] (special_realloc): New function.
17117 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17118 requests to realloc storage in the static heap.
17119
17120 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17121
17122 * bidi.c (bidi_initialize): Remove unused local.
17123
17124 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17125
17126 * bidimirror.h:
17127 * biditype.h: Remove file.
17128 * makefile.w32-in ($(BLD)/bidi.$(O)):
17129 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17130
17131 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17132
17133 * chartab.c: Improve commentary for the uniprop_table API.
17134
17135 * bidi.c (bidi_paragraph_init): Support zero value of
17136 bidi_ignore_explicit_marks_for_paragraph_level.
17137 (bidi_initialize): Use uniprop_table instead of including
17138 biditype.h and bidimirror.h.
17139
17140 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17141 coordinates of the iterator when restoring from ppos_it.
17142 (Bug#9296)
17143
17144 2011-08-14 Kenichi Handa <handa@m17n.org>
17145
17146 * process.c (create_process): Call setup_process_coding_systems
17147 after the pid of the process is set to -1 (Bug#8162).
17148
17149 2011-08-14 Eli Zaretskii <eliz@gnu.org>
17150
17151 * xdisp.c (move_it_in_display_line_to): Don't invoke
17152 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17153 ppos_it. Fixes vertical cursor motion when line beginning is
17154 covered by an image. (Bug#9296)
17155
17156 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17157
17158 * nsterm.h (ns_run_ascript): Declare.
17159 (NSAPP_DATA2_RUNASSCRIPT): Define.
17160
17161 * nsfns.m (as_script, as_result, as_status): New static variables.
17162 (ns_run_ascript): New function.
17163 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
17164 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17165 the event loop. Get status from as_status (Bug#7276).
17166
17167 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17168 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17169 the event loop (Bug#7276).
17170
17171 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17172
17173 * gnutls.c (QCgnutls_bootprop_priority)
17174 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17175 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17176 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17177 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17178 (QCgnutls_bootprop_verify_hostname_error)
17179 (QCgnutls_bootprop_callbacks_verify): Rename from
17180 Qgnutls_bootprop_..., all uses changed.
17181
17182 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17183 uses changed.
17184
17185 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17186
17187 * xfaces.c (Qframe_set_background_mode): Now static.
17188 * dispextern.h (Qframe_set_background_mode): Remove decl.
17189
17190 * process.c (Fnetwork_interface_info): Declare local only if needed.
17191
17192 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17193
17194 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17195 (Fnetwork_interface_list): Allocate in increments of bytes instead
17196 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17197 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17198 sockaddr.
17199 (struct ifflag_def): notrailers is smart on OSX.
17200 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17201 Get hardware address with getifaddrs if available.
17202
17203 2011-08-12 Eli Zaretskii <eliz@gnu.org>
17204
17205 * xdisp.c (iterate_out_of_display_property): xassert that
17206 IT->position is set to within IT->object's boundaries. Break from
17207 the loop as soon as EOB is reached; avoids infloops in redisplay
17208 when IT->position is set up wrongly due to some bug.
17209 Set IT->current to match the bidi iterator unconditionally.
17210 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17211 entry. Force push_it to save on the stack the current
17212 buffer/string position, to be restored by pop_it. Fix flags in
17213 the iterator structure wrt the object coming from a display
17214 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17215 properties. (Bug#9284)
17216
17217 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
17218
17219 * fontset.c (fontset_get_font_group): Add proper type checks.
17220 (Bug#9172)
17221
17222 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17223
17224 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17225 and LC_VERSION_MIN_MACOSX.
17226 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17227 (dump_it) [LC_FUNCTION_STARTS]: Use it.
17228
17229 2011-08-08 Eli Zaretskii <eliz@gnu.org>
17230
17231 * xdisp.c (forward_to_next_line_start): Allow to use the
17232 no-display-properties-and-no-overlays under bidi display.
17233 Set disp_pos in the bidi iterator to avoid searches for display
17234 properties and overlays.
17235
17236 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
17237
17238 * editfns.c (Fset_time_zone_rule): Document relationship with the
17239 setenv function.
17240
17241 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17242 the font entity extracted from the cache (Bug#8109).
17243
17244 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
17245
17246 * composite.c (autocmp_chars): Don't reset point. That is done by
17247 restore_point_unwind (Bug#5984).
17248
17249 2011-08-07 Juri Linkov <juri@jurta.org>
17250
17251 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17252 to show the arg `TIME' instead of `TIMEVAL'.
17253
17254 2011-08-06 Eli Zaretskii <eliz@gnu.org>
17255
17256 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17257 display property strides EOL and includes a newline, as in
17258 longlines-mode. (Bug#9254)
17259 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17260 word-wrap under bidirectional display. (Bug#9224)
17261
17262 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17263 is non-zero, even if the data buffer is NULL. Fixes a crash in
17264 vertical-motion with longlines-mode. (Bug#9254)
17265
17266 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17267
17268 * bidi.c <bidi_cache_total_alloc>: Now static.
17269 (bidi_initialize): Initialize bidi_cache_total_alloc.
17270
17271 * xdisp.c (display_line): Release buffer allocated for shelved bidi
17272 cache. (Bug#9221)
17273
17274 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17275 amount allocated this far in `bidi_cache_total_alloc'.
17276 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17277 non-zero, only free the data buffer without restoring the cache
17278 contents. All callers changed.
17279
17280 * dispextern.h (bidi_unshelve_cache): Update prototype.
17281
17282 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17283 (move_it_in_display_line, move_it_to)
17284 (move_it_vertically_backward, move_it_by_lines): Replace the call
17285 to xfree to an equivalent call to bidi_unshelve_cache.
17286 (move_it_in_display_line_to): Fix logic of returning
17287 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
17288
17289 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17290
17291 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17292 came from a string character with a `cursor' property. (Bug#9229)
17293
17294 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17295
17296 * Makefile.in (LIB_PTHREAD): New variable.
17297 (LIBES): Add LIB_PTHREAD (Bug#9216).
17298
17299 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17300 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17301
17302 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17303
17304 * regex.c (re_iswctype): Remove some redundant boolean conversions.
17305
17306 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17307
17308 * xterm.c (x_find_topmost_parent): New function.
17309 (x_set_frame_alpha): Find topmost parent window with
17310 x_find_topmost_parent and set the property there also (bug#9181).
17311 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17312
17313 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17314
17315 * callproc.c (Fcall_process): Avoid vfork clobbering
17316 the local vars buffer, coding_systems, current_dir.
17317
17318 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17319
17320 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17321
17322 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17323
17324 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17325 so that it is not optimized away.
17326
17327 * xdisp.c (compute_display_string_pos): Remove unused local.
17328
17329 2011-08-02 Eli Zaretskii <eliz@gnu.org>
17330
17331 Fix slow cursor motion and scrolling in large buffers with
17332 selective display, like Org Mode buffers. (Bug#9218)
17333
17334 * dispextern.h (struct bidi_it): New member disp_prop_p.
17335
17336 * xdisp.c: Remove one-slot cache of display string positions.
17337 (compute_display_string_pos): Accept an additional argument
17338 DISP_PROP_P; callers changed. Scan at most 5K characters forward
17339 for a display string or property. If found, set DISP_PROP_P
17340 non-zero.
17341
17342 * bidi.c (bidi_fetch_char): Accept an additional argument
17343 DISP_PROP_P, and pass it to compute_display_string_pos.
17344 Only handle text covered by a display string if DISP_PROP_P is returned
17345 non-zero. All callers of bidi_fetch_char changed.
17346
17347 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17348
17349 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17350
17351 2010-12-03 Don March <don@ohspite.net>
17352
17353 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17354 last character M-[char] is translated to ESC [char] (bug#7541).
17355
17356 2011-08-02 Kenichi Handa <handa@m17n.org>
17357
17358 * lisp.h (uniprop_table): Extern it.
17359
17360 * chartab.c (uniprop_table): Make it non-static.
17361
17362 2011-08-01 Eli Zaretskii <eliz@gnu.org>
17363
17364 * xdisp.c (forward_to_next_line_start): Accept additional argument
17365 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17366 on the newline.
17367 (reseat_at_next_visible_line_start): Use the bidi iterator state
17368 returned by forward_to_next_line_start to restore the state of
17369 it->bidi_it after backing up to previous newline. (Bug#9212)
17370
17371 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17372
17373 * regex.c (re_comp): Protoize.
17374 (re_exec): Fix return type.
17375 (regexec): Fix type of `ret'. (Bug#9203)
17376
17377 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17378
17379 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17380 This is needed if max-image-size is a floating-point number.
17381
17382 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17383
17384 * print.c (print_object): Print empty symbol as ##.
17385
17386 * lread.c (read1): Read ## as empty symbol.
17387
17388 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17389
17390 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17391 setting frame foreground color (Bug#9175).
17392 (x_set_background_color): Likewise.
17393
17394 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17395 contents (Bug#9176).
17396 (EmacsTooltip -init): Remove bezels and add shadows to
17397 tooltip windows.
17398
17399 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17400 or scroll bar (Bug#8470).
17401
17402 * nsfont.m (nsfont_open): Remove assignment to voffset and
17403 unnecessary vars hshink, expand, hd, full_height, min_height.
17404 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17405
17406 * nsterm.h (nsfont_info): Remove voffset field.
17407
17408 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17409
17410 Implement strike-through and overline on NextStep (Bug#8863).
17411
17412 * nsfont.m (nsfont_open): Use underline position provided by font,
17413 instead of hard-coded value of 2.
17414 (nsfont_draw): Call ns_draw_text_decoration instead.
17415
17416 * nsterm.h: Add declaration for ns_draw_text_decoration.
17417
17418 * nsterm.m (ns_draw_text_decoration): New function for drawing
17419 underline, overline, and strike-through.
17420 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17421 ns_draw_text_decoration. Change treatment of cursor drawing to
17422 accommodate underlining, etc.
17423
17424 2011-07-28 Eli Zaretskii <eliz@gnu.org>
17425
17426 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17427 default.
17428
17429 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17430
17431 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17432 Without this fix, if a signal arrives just after memory fills up,
17433 'malloc' might be invoked reentrantly.
17434
17435 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17436 In other words, assume that every image size is allowed, on non-X
17437 hosts. This assumption is probably wrong, but it lets Emacs compile.
17438
17439 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17440
17441 * regex.c (re_iswctype): Convert return values to boolean.
17442
17443 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17444
17445 * xdisp.c (compute_display_string_pos): Don't use cached display
17446 string position if the buffer had its restriction changed.
17447 (Bug#9184)
17448
17449 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17450
17451 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17452
17453 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17454
17455 Integer signedness and overflow and related fixes. (Bug#9079)
17456
17457 * bidi.c: Integer size and overflow fixes.
17458 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17459 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17460 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17461 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17462 (bidi_find_other_level_edge):
17463 Use ptrdiff_t instead of EMACS_INT where either will do.
17464 This works better on 32-bit hosts configured --with-wide-int.
17465 (bidi_cache_ensure_space): Check for size-calculation overflow.
17466 Use % rather than repeated addition, for better worst-case speed.
17467 Don't set bidi_cache_size until after xrealloc returns, because it
17468 might not return.
17469 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
17470 (bidi_cache_ensure_space): Also check that the bidi cache size
17471 does not exceed that of the largest Lisp string or buffer. See Eli
17472 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
17473
17474 * alloc.c (__malloc_size_t): Remove.
17475 All uses replaced by size_t. See Andreas Schwab's note
17476 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17477
17478 * image.c: Improve checking for integer overflow.
17479 (check_image_size): Assume that f is nonnull, since
17480 it is always nonnull in practice. This is one less thing to
17481 worry about when checking for integer overflow later.
17482 (x_check_image_size): New function, which checks for integer
17483 overflow issues inside X.
17484 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17485 This removes the need for a memory_full check.
17486 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17487 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17488 (xbm_read_bitmap_data): Change locals back to 'int', since
17489 their values must fit in 'int'.
17490 (xpm_load_image, png_load, tiff_load):
17491 Invoke x_create_x_image_and_pixmap earlier,
17492 to avoid much needless work if the image is too large.
17493 (tiff_load): Treat overly large images as if
17494 x_create_x_image_and_pixmap failed, not as malloc failures.
17495 (gs_load): Use x_check_image_size.
17496
17497 * gtkutil.c: Omit integer casts.
17498 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17499 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17500
17501 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17502
17503 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17504 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17505 would wrongly return t on a 64-bit host.
17506
17507 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17508 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17509 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17510 and therefore cause GCC to emit a bogus diagnostic in some cases.
17511
17512 * image.c: Integer signedness and overflow and related fixes.
17513 This is not an exhaustive set of fixes, but it's time to
17514 record what I've got.
17515 (lookup_pixel_color, check_image_size): Remove redundant decls.
17516 (check_image_size): Don't assume that arbitrary EMACS_INT values
17517 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17518 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17519 (tiff_load, imagemagick_load_image):
17520 Check for overflow in size calculations.
17521 (x_create_x_image_and_pixmap): Remove unnecessary test for
17522 xmalloc returning NULL; that can't happen.
17523 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17524 (xpm_color_bucket): Use better integer hashing function.
17525 (xpm_cache_color): Don't possibly over-allocate memory.
17526 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17527 (gif_memory_source):
17528 Use ptrdiff_t, not int or size_t, to record sizes.
17529 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17530 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17531 either works, as we prefer signed integers.
17532 (tiff_read_from_memory, tiff_write_from_memory):
17533 Return tsize_t, not size_t, since that's what the TIFF API wants.
17534 (tiff_read_from_memory): Don't fail simply because the read would
17535 go past EOF; instead, return a short read.
17536 (tiff_load): Omit no-longer-needed casts.
17537 (Fimagemagick_types): Don't assume size fits into 'int'.
17538
17539 Improve hashing quality when configured --with-wide-int.
17540 * fns.c (hash_string): New function, taken from sxhash_string.
17541 Do not discard information about ASCII character case; this
17542 discarding is no longer needed.
17543 (sxhash-string): Use it. Change sig to match it. Caller changed.
17544 * lisp.h: Declare it.
17545 * lread.c (hash_string): Remove, since we now use fns.c's version.
17546 The fns.c version returns a wider integer if --with-wide-int is
17547 specified, so this should help the quality of the hashing a bit.
17548
17549 * emacs.c: Integer overflow minor fix.
17550 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17551 Define only if GNU_LINUX.
17552 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17553
17554 * dispnew.c: Integer signedness and overflow fixes.
17555 Remove unnecessary forward decls, that were a maintenance hassle.
17556 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17557 All uses changed.
17558 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17559 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17560 (prepare_desired_row, line_draw_cost):
17561 Use int, not unsigned, where either works.
17562 (save_current_matrix, restore_current_matrix):
17563 Use ptrdiff_t, not size_t, where either works.
17564 (init_display): Check for overflow more accurately, and without
17565 relying on undefined behavior.
17566
17567 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17568 Remove, replacing with the new symbols in lisp.h. All uses changed.
17569 * fileio.c (make_temp_name):
17570 * filelock.c (lock_file_1, lock_file):
17571 * xdisp.c (message_dolog):
17572 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17573 Use pMd etc. instead.
17574 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17575 replacing the pWIDE etc. symbols removed from editfns.c.
17576
17577 * keyboard.h (num_input_events): Now uintmax_t.
17578 This is (very slightly) less likely to mess up due to wraparound.
17579 All uses changed.
17580
17581 * buffer.c: Integer signedness fixes.
17582 (alloc_buffer_text, enlarge_buffer_text):
17583 Use ptrdiff_t rather than size_t when either will do, as we prefer
17584 signed integers.
17585
17586 * alloc.c: Integer signedness and overflow fixes.
17587 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17588 (__malloc_size_t): Default to size_t, not to int.
17589 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17590 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17591 Prefer ptrdiff_t to size_t when either would do, as we prefer
17592 signed integers.
17593 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17594 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17595 Now const. Initialize with values that are in range even if char
17596 is signed.
17597 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17598 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17599 These functions do the right thing with sizes > 2**32.
17600 (check_depth): Now ptrdiff_t, not int.
17601 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17602 Adjust to new way of storing sizes. Check for size overflow bugs
17603 in rest of code.
17604 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17605 slightly wrong anyway, as it missed one instance of
17606 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17607 (refill_memory_reserve): Omit needless cast to size_t.
17608 (mark_object_loop_halt): Mark as externally visible.
17609
17610 * xselect.c: Integer signedness and overflow fixes.
17611 (Fx_register_dnd_atom, x_handle_dnd_message):
17612 Use ptrdiff_t, not size_t, since we prefer signed.
17613 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17614 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17615 x_dnd_atoms_size and x_dnd_atoms_length.
17616
17617 * doprnt.c: Prefer signed to unsigned when either works.
17618 * eval.c (verror):
17619 * doprnt.c (doprnt):
17620 * lisp.h (doprnt):
17621 * xdisp.c (vmessage):
17622 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17623 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17624 prefer signed arithmetic to avoid comparison confusion.
17625 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17626 but is a bit tricky.
17627
17628 Assume freestanding C89 headers, string.h, stdlib.h.
17629 * data.c, doprnt.c, floatfns.c, print.c:
17630 Include float.h unconditionally.
17631 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17632 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17633 * regex.c: Likewise for stddef.h, string.h.
17634 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17635 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17636 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17637 (STDC_HEADERS): Remove obsolete defines.
17638 * sysdep.c: Include limits.h unconditionally.
17639
17640 Assume support for memcmp, memcpy, memmove, memset.
17641 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17642 * regex.c (memcmp, memcpy):
17643 Remove; we assume C89 now.
17644
17645 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17646 (__malloc_safe_bcopy): Remove; no longer needed.
17647
17648 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
17649 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17650 well either way, and we prefer signed to unsigned.
17651
17652 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17653
17654 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17655 closes the connection while we're reading (bug#9182).
17656
17657 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
17658
17659 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17660 are specified (Bug#9168).
17661
17662 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17663
17664 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17665 Found by GCC static checking and --with-wide-int on a 32-bit host.
17666
17667 2011-07-25 Eli Zaretskii <eliz@gnu.org>
17668
17669 * xdisp.c (compute_display_string_pos): Fix logic of caching
17670 previous display string position. Initialize cached_prev_pos to
17671 -1. Fixes slow-down at the beginning of a buffer.
17672
17673 2011-07-24 Eli Zaretskii <eliz@gnu.org>
17674
17675 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17676 for attrs[LFACE_FONTSET_INDEX].
17677
17678 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17679
17680 * xml.c (parse_region): Remove unused local
17681 that was recently introduced.
17682
17683 2011-07-23 Eli Zaretskii <eliz@gnu.org>
17684
17685 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17686 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17687
17688 * xdisp.c (move_it_in_display_line_to): Record the best matching
17689 position for TO_CHARPOS while scanning the line, and restore it on
17690 exit if none of the characters scanned was an exact match.
17691 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
17692 when exact match is impossible due to invisible text, and the
17693 lines are truncated.
17694
17695 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17696
17697 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17698 for OSX >= 10.7.
17699
17700 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17701
17702 Fix a significant slow-down of cursor motion with C-n, C-p,
17703 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17704 auto-repeat under bidi redisplay in fontified buffers.
17705 * xdisp.c (compute_stop_pos_backwards): New function.
17706 (next_element_from_buffer): Call compute_stop_pos_backwards to
17707 find a suitable prev_stop when we find ourselves before
17708 base_level_stop.
17709 (reseat): Don't look for prev_stop, as that could mean a very long
17710 run.
17711 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17712 <cached_disp_overlay_modiff>: Cache for last found display string
17713 position.
17714 (compute_display_string_pos): Return the cached position if asked
17715 about the same buffer in the same area of character positions, and
17716 the buffer wasn't changed since the time the display string
17717 position was cached.
17718
17719 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17720
17721 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17722 is an integer, which is important for empty lines. (Bug#9149)
17723
17724 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
17725
17726 * frame.c (Fmodify_frame_parameters): In tty case, update the
17727 default face if necessary (Bug#4238).
17728
17729 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
17730
17731 * editfns.c (Fstring_to_char): No need to explain what a character
17732 is in the docstring (Bug#6576).
17733
17734 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17735
17736 * xml.c (parse_region): Make sure we always return a tree.
17737
17738 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17739
17740 * xml.c (parse_region): If a document contains only comments,
17741 return that, too.
17742
17743 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17744
17745 * xml.c (make_dom): Return comments, too.
17746
17747 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17748
17749 Port to OpenBSD.
17750 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17751 and the surrounding thread.
17752 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17753 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17754 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17755 timer goes off.
17756 * s/openbsd.h (BROKEN_SIGIO): Define.
17757 * unexelf.c (unexec) [__OpenBSD__]:
17758 Don't update the .mdebug section of the Alpha COFF symbol table.
17759
17760 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17761
17762 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17763 (bug#8460).
17764
17765 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17766
17767 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17768 This fixes some race conditions on the permissions of any newly
17769 created file.
17770
17771 * alloc.c (valid_pointer_p): Use pipe, not open.
17772 This fixes some permissions issues when debugging.
17773
17774 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17775 If fchown fails to set both uid and gid, try to set just gid,
17776 as that is sometimes allowed. Adjust the file's mode to eliminate
17777 setuid or setgid bits that are inappropriate if fchown fails.
17778
17779 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17780
17781 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17782 to compare Lisp_Objects.
17783 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17784 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17785 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17786
17787 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17788
17789 * lread.c (read_integer): Unread even EOF character.
17790 (read1): Likewise. Properly record start position of symbol.
17791
17792 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17793 symbol character follows.
17794
17795 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17796
17797 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17798 This works around a problem with the previous change to Fcopy_file.
17799 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17800 and without this change, GCC might complain about discarding
17801 fchown's return value.
17802
17803 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
17804
17805 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17806
17807 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17808
17809 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17810
17811 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17812
17813 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17814 it's used from the C level.
17815
17816 * process.c: Use the same condition for POLL_FOR_INPUT in both
17817 keyboard.c and process.c (bug#1858).
17818
17819 2011-07-09 Lawrence Mitchell <wence@gmx.li>
17820
17821 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17822 (Fgnutls_boot): Use it.
17823
17824 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17825
17826 * doc.c (Fsubstitute_command_keys): Revert last change.
17827
17828 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17829
17830 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17831 quotes the next character, and doesn't affect other longer
17832 sequences (bug#8935).
17833
17834 * lread.c (syms_of_lread): Clarify that is isn't only
17835 `eval-buffer' and `eval-defun' that's affected by
17836 `lexical-binding' (bug#8460).
17837
17838 2011-07-15 Eli Zaretskii <eliz@gnu.org>
17839
17840 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
17841 bidi redisplay when a line includes both an image and is truncated.
17842
17843 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17844
17845 Fix minor problems found by static checking.
17846 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17847 (elsz): Now a signed constant, not a size_t var. We prefer signed
17848 types to unsigned, to avoid integer comparison confusion. Without
17849 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17850 "cannot optimize loop, the loop counter may overflow", a symptom
17851 of the confusion.
17852 * indent.c (Fvertical_motion): Mark locals as initialized.
17853 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17854
17855 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17856
17857 * search.c (Fre_search_backward): Mention `case-fold-search' in
17858 all the re_search_* functions (bug#8138).
17859
17860 * keyboard.c (Fopen_dribble_file): Document when the file is
17861 closed (bug#8056).
17862
17863 2011-07-14 Eli Zaretskii <eliz@gnu.org>
17864
17865 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17866 bidi_cache_idx.
17867
17868 Support bidi reordering of display and overlay strings.
17869 * xdisp.c (compute_display_string_pos)
17870 (compute_display_string_end): Accept additional argument STRING.
17871 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17872 (reseat_to_string): Initialize bidi_it->string.s and
17873 bidi_it->string.schars.
17874 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
17875 NULL (avoids a crash in bidi_paragraph_init).
17876 Initialize itb.string.lstring.
17877 (init_iterator): Call bidi_init_it only of a valid
17878 buffer position was specified. Initialize paragraph_embedding to
17879 L2R.
17880 (reseat_to_string): Initialize the bidi iterator.
17881 (display_string): If we need to ignore text properties of
17882 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17883 original value of -1 will not work with bidi.)
17884 (compute_display_string_pos): First arg is now struct
17885 `text_pos *'; all callers changed. Support display properties on
17886 Lisp strings.
17887 (compute_display_string_end): Support display properties on Lisp
17888 strings.
17889 (init_iterator, reseat_1, reseat_to_string): Initialize the
17890 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17891 when iterating on a string not from display properties).
17892 (compute_display_string_pos, compute_display_string_end):
17893 Fix calculation of the object to scan. Fixes an error when using
17894 arrow keys.
17895 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
17896 base_level_stop; instead, set base_level_stop to BEGV.
17897 Fixes crashes in vertical-motion.
17898 (next_element_from_buffer): Improve commentary for when
17899 the iterator is before prev_stop.
17900 (init_iterator): Initialize bidi_p from the default value of
17901 bidi-display-reordering, not from buffer-local value. Use the
17902 buffer-local value only if initializing for buffer iteration.
17903 (handle_invisible_prop): Support invisible properties on strings
17904 that are being bidi-reordered.
17905 (set_iterator_to_next): Support bidi reordering of C strings and
17906 Lisp strings.
17907 (next_element_from_string): Support bidi reordering of Lisp
17908 strings.
17909 (handle_stop_backwards): Support Lisp strings as well.
17910 (display_string): Support display of R2L glyph rows.
17911 Use IT_STRING_CHARPOS when displaying from a Lisp string.
17912 (init_iterator): Don't initialize it->bidi_p for strings
17913 here.
17914 (reseat_to_string): Initialize it->bidi_p for strings here.
17915 (next_element_from_string, next_element_from_c_string)
17916 (next_element_from_buffer): Add xassert's for correspondence
17917 between IT's object being iterated and it->bidi_it.string
17918 structure.
17919 (face_before_or_after_it_pos): Support bidi iteration.
17920 (next_element_from_c_string): Handle the case of the first string
17921 character that is not the first one in the visual order.
17922 (get_visually_first_element): New function, refactored from common
17923 parts of next_element_from_buffer, next_element_from_string, and
17924 next_element_from_c_string.
17925 (tool_bar_lines_needed, redisplay_tool_bar)
17926 (display_menu_bar): Force left-to-right direction. Add a FIXME
17927 comment for making that be controlled by a user option.
17928 (push_it, pop_it): Save and restore the state of the
17929 bidi iterator. Save and restore the bidi_p flag.
17930 (pop_it): Iterate out of display property for string iteration as
17931 well.
17932 (iterate_out_of_display_property): Support iteration over strings.
17933 (handle_single_display_spec): Set up it->bidi_it for iteration
17934 over a display string, and call bidi_init_it.
17935 (handle_single_display_spec, next_overlay_string)
17936 (get_overlay_strings_1, push_display_prop): Set up the bidi
17937 iterator for displaying display or overlay strings.
17938 (forward_to_next_line_start): Don't use the shortcut if
17939 bidi-iterating.
17940 (back_to_previous_visible_line_start): If handle_display_prop
17941 pushed the iterator stack, restore the internal state of the bidi
17942 iterator by calling bidi_pop_it same number of times.
17943 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17944 and we are bidi-iterating, don't decrement the iterator position;
17945 instead, set the first_elt flag in the bidi iterator, to produce
17946 the same effect.
17947 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17948 (push_display_prop): xassert that we are iterating a buffer.
17949 (push_it, pop_it): Save and restore paragraph_embedding member.
17950 (handle_single_display_spec, next_overlay_string)
17951 (get_overlay_strings_1, reseat_1, reseat_to_string)
17952 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17953 correctly. Don't assume unibyte strings are not bidi-reordered.
17954 (compute_display_string_pos)
17955 (compute_display_string_end): Fix handling the case of C string.
17956 (push_it, pop_it): Save and restore from_disp_prop_p.
17957 (handle_single_display_spec, push_display_prop): Set the
17958 from_disp_prop_p flag.
17959 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17960 (pop_it): Call iterate_out_of_display_property only if we are
17961 popping after iteration over a string that came from a display
17962 property. Fix a typo in popping stretch info. Add an assertion
17963 for verifying that the iterator position is in sync with the bidi
17964 iterator.
17965 (handle_single_display_spec, get_overlay_strings_1)
17966 (push_display_prop): Fix initialization of paragraph direction for
17967 string when that of the parent object is not yet determined.
17968 (reseat_1): Call bidi_init_it to resync the bidi
17969 iterator with IT's position. (Bug#7616)
17970 (find_row_edges): If ROW->start.pos gives position
17971 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17972 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17973 Reset the from_disp_prop_p flag.
17974 (SAVE_IT, RESTORE_IT): New macros.
17975 (pos_visible_p, face_before_or_after_it_pos)
17976 (back_to_previous_visible_line_start)
17977 (move_it_in_display_line_to, move_it_in_display_line)
17978 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17979 (try_scrolling, redisplay_window, display_line): Use them when
17980 saving a temporary copy of the iterator and restoring it back.
17981 (back_to_previous_visible_line_start, reseat_1)
17982 (init_iterator): Empty the bidi cache "stack".
17983 (move_it_in_display_line_to): If iterator ended up at
17984 EOL, but we never saw any buffer positions smaller than
17985 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17986 motion in bidi-reordered lines.
17987 (move_it_in_display_line_to): Record prev_method and prev_pos
17988 immediately before the call to set_iterator_to_next. Fixes cursor
17989 motion in bidi-reordered lines with stretch glyphs and strings
17990 displayed in margins. (Bug#8133) (Bug#8867)
17991 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17992 TO_CHARPOS.
17993 (pos_visible_p): Support positions in bidi-reordered lines.
17994 Save and restore bidi cache.
17995
17996 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17997 (bidi_paragraph_info): Delete unused struct.
17998 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17999 (bidi_cache_start): New variable.
18000 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18001 to zero.
18002 (bidi_cache_fetch_state, bidi_cache_search)
18003 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18004 (bidi_cache_find, bidi_peek_at_next_level)
18005 (bidi_level_of_next_char, bidi_find_other_level_edge)
18006 (bidi_move_to_visually_next): Compare cache index with
18007 bidi_cache_start rather than with zero.
18008 (bidi_fetch_char): Accept new argument STRING; all callers
18009 changed. Support iteration over a string. Support strings with
18010 display properties. Support unibyte strings. Fix the type of
18011 `len' according to what STRING_CHAR_AND_LENGTH expects.
18012 (bidi_paragraph_init, bidi_resolve_explicit_1)
18013 (bidi_resolve_explicit, bidi_resolve_weak)
18014 (bidi_level_of_next_char, bidi_move_to_visually_next):
18015 Support iteration over a string.
18016 (bidi_set_sor_type, bidi_resolve_explicit_1)
18017 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18018 can now be zero (for strings); special values 0 and -1 were
18019 changed to -1 and -2, respectively.
18020 (bidi_char_at_pos): New function.
18021 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18022 Call it instead of FETCH_MULTIBYTE_CHAR.
18023 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18024 initialized to valid values.
18025 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18026 values.
18027 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18028 the test for valid cached positions. Fix the logic for looking up
18029 the sentinel state in the cache. GCPRO the Lisp string we are
18030 iterating.
18031 (bidi_push_it, bidi_pop_it): New functions.
18032 (bidi_initialize): Initialize the bidi cache start stack pointer.
18033 (bidi_cache_ensure_space): New function, refactored from part of
18034 bidi_cache_iterator_state. Don't assume the required size is just
18035 one BIDI_CACHE_CHUNK away.
18036 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18037 (bidi_count_bytes, bidi_char_at_pos): New functions.
18038 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18039 always valid if bidi_cache_idx is valid.
18040 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18041 is valid if it's going to be used.
18042 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18043 (bidi_cache_fetch_state, bidi_cache_search)
18044 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18045 (bidi_cache_iterator_state, bidi_cache_find)
18046 (bidi_find_other_level_edge, bidi_cache_start_stack):
18047 All variables related to cache indices are now EMACS_INT.
18048
18049 * dispextern.h (struct bidi_string_data): New structure.
18050 (struct bidi_it): New member `string'. Make flag members be 1-bit
18051 fields, and put them last in the struct.
18052 (compute_display_string_pos, compute_display_string_end):
18053 Update prototypes.
18054 (bidi_push_it, bidi_pop_it): Add prototypes.
18055 (struct iterator_stack_entry): New members bidi_p,
18056 paragraph_embedding, and from_disp_prop_p.
18057 (struct it): Member bidi_p is now a bit field 1 bit wide.
18058 (bidi_shelve_cache, bidi_unshelve_cache):
18059 Declare prototypes.
18060
18061 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18062 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18063 and vector-like objects.
18064
18065 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18066 cache around display iteration.
18067
18068 * window.c (Fwindow_end, window_scroll_pixel_based)
18069 (displayed_window_lines, Frecenter): Save and restore the bidi
18070 cache around display iteration.
18071
18072 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18073
18074 * editfns.c (Fdelete_region): Clarify the use of the named
18075 parameters (bug#6788).
18076
18077 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18078
18079 * indent.c (Fvertical_motion): Set and restore w->pointm when
18080 saving and restoring the window's buffer (Bug#9006).
18081
18082 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18083
18084 * editfns.c (Fstring_to_char): Clarify just what is returned
18085 (bug#6576). Text by Eli Zaretskii.
18086
18087 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18088
18089 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18090
18091 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18092
18093 * buffer.c (mmap_find): Fix a typo.
18094
18095 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18096
18097 Fix execution of x selection hooks.
18098 * xselect.c (Qx_lost_selection_functions)
18099 (Qx_sent_selection_functions): New vars.
18100 (syms_of_xselect): DEFSYM them.
18101 (x_handle_selection_request): Pass Qx_sent_selection_functions
18102 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18103 (x_handle_selection_clear,x_clear_frame_selections):
18104 Pass Qx_lost_selection_functions rather than
18105 Vx_lost_selection_functions to Frun_hook_with_args.
18106
18107 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18108
18109 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18110 The old code sometimes used this field without initializing it.
18111
18112 * alloc.c (gc_sweep): Don't read past end of array.
18113 In theory, the old code could also have corrupted Emacs internals,
18114 though it'd be very unlikely.
18115
18116 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18117
18118 * character.c (Fcharacterp): Don't advertise optional ignored
18119 argument. (Bug#4026)
18120
18121 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18122
18123 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18124 key" (bug#4257).
18125
18126 * window.c (Fset_window_start): Doc fix (bug#4199).
18127 (Fset_window_hscroll): Ditto.
18128
18129 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18130
18131 Fix minor new problems caught by GCC 4.6.1.
18132 * term.c (init_tty): Remove unused local.
18133 * xsettings.c (store_monospaced_changed): Define this function only
18134 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18135 not used otherwise.
18136
18137 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18138
18139 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18140
18141 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18142
18143 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18144 are the mini-buffer and the echo area (bug#3320).
18145
18146 * term.c (init_tty): Remove support for supdup, c10 and perq
18147 terminals, which are no longer supported (bug#1482).
18148
18149 2011-07-10 Johan Bockgård <bojohan@gnu.org>
18150
18151 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18152
18153 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18154
18155 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18156 for non-popups (Bug#3642).
18157
18158 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18159
18160 * alloc.c (reset_malloc_hooks): Protoize.
18161 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
18162 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18163 * cm.c (losecursor): Likewise.
18164 * data.c (fmod): Likewise.
18165 * dispnew.c (swap_glyphs_in_rows): Likewise.
18166 * emacs.c (memory_warning_signal): Likewise.
18167 * floatfns.c (float_error): Likewise.
18168 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18169 (otf_open, font_otf_capability, generate_otf_features)
18170 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18171 Likewise.
18172 * image.c (pbm_read_file): Likewise.
18173 * indent.c (string_display_width): Likewise.
18174 * intervals.c (check_for_interval, search_for_interval)
18175 (inc_interval_count, count_intervals, root_interval)
18176 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18177 * lread.c (defalias): Likewise.
18178 * ralloc.c (r_alloc_check): Likewise.
18179 * regex.c (set_image_of_range_1, set_image_of_range)
18180 (regex_grow_registers): Likewise.
18181 * sysdep.c (strerror): Likewise.
18182 * termcap.c (valid_filename_p, tprint, main): Likewise.
18183 * tparam.c (main): Likewise.
18184 * unexhp9k800.c (run_time_remap, save_data_space)
18185 (update_file_ptrs, read_header, write_header, calculate_checksum)
18186 (copy_file, copy_rest, display_header): Likewise.
18187 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18188 Likewise.
18189 * xdisp.c (check_it): Likewise.
18190 * xfaces.c (register_color, unregister_color, unregister_colors):
18191 Likewise.
18192 * xfns.c (print_fontset_result): Likewise.
18193 * xrdb.c (member, fatal, main): Likewise.
18194
18195 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18196
18197 Fix minor problems found by static checking (Bug#9031).
18198 * chartab.c (char_table_set_range, map_sub_char_table):
18199 Remove unused locals.
18200 (uniprop_table): Now static.
18201 * composite.c (_work_char): Remove unused static var.
18202
18203 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
18204
18205 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18206
18207 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18208
18209 * gtkutil.c (qttip_cb): Remove code without function.
18210
18211 2011-07-09 Eli Zaretskii <eliz@gnu.org>
18212
18213 * w32.c (pthread_sigmask): New stub.
18214
18215 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
18216
18217 Use pthread_sigmask, not sigprocmask (Bug#9010).
18218 sigprocmask is portable only for single-threaded applications, and
18219 Emacs can be multi-threaded when it uses GTK.
18220 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18221 (LIBES): Use it.
18222 * callproc.c (Fcall_process):
18223 * process.c (create_process):
18224 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18225 Use pthread_sigmask, not sigprocmask.
18226
18227 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18228
18229 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18230 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18231 wrong (Bug#8591).
18232
18233 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18234
18235 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18236 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18237 (xg_hide_tooltip): Fix comment.
18238
18239 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18240 in registerServicesMenuSendTypes.
18241 (validRequestorForSendType): Don't check ns_return_types.
18242
18243 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18244 ns_return_type.
18245
18246 2011-07-08 Jason Rumney <jasonr@gnu.org>
18247
18248 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18249 SH_SHOW for hidden windows (Bug#5482).
18250
18251 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18252 frame struct members of non-existent frames (Bug#6284).
18253
18254 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18255
18256 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18257 variable firstTime not needed on OSX >= 10.6.
18258 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18259 >= 10.5. Use setKnobProportion, setDoubleValue.
18260
18261 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18262 (MAC_OS_X_VERSION_10_5): Define if not defined.
18263 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18264 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18265 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18266
18267 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
18268 cString and lossyCString on OSX >= 10.4.
18269
18270 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
18271 sizeToFit on OSX >= 10.2.
18272
18273 * nsimage.m (allocInitFromFile): Don't use deprecated method
18274 bestRepresentationForDevice on OSX >= 10.6.
18275
18276 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18277 to avoid warning.
18278
18279 * emacs.c: Declare unexec_init_emacs_zone.
18280
18281 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18282
18283 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18284
18285 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18286 on svcsMenu (Bug#8842).
18287
18288 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18289 ns_return_types.
18290 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18291
18292 * nsterm.m (QUTF8_STRING): Declare.
18293 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18294 (validRequestorForSendType): Return type is (id).
18295 Change indexOfObjectIdenticalTo to indexOfObject.
18296 Check if we have local selection before returning self (Bug#8842).
18297 (writeSelectionToPasteboard): Put local selection into paste board
18298 if we have a local selection (Bug#8842).
18299 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18300
18301 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18302 (ns_get_local_selection): Declare.
18303
18304 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18305
18306 * keymap.c (describe_map_tree): Don't insert a double newline at
18307 the end of the buffer (bug#1169) and return whether we inserted
18308 something.
18309
18310 * callint.c (Fcall_interactively): Change "reading args" to
18311 "providing args" to try to clarify what it does (bug#1010).
18312
18313 2011-07-07 Kenichi Handa <handa@m17n.org>
18314
18315 * composite.c (composition_compute_stop_pos): Ignore a static
18316 composition starting before CHARPOS (Bug#8915).
18317
18318 * xdisp.c (handle_composition_prop): Likewise.
18319
18320 2011-07-07 Eli Zaretskii <eliz@gnu.org>
18321
18322 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18323 (Bug#9015)
18324
18325 2011-07-07 Kenichi Handa <handa@m17n.org>
18326
18327 * character.h (unicode_category_t): New enum type.
18328
18329 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18330 (Qchar_code_property_table): New variable.
18331 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18332 (UNIPROP_COMPRESSED_FORM_P): New macros.
18333 (char_table_ascii): Uncompress the compressed values.
18334 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18335 Uncompress the compressed values.
18336 (sub_char_table_ref_and_range): Likewise.
18337 (char_table_ref_and_range): Uncompress the compressed values.
18338 (sub_char_table_set): New arg is_uniprop. Callers changed.
18339 Uncompress the compressed values.
18340 (sub_char_table_set_range): Args changed. Callers changed.
18341 (char_table_set_range): Adjuted for the above change.
18342 (map_sub_char_table): Delete args default_val and parent. Add arg
18343 top. Give decoded values to a Lisp function.
18344 (map_char_table): Adjust for the above change. Give decoded
18345 values to a Lisp function. Gcpro more variables.
18346 (uniprop_table_uncompress)
18347 (uniprop_decode_value_run_length): New functions.
18348 (uniprop_decoder, uniprop_decoder_count): New variables.
18349 (uniprop_get_decoder, uniprop_encode_value_character)
18350 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18351 New functions.
18352 (uniprop_encoder, uniprop_encoder_count): New variables.
18353 (uniprop_get_encoder, uniprop_table)
18354 (Funicode_property_table_internal, Fget_unicode_property_internal)
18355 (Fput_unicode_property_internal): New functions.
18356 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18357 Sunicode_property_table_internal, Sget_unicode_property_internal,
18358 and Sput_unicode_property_internal. Defvar_lisp
18359 char-code-property-alist.
18360
18361 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
18362 Vunicode_category_table.
18363
18364 * font.c (font_range): Adjust for the change of
18365 Vunicode_category_table.
18366
18367 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18368
18369 * m/iris4d.h: Remove file, move contents ...
18370 * s/irix6-5.h: ... here.
18371
18372 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18373
18374 Remove unportable assumption about struct layout (Bug#8884).
18375 * alloc.c (mark_buffer):
18376 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18377 (clone_per_buffer_values): Don't assume that
18378 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18379 This isn't true in general, and it's particularly not true
18380 if Emacs is configured with --with-wide-int.
18381 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18382 New macros, used in the buffer.c change.
18383
18384 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18385
18386 * xsettings.c: Use both GConf and GSettings if both are available.
18387 (store_config_changed_event): Add comment.
18388 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18389 (store_tool_bar_style_changed): New functions.
18390 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
18391 (struct xsettings): Move font inside HAVE_XFT.
18392 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
18393 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
18394 Move inside HAVE_XFT.
18395 (something_changed_gsettingsCB): Rename from something_changedCB.
18396 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18397 also.
18398 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
18399 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
18400 (something_changed_gconfCB): Rename from something_changedCB.
18401 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18402 (parse_settings): Move check for font inside HAVE_XFT.
18403 (read_settings, apply_xft_settings): Add comment.
18404 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18405 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18406 call store_font_name_changed.
18407 (xft_settings_event): Add comment.
18408 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18409 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18410 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18411 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18412 (xsettings_initialize): Call init_gsettings last.
18413 (xsettings_get_system_font, xsettings_get_system_normal_font):
18414 Add comment.
18415
18416 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18417
18418 Random fixes. E.g., (random) never returned negative values.
18419 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18420 subseconds part to the entropy, as that's a bit more random.
18421 Prefer signed to unsigned, since the signedness doesn't matter and
18422 in general we prefer signed. When given a limit, use a
18423 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18424 latter isn't right if USE_2_TAGS_FOR_INTS.
18425 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18426 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18427
18428 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18429
18430 * textprop.c (text_property_stickiness):
18431 Obey Vtext_property_default_nonsticky.
18432 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18433 * w32fns.c (syms_of_w32fns):
18434 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18435
18436 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18437
18438 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18439 This is more efficient than Ffile_directory_p and avoids a minor race.
18440
18441 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18442
18443 * buffer.c (Foverlay_put): Say what the return value is
18444 (bug#7835).
18445
18446 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18447 is a directory before asking whether to use the file name
18448 (bug#7564).
18449 (barf_or_query_if_file_exists): Make the "File is a directory"
18450 error be more correct.
18451
18452 * fns.c (Frequire): Remove the mention of the .gz files, since
18453 that's installation-specific, but keep the mention of
18454 `get-load-suffixes'.
18455
18456 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18457
18458 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18459 Report string overflow if the output is too long.
18460
18461 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
18462
18463 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18464 (syms_of_gnutls): Remove duplicate DEFSYM for
18465 Qgnutls_bootprop_verify_hostname_error, an error for
18466 Qgnutls_bootprop_verify_error (which is no longer used).
18467
18468 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18469 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18470 Also (re)move comments that are misplaced or no longer relevant.
18471
18472 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18473
18474 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18475
18476 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
18477
18478 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18479 and background color parameters if they have been changed.
18480
18481 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18482
18483 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18484
18485 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18486
18487 * xsettings.c (SYSTEM_FONT): Define only when used.
18488 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18489
18490 * keymap.c (access_keymap_1): Now static.
18491
18492 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
18493
18494 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18495 leave any prefix arg for the up event (Bug#1586).
18496
18497 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18498
18499 * lread.c (syms_of_lread): Mention single symbols defined by
18500 `defvar' or `defconst' (bug#7154).
18501
18502 * fns.c (Frequire): Mention .el.gz files (bug#7314).
18503 (Frequire): Mention get-load-suffixes.
18504
18505 2011-07-02 Martin Rudalics <rudalics@gmx.at>
18506
18507 * window.h (window): Remove clone_number slot.
18508 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18509 Remove.
18510 (make_parent_window, make_window, saved_window)
18511 (Fset_window_configuration, save_window_save): Don't deal with
18512 clone numbers.
18513 * buffer.c (Qclone_number): Remove declaration.
18514 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18515
18516 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18517
18518 Add multiple inheritance to keymaps.
18519 * keymap.c (Fmake_composed_keymap): New function.
18520 (Fset_keymap_parent): Simplify.
18521 (fix_submap_inheritance): Remove.
18522 (access_keymap_1): New function extracted from access_keymap to handle
18523 embedded parents and handle lists of maps.
18524 (access_keymap): Use it.
18525 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18526 (Fcopy_keymap): Handle embedded parents.
18527 (Fcommand_remapping, define_as_prefix): Simplify.
18528 (Fkey_binding): Simplify.
18529 (syms_of_keymap): Move minibuffer-local-completion-map,
18530 minibuffer-local-filename-completion-map,
18531 minibuffer-local-must-match-map, and
18532 minibuffer-local-filename-must-match-map to Elisp.
18533 (syms_of_keymap): Defsubr make-composed-keymap.
18534 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18535 (parse_menu_item): Trivial simplification.
18536
18537 2011-07-01 Glenn Morris <rgm@gnu.org>
18538
18539 * Makefile.in (SETTINGS_LIBS): Fix typo.
18540
18541 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
18542
18543 * coding.c (Fencode_coding_string): Record the last coding system
18544 used, as the function doc string says (bug#8738).
18545
18546 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18547
18548 * xsettings.c (store_monospaced_changed): Take new font as arg and
18549 check for change against current_mono_font.
18550 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18551 (emacs_settings_constructor, emacs_settings_get_property)
18552 (emacs_settings_set_property, emacs_settings_class_init)
18553 (emacs_settings_init, gsettings_obj): Remove.
18554 (something_changedCB): New function for HAVE_GSETTINGS.
18555 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18556 with value as argument.
18557 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18558 g_settings_new (Bug#8967). Do not create gsettings_obj.
18559 Remove calls to g_settings_bind. Connect something_changedCB to
18560 "changed".
18561
18562 * xgselect.c: Add defined (HAVE_GSETTINGS).
18563 (xgselect_initialize): Ditto.
18564
18565 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18566 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18567 xg_select.
18568
18569 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18570
18571 * eval.c (struct backtrace): Simplify and port the data structure.
18572 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18573 signed bit field, as this assumption is not portable and it makes
18574 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18575 "char debug_on_exit : 1" as this is not portable either; instead,
18576 use the portable "unsigned int debug_on_exit : 1". Remove unused
18577 member evalargs. Remove obsolete comments about cc bombing out.
18578
18579 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18580
18581 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
18582 Let HAVE_GSETTINGS override HAVE_GCONF.
18583 (store_monospaced_changed): New function.
18584 (EMACS_SETTINGS): A new type derived from GObject to handle
18585 GSettings notifications.
18586 (emacs_settings_constructor, emacs_settings_get_property)
18587 (emacs_settings_set_property, emacs_settings_class_init):
18588 New functions.
18589 (gsettings_client, gsettings_obj): New variables.
18590 (GSETTINGS_SCHEMA): New define.
18591 (something_changedCB): Call store_monospaced_changed.
18592 (init_gsettings): New function.
18593 (xsettings_initialize): Call init_gsettings.
18594 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18595 to NULL.
18596
18597 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
18598 GCONF_CFLAGS/LIBS.
18599
18600 2011-06-29 Martin Rudalics <rudalics@gmx.at>
18601
18602 * window.c (resize_root_window, grow_mini_window)
18603 (shrink_mini_window): Rename Qresize_root_window to
18604 Qwindow_resize_root_window and Qresize_root_window_vertically to
18605 Qwindow_resize_root_window_vertically.
18606
18607 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18608
18609 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18610
18611 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
18612
18613 * makefile.w32-in: Redesign dependencies so they reflect more
18614 clearly which files are directly included by each source file,
18615 and not through other includes.
18616
18617 2011-06-27 Martin Rudalics <rudalics@gmx.at>
18618
18619 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18620 (sort_overlays, overlay_strings): When an overlay's clone number
18621 matches the window's clone number process the overlay even if
18622 the overlay's window property doesn't match the current window.
18623
18624 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18625 (Fwindow_hchild): Rename to Fwindow_left_child.
18626 (Fwindow_next): Rename to Fwindow_next_sibling.
18627 (Fwindow_prev): Rename to Fwindow_prev_sibling.
18628 (resize_window_check): Rename to window_resize_check.
18629 (resize_window_apply): Rename to window_resize_apply.
18630 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18631 (Fdelete_other_windows_internal, resize_frame_windows)
18632 (Fsplit_window_internal, Fdelete_window_internal)
18633 (grow_mini_window, shrink_mini_window)
18634 (Fresize_mini_window_internal): Fix callers accordingly.
18635
18636 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18637
18638 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18639 (emacs_fixed_set_min_size): Remove.
18640 (emacs_fixed_new): Take frame as argument.
18641
18642 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18643 (_EmacsFixedPrivate): Remove minwidth/height.
18644 Add struct frame *f.
18645 (emacs_fixed_init): Initialize priv->f.
18646 (get_parent_class, emacs_fixed_set_min_size): Remove.
18647 (emacs_fixed_new): Set priv->f to argument.
18648 (emacs_fixed_get_preferred_width)
18649 (emacs_fixed_get_preferred_height): Use min_width/height from
18650 frames size_hint to set minimum and natural (Bug#8919).
18651 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18652 and use min_width/height from frames size_hint to set
18653 min_width/height (Bug#8919).
18654
18655 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
18656 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18657 Fix indentation.
18658
18659 2011-06-26 Eli Zaretskii <eliz@gnu.org>
18660
18661 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18662 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18663 called at ZV.
18664
18665 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
18666
18667 * process.c (wait_reading_process_output): Bypass select if
18668 waiting for a cell while ignoring keyboard input, and input is
18669 pending. Suggested by Jan Djärv (Bug#8869).
18670
18671 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18672
18673 Use gnulib's dup2 module instead of rolling our own.
18674 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18675
18676 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18677
18678 * dispnew.c (scrolling_window): Before scrolling, turn off a
18679 mouse-highlight in the window being scrolled.
18680
18681 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
18682
18683 Move DEFSYM to lisp.h and use everywhere.
18684
18685 * character.h (DEFSYM): Move declaration...
18686 * lisp.h (DEFSYM): ...here.
18687
18688 * gnutls.c:
18689 * minibuf.c:
18690 * w32menu.c:
18691 * w32proc.c:
18692 * w32select.c: Don't include character.h.
18693
18694 * alloc.c (syms_of_alloc):
18695 * buffer.c (syms_of_buffer):
18696 * bytecode.c (syms_of_bytecode):
18697 * callint.c (syms_of_callint):
18698 * casefiddle.c (syms_of_casefiddle):
18699 * casetab.c (init_casetab_once):
18700 * category.c (init_category_once, syms_of_category):
18701 * ccl.c (syms_of_ccl):
18702 * cmds.c (syms_of_cmds):
18703 * composite.c (syms_of_composite):
18704 * dbusbind.c (syms_of_dbusbind):
18705 * dired.c (syms_of_dired):
18706 * dispnew.c (syms_of_display):
18707 * doc.c (syms_of_doc):
18708 * editfns.c (syms_of_editfns):
18709 * emacs.c (syms_of_emacs):
18710 * eval.c (syms_of_eval):
18711 * fileio.c (syms_of_fileio):
18712 * fns.c (syms_of_fns):
18713 * frame.c (syms_of_frame):
18714 * fringe.c (syms_of_fringe):
18715 * insdel.c (syms_of_insdel):
18716 * keymap.c (syms_of_keymap):
18717 * lread.c (init_obarray, syms_of_lread):
18718 * macros.c (syms_of_macros):
18719 * msdos.c (syms_of_msdos):
18720 * print.c (syms_of_print):
18721 * process.c (syms_of_process):
18722 * search.c (syms_of_search):
18723 * sound.c (syms_of_sound):
18724 * syntax.c (init_syntax_once, syms_of_syntax):
18725 * terminal.c (syms_of_terminal):
18726 * textprop.c (syms_of_textprop):
18727 * undo.c (syms_of_undo):
18728 * w32.c (globals_of_w32):
18729 * window.c (syms_of_window):
18730 * xdisp.c (syms_of_xdisp):
18731 * xfaces.c (syms_of_xfaces):
18732 * xfns.c (syms_of_xfns):
18733 * xmenu.c (syms_of_xmenu):
18734 * xsettings.c (syms_of_xsettings):
18735 * xterm.c (syms_of_xterm): Use DEFSYM.
18736
18737 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18738
18739 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
18740
18741 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18742
18743 Integer and buffer overflow fixes (Bug#8873).
18744
18745 * print.c (printchar, strout): Check for string overflow.
18746 (PRINTPREPARE, printchar, strout):
18747 Don't set size unless allocation succeeds.
18748
18749 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18750 for sizes. Check for string overflow more accurately.
18751 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18752
18753 * macros.c: Integer and buffer overflow fixes.
18754 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18755 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18756 Use ptrdiff_t, not int, for sizes.
18757 Don't increment bufsize until after realloc succeeds.
18758 Check for size-calculation overflow.
18759 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18760
18761 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18762
18763 * lread.c: Integer overflow fixes.
18764 (read_integer): Radix is now EMACS_INT, not int,
18765 to improve quality of diagnostics for out-of-range radices.
18766 Calculate buffer size correctly for out-of-range radices.
18767 (read1): Check for integer overflow in radices, and in
18768 read-circle numbers.
18769 (read_escape): Avoid int overflow.
18770 (Fload, openp, read_buffer_size, read1)
18771 (substitute_object_recurse, read_vector, read_list, map_obarray):
18772 Use ptrdiff_t, not int, for sizes.
18773 (read1): Use EMACS_INT, not int, for sizes.
18774 Check for size overflow.
18775
18776 * image.c (cache_image): Check for size arithmetic overflow.
18777
18778 * lread.c: Integer overflow issues.
18779 (saved_doc_string_size, saved_doc_string_length)
18780 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18781 Now ptrdiff_t, not int.
18782 (read1): Don't assume doc string length fits in int. Check for
18783 out-of-range doc string lengths.
18784 (read_list): Don't assume file position fits in int.
18785 (read_escape): Check for hex character overflow.
18786
18787 2011-06-22 Leo Liu <sdl.web@gmail.com>
18788
18789 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18790 Move to minibuffer.el.
18791
18792 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18793
18794 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
18795 The following patches are for when GLYPH_DEBUG && !XASSERT.
18796 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18797 * dispnew.c (flush_stdout):
18798 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18799 Mark as externally visible.
18800 * dispnew.c (check_window_matrix_pointers): Now static.
18801 * dispnew.c (window_to_frame_vpos):
18802 * xfns.c (unwind_create_frame):
18803 * xterm.c (x_check_font): Remove unused local.
18804 * scroll.c (CHECK_BOUNDS):
18805 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18806 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18807 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18808 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18809 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18810 Now static.
18811 (debug_method_add): Use va_list and vsprintf rather than relying
18812 on undefined behavior with wrong number of arguments.
18813 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18814 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18815 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18816 since we're not interested in debugging glyphs with old libraries.
18817 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18818 GCC 4.6.0's static checking.
18819
18820 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18821
18822 Integer overflow and signedness fixes (Bug#8873).
18823 A few related buffer overrun fixes, too.
18824
18825 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18826
18827 * dispextern.h (struct face.stipple):
18828 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18829 (x_bitmap_mask, x_allocate_bitmap_record)
18830 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18831 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18832 (x_create_bitmap_from_xpm_data):
18833 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18834 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18835 (.bitmaps_last):
18836 * xfaces.c (load_pixmap):
18837 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18838 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18839 (.bitmaps_last, struct x_output.icon_bitmap):
18840 Use ptrdiff_t, not int, for bitmap indexes.
18841 (x_allocate_bitmap_record): Check for size overflow.
18842 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18843
18844 Use ptrdiff_t, not int, for overlay counts.
18845 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18846 * editfns.c (overlays_around, get_pos_property):
18847 * textprop.c (get_char_property_and_overlay):
18848 * xdisp.c (next_overlay_change, note_mouse_highlight):
18849 * xfaces.c (face_at_buffer_position):
18850 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18851 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18852 (Fnext_overlay_change, Fprevious_overlay_change)
18853 (mouse_face_overlay_overlaps, Foverlays_in):
18854 Use ptrdiff_t, not int, for sizes.
18855 (overlays_at, overlays_in): Check for size-calculation overflow.
18856
18857 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18858
18859 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18860 (x_session_initialize): Do not assume string length fits in int.
18861
18862 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18863 This is unlikely, but can occur if DPI is outlandish.
18864
18865 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
18866 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18867
18868 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18869 * xrdb.c (magic_file_p, search_magic_path):
18870 Omit last arg SUFFIX; it was always 0. All callers changed.
18871 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18872
18873 * xfont.c (xfont_match): Avoid need for strlen.
18874
18875 * xfns.c: Don't assume strlen fits in int.
18876 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18877
18878 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18879 not unsigned long, as we prefer signed integers. All callers changed.
18880 Detect integer overflow in repeat count.
18881 (message_dolog): Don't assume print length fits in 39 bytes.
18882 (display_mode_element): Don't assume strlen fits in int.
18883
18884 * termcap.c: Don't assume sizes fit in int and never overflow.
18885 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18886 (gobble_line): Check for size-calculation overflow.
18887
18888 * minibuf.c (Fread_buffer):
18889 * lread.c (intern, intern_c_string):
18890 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18891 Don't assume string length fits in int.
18892
18893 * keyboard.c (parse_tool_bar_item):
18894 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18895
18896 * font.c: Don't assume string length fits in int.
18897 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18898 Use ptrdiff_t, not int.
18899 (font_intern_prop): Don't assume string length fits in int.
18900 Don't assume integer property fits in fixnum.
18901 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
18902
18903 * filelock.c: Fix some buffer overrun and integer overflow issues.
18904 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
18905 Reformulate so as not to need the command string.
18906 Invoke gzip -cd rather than gunzip, as it's more portable.
18907 (lock_info_type, lock_file_1, lock_file):
18908 Don't assume pid_t and time_t fit in unsigned long.
18909 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18910 (current_lock_owner): Prefer signed type for sizes.
18911 Use memcpy, not strncpy, where memcpy is what is really wanted.
18912 Don't assume (via atoi) that time_t and pid_t fit in int.
18913 Check for time_t and/or pid_t out of range, e.g., via a network share.
18914 Don't alloca where an auto var works fine.
18915
18916 * fileio.c: Fix some integer overflow issues.
18917 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18918 Don't assume string length fits in int.
18919 (directory_file_name): Don't assume string length fits in long.
18920 (make_temp_name): Don't assume pid fits in int, or that its print
18921 length is less than 20.
18922
18923 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18924
18925 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18926
18927 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18928
18929 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18930 We prefer signed integers, even for size calculations.
18931
18932 * emacs.c: Don't assume string length fits in 'int'.
18933 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18934 (main): Don't invoke strlen when not needed.
18935
18936 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18937 (XD_DEBUG_MESSAGE): Don't waste a byte.
18938
18939 * callproc.c (getenv_internal_1, getenv_internal)
18940 (Fgetenv_internal):
18941 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18942
18943 * lread.c (invalid_syntax): Omit length argument.
18944 All uses changed. This doesn't fix a bug, but it simplifies the
18945 code away from its former Hollerith-constant appearance, and it's
18946 one less 'int' to worry about when looking at integer-overflow issues.
18947 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
18948
18949 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18950 This didn't break anything, but it didn't help either.
18951 It's confusing to put a bogus integer in a place where the actual
18952 value does not matter.
18953 (LIST_END_P): Remove unused macro and its bogus comment.
18954 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
18955
18956 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18957 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18958 implementation.
18959 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18960 We prefer signed types, and the value cannot exceed the EMACS_INT
18961 range anyway (because otherwise the length would not be representable).
18962 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18963 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18964 This avoids a GCC warning when WIDE_EMACS_INT.
18965
18966 * indent.c (sane_tab_width): New function.
18967 (current_column, scan_for_column, Findent_to, position_indentation)
18968 (compute_motion): Use it. This is just for clarity.
18969 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
18970
18971 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
18972
18973 * lisp.h (lint_assume): New macro.
18974 * composite.c (composition_gstring_put_cache):
18975 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18976
18977 * editfns.c, insdel.c:
18978 Omit unnecessary forward decls, to simplify future changes.
18979
18980 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18981
18982 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18983
18984 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
18985 Use much-faster test for byte-length change.
18986 Don't assume string byte-length fits in 'int'.
18987 Check that character arg fits in 'int'.
18988 (mapcar1): Declare byte as byte, for clarity.
18989
18990 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18991
18992 * fns.c (concat): Catch string overflow earlier.
18993 Do not rely on integer wraparound.
18994
18995 * dispextern.h (struct it.overlay_strings_charpos)
18996 (struct it.selective): Now EMACS_INT, not int.
18997 * xdisp.c (forward_to_next_line_start)
18998 (back_to_previous_visible_line_start)
18999 (reseat_at_next_visible_line_start, next_element_from_buffer):
19000 Don't arbitrarily truncate the value of 'selective' to int.
19001
19002 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19003
19004 * composite.c: Don't truncate sizes to 'int'.
19005 (composition_gstring_p, composition_reseat_it)
19006 (composition_adjust_point): Use EMACS_INT, not int.
19007 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19008 not EMACS_UINT, for indexes.
19009
19010 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19011
19012 * buffer.c: Include <verify.h>.
19013 (struct sortvec.priority, struct sortstr.priority):
19014 Now EMACS_INT, not int.
19015 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19016 (struct sortstr.size, record_overlay_string)
19017 (struct sortstrlist.size, struct sortlist.used):
19018 Don't truncate size to int.
19019 (record_overlay_string): Check for size-calculation overflow.
19020 (init_buffer_once): Check at compile-time, not run-time.
19021
19022 2011-06-22 Jim Meyering <meyering@redhat.com>
19023
19024 Don't leak an XBM-image-sized buffer
19025 * image.c (xbm_load): Free the image buffer after using it.
19026
19027 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19028
19029 Port to Sun C.
19030 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19031 that Sun C diagnosed.
19032 * fns.c (secure_hash): Fix pointer signedness issue.
19033 * intervals.c (static_offset_intervals): New function.
19034 (offset_intervals): Use it.
19035
19036 2011-06-21 Leo Liu <sdl.web@gmail.com>
19037
19038 * deps.mk (fns.o):
19039 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19040 sha512.h.
19041
19042 * fns.c (secure_hash): Rename from crypto_hash_function and change
19043 the first arg to accept symbols.
19044 (Fsecure_hash): New primitive.
19045 (syms_of_fns): New symbols.
19046
19047 2011-06-20 Deniz Dogan <deniz@dogan.se>
19048
19049 * process.c (Fset_process_buffer): Clarify return value in
19050 docstring.
19051
19052 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19053
19054 * dispnew.c (add_window_display_history): Use BVAR.
19055
19056 * xdisp.c (debug_method_add): Use BVAR.
19057 (check_window_end, dump_glyph_matrix, dump_glyph)
19058 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19059
19060 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19061 Likewise.
19062
19063 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19064 check till after the cache is created in init_frame_faces.
19065
19066 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19067
19068 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19069
19070 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19071
19072 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19073 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19074 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19075
19076 Improve buffer-overflow checking (Bug#8873).
19077 * fileio.c (Finsert_file_contents):
19078 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19079 Remove the old (too-loose) buffer overflow checks.
19080 They weren't needed, since make_gap checks for buffer overflow.
19081 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19082 The old code merely checked for Emacs fixnum overflow, and relied
19083 on undefined (wraparound) behavior. The new code avoids undefined
19084 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19085
19086 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19087 Tune. Don't use wider integers than needed. Don't use alloca.
19088 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19089
19090 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19091
19092 * insdel.c, lisp.h (buffer_overflow): New function.
19093 (insert_from_buffer_1, replace_range, replace_range_2):
19094 * insdel.c (make_gap_larger):
19095 * editfns.c (Finsert_char):
19096 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19097
19098 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19099
19100 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19101
19102 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19103
19104 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19105 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19106
19107 * fileio.c: Don't assume EMACS_INT fits in off_t.
19108 (emacs_lseek): New static function.
19109 (Finsert_file_contents, Fwrite_region): Use it.
19110 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19111
19112 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19113
19114 * fns.c: Don't overflow int when computing a list length.
19115 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19116 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19117 truncation on 64-bit hosts. Check for QUIT every
19118 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19119 faster and is responsive enough.
19120 (Flength): Report an error instead of overflowing an integer.
19121 (Fsafe_length): Return a float if the value is not representable
19122 as a fixnum. This shouldn't happen except in contrived situations.
19123 (Fnthcdr, Fsort): Don't assume list length fits in int.
19124 (Fcopy_sequence): Don't assume vector length fits in int.
19125
19126 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19127 (header_size, word_size): New constants.
19128 (allocate_vectorlike): Don't check size overflow here.
19129 (allocate_vector): Check it here instead, since this is the only
19130 caller of allocate_vectorlike that could cause overflow.
19131 Check that the new vector's length is representable as a fixnum.
19132
19133 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19134 The previous code was bogus. For example, next_almost_prime (32)
19135 returned 39, which is undesirable as it is a multiple of 3; and
19136 next_almost_prime (24) returned 25, which is a multiple of 5 so
19137 why was the code bothering to check for multiples of 7?
19138
19139 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19140
19141 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19142
19143 Variadic C functions now count arguments with ptrdiff_t.
19144 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19145 Back then I didn't know that the Emacs coding style prefers signed int.
19146 Also, in the meantime I found a few more instances where arguments
19147 were being counted with int, which may truncate counts on 64-bit
19148 machines, or EMACS_INT, which may be unnecessarily wide.
19149 * lisp.h (struct Lisp_Subr.function.aMANY)
19150 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19151 Arg counts are now ptrdiff_t, not size_t.
19152 All variadic functions and their callers changed accordingly.
19153 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19154 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19155 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19156 * callint.c (Fcall_interactively): Check arg count for overflow,
19157 to avoid potential buffer overrun. Use signed char, not 'int',
19158 for 'varies' array, so that we needn't bother to check its size
19159 calculation for overflow.
19160 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19161 * eval.c (apply_lambda):
19162 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19163 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19164 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19165
19166 * callint.c (Fcall_interactively): Don't use index var as event count.
19167
19168 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19169 * mem-limits.h (SIZE): Remove; no longer used.
19170
19171 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
19172
19173 Remove unnecessary casts.
19174 * xterm.c (x_term_init):
19175 * xfns.c (x_set_border_pixel):
19176 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19177 These aren't needed now that we assume ANSI C.
19178
19179 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19180 It's more likely to cause problems (due to unsigned overflow)
19181 than to cure them.
19182
19183 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19184
19185 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19186
19187 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19188
19189 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19190
19191 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19192
19193 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19194
19195 GLYPH_CODE_FACE returns EMACS_INT, not int.
19196 * dispextern.h (merge_faces):
19197 * xfaces.c (merge_faces):
19198 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19199 Don't assume EMACS_INT fits in int.
19200
19201 * character.h (CHAR_VALID_P): Remove unused parameter.
19202 * fontset.c, lisp.h, xdisp.c: All uses changed.
19203
19204 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19205
19206 * fns.c (concat): Minor tuning based on overflow analysis.
19207 This doesn't fix any bugs. Use int to hold character, instead
19208 of constantly refetching from Emacs object. Use XFASTINT, not
19209 XINT, for value known to be a character. Don't bother comparing
19210 a single byte to 0400, as it's always less.
19211
19212 * floatfns.c (Fexpt):
19213 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19214
19215 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19216 for characters.
19217
19218 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19219
19220 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19221 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19222 incorrectly succeed when S was a string, because 4294967386 was
19223 truncated before it was used.
19224
19225 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19226 Otherwise, an out-of-range integer could cause undefined behavior
19227 on a 64-bit host.
19228
19229 * composite.c: Use int, not EMACS_INT, for characters.
19230 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19231 EMACS_INT, for values that are known to be in character range.
19232 This doesn't fix any bugs but is the usual style inside Emacs and
19233 may generate better code on 32-bit machines.
19234
19235 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19236 This is for reasons similar to the recent CHAR_STRING fix.
19237 * charset.c (Fencode_char): Check that character arg is actually
19238 a character. Pass an int to ENCODE_CHAR.
19239 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19240 wider than 'int', as a compile-time check to prevent future regressions
19241 in this area.
19242
19243 * character.c (char_string): Remove unnecessary casts.
19244
19245 Make sure a 64-bit char is never passed to CHAR_STRING.
19246 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19247 by silently ignoring the top 32 bits, allowing some values
19248 that were far too large to be valid characters.
19249 * character.h: Include <verify.h>.
19250 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19251 arguments are no wider than unsigned, as a compile-time check
19252 to prevent future regressions in this area.
19253 * data.c (Faset):
19254 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
19255 (Fsubst_char_in_region):
19256 * fns.c (concat):
19257 * xdisp.c (decode_mode_spec_coding):
19258 Adjust to CHAR_STRING's new requirement.
19259 * editfns.c (Finsert_char, Fsubst_char_in_region):
19260 * fns.c (concat): Check that character args are actually
19261 characters. Without this test, these functions did the wrong
19262 thing with wildly out-of-range values on 64-bit hosts.
19263
19264 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19265 These casts should not be needed on 32-bit hosts, either.
19266 * keyboard.c (read_char):
19267 * lread.c (Fload): Remove casts to unsigned.
19268
19269 * lisp.h (UNSIGNED_CMP): New macro.
19270 This fixes comparison bugs on 64-bit hosts.
19271 (ASCII_CHAR_P): Use it.
19272 * casefiddle.c (casify_object):
19273 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
19274 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19275 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19276 * dispextern.h (FACE_FROM_ID):
19277 * keyboard.c (read_char): Use UNSIGNED_CMP.
19278
19279 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19280 not to EMACS_INT, to avoid GCC warning.
19281
19282 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19283
19284 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19285 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19286 isn't needed on 32-bit machines.
19287
19288 * buffer.c (Fgenerate_new_buffer_name):
19289 Use EMACS_INT for count, not int.
19290 (advance_to_char_boundary): Return EMACS_INT, not int.
19291
19292 * data.c (Qcompiled_function): Now static.
19293
19294 * window.c (window_body_lines): Now static.
19295
19296 * image.c (gif_load): Rename local to avoid shadowing.
19297
19298 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19299 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19300 * alloc.c (make_save_value): Integer argument is now of type
19301 ptrdiff_t, not int.
19302 (mark_object): Use ptrdiff_t, not int.
19303 * lisp.h (pD): New macro.
19304 * print.c (print_object): Use it.
19305
19306 * alloc.c: Use EMACS_INT, not int, to count objects.
19307 (total_conses, total_markers, total_symbols, total_vector_size)
19308 (total_free_conses, total_free_markers, total_free_symbols)
19309 (total_free_floats, total_floats, total_free_intervals)
19310 (total_intervals, total_strings, total_free_strings):
19311 Now EMACS_INT, not int. All uses changed.
19312 (Fgarbage_collect): Compute overall total using a double, so that
19313 integer overflow is less likely to be a problem. Check for overflow
19314 when converting back to an integer.
19315 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19316 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19317 These were 'int' variables that could overflow on 64-bit hosts;
19318 they were never used, so remove them instead of repairing them.
19319 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
19320 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19321 Previously, this ceilinged at INT_MAX, but that doesn't work on
19322 64-bit machines.
19323 (allocate_pseudovector): Don't use EMACS_INT when int would do.
19324
19325 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
19326 (allocate_vectorlike): Check for ptrdiff_t overflow.
19327 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19328 when a (possibly-narrower) signed value would do just as well.
19329 We prefer using signed arithmetic, to avoid comparison confusion.
19330
19331 * alloc.c: Catch some string size overflows that we were missing.
19332 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19333 for convenience in STRING_BYTES_MAX.
19334 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19335 The definition here is exact; the one in lisp.h was approximate.
19336 (allocate_string_data): Check for string overflow. This catches
19337 some instances we weren't catching before. Also, it catches
19338 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19339 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19340 and ptrdiff_t and EMACS_INT are both 64 bits.
19341
19342 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19343 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
19344 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
19345
19346 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19347
19348 * alloc.c (Fmake_string): Check for out-of-range init.
19349
19350 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19351
19352 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19353
19354 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19355
19356 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19357 xg_get_default_scrollbar_width.
19358
19359 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19360 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19361 (style_changed_cb): Call update_theme_scrollbar_width and call
19362 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19363 all frames (Bug#8505).
19364 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19365 Call gtk_window_set_resizable if HAVE_GTK3.
19366 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19367 and height if HAVE_GTK3 (Bug#8505).
19368 (scroll_bar_width_for_theme): New variable.
19369 (update_theme_scrollbar_width): New function.
19370 (xg_get_default_scrollbar_width): Move code to
19371 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19372 (xg_initialize): Call update_theme_scrollbar_width.
19373
19374 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19375
19376 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19377
19378 2011-06-12 Martin Rudalics <rudalics@gmx.at>
19379
19380 * frame.c (make_frame): Call other_buffer_safely instead of
19381 other_buffer.
19382
19383 * window.c (temp_output_buffer_show): Call display_buffer with
19384 second argument Vtemp_buffer_show_specifiers and reset latter
19385 immediately after the call.
19386 (Vtemp_buffer_show_specifiers): New variable.
19387 (auto_window_vscroll_p, next_screen_context_lines)
19388 (Vscroll_preserve_screen_position): Remove leading asterisks from
19389 doc-strings.
19390
19391 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
19392
19393 Fix minor problems found by GCC 4.6.0 static checking.
19394 * buffer.c (Qclone_number): Remove for now, as it's unused.
19395 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19396 (record_buffer): Remove unused local.
19397 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19398 (set_frame_buffer_list): Remove; unused.
19399 * frame.h (other_visible_frames): Remove decl.
19400 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19401 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19402 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19403 if HAVE_GPM.
19404 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19405 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19406 Define only if HAVE_GPM.
19407 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19408 (update_hints_inhibit): Remove; never set. All uses removed.
19409 * widgetprv.h (emacsFrameClassRec): Remove decl.
19410 * window.c (delete_deletable_window): Now returns void, since it
19411 wasn't returning anything.
19412 (compare_window_configurations): Remove unused locals.
19413 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19414 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
19415 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19416 the same widths as pointers. This follows up on the 2011-05-06 patch.
19417 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19418 * xterm.h: Likewise.
19419 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19420
19421 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
19422
19423 * makefile.w32-in: Update dependencies.
19424 (LISP_H): Add lib/intprops.h.
19425
19426 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19427
19428 * image.c (gif_load): Add animation frame delay to the metadata.
19429 (syms_of_image): Use DEFSYM. New symbol `delay'.
19430
19431 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19432
19433 * window.c (delete_deletable_window): Re-add.
19434 (Fset_window_configuration): Rewrite to handle dead buffers and
19435 consequently deletable windows.
19436 (window_tree, Fwindow_tree): Remove. Supply functionality in
19437 window.el.
19438 (compare_window_configurations): Simplify code.
19439
19440 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19441
19442 * image.c (imagemagick_load_image): Fix type mismatch.
19443 (Fimagemagick_types): Likewise.
19444
19445 * window.h (replace_buffer_in_windows): Declare.
19446
19447 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19448
19449 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19450 Qclone_number. Remove external declaration of Qdelete_window.
19451 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19452 code.
19453 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19454 Run Qbuffer_list_update_hook if allowed.
19455 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19456 buffer list implementation.
19457 (other_buffer_safely): New function.
19458 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19459 calls to replace_buffer_in_windows and
19460 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19461 if allowed.
19462 (record_buffer): Inhibit quitting and rewrite using quittable
19463 functions. Run Qbuffer_list_update_hook if allowed.
19464 (Frecord_buffer, Funrecord_buffer): New functions.
19465 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19466 Move switch-to-buffer to window.el.
19467 (bury-buffer): Move to window.el.
19468 (Vbuffer_list_update_hook): New variable.
19469
19470 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19471 section.
19472
19473 * window.h (resize_frame_windows): Move up in code.
19474 (Fwindow_frame): Remove EXFUN.
19475 (replace_buffer_in_all_windows): Remove prototype.
19476 (replace_buffer_in_windows_safely): Add prototype.
19477
19478 * window.c: Declare Qdelete_window static again. Move down
19479 declaration of select_count.
19480 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19481 (Fother_window): Move to window.el.
19482 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19483 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19484 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19485 window.el.
19486 (replace_buffer_in_windows): Implement by calling
19487 Qreplace_buffer_in_windows.
19488 (replace_buffer_in_all_windows): Remove with some functionality
19489 moved into replace_buffer_in_windows_safely.
19490 (replace_buffer_in_windows_safely): New function.
19491 (select_window_norecord, select_frame_norecord): Move in front
19492 of run_window_configuration_change_hook. Remove now obsolete
19493 declarations.
19494 (Fset_window_buffer): Rewrite doc-string.
19495 Call Qrecord_window_buffer.
19496 (keys_of_window): Move binding for other-window to window.el.
19497
19498 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19499
19500 * dispextern.h (struct image): Replace data member, whose int_val
19501 and ptr_val fields were not used by anything, with a single
19502 lisp_val object.
19503
19504 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19505 (gif_clear_image, gif_load, imagemagick_load_image)
19506 (gs_clear_image, gs_load): Callers changed.
19507
19508 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19509
19510 * buffer.h: Include <time.h>, for time_t.
19511 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19512
19513 Fix minor problems found by static checking.
19514
19515 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19516
19517 Make identifiers static if they are not used in other modules.
19518 * data.c (Qcompiled_function, Qframe, Qvector):
19519 * image.c (QimageMagick, Qsvg):
19520 * minibuf.c (Qmetadata):
19521 * window.c (resize_window_check, resize_root_window): Now static.
19522 * window.h (resize_window_check, resize_root_window): Remove decls.
19523
19524 * window.c (window_deletion_count, delete_deletable_window):
19525 Remove; unused.
19526 (window_body_lines): Now static.
19527 (Fdelete_other_windows_internal): Mark vars as initialized.
19528 Make sure 'resize_failed' is initialized.
19529 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19530 (resize_window_apply): Remove unused local.
19531 * window.h (delete_deletable_window): Remove decl.
19532
19533 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
19534 (imagemagick_load_image): Fix pointer signedness problem by changing
19535 last arg from unsigned char * to char *. All uses changed.
19536 Also, fix a local for similar reasons.
19537 Remove unused locals. Remove locals to avoid shadowing.
19538 (fn_rsvg_handle_free): Remove; unused.
19539 (svg_load, svg_load_image): Fix pointer signedness problem.
19540 (imagemagick_load_image): Don't use garbage pointer image_wand.
19541
19542 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19543
19544 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
19545
19546 * image.c (gif_load): Fix omitted cast error introduced by
19547 2011-06-06 change.
19548
19549 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19550
19551 * window.h (resize_proportionally, orig_total_lines)
19552 (orig_top_line): Remove from window structure.
19553 (set_window_height, set_window_width, change_window_heights)
19554 (Fdelete_window): Remove prototypes.
19555 (resize_frame_windows): Remove duplicate declaration.
19556
19557 2011-06-10 Eli Zaretskii <eliz@gnu.org>
19558
19559 * window.h (resize_frame_windows, resize_window_check)
19560 (delete_deletable_window, resize_root_window)
19561 (resize_frame_windows): Declare prototypes.
19562
19563 * window.c (resize_window_apply): Make definition be "static" to
19564 match the prototype.
19565
19566 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19567
19568 * window.c: Remove declarations of Qwindow_size_fixed,
19569 window_min_size_1, window_min_size_2, window_min_size,
19570 size_window, window_fixed_size_p, enlarge_window, delete_window.
19571 Remove static from declaration of Qdelete_window, it's
19572 temporarily needed by Fbury_buffer.
19573 (replace_window): Don't assign orig_top_line and
19574 orig_total_lines.
19575 (Fdelete_window, delete_window): Remove. Window deletion is
19576 handled by window.el.
19577 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19578 Replace Fdelete_window calls with calls to Qdelete_window.
19579 (Fdelete_other_windows): Remove. Deleting other windows is
19580 handled by window.el.
19581 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19582 handled in window.el.
19583 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19584 Window minimum sizes are handled in window.el.
19585 (shrink_windows, size_window, set_window_height)
19586 (set_window_width, change_window_heights, window_height)
19587 (window_width, CURBEG, CURSIZE, enlarge_window)
19588 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19589 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19590 handled in window.el.
19591 (make_dummy_parent): Rename to make_parent_window and give it a
19592 second argument horflag.
19593 (make_window): Don't set resize_proportionally any more.
19594 (Fsplit_window): Remove. Windows are split in window.el.
19595 (save_restore_action, save_restore_orig_size)
19596 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19597 Resize mini windows in window.el.
19598 (grow_mini_window, shrink_mini_window): Implement by calling
19599 Qresize_root_window_vertically, resize_window_check and
19600 resize_window_apply.
19601 (saved_window, Fset_window_configuration, save_window_save):
19602 Do not handle orig_top_line, orig_total_lines, and
19603 resize_proportionally.
19604 (window_min_height, window_min_width): Move to window.el.
19605 (keys_of_window): Move bindings for delete-other-windows,
19606 split-window, delete-window and enlarge-window to window.el.
19607
19608 * buffer.c: Temporarily extern Qdelete_window.
19609 (Fbury_buffer): Temporarily call Qdelete_window instead of
19610 Fdelete_window (Fbury_buffer will move to window.el soon).
19611
19612 * frame.c (set_menu_bar_lines_1): Remove code handling
19613 orig_top_line and orig_total_lines.
19614
19615 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19616 set_window_height but set heights directly.
19617 (change_frame_size_1): Use resize_frame_windows.
19618
19619 * xdisp.c (init_xdisp): Don't use set_window_height but set
19620 heights directly.
19621
19622 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19623 Use resize_frame_windows instead of change_window_heights and run
19624 run_window_configuration_change_hook.
19625
19626 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19627 instead of change_window_heights and run
19628 run_window_configuration_change_hook.
19629
19630 2011-06-09 Martin Rudalics <rudalics@gmx.at>
19631
19632 * window.c (replace_window): Rename second argument REPLACEMENT to
19633 NEW. New third argument SETFLAG. Rewrite.
19634 (delete_window, make_dummy_parent): Call replace_window with
19635 third argument 1.
19636 (window_list_1): Move down in code.
19637 (run_window_configuration_change_hook): Move set_buffer part
19638 before select_frame_norecord part in order to unwind correctly.
19639 Rename count1 to count.
19640 (recombine_windows, delete_deletable_window, resize_root_window)
19641 (Fdelete_other_windows_internal)
19642 (Frun_window_configuration_change_hook, make_parent_window)
19643 (resize_window_check, resize_window_apply, Fresize_window_apply)
19644 (resize_frame_windows, Fsplit_window_internal)
19645 (Fdelete_window_internal, Fresize_mini_window_internal):
19646 New functions.
19647 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19648
19649 2011-06-08 Martin Rudalics <rudalics@gmx.at>
19650
19651 * window.h (window): Add some new members to window structure -
19652 normal_lines, normal_cols, new_total, new_normal, clone_number,
19653 splits, nest, prev_buffers, next_buffers.
19654 (WINDOW_TOTAL_SIZE): Move here from window.c.
19655 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
19656
19657 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19658 Remove.
19659 (make_dummy_parent): Set new members of windows structure.
19660 (make_window): Move down in code. Handle new members of window
19661 structure.
19662 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19663 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19664 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19665 (Fset_window_prev_buffers, Fwindow_next_buffers)
19666 (Fset_window_next_buffers, Fset_window_clone_number):
19667 New functions.
19668 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19669 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19670 Doc-string fixes.
19671 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19672 Argument WINDOW can be now internal window too.
19673 (Fwindow_use_time): Move up in code.
19674 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19675 Rewrite doc-string.
19676 (Fset_window_configuration, saved_window)
19677 (Fcurrent_window_configuration, save_window_save): Handle new
19678 members of window structure.
19679 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19680 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19681 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19682 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19683 Qget_mru_window, Qresize_root_window,
19684 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19685 Qauto_buffer_name; staticpro them.
19686
19687 2011-06-07 Martin Rudalics <rudalics@gmx.at>
19688
19689 * window.c (Fwindow_total_size, Fwindow_left_column)
19690 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19691 (Fwindow_list_1): New functions.
19692 (window_box_text_cols): Replace with window_body_cols.
19693 (Fwindow_width, Fscroll_left, Fscroll_right):
19694 Use window_body_cols instead of window_box_text_cols.
19695 (delete_window, Fset_window_configuration):
19696 Call delete_all_subwindows with window as argument.
19697 (delete_all_subwindows): Take a window as argument and not a
19698 structure. Rewrite.
19699 (window_loop): Remove handling of GET_LRU_WINDOW and
19700 GET_LARGEST_WINDOW.
19701 (Fget_lru_window, Fget_largest_window): Move to window.el.
19702
19703 * window.h: Extern window_body_cols instead of
19704 window_box_text_cols. delete_all_subwindows now takes a
19705 Lisp_Object as argument.
19706
19707 * indent.c (compute_motion, Fcompute_motion):
19708 Use window_body_cols instead of window_box_text_cols.
19709
19710 * frame.c (delete_frame): Call delete_all_subwindows with root
19711 window as argument.
19712
19713 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19714
19715 * fns.c (Fputhash): Document return value.
19716
19717 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
19718
19719 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19720
19721 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19722
19723 Cons<->int and similar integer overflow fixes (Bug#8794).
19724
19725 Check for overflow when converting integer to cons and back.
19726 * charset.c (Fdefine_charset_internal, Fdecode_char):
19727 Use cons_to_unsigned to catch overflow.
19728 (Fencode_char): Use INTEGER_TO_CONS.
19729 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19730 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19731 * data.c (long_to_cons, cons_to_long): Remove.
19732 (cons_to_unsigned, cons_to_signed): New functions.
19733 These signal an error for invalid or out-of-range values.
19734 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19735 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19736 * font.c (Ffont_variation_glyphs):
19737 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19738 * lisp.h: Include <intprops.h>.
19739 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19740 (cons_to_signed, cons_to_unsigned): New decls.
19741 (long_to_cons, cons_to_long): Remove decls.
19742 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19743 (Fprimitive_undo): Use CONS_TO_INTEGER.
19744 * xfns.c (Fx_window_property): Likewise.
19745 * xselect.c: Include <limits.h>.
19746 (x_own_selection, selection_data_to_lisp_data):
19747 Use INTEGER_TO_CONS.
19748 (x_handle_selection_request, x_handle_selection_clear)
19749 (x_get_foreign_selection, Fx_disown_selection_internal)
19750 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19751 (lisp_data_to_selection_data): Use cons_to_unsigned.
19752 (x_fill_property_data): Use cons_to_signed.
19753 Report values out of range.
19754
19755 Check for buffer and string overflow more precisely.
19756 * buffer.h (BUF_BYTES_MAX): New macro.
19757 * lisp.h (STRING_BYTES_MAX): New macro.
19758 * alloc.c (Fmake_string):
19759 * character.c (string_escape_byte8):
19760 * coding.c (coding_alloc_by_realloc):
19761 * doprnt.c (doprnt):
19762 * editfns.c (Fformat):
19763 * eval.c (verror):
19764 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19765 since they may not be the same number.
19766 * editfns.c (Finsert_char):
19767 * fileio.c (Finsert_file_contents):
19768 Likewise for BUF_BYTES_MAX.
19769
19770 * image.c: Use ptrdiff_t, not int, for sizes.
19771 (slurp_file): Switch from int to ptrdiff_t.
19772 All uses changed.
19773 (slurp_file): Check that file size fits in both size_t (for
19774 malloc) and ptrdiff_t (for sanity and safety).
19775
19776 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19777 if b->modtime has its maximal value.
19778
19779 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19780
19781 Don't assume time_t can fit into int.
19782 * buffer.h (struct buffer.modtime): Now time_t, not int.
19783 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19784 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19785
19786 Minor fixes for signed vs unsigned integers.
19787 * character.h (MAYBE_UNIFY_CHAR):
19788 * charset.c (maybe_unify_char):
19789 * keyboard.c (read_char, reorder_modifiers):
19790 XINT -> XFASTINT, since the integer must be nonnegative.
19791 * ftfont.c (ftfont_spec_pattern):
19792 * keymap.c (access_keymap, silly_event_symbol_error):
19793 XUINT -> XFASTINT, since the integer must be nonnegative.
19794 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19795 since it makes no difference and we prefer signed.
19796 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19797 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19798 nonnegative.
19799
19800 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19801
19802 * window.h (Fwindow_frame): Declare.
19803
19804 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19805
19806 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19807 (SPARE_MEMORY): Always define.
19808 (LARGE_REQUEST): Remove.
19809 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19810
19811 2011-06-06 Martin Rudalics <rudalics@gmx.at>
19812
19813 * lisp.h: Move EXFUNS for Fframe_root_window,
19814 Fframe_first_window and Fset_frame_selected_window to window.h.
19815
19816 * window.h: Move EXFUNS for Fframe_root_window,
19817 Fframe_first_window and Fset_frame_selected_window here from
19818 lisp.h.
19819
19820 * frame.c (Fwindow_frame, Fframe_first_window)
19821 (Fframe_root_window, Fframe_selected_window)
19822 (Fset_frame_selected_window): Move to window.c.
19823 (Factive_minibuffer_window): Move to minibuf.c.
19824 (Fother_visible_frames_p): New function.
19825
19826 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19827
19828 * window.c (decode_window, decode_any_window): Move up in code.
19829 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19830 (inhibit_frame_unsplittable): Remove unused variable.
19831 (Fwindow_buffer): Move up and rewrite doc-string.
19832 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19833 (Fwindow_prev): New functions.
19834 (Fwindow_frame): Move here from frame.c. Accept any window as
19835 argument.
19836 (Fframe_root_window, Fframe_first_window)
19837 (Fframe_selected_window): Move here from frame.c. Accept frame
19838 or arbitrary window as argument. Update doc-strings.
19839 (Fminibuffer_window): Move up in code.
19840 (Fwindow_minibuffer_p): Move up in code and simplify.
19841 (Fset_frame_selected_window): Move here from frame.c.
19842 Marginal rewrite.
19843 (Fselected_window, select_window, Fselect_window): Move up in
19844 code. Minor doc-string fixes.
19845
19846 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19847
19848 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19849 Do not assume that spare memory exists; that assumption is valid
19850 only if SYSTEM_MALLOC.
19851 (LARGE_REQUEST): New macro, so that the issue of large requests
19852 is separated from the issue of spare memory.
19853
19854 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19855
19856 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19857 format. (Bug#8806)
19858
19859 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19860
19861 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19862 before statements.
19863
19864 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19865
19866 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19867
19868 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19869
19870 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19871 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19872
19873 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
19874
19875 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19876
19877 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
19878
19879 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19880 (x_clipboard_manager_save): Add return value.
19881 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19882 New error handlers.
19883 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19884 Obey Vx_select_enable_clipboard_manager. Catch errors in
19885 x_clipboard_manager_save (Bug#8779).
19886 (Vx_select_enable_clipboard_manager): New variable.
19887 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
19888
19889 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
19890
19891 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19892
19893 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19894
19895 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19896 in the current matrix if keep_current_p is non-zero.
19897
19898 2011-06-04 Eli Zaretskii <eliz@gnu.org>
19899
19900 * bidi.c (bidi_level_of_next_char): Fix last change.
19901
19902 2011-06-03 Eli Zaretskii <eliz@gnu.org>
19903
19904 Support bidi reordering of text covered by display properties.
19905
19906 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19907 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19908 (bidi_cache_search, bidi_cache_iterator_state)
19909 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
19910 (bidi_level_of_next_char, bidi_move_to_visually_next):
19911 Support character positions inside a run of characters covered by a
19912 display string.
19913 (bidi_paragraph_init, bidi_resolve_explicit_1)
19914 (bidi_level_of_next_char): Call bidi_fetch_char and
19915 bidi_fetch_char_advance instead of FETCH_CHAR and
19916 FETCH_CHAR_ADVANCE.
19917 (bidi_init_it): Initialize new members.
19918 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19919 definitions.
19920 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19921 instead of using explicit *_CHAR codes.
19922 (bidi_resolve_explicit, bidi_resolve_weak):
19923 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
19924 bidirectional text is supported only in multibyte buffers.
19925 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19926 it to initialize the frame_window_p member of struct bidi_it.
19927 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19928 (bidi_resolve_explicit, bidi_resolve_weak)
19929 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19930 bidi_it->nchars is non-positive.
19931 (bidi_level_of_next_char): Don't try to lookup the cache for the
19932 next/previous character if nothing is cached there yet, or if we
19933 were just reseat()'ed to a new position.
19934
19935 * xdisp.c (set_cursor_from_row): Set start and stop points
19936 according to the row's direction when priming the loop that looks
19937 for the glyph on which to display cursor.
19938 (single_display_spec_intangible_p): Function deleted.
19939 (display_prop_intangible_p): Reimplement to call
19940 handle_display_spec instead of single_display_spec_intangible_p.
19941 Accept 3 additional arguments needed by handle_display_spec.
19942 This fixes incorrect cursor motion across display property with complex
19943 values: lists, `(when COND...)' forms, etc.
19944 (single_display_spec_string_p): Support property values that are
19945 lists with the argument STRING its top-level element.
19946 (display_prop_string_p): Fix the condition for processing a
19947 property that is a list to be consistent with handle_display_spec.
19948 (handle_display_spec): New function, refactored from the
19949 last portion of handle_display_prop.
19950 (compute_display_string_pos): Accept additional argument
19951 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19952 value of a `display' property is a "replacing spec".
19953 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19954 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19955 the display property, but just return a value indicating whether
19956 the display property will replace the characters it covers.
19957 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19958 frame_window_p members of struct bidi_it.
19959 (compute_display_string_pos, compute_display_string_end):
19960 New functions.
19961 (push_it): Accept second argument POSITION, where pop_it should
19962 jump to continue iteration.
19963 (reseat_1): Initialize bidi_it.disp_pos.
19964
19965 * keyboard.c (adjust_point_for_property): Adjust the call to
19966 display_prop_intangible_p to its new signature.
19967
19968 * dispextern.h (struct bidi_it): New member frame_window_p.
19969 (bidi_init_it): Update prototypes.
19970 (display_prop_intangible_p): Update prototype.
19971 (compute_display_string_pos, compute_display_string_end):
19972 Declare prototypes.
19973 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19974 EMACS_INT.
19975
19976 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
19977
19978 Malloc failure behavior now depends on size of allocation.
19979 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19980 * lisp.h: Change signatures accordingly.
19981 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19982 All callers changed. (Bug#8762)
19983
19984 * gnutls.c: Use Emacs's memory allocators.
19985 Without this change, the gnutls library would invoke malloc etc.
19986 directly, which causes problems on non-SYNC_INPUT hosts, and which
19987 runs afoul of improving memory_full behavior. (Bug#8761)
19988 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19989 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19990 xfree instead of the default malloc, realloc, free.
19991 (Fgnutls_boot): No need to check for memory allocation failure,
19992 since xmalloc does that for us.
19993
19994 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
19995 * category.c (hash_get_category_set):
19996 * ccl.c (ccl_driver):
19997 * charset.c (Fdefine_charset_internal):
19998 * charset.h (struct charset.hash_index):
19999 * composite.c (get_composition_id, gstring_lookup_cache)
20000 (composition_gstring_put_cache):
20001 * composite.h (struct composition.hash_index):
20002 * dispextern.h (struct image.hash):
20003 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20004 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20005 (hashfn_equal, hashfn_user_defined, make_hash_table)
20006 (maybe_resize_hash_table, hash_lookup, hash_put)
20007 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20008 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20009 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20010 * image.c (make_image, search_image_cache, lookup_image)
20011 (xpm_put_color_table_h):
20012 * lisp.h (struct Lisp_Hash_Table):
20013 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20014 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20015 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20016 * alloc.c (allocate_vectorlike):
20017 Check for overflow in vector size calculations.
20018 * ccl.c (ccl_driver):
20019 Check for overflow when converting EMACS_INT to int.
20020 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20021 need to be updated by these changes.
20022 * fns.c (make_hash_table, maybe_resize_hash_table):
20023 Check for integer overflow with large hash tables.
20024 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20025 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20026 (SXHASH_REDUCE): New macro.
20027 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20028 Use it instead of discarding useful hash info with large hash values.
20029 (sxhash_float): New function.
20030 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20031 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20032 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20033 Rewrite to use FIXNUM_BITS, as this simplifies things.
20034 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20035 Adjust signatures to match updated version of code.
20036 (consing_since_gc): Now EMACS_INT, since a single hash table can
20037 use more than INT_MAX bytes.
20038
20039 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20040
20041 Make it possible to build with GCC-4.6+ -O2 -flto.
20042
20043 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20044
20045 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20046
20047 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20048 Call minibuffer-inactive-mode.
20049
20050 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20051
20052 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20053 Update dependencies.
20054
20055 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20056
20057 * data.c (init_data): Remove code for UTS, this system is not
20058 supported anymore.
20059
20060 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20061
20062 Don't force ./temacs to start in terminal mode.
20063
20064 * frame.c (make_initial_frame): Initialize faces in all cases, not
20065 only when CANNOT_DUMP is defined.
20066 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20067
20068 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20069
20070 * dispnew.c (add_window_display_history): Use const for the string
20071 pointer. Remove declaration, not needed.
20072
20073 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20074
20075 Use 'inline', not 'INLINE'.
20076 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20077 * alloc.c, fontset.c (INLINE): Remove.
20078 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20079 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20080 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20081 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20082 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20083
20084 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20085
20086 Make it possible to run ./temacs.
20087
20088 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20089 syms_of_callproc does the same thing. Remove test for
20090 "initialized", do it in the caller.
20091 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20092
20093 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20094
20095 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20096 (read_minibuf): Use get_minibuffer.
20097 (syms_of_minibuf): Use DEFSYM.
20098 (Qmetadata): New var.
20099 * data.c (Qbuffer): Don't make it static.
20100 (syms_of_data): Use DEFSYM.
20101
20102 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20103
20104 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20105 (CCL_CODE_MIN): New macro.
20106
20107 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20108
20109 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20110
20111 * eval.c (Qdebug): Now static.
20112 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20113 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20114 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20115
20116 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20117
20118 * image.c: Various fixes to ImageMagick code comments.
20119 (Fimagemagick_types): Doc fix.
20120
20121 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20122
20123 Minor fixes prompted by GCC 4.6.0 warnings.
20124
20125 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20126
20127 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20128 (x_clipboard_manager_save_all): Move extern decl to ...
20129 * xterm.h: ... here, so that it can be checked for consistency.
20130
20131 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20132
20133 * xselect.c (x_clipboard_manager_save_frame)
20134 (x_clipboard_manager_save_all): New functions.
20135 (Fx_clipboard_manager_save): Lisp function deleted.
20136
20137 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20138 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20139
20140 * xterm.h: Update prototype.
20141
20142 2011-05-28 William Xu <william.xwl@gmail.com>
20143
20144 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20145 exiting (Bug#8239).
20146
20147 2011-05-28 Jim Meyering <meyering@redhat.com>
20148
20149 Avoid a sign-extension bug in crypto_hash_function.
20150 * fns.c (to_uchar): Define.
20151 (crypto_hash_function): Use it to convert some newly-signed
20152 variables to unsigned, to avoid sign-extension bugs. For example,
20153 without this change, (md5 "truc") would evaluate to
20154 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20155 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
20156 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
20157
20158 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20159
20160 Integer overflow fixes.
20161
20162 * dbusbind.c: Serial number integer overflow fixes.
20163 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
20164 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20165 to hold a serial number that is too large for a fixnum.
20166 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20167 Check for serial numbers out of range. Decode any serial number
20168 that was so large that it became a float. (Bug#8722)
20169
20170 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20171 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20172 Use XFASTINT rather than XUINT when numbers are nonnegative.
20173 (xd_append_arg, Fdbus_method_return_internal):
20174 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20175 arguments, check that Lisp number is nonnegative, rather than
20176 silently wrapping negative numbers around. (Bug#8722)
20177 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
20178 (Bug#8722)
20179
20180 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20181
20182 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20183
20184 ccl: Add integer overflow checks.
20185 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20186 (IN_INT_RANGE): New macros.
20187 (ccl_driver): Use them to check for integer overflow when
20188 decoding a CCL program. Many of the new checks are whether XINT (x)
20189 fits in int; it doesn't always, on 64-bit hosts. The new version
20190 doesn't catch all possible integer overflows, but it's an
20191 improvement. (Bug#8719)
20192
20193 * alloc.c (make_event_array): Use XINT, not XUINT.
20194 There's no need for unsigned here.
20195
20196 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20197 This follows up to the 2011-05-06 change that substituted uintptr_t
20198 for EMACS_INT. This case wasn't caught back then.
20199
20200 Rework Fformat to avoid integer overflow issues.
20201 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20202 now (part of C89). Include <verify.h>.
20203 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20204 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20205 (Fformat): Avoid the prepass trying to compute sizes; it was only
20206 approximate and thus did not catch overflow reliably. Instead, walk
20207 through the format just once, formatting and computing sizes as we go,
20208 checking for integer overflow at every step, and allocating a larger
20209 buffer as needed. Keep track separately whether the format is
20210 multibyte. Keep only the most-recently calculated precision, rather
20211 than them all. Record whether each argument has been converted to
20212 string. Use EMACS_INT, not int, for byte and char and arg counts.
20213 Support field widths and precisions larger than INT_MAX. Avoid
20214 sprintf's undefined behavior with conversion specifications such as %#d
20215 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20216 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20217 formatting out-of-range floating point numbers with int
20218 formats. (Bug#8668)
20219
20220 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20221
20222 * data.c: Avoid integer truncation in expressions involving floats.
20223 * data.c: Include <intprops.h>.
20224 (arith_driver): When there's an integer overflow in an expression
20225 involving floating point, convert the integers to floating point
20226 so that the resulting value does not suffer from catastrophic
20227 integer truncation. For example, on a 64-bit host (* 4
20228 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20229 Do not rely on undefined behavior after integer overflow.
20230
20231 merge count_size_as_multibyte, parse_str_to_multibyte
20232 * character.c, character.h (count_size_as_multibyte):
20233 Rename from parse_str_to_multibyte; all uses changed.
20234 Check for integer overflow.
20235 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20236 since it's now a duplicate of the other. This is more of
20237 a character than a buffer op, so better that it's in character.c.
20238 * fns.c, print.c: Adjust to above changes.
20239
20240 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20241
20242 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20243
20244 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20245
20246 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20247 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20248 (x_clipboard_manager_save): Now static.
20249 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20250
20251 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20252 (crypto_hash_function): Now static.
20253 Fix pointer signedness problems. Avoid unnecessary initializations.
20254
20255 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
20256
20257 * termhooks.h (Vselection_alist): Make it terminal-local.
20258
20259 * terminal.c (create_terminal): Initialize it.
20260
20261 * xselect.c: Support for clipboard managers.
20262 (Vselection_alist): Move to termhooks.h as terminal-local var.
20263 (LOCAL_SELECTION): New macro.
20264 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20265 (symbol_to_x_atom): Remove gratuitous arg.
20266 (x_handle_selection_request, lisp_data_to_selection_data)
20267 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
20268 (x_own_selection, x_get_local_selection, x_convert_selection):
20269 New arg, specifying work frame. Use terminal-local Vselection_alist.
20270 (some_frame_on_display): Delete unused function.
20271 (Fx_own_selection_internal, Fx_get_selection_internal)
20272 (Fx_disown_selection_internal, Fx_selection_owner_p)
20273 (Fx_selection_exists_p): New optional frame arg.
20274 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20275 (x_handle_selection_clear): Don't treat other terminals with the
20276 same keyboard specially. Use the terminal-local Vselection_alist.
20277 (x_clear_frame_selections): Use Frun_hook_with_args.
20278
20279 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20280
20281 * xterm.h: Add support for those atoms.
20282
20283 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
20284
20285 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20286 (converted_selections, conversion_fail_tag): New global variables.
20287 (x_selection_request_lisp_error): Free the above.
20288 (x_get_local_selection): Remove unnecessary code.
20289 (x_reply_selection_request): Args changed; handle arbitrary array
20290 of converted selections stored in converted_selections.
20291 Separate the XChangeProperty and SelectionNotify steps.
20292 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20293 (x_convert_selection): New function.
20294 (x_handle_selection_event): Simplify.
20295 (x_get_foreign_selection): Don't ignore incoming requests while
20296 waiting for an answer; this will fail when we implement
20297 SAVE_TARGETS, and seems unnecessary anyway.
20298 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20299 (Vx_sent_selection_functions): Doc fix.
20300
20301 2011-05-26 Leo Liu <sdl.web@gmail.com>
20302
20303 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20304
20305 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20306
20307 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20308
20309 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20310 for fringe update if it has periodic bitmap.
20311 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
20312 and fringe_bitmap_periodic_p.
20313
20314 * fringe.c (get_fringe_bitmap_data): New function.
20315 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20316 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20317 row. Mark glyph row for fringe update if periodicity changed.
20318
20319 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20320 for fringe update unless it has periodic bitmap.
20321
20322 2011-05-25 Kenichi Handa <handa@m17n.org>
20323
20324 * xdisp.c (get_next_display_element): Set correct it->face_id for
20325 a static composition.
20326
20327 2011-05-24 Leo Liu <sdl.web@gmail.com>
20328
20329 * deps.mk (fns.o):
20330 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20331
20332 * fns.c (crypto_hash_function, Fsha1): New function.
20333 (Fmd5): Use crypto_hash_function.
20334 (syms_of_fns): Add Ssha1.
20335
20336 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20337
20338 * gnutls.c: Remove unused macros.
20339 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20340 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20341 Remove macros that are defined and never used.
20342 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20343
20344 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20345
20346 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20347 (Fx_get_selection_internal): Minor cleanup.
20348 (Fx_own_selection_internal): Rename arguments for consistency with
20349 select.el.
20350
20351 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20352
20353 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20354
20355 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20356
20357 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20358
20359 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20360
20361 * dispnew.c (scrolling_window): Don't exclude the case that the
20362 last enabled row in the desired matrix touches the bottom boundary.
20363
20364 2011-05-21 Glenn Morris <rgm@gnu.org>
20365
20366 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
20367 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20368 and add some more files.
20369
20370 2011-05-20 Eli Zaretskii <eliz@gnu.org>
20371
20372 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20373 report_file_error introduced by the change from 2011-05-07.
20374
20375 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20376
20377 * systime.h (Time): Define only if emacs is defined.
20378 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20379 where the include path doesn't have X11/X.h by default. See
20380 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20381
20382 2011-05-20 Kenichi Handa <handa@m17n.org>
20383
20384 * composite.c (find_automatic_composition): Fix previous change.
20385
20386 2011-05-20 Glenn Morris <rgm@gnu.org>
20387
20388 * lisp.mk: New file, split from Makefile.in.
20389 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20390 (shortlisp): Remove.
20391 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20392
20393 2011-05-19 Glenn Morris <rgm@gnu.org>
20394
20395 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20396 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20397 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20398 (lisp): Set the order to that of loadup.el.
20399 (shortlisp): Make it a copy of $lisp.
20400 (SOME_MACHINE_LISP): Remove.
20401 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20402 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20403
20404 2011-05-18 Kenichi Handa <handa@m17n.org>
20405
20406 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20407 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20408 (find_automatic_composition): Mostly rewrite for efficiency.
20409
20410 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
20411
20412 * makefile.w32-in: Update dependencies.
20413
20414 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20415
20416 * menu.c: Include limits.h (fixes the MS-Windows build broken by
20417 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
20418
20419 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
20420
20421 Fix some integer overflow issues, such as string length overflow.
20422
20423 * insdel.c (count_size_as_multibyte): Check for string overflow.
20424
20425 * character.c (lisp_string_width): Check for string overflow.
20426 Use EMACS_INT, not int, for string indexes and lengths; in
20427 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20428 the resulting string length overflows an EMACS_INT; instead,
20429 report a string overflow if no precision given. When checking for
20430 precision exhaustion, use a check that cannot possibly have
20431 integer overflow. (Bug#8675)
20432 * character.h (lisp_string_width): Adjust to new signature.
20433
20434 * alloc.c (string_overflow): New function.
20435 (Fmake_string): Use it. This doesn't change behavior, but saves
20436 a few bytes and will simplify future changes.
20437 * character.c (string_escape_byte8): Likewise.
20438 * lisp.h (string_overflow): New decl.
20439
20440 Fixups, following up to the user-interface timestamp change.
20441 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20442 for UI timestamps, instead of unsigned long.
20443 * msdos.c (mouse_get_pos): Likewise.
20444 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
20445 * w32gui.h (Time): Define by including "systime.h" rather than by
20446 declaring it ourselves. (Bug#8664)
20447
20448 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20449 * image.c (clear_image_cache): Likewise.
20450
20451 * term.c (term_mouse_position): Don't assume time_t wraparound.
20452
20453 Be more systematic about user-interface timestamps.
20454 Before, the code sometimes used 'Time', sometimes 'unsigned long',
20455 and sometimes 'EMACS_UINT', to represent these timestamps.
20456 This change causes it to use 'Time' uniformly, as that's what X uses.
20457 This makes the code easier to follow, and makes it easier to catch
20458 integer overflow bugs such as Bug#8664.
20459 * frame.c (Fmouse_position, Fmouse_pixel_position):
20460 Use Time, not unsigned long, for user-interface timestamps.
20461 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20462 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20463 * keyboard.h (last_event_timestamp): Likewise.
20464 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20465 * menu.h (xmenu_show): Likewise.
20466 * term.c (term_mouse_position): Likewise.
20467 * termhooks.h (struct input_event.timestamp): Likewise.
20468 (struct terminal.mouse_position_hook): Likewise.
20469 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20470 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20471 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20472 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20473 what it was before.
20474 * menu.h, termhooks.h: Include "systime.h", for Time.
20475
20476 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20477 Don't assume that the difference between two unsigned long values
20478 can fit into an integer. At this point, we know button_down_time
20479 <= event->timestamp, so the difference must be nonnegative, so
20480 there's no need to cast the result if double-click-time is
20481 nonnegative, as it should be; check that it's nonnegative, just in
20482 case. This bug is triggered when events are more than 2**31 ms
20483 apart (about 25 days). (Bug#8664)
20484
20485 * xselect.c (last_event_timestamp): Remove duplicate decl.
20486 (x_own_selection): Remove needless cast to unsigned long.
20487
20488 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20489 that always fit in int. Use a sentinel instead of a counter, to
20490 avoid a temp and to allay GCC's concerns about possible int overflow.
20491 * frame.h (struct frame): Use int for menu_bar_items_used
20492 instead of EMACS_INT, since it always fits in int.
20493
20494 * menu.c (grow_menu_items): Check for int overflow.
20495
20496 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20497
20498 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20499 Before, the code was not consistent. These values cannot exceed
20500 2**31 - 1 so there's no need to make them unsigned.
20501 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20502 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20503 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20504 as modifiers.
20505 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20506
20507 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20508 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20509 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20510 presumably because the widths might not match.
20511
20512 * window.c (size_window): Avoid needless test at loop start.
20513
20514 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20515
20516 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20517
20518 2011-05-12 Drew Adams <drew.adams@oracle.com>
20519
20520 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20521
20522 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20523
20524 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20525 `width' to `bar_area_x' and `bar_area_width', respectively.
20526 (x_scroll_run): Take account of fringe background extension.
20527
20528 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20529 Rename local vars `left' and `width' to `bar_area_x' and
20530 `bar_area_width', respectively.
20531 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20532 background extension.
20533
20534 2011-05-10 Jim Meyering <meyering@redhat.com>
20535
20536 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20537
20538 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
20539
20540 * image.c (Finit_image_library): Return t for built-in image types,
20541 like pbm and xbm. (Bug#8640)
20542
20543 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20544
20545 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20546
20547 2011-05-07 Eli Zaretskii <eliz@gnu.org>
20548
20549 * w32console.c (Fset_screen_color): Doc fix.
20550 (Fget_screen_color): New function.
20551 (syms_of_ntterm): Defsubr it.
20552
20553 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20554 unlink the temporary file if Fcall_process didn't create it in the
20555 first place.
20556 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20557 child process will be redirected to a file specified with `:file'.
20558 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20559 cue to call_process_cleanup not to close that handle.
20560
20561 2011-05-07 Ben Key <bkey76@gmail.com>
20562
20563 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20564 one of two shell specific rules, either bootstrap-temacs-CMD or
20565 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20566 to the previous implementation of the bootstrap-temacs rule.
20567 The bootstrap-temacs-CMD rule is similar to the previous
20568 implementation of the bootstrap-temacs rule except that it
20569 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20570 variable.
20571
20572 These changes, along with some changes to nt/configure.bat,
20573 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20574 earlier fix to add support for --cflags and --ldflags options
20575 that include quotes so that it works whether make uses cmd or
20576 sh as the shell.
20577
20578 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
20579
20580 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20581 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20582 is a constant.
20583 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20584 a string. Handle both cases.
20585 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20586 (Fdbus_register_method): Use Qinvalid_function.
20587
20588 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20589
20590 * makefile.w32-in: Update dependencies.
20591 (LISP_H): Add inttypes.h and stdin.h.
20592 (PROCESS_H): Add unistd.h.
20593
20594 2011-05-06 Eli Zaretskii <eliz@gnu.org>
20595
20596 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20597 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20598
20599 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
20600
20601 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20602
20603 * term.c (vfatal): Remove stray call to va_end.
20604 It's not needed and the C Standard doesn't allow it here anyway.
20605
20606 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20607 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20608
20609 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20610 bytes.
20611
20612 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20613
20614 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20615
20616 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20617
20618 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20619
20620 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20621
20622 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20623 * charset.c (Fdefine_charset_internal): Don't initialize
20624 charset.code_space[15]. The value was garbage, on hosts with
20625 32-bit int (Bug#8600).
20626
20627 * lread.c (read_integer): Be more consistent with string-to-number.
20628 Use string_to_number to do the actual conversion; this avoids
20629 rounding errors and fixes some other screwups. Without this fix,
20630 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20631 (digit_to_number): Move earlier, for benefit of read_integer.
20632 Return -1 if the digit is out of range for the base, -2 if it is
20633 not a digit in any supported base. (Bug#8602)
20634
20635 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20636
20637 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20638 to match comment at start of function. This also removes a
20639 GCC warning about overflow in a 32+64-bit port.
20640
20641 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20642
20643 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20644 Reported by Stefan Monnier in
20645 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
20646 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20647 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
20648
20649 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20650 (EMACS_UINTPTR): Likewise, with uintptr_t.
20651
20652 * lisp.h: Prefer 64-bit EMACS_INT if available.
20653 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20654 on 32-bit hosts that have 64-bit int, so that they can access
20655 large files.
20656 However, temporarily disable this change unless the temporary
20657 symbol WIDE_EMACS_INT is defined.
20658
20659 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20660
20661 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20662 This removes an assumption that EMACS_INT and long are the same
20663 width as pointers. The assumption is true for Emacs porting targets
20664 now, but we want to make other targets possible.
20665 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20666 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20667 In the rest of the code, change types of integers that hold casted
20668 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20669 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20670 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20671 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20672 No need to cast type when ORing.
20673 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20674 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20675 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20676 assume EMACS_INT is the same width as char *.
20677 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20678 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20679 Remove no-longer-needed casts.
20680 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20681 (xg_tool_bar_help_callback, xg_make_tool_item):
20682 Use EMACS_INTPTR to hold an integer
20683 that will be cast to void *; this can avoid a GCC warning
20684 if EMACS_INT is not the same width as void *.
20685 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20686 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20687 (current_message_1, set_message_1):
20688 Use a local to convert to proper width without a cast.
20689 * xmenu.c (dialog_selection_callback): Likewise.
20690
20691 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20692 Also, don't assume VALBITS / RAND_BITS is less than 5,
20693 and don't rely on undefined behavior when shifting a 1 left into
20694 the sign bit.
20695 * lisp.h (get_random): Change signature to match.
20696
20697 * lread.c (hash_string): Use size_t, not int, for hash computation.
20698 Normally we prefer signed values; but hashing is special, because
20699 it's better to use unsigned division on hash table sizes so that
20700 the remainder is nonnegative. Also, size_t is the natural width
20701 for hashing into memory. The previous code used 'int', which doesn't
20702 retain enough info to hash well into very large tables.
20703 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20704
20705 * dbusbind.c: Don't possibly lose pointer info when converting.
20706 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20707 Use XPNTR rather than XHASH, so that the high-order bits of
20708 the pointer aren't lost when converting through void *.
20709
20710 * eval.c (Fautoload): Don't double-shift a pointer.
20711
20712 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20713
20714 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20715
20716 * gnutls.c (DEF_GNUTLS_FN):
20717 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20718
20719 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20720
20721 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20722 marker. (Bug#8610)
20723
20724 2011-05-05 Eli Zaretskii <eliz@gnu.org>
20725
20726 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20727 New version that can reserve upto 2GB of heap space.
20728
20729 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
20730
20731 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20732
20733 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20734
20735 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20736 `gnutls_certificate_set_x509_key_file'.
20737
20738 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
20739
20740 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20741 Update dependencies.
20742
20743 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20744
20745 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20746 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20747 Remove unused parameter `fildes'.
20748 * process.c (read_process_output, send_process): Don't pass it.
20749
20750 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20751
20752 Fix previous change: the library cache is defined in w32.c.
20753 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20754 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20755
20756 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20757
20758 Implement dynamic loading of GnuTLS on Windows.
20759
20760 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20761 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20762 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20763 Declare.
20764
20765 * gnutls.c (Qgnutls_dll): Define.
20766 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20767 (gnutls_*): Declare function pointers.
20768 (init_gnutls_functions): New function to initialize function pointers.
20769 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20770 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20771 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20772 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20773 (emacs_gnutls_write, emacs_gnutls_read)
20774 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20775 (Fgnutls_available_p): New function.
20776 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20777 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20778 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20779
20780 * image.c: Include w32.h.
20781 (Vimage_type_cache): Delete.
20782 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20783 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20784 (w32_delayed_load): Move to w32.c.
20785
20786 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20787
20788 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20789 (w32_delayed_load): Move from image.c. When loading a library, record
20790 its filename in the :loaded-from property of the library id.
20791 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20792 Initialize and staticpro them.
20793 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20794
20795 * process.c: Include lisp.h before w32.h, not after.
20796 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20797 instead of gnutls_record_check_pending.
20798
20799 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20800
20801 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20802
20803 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20804 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20805 as passed in.
20806
20807 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20808
20809 * xterm.c (x_set_frame_alpha): Do not set property on anything
20810 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20811
20812 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20813
20814 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20815
20816 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20817
20818 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20819 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20820 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20821 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20822 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20823 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20824 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20825 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20826 (Qgnutls_bootprop_callbacks_verify): Make static.
20827
20828 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20829
20830 * callproc.c: Indentation fixup.
20831
20832 * sysdep.c (wait_for_termination_1): Make static.
20833 (wait_for_termination, interruptible_wait_for_termination):
20834 Move after wait_for_termination_1.
20835
20836 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20837
20838 * sysdep.c (interruptible_wait_for_termination): New function
20839 which is like wait_for_termination, but allows keyboard
20840 interruptions.
20841
20842 * callproc.c (Fcall_process): Add (:file "file") as an option for
20843 the STDOUT buffer.
20844 (Fcall_process_region): Ditto.
20845
20846 2011-04-30 Eli Zaretskii <eliz@gnu.org>
20847
20848 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20849 rather than `XVECTOR (FOO)->size'.
20850
20851 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20852 inttypes.h, as a gnulib replacement is used if it not available in
20853 system headers.
20854
20855 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20856
20857 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20858 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20859 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20860
20861 * coding.c (coding_alloc_by_realloc): Error out if destination
20862 will grow beyond MOST_POSITIVE_FIXNUM.
20863 (decode_coding_emacs_mule): Abort if there isn't enough place in
20864 charbuf for the composition carryover bytes. Reserve an extra
20865 space for up to 2 characters produced in a loop.
20866 (decode_coding_iso_2022): Abort if there isn't enough place in
20867 charbuf for the composition carryover bytes.
20868
20869 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20870
20871 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20872 aborting when %lld or %lll format is passed.
20873 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20874 %llo or %llx format is passed. (Bug#8545)
20875
20876 * window.c (window_scroll_line_based): Use a marker instead of
20877 simple variables to record original value of point. (Bug#7952)
20878
20879 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20880 produced by %s or %c overflows available buffer space. (Bug#8545)
20881
20882 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20883
20884 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
20885 (SIZE_MAX): Move defn after all includes, as they might #define it.
20886
20887 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20888
20889 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20890
20891 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20892
20893 * keyboard.c (Qdelayed_warnings_hook): Define.
20894 (command_loop_1): Run `delayed-warnings-hook'
20895 if Vdelayed_warnings_list is non-nil.
20896 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20897 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20898
20899 2011-04-28 Eli Zaretskii <eliz@gnu.org>
20900
20901 * doprnt.c (doprnt): Don't return value smaller than the buffer
20902 size if the message was truncated. (Bug#8545).
20903
20904 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20905
20906 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20907 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20908
20909 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20910
20911 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20912
20913 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
20914
20915 * makefile.w32-in: Update dependencies.
20916
20917 2011-04-27 Eli Zaretskii <eliz@gnu.org>
20918
20919 Improve `doprnt' and its usage. (Bug#8545)
20920 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20921 `format_end'. Remove support for %l as a conversion specifier.
20922 Don't use xrealloc. Improve diagnostics when the %l size modifier
20923 is used. Update the commentary.
20924
20925 * eval.c (verror): Simplify calculation of size_t.
20926
20927 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20928 messages.
20929
20930 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20931
20932 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20933 change.
20934
20935 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20936
20937 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20938 This makes this file independent of the recent pseudovector change.
20939
20940 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
20941
20942 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20943
20944 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
20945 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
20946 Remove unused local.
20947 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
20948
20949 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
20950 GCC 4.6.0 optimizes based on type-based alias analysis.
20951 For example, if b is of type struct buffer * and v of type struct
20952 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20953 != &v->size, and therefore "v->size = 1; b->size = 2; return
20954 v->size;" must therefore return 1. This assumption is incorrect
20955 for Emacs, since it type-puns struct Lisp_Vector * with many other
20956 types. To fix this problem, this patch adds a new type struct
20957 vectorlike_header that documents the constraints on layout of vectors
20958 and pseudovectors, and helps optimizing compilers not get fooled
20959 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20960 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
20961 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20962 the size member.
20963 (XSETPVECTYPE): Rewrite in terms of new macro.
20964 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20965 This is a bit clearer, and further avoids the possibility of
20966 undesirable aliasing.
20967 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
20968 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
20969 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20970 since Lisp_Subr is a special case (no "next" field).
20971 (ASIZE): Now uses header.size rather than size.
20972 All previous uses of XVECTOR (foo)->size replaced to use this macro,
20973 to avoid the hassle of writing XVECTOR (foo)->header.size.
20974 (struct vectorlike_header): New type.
20975 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20976 object, to help avoid aliasing.
20977 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20978 (SUBRP): Likewise, since Lisp_Subr is a special case.
20979 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20980 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20981 (struct Lisp_Hash_Table): Combine first two members into a single
20982 struct vectorlike_header member. All uses of "size" and "next" members
20983 changed to be "header.size" and "header.next".
20984 * buffer.h (struct buffer): Likewise.
20985 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20986 * frame.h (struct frame): Likewise.
20987 * process.h (struct Lisp_Process): Likewise.
20988 * termhooks.h (struct terminal): Likewise.
20989 * window.c (struct save_window_data, struct saved_window): Likewise.
20990 * window.h (struct window): Likewise.
20991 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20992 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20993 * buffer.c (init_buffer_once): Likewise.
20994 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20995 special case.
20996 * process.c (Fformat_network_address): Use local var for size,
20997 for brevity.
20998
20999 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21000
21001 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21002 * data.c (atof): Remove decl; no longer used or needed.
21003 (digit_to_number): Move to lread.c.
21004 (Fstring_to_number): Use new string_to_number function, to be
21005 consistent with how the Lisp reader treats infinities and NaNs.
21006 Do not assume that floating-point numbers represent EMACS_INT
21007 without losing information; this is not true on most 64-bit hosts.
21008 Avoid double-rounding errors, by insisting on integers when
21009 parsing non-base-10 numbers, as the documentation specifies.
21010 * lisp.h (string_to_number): New decl, replacing ...
21011 (isfloat_string): Remove.
21012 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21013 (read1): Do not accept +. and -. as integers; this
21014 appears to have been a coding error. Similarly, do not accept
21015 strings like +-1e0 as floating point numbers. Do not report
21016 overflow for integer overflows unless the base is not 10 which
21017 means we have no simple and reliable way to continue.
21018 Break out the floating-point parsing into a new
21019 function string_to_number, so that Fstring_to_number parses
21020 floating point numbers consistently with the Lisp reader.
21021 (digit_to_number): Move here from data.c. Make it static inline.
21022 (E_CHAR, EXP_INT): Remove, replacing with ...
21023 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21024 (string_to_number): New function, replacing isfloat_string.
21025 This function checks for valid syntax and produces the resulting
21026 Lisp float number too. Rework it so that string-to-number
21027 no longer mishandles examples like "1.0e+". Use strtoumax,
21028 so that overflow for non-base-10 numbers is reported only when
21029 there's no portable and simple way to convert to floating point.
21030
21031 * textprop.c (set_text_properties_1): Rewrite for clarity,
21032 and to avoid GCC warning about integer overflow.
21033
21034 * intervals.h (struct interval): Use EMACS_INT for members
21035 where EMACS_UINT might cause problems. See
21036 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21037 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21038 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21039 All uses changed.
21040 (offset_intervals): Tell GCC not to worry about length overflow
21041 when negating a negative length.
21042
21043 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21044 (overrun_check_free): Likewise.
21045
21046 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21047 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21048 word size.
21049
21050 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21051 (gnutls_make_error): Rename local to avoid shadowing.
21052 (gnutls_emacs_global_deinit): ifdef out; not used.
21053 (Fgnutls_boot): Use const for pointer to readonly storage.
21054 Comment out unused local. Fix pointer signedness problems.
21055
21056 * lread.c (openp): Don't stuff size_t into an 'int'.
21057 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21058 about possible signed overflow.
21059
21060 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21061 (GDK_KEY_g): Don't define if already defined.
21062 (xg_prepare_tooltip): Avoid pointer signedness problem.
21063 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21064
21065 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21066 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21067
21068 * xfns.c (Fx_window_property): Simplify a bit,
21069 to make a bit faster and to avoid GCC 4.6.0 warning.
21070 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21071
21072 * fns.c (internal_equal): Don't assume size_t fits in int.
21073
21074 * alloc.c (compact_small_strings): Tighten assertion a little.
21075
21076 Replace pEd with more-general pI, and fix some printf arg casts.
21077 * lisp.h (pI): New macro, generalizing old pEd macro to other
21078 conversion specifiers. For example, use "...%"pI"d..." rather
21079 than "...%"pEd"...".
21080 (pEd): Remove. All uses replaced with similar uses of pI.
21081 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21082 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21083 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21084 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21085 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21086 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21087 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21088 64-bit hosts.
21089 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21090 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21091 * print.c (safe_debug_print, print_object): Likewise.
21092 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21093 to int.
21094 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21095 avoiding the 0 flag, which is not portable.
21096 * process.c (Fmake_network_process): Use pI to avoid cast.
21097 * region-cache.c (pp_cache): Likewise.
21098 * xdisp.c (decode_mode_spec): Likewise.
21099 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21100 behavior on 64-bit hosts with printf arg.
21101 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21102 (x_stop_queuing_selection_requests): Likewise.
21103 (x_get_window_property): Don't truncate byte count to an 'int'
21104 when tracing.
21105
21106 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21107 here, since it parses constructs like leading '-' and spaces,
21108 which are not wanted; and it overflows with large numbers.
21109 Instead, simply match F[0-9]+, which is what is wanted anyway.
21110
21111 * alloc.c: Remove unportable assumptions about struct layout.
21112 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21113 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21114 (allocate_vectorlike, make_pure_vector): Use the new macros,
21115 plus offsetof, to remove unportable assumptions about struct layout.
21116 These assumptions hold on all porting targets that I know of, but
21117 they are not guaranteed, they're easy to remove, and removing them
21118 makes further changes easier.
21119
21120 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21121 This doesn't fix a bug but makes the code clearer.
21122 (string_overrun_cookie): Now const. Use initializers that
21123 don't formally overflow signed char, to avoid warnings.
21124 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21125 can cause Emacs to crash when string overrun checking is enabled.
21126 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21127 multiple of sizeof (EMACS_INT); it need not be, if
21128 alignof(EMACS_INT) < sizeof (EMACS_INT).
21129 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21130
21131 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21132
21133 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21134
21135 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21136
21137 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21138 supposed to be handshaking. (Bug#8556)
21139 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21140
21141 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21142
21143 * lisp.h (Qdebug): List symbol.
21144 * eval.c (Qdebug): Restore global linkage.
21145 * keyboard.c (debug-on-event): New variable.
21146 (handle_user_signal): Break into debugger when debug-on-event
21147 matches the current signal symbol.
21148
21149 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21150
21151 * alloc.c (check_sblock, check_string_bytes)
21152 (check_string_free_list): Convert to standard C.
21153
21154 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21155
21156 * w32.c (emacs_gnutls_push): Fix typo.
21157
21158 2011-04-25 Eli Zaretskii <eliz@gnu.org>
21159
21160 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21161 "cast to pointer from integer of different size".
21162
21163 Improve doprnt and its use in verror. (Bug#8545)
21164 * doprnt.c (doprnt): Document the set of format control sequences
21165 supported by the function. Use SAFE_ALLOCA instead of always
21166 using `alloca'.
21167
21168 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21169 is one byte too soon. Don't use xrealloc; instead xfree and
21170 xmalloc anew.
21171
21172 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21173
21174 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21175 callbacks stage.
21176
21177 * gnutls.c: Renamed global_initialized to
21178 gnutls_global_initialized. Added internals for the
21179 :verify-hostname-error, :verify-error, and :verify-flags
21180 parameters of `gnutls-boot' and documented those parameters in the
21181 docstring. Start callback support.
21182 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21183 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21184 on error. Return error code.
21185 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21186 (emacs_gnutls_read): Likewise.
21187 (Fgnutls_boot): Return handshake error code.
21188 (emacs_gnutls_handle_error): New function.
21189 (wsaerror_to_errno): Likewise.
21190
21191 * w32.h (emacs_gnutls_pull): Add prototype.
21192 (emacs_gnutls_push): Likewise.
21193
21194 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21195 (emacs_gnutls_push): Likewise.
21196
21197 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21198
21199 * process.c (wait_reading_process_output): Check if GnuTLS
21200 buffered some data internally if no FDs are set for TLS
21201 connections.
21202
21203 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21204 (LIBS): Link to USER_LIBS.
21205 ($(BLD)/gnutls.$(0)): New target.
21206
21207 2011-04-24 Eli Zaretskii <eliz@gnu.org>
21208
21209 * xdisp.c (handle_single_display_spec): Rename the
21210 display_replaced_before_p argument into display_replaced_p, to
21211 make it consistent with the commentary. Fix typos in the
21212 commentary.
21213
21214 * textprop.c (syms_of_textprop): Remove dead code.
21215 (copy_text_properties): Delete obsolete commentary about an
21216 interface that was deleted long ago. Fix typos in the description
21217 of arguments.
21218
21219 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21220 to changes in oldXMenu/XMenu.h from 2011-04-16.
21221 <menu_help_message, prev_menu_help_message>: Constify.
21222 (IT_menu_make_room): menu->help_text is now `const char **';
21223 adjust.
21224
21225 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21226 to changes in oldXMenu/XMenu.h from 2011-04-16.
21227 (struct XMenu): Declare `help_text' `const char **'.
21228
21229 * xfaces.c <Qunspecified>: Make extern again.
21230
21231 * syntax.c: Include sys/types.h before including regex.h, as
21232 required by POSIX.
21233
21234 * doc.c (get_doc_string): Improve the format passed to `error'.
21235
21236 * doprnt.c (doprnt): Improve commentary.
21237
21238 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21239
21240 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21241 them with etags.
21242
21243 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21244 changes in globals.h immediately force recompilation.
21245 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21246 $(CURDIR)/s/ms-w32.h.
21247 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
21248
21249 * character.c (Fchar_direction): Function deleted.
21250 (syms_of_character): Don't defsubr it.
21251 <char-direction-table>: Deleted.
21252
21253 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21254
21255 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21256 * doprnt.c: Include limits.h.
21257 (SIZE_MAX): New macro.
21258 (doprnt): Return a size_t value. 2nd arg is now size_t.
21259 Many local variables are now size_t instead of int or unsigned.
21260 Improve overflow protection. Support `l' modifier for integer
21261 conversions. Support %l conversion. Don't assume an EMACS_INT
21262 argument for integer conversions and for %c.
21263
21264 * lisp.h (doprnt): Restore prototype.
21265
21266 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21267 $(SRC)/character.h.
21268
21269 * Makefile.in (base_obj): Add back doprnt.o.
21270
21271 * deps.mk (doprnt.o): Add back prerequisites.
21272 (callint.o): Depend on character.h.
21273
21274 * eval.c (internal_lisp_condition_case): Include the handler
21275 representation in the error message.
21276 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21277 when breaking from the loop.
21278
21279 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21280
21281 * callint.c (Fcall_interactively): When displaying error message
21282 about invalid control letter, pass the character's codepoint, not
21283 a pointer to its multibyte form. Improve display of the character
21284 in octal and display also its hex code.
21285
21286 * character.c (char_string): Use %x to display the (unsigned)
21287 codepoint of an invalid character, to avoid displaying a bogus
21288 negative value.
21289
21290 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21291 `error', not SYMBOL_NAME itself.
21292
21293 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21294 character arguments to `error'.
21295
21296 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21297 to `error' in error message about FINAL_CHAR argument. Make sure
21298 FINAL_CHAR is a character, and use %c when it is passed as
21299 argument to `error'.
21300
21301 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21302
21303 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21304
21305 * w32.c: Include <time.h>.
21306 (sys_localtime): New function.
21307
21308 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
21309
21310 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21311
21312 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
21313
21314 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
21315
21316 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21317 zombies (Bug#8467).
21318
21319 2011-04-19 Eli Zaretskii <eliz@gnu.org>
21320
21321 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21322 gl_state.e_property when gl_state.object is Qt.
21323
21324 * insdel.c (make_gap_larger): Remove limitation of buffer size
21325 to <= INT_MAX.
21326
21327 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
21328
21329 * xdisp.c (lookup_glyphless_char_display)
21330 (produce_glyphless_glyph): Handle cons cell entry in
21331 glyphless-char-display.
21332 (Vglyphless_char_display): Document it.
21333
21334 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21335 glyphless-char-display.
21336
21337 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
21338
21339 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21340
21341 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21342
21343 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21344 definition for no-X builds.
21345
21346 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
21347
21348 Static checks with GCC 4.6.0 and non-default toolkits.
21349
21350 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21351
21352 * process.c (keyboard_bit_set): Define only if SIGIO.
21353 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21354 (send_process): Repair possible setjmp clobbering.
21355
21356 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21357
21358 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21359
21360 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21361
21362 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21363 Define only if needed.
21364
21365 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21366 by pacifying GCC about it. Maybe it's time to retire it?
21367 * xfaces.c (USG, __TIMEVAL__): Likewise.
21368
21369 * dispextern.h (struct redisplay_interface): Rename param
21370 to avoid shadowing.
21371 * termhooks.h (struct terminal): Likewise.
21372 * xterm.c (xembed_send_message): Likewise.
21373
21374 * insdel.c (make_gap_smaller): Define only if
21375 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21376
21377 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21378 it.
21379
21380 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21381 so that we aren't warned about unused symbols.
21382
21383 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21384
21385 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
21386
21387 * xfns.c (x_real_positions): Mark locals as initialized.
21388
21389 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21390
21391 * xterm.c: Fix problems found by static analysis with other toolkits.
21392 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
21393 (x_dispatch_event): Declare static if USE_GTK, and
21394 define if USE_GTK || USE_X_TOOLKIT.
21395 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
21396 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
21397 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21398 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
21399
21400 * xmenu.c (menu_help_callback): Pointer type fixes.
21401 Use const pointers when pointing at readonly data. Avoid pointer
21402 signedness clashes.
21403 (FALSE): Remove unused macro.
21404 (update_frame_menubar): Remove unused decl.
21405
21406 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21407
21408 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21409 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21410 (single_menu_item): Rename local to avoid shadowing.
21411
21412 * keyboard.c (make_lispy_event): Remove unused local var.
21413
21414 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21415 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21416
21417 * bitmaps: Change bitmaps from unsigned char back to the X11
21418 compatible char. Avoid the old compiler warnings about
21419 out-of-range initializers by using, for example, '\xab' rather
21420 than 0xab.
21421
21422 * xgselect.c (xgselect_initialize): Check vs interface
21423 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21424
21425 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21426
21427 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21428 to read-only memory.
21429
21430 * fns.c (vector): Remove; this old hack is no longer needed.
21431
21432 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
21433 Remove unused var.
21434 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
21435
21436 * xrdb.c (x_load_resources): Omit unused local.
21437
21438 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
21439 (x_window): Rename locals to avoid shadowing.
21440 (USG): Use the kludged USG macro, to pacify gcc.
21441
21442 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
21443 (x_term_init): Remove local to avoid shadowing.
21444
21445 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
21446
21447 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21448 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21449
21450 2011-04-16 Eli Zaretskii <eliz@gnu.org>
21451
21452 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21453
21454 Fix regex.c, syntax.c and friends for buffers > 2GB.
21455 * syntax.h (struct gl_state_s): Declare character position members
21456 EMACS_INT.
21457
21458 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21459
21460 * textprop.c (verify_interval_modification, interval_of):
21461 Declare arguments EMACS_INT.
21462
21463 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21464 EMACS_INT.
21465
21466 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21467
21468 * indent.c (Fvertical_motion): Local variable it_start is now
21469 EMACS_INT.
21470
21471 * regex.c (re_match, re_match_2, re_match_2_internal)
21472 (bcmp_translate, regcomp, regexec, print_double_string)
21473 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21474 (re_compile_pattern, re_exec): Declare arguments and local
21475 variables `size_t' and `ssize_t' and return values `regoff_t', as
21476 appropriate.
21477 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21478 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21479 <compile_stack_type>: `size' and `avail' are now `size_t'.
21480
21481 * regex.h <regoff_t>: Use ssize_t, not int.
21482 (re_search, re_search_2, re_match, re_match_2): Arguments that
21483 specify buffer/string position and length are now ssize_t and
21484 size_t. Return type is regoff_t.
21485
21486 2011-04-16 Ben Key <bkey76@gmail.com>
21487
21488 * nsfont.m: Fixed bugs in ns_get_family and
21489 ns_descriptor_to_entity that were caused by using free to
21490 deallocate memory blocks that were allocated by xmalloc (via
21491 xstrdup). This caused Emacs to crash when compiled with
21492 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21493 --enable-checking=xmallocoverrun). xfree is now used to
21494 deallocate these memory blocks.
21495
21496 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
21497
21498 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21499
21500 emacs_write: Accept and return EMACS_INT for sizes.
21501 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21502 et seq.
21503 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21504 Accept and return EMACS_INT.
21505 (emacs_gnutls_write): Return the number of bytes written on
21506 partial writes.
21507 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
21508 (emacs_read, emacs_write): Remove check for negative size, as the
21509 Emacs source code has been audited now.
21510 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21511 (emacs_read, emacs_write): Use it.
21512 * process.c (send_process): Adjust to the new signatures of
21513 emacs_write and emacs_gnutls_write. Do not attempt to store
21514 a byte offset into an 'int'; it might overflow.
21515 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
21516
21517 * sound.c: Don't assume sizes fit in 'int'.
21518 (struct sound_device.period_size, alsa_period_size):
21519 Return EMACS_INT, not int.
21520 (struct sound_device.write, vox_write, alsa_write):
21521 Accept EMACS_INT, not int.
21522 (wav_play, au_play): Use EMACS_INT to store sizes and to
21523 record read return values.
21524
21525 2011-04-15 Ben Key <bkey76@gmail.com>
21526
21527 * keyboard.c (Qundefined): Don't declare static since it is used
21528 in nsfns.m.
21529 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21530 static since they are used in nsfont.m.
21531
21532 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21533
21534 * process.c (Qprocessp): Don't declare static.
21535 * lisp.h (Qprocessp): Declare again.
21536
21537 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
21538
21539 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21540
21541 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21542
21543 Improve C-level modularity by making more things 'static'.
21544
21545 Don't publish debugger-only interfaces to other modules.
21546 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21547 (verify_bytepos, count_markers): Move decls to the only modules
21548 that need them.
21549 * region-cache.h (pp_cache): Likewise.
21550 * window.h (check_all_windows): Likewise.
21551 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21552
21553 * sysdep.c (croak): Now static, if
21554 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21555 * syssignal.h (croak): Declare only if not static.
21556
21557 * alloc.c (refill_memory_reserve): Now static if
21558 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21559 * lisp.h (refill_memory_reserve): Declare only if not static.
21560
21561 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21562 Define only if USE_LUCID.
21563
21564 * xrdb.c (x_customization_string, x_rm_string): Now static.
21565
21566 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21567 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21568
21569 * xdisp.c (draw_row_with_mouse_face): Now static.
21570 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21571
21572 * window.h (check_all_windows): Mark externally visible.
21573
21574 * window.c (window_deletion_count): Now static.
21575
21576 * undo.c: Make symbols static if they're not exported.
21577 (last_undo_buffer, last_boundary_position, pending_boundary):
21578 Now static.
21579
21580 * textprop.c (interval_insert_behind_hooks): Now static.
21581 (interval_insert_in_front_hooks): Likewise.
21582
21583 * term.c: Make symbols static if they're not exported.
21584 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21585 (max_frame_lines, tty_set_terminal_modes):
21586 (tty_reset_terminal_modes, tty_turn_off_highlight):
21587 (get_tty_terminal): Now static.
21588 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21589 * termhooks.h (term_mouse_moveto): Do not declare if
21590 HAVE_WINDOW_SYSTEM.
21591 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21592 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21593
21594 * sysdep.c: Make symbols static if they're not exported.
21595 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21596 Now static.
21597 (sigprocmask_set, full_mask): Remove; unused.
21598 (wait_debugging): Mark as visible.
21599 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21600 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21601
21602 * syntax.c (syntax_temp): Define only if !__GNUC__.
21603
21604 * sound.c (current_sound_device, current_sound): Now static.
21605
21606 * search.c (searchbufs, searchbuf_head): Now static.
21607
21608 * scroll.c (scroll_cost): Remove; unused.
21609 * dispextern.h (scroll_cost): Remove decl.
21610
21611 * region-cache.h (pp_cache): Mark as externally visible.
21612
21613 * process.c: Make symbols static if they're not exported.
21614 (process_tick, update_tick, create_process, chan_process):
21615 (Vprocess_alist, proc_buffered_char, datagram_access):
21616 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21617 (deactivate_process): Mark defn as static, as well as decl.
21618 * lisp.h (create_process): Remove decl.
21619 * process.h (chan_process, Vprocess_alist): Remove decls.
21620
21621 * print.c: Make symbols static if they're not exported.
21622 (print_depth, new_backquote_output, being_printed, print_buffer):
21623 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21624 (print_interval, print_number_index, initial_stderr_stream):
21625 Now static.
21626 * lisp.h (Fprinc): Remove decl.
21627 (debug_output_compilation_hack): Mark as externally visible.
21628
21629 * sysdep.c (croak): Move decl from here to syssignal.h.
21630 * syssignal.h (croak): Put it here, so the API can be checked when
21631 'croak' is called from dissociate_if_controlling_tty.
21632
21633 * minibuf.c: Make symbols static if they're not exported.
21634 (minibuf_save_list, choose_minibuf_frame): Now static.
21635 * lisp.h (choose_minibuf_frame): Remove decl.
21636
21637 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21638
21639 * lread.c: Make symbols static if they're not exported.
21640 (read_objects, initial_obarray, oblookup_last_bucket_number):
21641 Now static.
21642 (make_symbol): Remove; unused.
21643 * lisp.h (initial_obarray, make_symbol): Remove decls.
21644
21645 * keyboard.c: Make symbols static if they're not exported.
21646 (single_kboard, recent_keys_index, total_keys, recent_keys):
21647 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21648 (this_single_command_key_start, echoing, last_auto_save):
21649 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21650 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21651 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21652 (Vlispy_mouse_stem, double_click_count):
21653 Now static.
21654 (force_auto_save_soon): Define only if SIGDANGER.
21655 (ignore_mouse_drag_p): Now static if
21656 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21657 (print_help): Remove; unused.
21658 (stop_character, last_timer_event): Mark as externally visible.
21659 * keyboard.h (ignore_mouse_drag_p): Declare only if
21660 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21661 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21662 * lisp.h (echoing): Remove decl.
21663 (force_auto_save_soon): Declare only if SIGDANGER.
21664 * xdisp.c (redisplay_window): Simplify code, to make it more
21665 obvious that ignore_mouse_drag_p is not accessed if !defined
21666 USE_GTK && !defined HAVE_NS.
21667
21668 * intervals.c: Make symbols static if they're not exported.
21669 (merge_properties_sticky, merge_interval_right, delete_interval):
21670 Now static.
21671 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21672
21673 * insdel.c: Make symbols static if they're not exported.
21674 However, leave prepare_to_modify_buffer alone. It's never
21675 called from outside this function, but that appears to be a bug.
21676 (combine_after_change_list, combine_after_change_buffer):
21677 (adjust_after_replace, signal_before_change): Now static.
21678 (adjust_after_replace_noundo): Remove; unused.
21679 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
21680 (signal_before_change): Remove decls.
21681
21682 * indent.c (val_compute_motion, val_vmotion): Now static.
21683
21684 * image.c: Make symbols static if they're not exported.
21685 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21686 if USE_GTK.
21687 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21688 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21689
21690 * fringe.c (standard_bitmaps): Now static.
21691 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21692
21693 * frame.c: Make symbols static if they're not exported.
21694 (x_report_frame_params, make_terminal_frame): Now static.
21695 (get_frame_param): Now static, unless HAVE_NS.
21696 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21697 (x_get_resource_string): Remove; not used.
21698 * frame.h (make_terminal_frame, x_report_frame_params):
21699 (x_get_resource_string); Remove decls.
21700 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21701 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21702
21703 * font.c, fontset.c: Make symbols static if they're not exported.
21704 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21705 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21706 * font.c (font_close_object): Now static.
21707 * font.h (font_close_object): Remove.
21708 * fontset.c (FONTSET_OBJLIST): Remove.
21709 (free_realized_fontset) #if-0 the body, which does nothing.
21710 (face_suitable_for_char_p): #if-0, as it's never called.
21711 * fontset.h (face_suitable_for_char_p): Remove decl.
21712 * xfaces.c (face_at_string_position):
21713 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
21714 since 0 is always ASCII.
21715
21716 * fns.c (weak_hash_tables): Now static.
21717
21718 * fileio.c: Make symbols static if they're not exported.
21719 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21720 (Vwrite_region_annotation_buffers): Now static.
21721
21722 * eval.c: Make symbols static if they're not exported.
21723 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21724 * lisp.h (backtrace_list): Remove decl.
21725
21726 * emacs.c: Make symbols static if they're not exported.
21727 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21728 (fatal_error_code, fatal_error_signal_hook, standard_args):
21729 Now static.
21730 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21731 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21732 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21733 * lisp.h (fatal_error_signal_hook): Remove decl.
21734 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21735
21736 * editfns.c: Move a (normally-unused) function to its only use.
21737 * editfns.c, lisp.h (get_operating_system_release): Remove.
21738 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21739 worth the hassle of breaking this out.
21740
21741 * xterm.c: Make symbols static if they're not exported.
21742 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21743 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21744 (x_destroy_window, x_delete_display):
21745 Now static.
21746 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21747 (x_mouse_leave): Remove; unused.
21748 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21749 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21750 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21751 Remove decls.
21752 (x_mouse_leave): Declare only if WINDOWSNT.
21753 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21754 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21755 USE_X_TOOLKIT.
21756
21757 * ftxfont.c: Make symbols static if they're not exported.
21758 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21759 HAVE_FREETYPE.
21760 * font.h (ftxfont_driver): Likewise.
21761
21762 * xfns.c: Make symbols static if they're not exported.
21763 (x_last_font_name, x_display_info_for_name):
21764 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21765 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21766 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21767 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21768 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21769 (last_show_tip_args): Now static.
21770 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21771 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21772 (x_screen_planes): Remove; unused.
21773 * dispextern.h (x_screen_planes): Remove decl.
21774
21775 * dispnew.c: Make symbols static if they're not exported.
21776 * dispextern.h (redraw_garbaged_frames, scrolling):
21777 (increment_row_positions): Remove.
21778 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21779 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21780 Now static.
21781 (redraw_garbaged_frames): Remove; unused.
21782
21783 * xfaces.c: Make symbols static if they're not exported.
21784 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21785 Remove decls.
21786 * xterm.h (defined_color): Remove decls.
21787 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21788 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21789 (menu_face_changed_default, defined_color, free_realized_face):
21790 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21791 (ascii_face_of_lisp_face): Remove; unused.
21792
21793 * xdisp.c: Make symbols static if they're not exported.
21794 * dispextern.h (scratch_glyph_row, window_box_edges):
21795 (glyph_to_pixel_coords, set_cursor_from_row):
21796 (get_next_display_element, set_iterator_to_next):
21797 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21798 (show_mouse_face): Remove decls
21799 * frame.h (message_buf_print): Likewise.
21800 * lisp.h (pop_message, set_message, check_point_in_composition):
21801 Likewise.
21802 * xterm.h (set_vertical_scroll_bar): Likewise.
21803 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21804 (message_buf_print, scratch_glyph_row, displayed_buffer):
21805 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21806 (get_next_display_element, show_mouse_face, window_box_edges):
21807 (frame_to_window_pixel_xy, check_point_in_composition):
21808 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21809 (glyph_to_pixel_coords): Remove; unused.
21810
21811 * dired.c (file_name_completion): Now static.
21812
21813 * dbusbind.c (xd_in_read_queued_messages): Now static.
21814
21815 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21816 * data.c (circular_list_error): Remove.
21817
21818 * commands.h (last_point_position, last_point_position_buffer):
21819 (last_point_position_window): Remove decls.
21820 * keyboard.c: Make these variables static.
21821
21822 * coding.h (coding, code_convert_region, encode_coding_gap):
21823 Remove decls.
21824 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21825 (iso_code_class, detect_coding, code_convert_region): Now static.
21826 (encode_coding_gap): Remove; unused.
21827
21828 * chartab.c (chartab_chars, chartab_bits): Now static.
21829
21830 * charset.h (charset_iso_8859_1): Remove decl.
21831 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21832 Now static.
21833
21834 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21835 * ccl.c (Vccl_program_table): Now static.
21836 (check_ccl_update): Remove; unused.
21837
21838 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21839 * category.h: ... from here.
21840 * category.c (check_category_table, set_category_set): Now static.
21841
21842 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21843 * lisp.h: Remove these decls.
21844
21845 * buffer.c (buffer_count): Remove unused var.
21846
21847 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21848 so that it's not optimized away.
21849 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21850 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21851 exported only to the debugger.
21852
21853 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
21854 * atimer.h (run_all_atimers): Remove; not exported.
21855
21856 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21857 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21858 was inaccessible from Lisp.
21859 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21860 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21861
21862 alloc.c: Import and export fewer symbols, and remove unused items.
21863 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21864 is defined.
21865 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21866 it's not optimized away by whole-program optimization.
21867 (message_enable_multibyte, free_misc): Remove.
21868 (catchlist, handlerlist, mark_backtrace):
21869 Declare only if BYTE_MARK_STACK.
21870 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21871 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21872 (message_enable_multibyte): Remove decl.
21873 (free_misc, interval_free_list, float_block, float_block_index):
21874 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21875 (cons_free_list, last_marked_index):
21876 Now static.
21877 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21878 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21879 (mark_backtrace): Define only if BYTE_MARK_STACK.
21880 * xdisp.c (message_enable_multibyte): Now static.
21881
21882 Declare Lisp_Object Q* variables to be 'static' if not exported.
21883 This makes it easier for human readers (and static analyzers)
21884 to see whether these variables are used from other modules.
21885 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21886 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21887 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21888 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21889 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21890 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21891 * xmenu.c, xselect.c:
21892 Declare Q* vars static if they are not used in other modules.
21893 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21894 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21895 Remove decls of unexported vars.
21896 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21897
21898 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21899
21900 Make Emacs functions such as Fatom 'static' by default.
21901 This makes it easier for human readers (and static analyzers)
21902 to see whether these functions can be called from other modules.
21903 DEFUN now defines a static function. To make the function external
21904 so that it can be used in other C modules, use the new macro DEFUE.
21905 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21906 (Finit_image_library):
21907 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21908 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21909 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21910 Remove decls, since these functions are now static.
21911 (Funintern, Fget_internal_run_time): New decls, since these functions
21912 were already external.
21913
21914 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21915 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21916 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21917 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21918 * keyboard.c, keymap.c, lread.c:
21919 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21920 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21921 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21922 Mark functions with DEFUE instead of DEFUN,
21923 if they are used in other modules.
21924 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21925 decls for now-static functions.
21926 * buffer.h (Fdelete_overlay): Remove decl.
21927 * callproc.c (Fgetenv_internal): Mark as internal.
21928 * composite.c (Fremove_list_of_text_properties): Remove decl.
21929 (Fcomposition_get_gstring): New forward static decl.
21930 * composite.h (Fcomposite_get_gstring): Remove decl.
21931 * dired.c (Ffile_attributes): New forward static decl.
21932 * doc.c (Fdocumntation_property): New forward static decl.
21933 * eval.c (Ffetch_bytecode): New forward static decl.
21934 (Funintern): Remove extern decl; now in .h file where it belongs.
21935 * fileio.c (Fmake_symbolic_link): New forward static decl.
21936 * image.c (Finit_image_library): New forward static decl.
21937 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21938 * intervals.h (Fprevious_property_change):
21939 (Fremove_list_of_text_properties): Remove decls.
21940 * keyboard.c (Fthis_command_keys): Remove decl.
21941 (Fcommand_execute): New forward static decl.
21942 * keymap.c (Flookup_key): New forward static decl.
21943 (Fcopy_keymap): Now static.
21944 * keymap.h (Flookup_key): Remove decl.
21945 * process.c (Fget_process): New forward static decl.
21946 (Fprocess_datagram_address): Mark as internal.
21947 * syntax.c (Fsyntax_table_p): New forward static decl.
21948 (skip_chars): Remove duplicate decl.
21949 * textprop.c (Fprevious_property_change): New forward static decl.
21950 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21951 Now internal.
21952 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21953 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21954
21955 * editfns.c (Fformat): Remove unreachable code.
21956
21957 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21958
21959 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21960 change. (Bug#8496)
21961
21962 2011-04-13 Eli Zaretskii <eliz@gnu.org>
21963
21964 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21965 when at ZV. (Bug#8487)
21966
21967 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21968
21969 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21970 (Bug#8437)
21971 * keyboard.c (parse_tool_bar_item): Likewise.
21972 * sound.c (sound_cleanup, alsa_close): Likewise.
21973 * termcap.c (tgetent): Likewise.
21974 * xfns.c (x_default_font_parameter): Likewise.
21975 * xsettings.c (read_and_apply_settings): Likewise.
21976
21977 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21978 (overrun_check_free): Protoize.
21979
21980 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21981
21982 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21983 since callers should never pass a negative size.
21984 Change the signature to match that of plain 'read' and 'write'; see
21985 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21986 * lisp.h: Update prototypes of emacs_write and emacs_read.
21987
21988 2011-04-11 Eli Zaretskii <eliz@gnu.org>
21989
21990 * xdisp.c (redisplay_window): Don't try to determine the character
21991 position of the scroll margin if the window start point w->startp
21992 is outside the buffer's accessible region. (Bug#8468)
21993
21994 2011-04-10 Eli Zaretskii <eliz@gnu.org>
21995
21996 Fix write-region and its subroutines for buffers > 2GB.
21997 * fileio.c (a_write, e_write): Modify declaration of arguments and
21998 local variables to support buffers larger than 2GB.
21999 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22000
22001 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22002 argument, local variables, and return value.
22003
22004 * lisp.h: Update prototypes of emacs_write and emacs_read.
22005
22006 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22007
22008 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22009
22010 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22011
22012 Fix more problems found by GCC 4.6.0's static checks.
22013
22014 * xdisp.c (vmessage): Use a better test for character truncation.
22015
22016 * charset.c (load_charset_map): <, not <=, for optimization,
22017 and to avoid potential problems with integer overflow.
22018 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22019 * casetab.c (set_identity, shuffle): Likewise.
22020 * editfns.c (Fformat): Likewise.
22021 * syntax.c (skip_chars): Likewise.
22022
22023 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22024 This also lets GCC 4.6.0 generate slightly better loop code.
22025
22026 * callint.c (Fcall_interactively): <, not <=, for optimization.
22027 (Fcall_interactively): Count the number of arguments produced,
22028 not the number of arguments given. This is simpler and lets GCC
22029 4.6.0 generate slightly better code.
22030
22031 * ftfont.c: Distingish more carefully between FcChar8 and char.
22032 The previous code passed unsigned char * to a functions like
22033 strlen and xstrcasecmp that expect char *, which does not
22034 conform to the C standard.
22035 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22036 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22037 char * when the C standard requires it.
22038
22039 * keyboard.c (read_char): Remove unused var.
22040
22041 * eval.c: Port to Windows vsnprintf (Bug#8435).
22042 Include <limits.h>.
22043 (SIZE_MAX): Define if the headers do not.
22044 (verror): Do not give up if vsnprintf returns a negative count.
22045 Instead, grow the buffer. This ports to Windows vsnprintf, which
22046 does not conform to C99. Problem reported by Eli Zaretskii.
22047 Also, simplify the allocation scheme, by avoiding the need for
22048 calling realloc, and removing the ALLOCATED variable.
22049
22050 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22051
22052 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22053 But keep the doprint source code for now, as we might revamp it
22054 and use it again (Bug#8435).
22055 * lisp.h (doprnt): Remove.
22056 * Makefile.in (base_obj): Remove doprnt.o.
22057 * deps.mk (doprnt.o): Remove.
22058
22059 error: Print 32- and 64-bit integers portably (Bug#8435).
22060 Without this change, on typical 64-bit hosts error ("...%d...", N)
22061 was used to print both 32- and 64-bit integers N, which relied on
22062 undefined behavior.
22063 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22064 * lisp.h (error, verror): Mark as printf-like functions.
22065 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22066 Report overflow in size calculations when allocating printf buffer.
22067 Do not truncate output string at its first null byte.
22068 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22069 Truncate the output at a character boundary, since vsnprintf does not
22070 do that.
22071 * charset.c (check_iso_charset_parameter): Convert internal
22072 character to string before calling 'error', since %c now has the
22073 printf meaning.
22074 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22075 overflow when computing char to be passed to 'error'. Do not
22076 pass Lisp_Object to 'error'; pass the integer instead.
22077 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22078 formatted with plain %d.
22079
22080 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22081
22082 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22083
22084 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22085
22086 * xterm.c (x_catch_errors): Remove duplicate declaration.
22087
22088 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22089
22090 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22091
22092 2011-04-10 Jim Meyering <meyering@redhat.com>
22093
22094 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22095 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22096 return ssize_t not "int", and use size_t as the buffer length.
22097 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22098 * gnutls.h: Update declarations.
22099 * process.c (read_process_output): Use ssize_t, to match.
22100 (send_process): Likewise.
22101
22102 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22103
22104 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22105
22106 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22107
22108 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22109 Use unsigned char, to match FcChar8 type definition.
22110
22111 * xterm.c (handle_one_xevent):
22112 * xmenu.c (create_and_show_popup_menu):
22113 * xselect.c (x_decline_selection_request)
22114 (x_reply_selection_request): Avoid type-punned deref of X events.
22115
22116 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22117
22118 Fix some uses of `int' instead of EMACS_INT.
22119 * search.c (string_match_1, fast_string_match)
22120 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22121 (scan_buffer, find_next_newline_no_quit)
22122 (find_before_next_newline, search_command, Freplace_match)
22123 (Fmatch_data): Make some `int' variables be EMACS_INT.
22124
22125 * xdisp.c (display_count_lines): 3rd argument and return value now
22126 EMACS_INT. All callers changed.
22127 (pint2hrstr): Last argument is now EMACS_INT.
22128
22129 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22130 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22131 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22132 (decode_coding_utf_16, decode_coding_emacs_mule)
22133 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22134 (decode_coding_ccl, decode_coding_charset)
22135 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22136 (decode_coding_iso_2022, decode_coding_emacs_mule)
22137 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22138 <char_offset, last_offset>: Declare EMACS_INT.
22139 (encode_coding_utf_8, encode_coding_utf_16)
22140 (encode_coding_emacs_mule, encode_invocation_designation)
22141 (encode_designation_at_bol, encode_coding_iso_2022)
22142 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22143 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22144 Declare EMACS_INT.
22145 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22146 (encode_invocation_designation): Last argument P_NCHARS is now
22147 EMACS_INT.
22148 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22149 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22150
22151 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22152 All users changed.
22153
22154 * ccl.c (Fccl_execute_on_string): Declare some variables
22155 EMACS_INT.
22156
22157 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
22158
22159 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22160
22161 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22162
22163 * process.c (Fformat_network_address): Doc fix.
22164
22165 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22166
22167 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
22168
22169 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
22170
22171 * keyboard.c (read_char): Call Lisp function help-form-show,
22172 instead of using internal_with_output_to_temp_buffer.
22173 (Qhelp_form_show): New var.
22174 (syms_of_keyboard): Use DEFSYM macro.
22175
22176 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22177
22178 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22179
22180 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
22181
22182 * process.c (Flist_processes): Remove to Lisp.
22183 (list_processes_1): Delete.
22184
22185 2011-04-06 Eli Zaretskii <eliz@gnu.org>
22186
22187 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22188
22189 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22190
22191 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
22192
22193 Fix more problems found by GCC 4.6.0's static checks.
22194
22195 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22196
22197 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22198
22199 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
22200
22201 * xdisp.c (vmessage): Mark as a printf-like function.
22202
22203 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22204
22205 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22206
22207 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22208 printf-like functions.
22209 (tiff_load): Add casts to remove these marks before passing them
22210 to system-supplied API.
22211
22212 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22213
22214 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22215 This avoids several warnings with gcc -Wstrict-overflow.
22216 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22217 directly, rather than having caller test rule sign. This avoids
22218 some unnecessary tests.
22219 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22220 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22221 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
22222
22223 * xfont.c (xfont_text_extents): Remove var that was set but not used.
22224 (xfont_open): Avoid unnecessary tests.
22225
22226 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22227
22228 * composite.h, composite.c (composition_gstring_put_cache):
22229 Use EMACS_INT, not int, for length.
22230
22231 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22232 breaking out part of COMPOSITION_DECODE_RULE.
22233 (COMPOSITION_DECODE_RULE): Use it.
22234 * composite.c (get_composition_id): Remove unused local vars,
22235 by using the new macro.
22236
22237 * textprop.c (set_text_properties_1): Change while to do-while,
22238 since the condition is always true at first.
22239
22240 * intervals.c (graft_intervals_into_buffer): Mark var as used.
22241 (interval_deletion_adjustment): Return unsigned value.
22242 All uses changed.
22243
22244 * process.c (list_processes_1, create_pty, read_process_output):
22245 (exec_sentinel): Remove vars that were set but not used.
22246 (create_pty): Remove unnecessary "volatile"s.
22247 (Fnetwork_interface_info): Avoid possibility of int overflow.
22248 (read_process_output): Do adaptive read buffering even if carryover.
22249 (read_process_output): Simplify nbytes computation if buffered.
22250
22251 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22252
22253 * syntax.c (scan_words): Remove var that was set but not used.
22254 (update_syntax_table): Use unsigned instead of int.
22255
22256 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
22257 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
22258 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
22259
22260 * print.c (print_error_message): Avoid int overflow.
22261
22262 * font.c (font_list_entities): Redo for clarity,
22263 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22264
22265 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
22266 (font_score): Avoid potential overflow in diff calculation.
22267
22268 * fns.c (substring_both): Remove var that is set but not used.
22269 (sxhash): Redo loop for clarity and to avoid wraparound warning.
22270
22271 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22272
22273 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22274 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22275 can always succeed if overflow has undefined behavior.
22276
22277 * search.c (boyer_moore, wordify): Remove vars set but not used.
22278 (wordify): Omit three unnecessary tests.
22279
22280 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22281 All callers changed. This avoids the need for an unused var.
22282
22283 * casefiddle.c (casify_region): Remove var that is set but not used.
22284
22285 * dired.c (file_name_completion): Remove var that is set but not used.
22286
22287 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22288
22289 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
22290 (Finsert_file_contents): Remove unnecessary code checking fd.
22291
22292 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22293 Check for integer overflow on size calculations.
22294
22295 * buffer.c (Fprevious_overlay_change): Remove var that is set
22296 but not used.
22297
22298 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22299 Remove vars that are set but not used.
22300 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
22301 (timer_check_2): Mark vars as initialized.
22302
22303 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22304
22305 * image.c (lookup_image): Remove var that is set but not used.
22306 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
22307
22308 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22309 that are set but not used.
22310
22311 * xfns.c (make_invisible_cursor): Don't return garbage
22312 if XCreateBitmapFromData fails (Bug#8410).
22313
22314 * xselect.c (x_get_local_selection, x_handle_property_notify):
22315 Remove vars that are set but not used.
22316
22317 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
22318 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
22319
22320 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22321 Remove var that is set but not used.
22322 (scroll_bar_windows_size): Now size_t, not int.
22323 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22324 Check for overflow.
22325
22326 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22327 (map_tty_color) [!defined MSDOS]: Likewise.
22328
22329 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22330
22331 * coding.c: Remove vars that are set but not used.
22332 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22333 All callers changed.
22334 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22335 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22336 (decode_coding_charset): Remove vars that are set but not used.
22337
22338 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22339 that is set but not used.
22340
22341 * print.c (print_object): Remove var that is set but not used.
22342
22343 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
22344 The gnulib version avoids calling malloc in the usual case,
22345 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22346 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22347 * filelock.c (current_lock_owner): Likewise.
22348 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22349 * sysdep.c: Include allocator.h, careadlinkat.h.
22350 (emacs_no_realloc_allocator): New static constant.
22351 (emacs_readlink): New function.
22352 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22353 ../lib/careadlinkat.h.
22354
22355 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22356
22357 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22358 first non-nil return value).
22359
22360 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22361
22362 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22363 if not defined (Bug#8403).
22364
22365 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22366
22367 * xdisp.c (display_count_lines): Remove parameter `start',
22368 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22369 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22370 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22371 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22372 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22373 and thereabouts. All callers changed.
22374 (get_per_char_metric): Remove parameter `f', unused since
22375 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22376
22377 2011-04-02 Jim Meyering <meyering@redhat.com>
22378
22379 do not dereference NULL upon failed strdup
22380 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22381 (ns_get_family): Likewise.
22382
22383 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22384
22385 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22386
22387 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22388
22389 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22390 later (Bug#8403).
22391
22392 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22393
22394 Add lexical binding.
22395
22396 * window.c (Ftemp_output_buffer_show): New fun.
22397 (Fsave_window_excursion):
22398 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22399
22400 * lread.c (lisp_file_lexically_bound_p): New function.
22401 (Fload): Bind Qlexical_binding.
22402 (readevalloop): Remove `evalfun' arg.
22403 Bind Qinternal_interpreter_environment.
22404 (Feval_buffer): Bind Qlexical_binding.
22405 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22406 Mark as dynamic.
22407 (syms_of_lread): Declare `lexical-binding'.
22408
22409 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22410
22411 * keyboard.c (eval_dyn): New fun.
22412 (menu_item_eval_property): Use it.
22413
22414 * image.c (parse_image_spec): Use Ffunctionp.
22415
22416 * fns.c (concat, mapcar1): Accept byte-code-functions.
22417
22418 * eval.c (Fsetq): Handle lexical vars.
22419 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22420 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22421 (FletX, Flet): Obey lexical binding.
22422 (Fcommandp): Handle closures.
22423 (Feval): New `lexical' arg.
22424 (eval_sub): New function extracted from Feval. Use it almost
22425 everywhere where Feval was used. Look up vars in lexical env.
22426 Handle closures.
22427 (Ffunctionp): Move from subr.el.
22428 (Ffuncall): Handle closures.
22429 (apply_lambda): Remove `eval_flags'.
22430 (funcall_lambda): Handle closures and new byte-code-functions.
22431 (Fspecial_variable_p): New function.
22432 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22433 but without exporting it to Lisp.
22434
22435 * doc.c (Fdocumentation, store_function_docstring):
22436 * data.c (Finteractive_form): Handle closures.
22437
22438 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22439 interactive spec.
22440
22441 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22442 New byte-codes.
22443 (exec_byte_code): New function extracted from Fbyte_code to handle new
22444 calling convention for byte-code-functions. Add new byte-codes.
22445
22446 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
22447
22448 * alloc.c (Fmake_symbol): Init new `declared_special' field.
22449
22450 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22451
22452 * xdisp.c (redisplay_internal): Fix prototype.
22453
22454 2011-03-31 Eli Zaretskii <eliz@gnu.org>
22455
22456 * xdisp.c (SCROLL_LIMIT): New macro.
22457 (try_scrolling): Use it when setting scroll_limit.
22458 Limit scrolling to 100 screen lines.
22459 (redisplay_window): Even when falling back on "recentering",
22460 position point in the window according to scroll-conservatively,
22461 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22462
22463 (try_scrolling): When point is above the window, allow searching
22464 as far as scroll_max, or one screenful, to compute vertical
22465 distance from PT to the scroll margin position. This prevents
22466 try_scrolling from unnecessarily failing when
22467 scroll-conservatively is set to a value slightly larger than the
22468 window height. Clean up the case of PT below the margin at bottom
22469 of window: scroll_max can no longer be INT_MAX. When aggressive
22470 scrolling is in use, don't let point enter the opposite scroll
22471 margin as result of the scroll.
22472 (syms_of_xdisp) <scroll-conservatively>: Document the
22473 threshold of 100 lines for never-recentering scrolling.
22474
22475 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22476
22477 * dispextern.h (move_it_by_lines):
22478 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22479 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22480 (message_log_check_duplicate): Remove parameters `prev_bol' and
22481 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22482 (redisplay_internal): Remove parameter `preserve_echo_area',
22483 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22484
22485 * indent.c (Fvertical_motion):
22486 * window.c (window_scroll_pixel_based, Frecenter):
22487 Don't pass `need_y_p' to `move_it_by_lines'.
22488
22489 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22490
22491 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22492 steal a few bits to be more compact.
22493 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22494 Remove unneeded casts.
22495
22496 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22497
22498 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22499
22500 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22501 binding" message (bug#7967).
22502
22503 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22504
22505 Fix more problems found by GCC 4.6.0's static checks.
22506
22507 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22508 Remove unused local var.
22509
22510 * editfns.c (Fmessage_box): Remove unused local var.
22511
22512 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22513 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22514 Omit unused local vars.
22515 * window.c (shrink_windows): Omit unused local var.
22516 * menu.c (digest_single_submenu): Omit unused local var.
22517 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22518 Omit unused local var.
22519
22520 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22521 Don't assume string length fits in int.
22522 (keyremap_step, read_key_sequence): Use size_t for sizes.
22523 (read_key_sequence): Don't check last_real_key_start redundantly.
22524
22525 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22526 instead of alloca (Bug#8344).
22527
22528 * eval.c (Fbacktrace): Don't assume nargs fits in int.
22529 (Fbacktrace_frame): Don't assume nframes fits in int.
22530
22531 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22532
22533 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22534 concerns.
22535
22536 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22537
22538 * cm.c (calccost): Turn while-do into do-while, for clarity.
22539
22540 * keyboard.c (syms_of_keyboard): Use the same style as later
22541 in this function when indexing through an array. This also
22542 works around GCC bug 48267.
22543
22544 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22545
22546 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22547
22548 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22549 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22550
22551 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22552 This avoids undefined behavior on integer overflow, and is a bit
22553 more convenient anyway since it is compared to a size_t variable.
22554
22555 Variadic C functions now count arguments with size_t, not int.
22556 This avoids an unnecessary limitation on 64-bit machines, which
22557 caused (substring ...) to crash on large vectors (Bug#8344).
22558 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22559 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
22560 All variadic functions and their callers changed accordingly.
22561 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22562 * data.c (arith_driver, float_arith_driver): Likewise.
22563 * editfns.c (general_insert_function): Likewise.
22564 * eval.c (struct backtrace.nargs, interactive_p)
22565 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22566 (funcall_lambda, mark_backtrace): Likewise.
22567 * fns.c (concat): Likewise.
22568 * frame.c (x_set_frame_parameters): Likewise.
22569 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22570 0 if not found, not -1. All callers changed.
22571
22572 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22573 (stack_copy_size): Now size_t, not int.
22574 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22575
22576 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22577
22578 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22579 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22580 All callers changed.
22581
22582 * lisp.h (multibyte_char_to_unibyte):
22583 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22584 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22585 * character.h (CHAR_TO_BYTE8):
22586 * cmds.c (internal_self_insert):
22587 * editfns.c (general_insert_function):
22588 * keymap.c (push_key_description):
22589 * search.c (Freplace_match):
22590 * xdisp.c (message_dolog, set_message_1): All callers changed.
22591
22592 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22593
22594 * keyboard.c (safe_run_hook_funcall): New function.
22595 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22596 don't set the hook to nil, but remove the offending function instead.
22597 (Qcommand_hook_internal): Remove, unused.
22598 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22599 Vcommand_hook_internal.
22600
22601 * eval.c (enum run_hooks_condition): Remove.
22602 (funcall_nil, funcall_not): New functions.
22603 (run_hook_with_args): Call each function through a `funcall' argument.
22604 Remove `cond' argument, now redundant.
22605 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22606 (Frun_hook_with_args_until_failure): Adjust accordingly.
22607 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22608
22609 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22610
22611 * dispextern.h (string_buffer_position): Remove declaration.
22612
22613 * print.c (strout): Remove parameter `multibyte', unused since
22614 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22615
22616 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22617 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22618 All callers changed.
22619
22620 * w32.c (_wsa_errlist): Use braces for struct initializers.
22621
22622 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22623 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22624 All callers changed.
22625 (string_buffer_position): Likewise. Also, make static (it's never
22626 used outside xdisp.c).
22627 (cursor_row_p): Remove parameter `w', unused since
22628 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22629 (decode_mode_spec): Remove parameter `precision', introduced during
22630 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22631 All callers changed.
22632
22633 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22634
22635 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22636
22637 2011-03-27 Anders Lindgren <andlind@gmail.com>
22638
22639 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22640 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22641 (ns_update_auto_hide_menu_bar): New functions.
22642 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22643 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22644 ns_constrain_all_frames.
22645 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22646 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22647
22648 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22649
22650 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22651
22652 2011-03-27 Glenn Morris <rgm@gnu.org>
22653
22654 * syssignal.h: Replace RETSIGTYPE with void.
22655 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22656 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22657 Replace SIGTYPE with void everywhere.
22658 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22659 * s/template.h (SIGTYPE): Remove commented out definition.
22660
22661 2011-03-26 Eli Zaretskii <eliz@gnu.org>
22662
22663 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22664 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22665
22666 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
22667
22668 * w32.c (read_unc_volume): Use parameter `henum', instead of
22669 global variable `wget_enum_handle'.
22670
22671 * keymap.c (describe_vector): Remove parameters `indices' and
22672 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22673 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22674
22675 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22676
22677 * keyboard.c (timer_check): Remove parameter `do_it_now',
22678 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22679 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22680 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22681
22682 * keyboard.c (read_char):
22683 * w32menu.c (w32_menu_display_help):
22684 * xmenu.c (show_help_event, menu_help_callback):
22685 Adjust calls to `show_help_echo'.
22686
22687 * gtkutil.c (xg_maybe_add_timer):
22688 * keyboard.c (readable_events):
22689 * process.c (wait_reading_process_output):
22690 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22691
22692 * insdel.c (adjust_markers_gap_motion):
22693 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22694 (gap_left, gap_right): Don't call it.
22695
22696 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
22697
22698 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22699 incurred during fontification.
22700
22701 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22702
22703 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22704 (DEFVAR_PER_BUFFER): Don't pass it.
22705
22706 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22707 (scrolling_window): Don't pass it.
22708
22709 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22710
22711 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22712
22713 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22714 and `suffix'.
22715 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22716 of variables specific to SELinux and computation of `encoded_absname'.
22717
22718 * image.c (XPutPixel): Remove unused variable `height'.
22719
22720 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22721
22722 * unexw32.c (get_section_info): Remove unused variable `section'.
22723
22724 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22725 (system_process_attributes): Remove unused variable `sess'.
22726 (sys_read): Remove unused variable `err'.
22727
22728 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22729 (w32_wnd_proc): Remove unused variable `isdead'.
22730 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22731 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22732 (x_create_tip_frame): Remove unused variable `tem'.
22733
22734 * w32inevt.c (w32_console_read_socket):
22735 Remove unused variable `no_events'.
22736
22737 * w32term.c (x_draw_composite_glyph_string_foreground):
22738 Remove unused variable `width'.
22739
22740 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
22741
22742 * w32term.c (x_set_glyph_string_clipping):
22743 Don't pass uninitialized region to CombineRgn.
22744
22745 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
22746
22747 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22748 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22749 (Fx_close_connection): Remove unused variable `i'.
22750
22751 * w32font.c (w32font_draw): Return number of glyphs.
22752 (w32font_open_internal): Remove unused variable `i'.
22753 (w32font_driver): Add missing initializer.
22754
22755 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22756 (fill_in_menu): Remove unused variable `items_added'.
22757
22758 * w32term.c (last_mouse_press_frame): Remove static global variable.
22759 (w32_clip_to_row): Remove unused variable `f'.
22760 (x_delete_terminal): Remove unused variable `i'.
22761
22762 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22763 (NOTHING): Remove unused static global variable.
22764 (uniscribe_check_otf): Remove unused variable `table'.
22765 (uniscribe_font_driver): Add missing initializers.
22766
22767 2011-03-23 Julien Danjou <julien@danjou.info>
22768
22769 * term.c (Fsuspend_tty, Fresume_tty):
22770 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22771 * window.c (temp_output_buffer_show):
22772 * insdel.c (signal_before_change):
22773 * frame.c (Fhandle_switch_frame):
22774 * fileio.c (Fdo_auto_save):
22775 * emacs.c (Fkill_emacs):
22776 * editfns.c (save_excursion_restore):
22777 * cmds.c (internal_self_insert):
22778 * callint.c (Fcall_interactively):
22779 * buffer.c (Fkill_all_local_variables):
22780 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22781 Use Frun_hooks.
22782 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
22783 unconditionally since it does the check itself.
22784
22785 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
22786
22787 Fix more problems found by GCC 4.5.2's static checks.
22788
22789 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22790 the first time through the loop, since we know p0 < p1 then.
22791 This also avoids a gcc -Wstrict-overflow warning.
22792
22793 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22794 leading to a memory leak, possible in functions like
22795 load_charset_map_from_file that can allocate an unbounded number
22796 of objects (Bug#8318).
22797
22798 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22799 that could (at least in theory) be that large.
22800
22801 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22802 This is less likely to overflow, and avoids undefined behavior if
22803 overflow does occur. All callers changed. Use strtoul to scan
22804 for the unsigned long integer.
22805 (pint2hrstr): Simplify and tune code slightly.
22806 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
22807
22808 * scroll.c (do_scrolling): Work around GCC bug 48228.
22809 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22810
22811 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22812 This also avoids a warning with gcc -Wstrict-overflow.
22813 (validate_x_resource_name): Simplify count usage.
22814 This also avoids a warning with gcc -Wstrict-overflow.
22815
22816 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22817 fail (Bug#8306).
22818
22819 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
22820
22821 * process.c (Fmake_network_process): Use socklen_t, not int,
22822 where POSIX says socklen_t is required in portable programs.
22823 This fixes a porting bug on hosts like 64-bit HP-UX, where
22824 socklen_t is wider than int (Bug#8277).
22825 (Fmake_network_process, server_accept_connection):
22826 (wait_reading_process_output, read_process_output):
22827 Likewise.
22828
22829 * process.c: Rename or move locals to avoid shadowing.
22830 (list_processes_1, Fmake_network_process):
22831 (read_process_output_error_handler, exec_sentinel_error_handler):
22832 Rename or move locals.
22833 (Fmake_network_process): Define label "retry_connect" only if needed.
22834 (Fnetwork_interface_info): Fix pointer signedness.
22835 (process_send_signal): Add cast to avoid pointer signedness problem.
22836 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
22837 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
22838
22839 Make tparam.h and terminfo.c consistent.
22840 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22841 Include tparam.h instead, since it declares them.
22842 * cm.h (PC): Remove extern decl; tparam.h now does this.
22843 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22844 * terminfo.c: Include tparam.h, to check interfaces.
22845 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22846 (tparam): Adjust signature to match interface in tparam.h;
22847 this removes some undefined behavior. Check that outstring and len
22848 are zero, which they always are with Emacs.
22849 * tparam.h (PC, BC, UP): New extern decls.
22850
22851 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
22852 (xftfont_open): Rename locals to avoid shadowing.
22853
22854 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
22855 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22856 (OTF_TAG_SYM): Omit macro if not needed.
22857 (ftfont_list): Remove unused local.
22858 (get_adstyle_property, ftfont_pattern_entity):
22859 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22860 Rename locals to avoid shadowing.
22861
22862 * xfont.c (xfont_list_family): Mark var as initialized.
22863
22864 * xml.c (make_dom): Now static.
22865
22866 * composite.c (composition_compute_stop_pos): Rename local to
22867 avoid shadowing.
22868 (composition_reseat_it): Remove unused locals.
22869 (find_automatic_composition, composition_adjust_point): Likewise.
22870 (composition_update_it): Mark var as initialized.
22871 (find_automatic_composition): Mark vars as initialized,
22872 with a FIXME (Bug#8290).
22873
22874 character.h: Rename locals to avoid shadowing.
22875 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22876 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22877 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22878 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22879 to avoid shadowing.
22880
22881 * textprop.c (property_change_between_p): Remove; unused.
22882
22883 * intervals.c (interval_start_pos): Now static.
22884
22885 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22886
22887 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22888 Rename locals to avoid shadowing.
22889
22890 * sound.c (wav_play, au_play, Fplay_sound_internal):
22891 Fix pointer signedness.
22892 (alsa_choose_format): Remove unused local var.
22893 (wav_play): Initialize a variable to 0, to prevent undefined
22894 behavior (Bug#8278).
22895
22896 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22897
22898 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22899
22900 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22901 clobbering (Bug#8298).
22902 * sysdep.c (sys_subshell): Likewise.
22903 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
22904
22905 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22906 This should get cleaned up, so that child_setup has the
22907 same signature on all platforms.
22908
22909 * callproc.c (call_process_cleanup): Now static.
22910 (relocate_fd): Rename locals to avoid shadowing.
22911
22912 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
22913
22914 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22915 not to be necessary, and produces flickering.
22916
22917 2011-03-20 Glenn Morris <rgm@gnu.org>
22918
22919 * config.in: Remove file.
22920
22921 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
22922
22923 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22924 are now in src/globals.h.
22925 (syms_of_minibuf): Remove spurious & from previous change.
22926
22927 2011-03-20 Leo Liu <sdl.web@gmail.com>
22928
22929 * minibuf.c (completing-read-function): New variable.
22930 (completing-read-default): Rename from completing-read.
22931 (completing-read): Call completing-read-function.
22932
22933 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22934
22935 * xfaces.c (Fx_load_color_file):
22936 Read color file from absolute filename (bug#8250).
22937
22938 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22939
22940 * makefile.w32-in: Update dependencies.
22941
22942 2011-03-17 Eli Zaretskii <eliz@gnu.org>
22943
22944 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22945
22946 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22947
22948 Fix more problems found by GCC 4.5.2's static checks.
22949
22950 * process.c (make_serial_process_unwind, send_process_trap):
22951 (sigchld_handler): Now static.
22952
22953 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22954 That way, the code declares only the vars that it needs.
22955 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22956 * s/cygwin.h (PTY_ITERATION): Likewise.
22957 * s/darwin.h (PTY_ITERATION): Likewise.
22958 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22959
22960 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22961 * process.c (allocate_pty): Don't declare stb unless it's needed.
22962
22963 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
22964 (CONSTANTLIM): Remove; unused.
22965 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22966 Define only if needed.
22967
22968 * unexelf.c (unexec): Name an expression,
22969 to avoid gcc -Wbad-function-cast warning.
22970 Use a different way to cause a compilation error if anyone uses
22971 n rather than nn, a way that does not involve shadowing.
22972 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
22973
22974 * deps.mk (unexalpha.o): Remove; unused.
22975
22976 New file unexec.h, the (simple) interface for unexec (Bug#8267).
22977 * unexec.h: New file.
22978 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22979 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22980 Depend on unexec.h.
22981 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22982 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22983 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
22984 Change as necessary to match prototype in unexec.h.
22985
22986 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22987 shadowing.
22988 (back_comment, skip_chars): Mark vars as initialized.
22989
22990 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22991 Rename locals to avoid shadowing.
22992
22993 * lread.c (read1): Rewrite so as not to use empty "else".
22994 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
22995
22996 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22997
22998 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22999 warning when compiling print.c.
23000
23001 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23002 instead of using an uninitialized var.
23003 (font_sort_entities): Mark var as initialized.
23004
23005 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23006
23007 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23008 pointers to constants.
23009 (font_parse_fcname): Remove unused vars.
23010 (font_delete_unmatched): Now static.
23011 (font_get_spec): Remove; unused.
23012 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23013 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23014 Rename or move locals to avoid shadowing.
23015
23016 * fns.c (require_nesting_list, require_unwind): Now static.
23017 (Ffillarray): Rename locals to avoid shadowing.
23018
23019 * floatfns.c (domain_error2): Define only if needed.
23020 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23021
23022 * alloc.c (mark_backtrace): Move decl from here ...
23023 * lisp.h: ... to here, so that it can be checked.
23024
23025 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23026 (Fdefvar): Rewrite so as not to use empty "else".
23027 (lisp_indirect_variable): Name an expression,
23028 to avoid gcc -Wbad-function-cast warning.
23029 (Fdefvar): Rename locals to avoid shadowing.
23030
23031 * callint.c (quotify_arg, quotify_args): Now static.
23032 (Fcall_interactively): Rename locals to avoid shadowing.
23033 Use const pointer when appropriate.
23034
23035 * lisp.h (get_system_name, get_operating_system_release):
23036 Move decls here, to check interfaces.
23037 * process.c (get_operating_system_release): Move decl to lisp.h.
23038 * xrdb.c (get_system_name): Likewise.
23039 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23040 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23041 some of which prompt warnings from gcc -Wbad-function-cast.
23042 (Fformat_time_string, Fencode_time, Finsert_char):
23043 (Ftranslate_region_internal, Fformat):
23044 Rename or remove local vars to avoid shadowing.
23045 (Ftranslate_region_internal): Mark var as initialized.
23046
23047 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23048 avoid shadowing.
23049
23050 * lisp.h (eassert): Check that the argument compiles, even if
23051 ENABLE_CHECKING is not defined.
23052
23053 * data.c (Findirect_variable): Name an expression, to avoid
23054 gcc -Wbad-function-cast warning.
23055 (default_value, arithcompare, arith_driver, arith_error): Now static.
23056 (store_symval_forwarding): Rename local to avoid shadowing.
23057 (Fmake_variable_buffer_local, Fmake_local_variable):
23058 Mark variables as initialized.
23059 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23060
23061 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23062 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23063 Rename locals to avoid shadowing.
23064 (mark_stack): Move local variables into the #ifdef region where
23065 they're used.
23066 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23067 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23068 needed otherwise.
23069 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23070 (GC_STRING_CHARS): Remove; not used.
23071 (Fmemory_limit): Cast sbrk's returned value to char *.
23072
23073 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23074 avoids undefined behavior in theory.
23075
23076 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23077
23078 Use functions, not macros, for up- and down-casing (Bug#8254).
23079 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23080 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23081 to use the following functions instead of these macros.
23082 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23083 EMACS_INT, since callers assume the returned value fits in int.
23084 (upcase1): Likewise, for UPCASE_TABLE.
23085 (uppercasep, lowercasep, upcase): New static inline functions.
23086 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23087 the race-condition problem in the old DOWNCASE.
23088
23089 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23090 Rename locals to avoid shadowing.
23091 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23092 (regex_compile, re_search_2, re_match_2_internal):
23093 Remove unused local vars.
23094 (FREE_VAR): Rewrite so as not to use empty "else",
23095 which gcc can warn about.
23096 (regex_compile, re_match_2_internal): Mark locals as initialized.
23097 (RETALLOC_IF): Define only if needed.
23098 (WORDCHAR_P): Likewise. This one is never needed, but is used
23099 only in a comment talking about a compiler bug, so put inside
23100 the #if 0 of that comment.
23101 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23102 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23103 Remove; unused.
23104
23105 * search.c (boyer_moore): Rename locals to avoid shadowing.
23106 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23107 (PREV_CHAR_BOUNDARY): Likewise.
23108
23109 * search.c (simple_search): Remove unused var.
23110
23111 * dired.c (compile_pattern): Move decl from here ...
23112 * lisp.h: ... to here, so that it can be checked.
23113 (struct re_registers): New forward decl.
23114
23115 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23116
23117 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23118 All uses changed.
23119 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23120 Rename locals to avoid shadowing.
23121 (Fvertical_motion): Mark locals as initialized.
23122
23123 * casefiddle.c (casify_object, casify_region): Now static.
23124 (casify_region): Mark local as initialized.
23125
23126 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23127
23128 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23129 New macros, so that the caller can use some names other than
23130 gcpro1, gcpro2, etc.
23131 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23132 of the new macros.
23133 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23134 argument, for consistency with GCPRO2_VAR, etc: it is now the
23135 prefix of the variable, not the variable itself. All uses
23136 changed.
23137 * dired.c (directory_files_internal, file_name_completion):
23138 Rename locals to avoid shadowing.
23139
23140 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23141 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23142 dired.c's scmp function, had undefined behavior.
23143 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23144 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23145 * buffer.h: ... to here, because these macros use current_buffer,
23146 and the new implementation with inline functions needs to have
23147 current_buffer in scope now, rather than later when the macros
23148 are used.
23149 (downcase, upcase1): New static inline functions.
23150 (DOWNCASE, UPCASE1): Reimplement using these functions.
23151 This avoids undefined behavior in expressions like
23152 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23153 from race conditions in accessing the global variables
23154 case_temp1 and case_temp2.
23155 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23156 * lisp.h (case_temp1, case_temp2): Remove their decls.
23157 * character.h (ASCII_CHAR_P): Move from here ...
23158 * lisp.h: ... to here, so that the inline functions mentioned
23159 above can use them.
23160
23161 * dired.c (directory_files_internal_unwind): Now static.
23162
23163 * fileio.c (file_name_as_directory, directory_file_name):
23164 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23165 Now static.
23166 (file_name_as_directory): Use const pointers when appropriate.
23167 (Fexpand_file_name): Likewise. In particular, newdir might
23168 point at constant storage, so make it a const pointer.
23169 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
23170 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23171 signedness issues.
23172 (Fset_file_times, Finsert_file_contents, auto_save_error):
23173 Rename locals to avoid shadowing.
23174
23175 * minibuf.c (choose_minibuf_frame_1): Now static.
23176 (Ftry_completion, Fall_completions): Rename or remove locals
23177 to avoid shadowing.
23178
23179 * marker.c (bytepos_to_charpos): Remove; unused.
23180
23181 * lisp.h (verify_bytepos, count_markers): New decls,
23182 so that gcc does not warn that these functions aren't declared.
23183
23184 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23185 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
23186 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
23187 (copy_text): Remove unused local var.
23188
23189 * filelock.c (within_one_second): Now static.
23190 (lock_file_1): Rename local to avoid shadowing.
23191
23192 * buffer.c (fix_overlays_before): Mark locals as initialized.
23193 (fix_start_end_in_overlays): Likewise. This function should be
23194 simplified by using pointers-to-pointers, but that's a different
23195 matter.
23196 (switch_to_buffer_1): Now static.
23197 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23198 (report_overlay_modification): Rename locals to avoid shadowing.
23199
23200 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
23201 Fix pointer signedness issue.
23202 (sys_subshell): Mark local as volatile if checking for lint,
23203 to suppress a gcc -Wclobbered warning that does not seem to be right.
23204 (MAXPATHLEN): Define only if needed.
23205
23206 * process.c (serial_open, serial_configure): Move decls from here ...
23207 * systty.h: ... to here, so that they can be checked.
23208
23209 * fns.c (get_random, seed_random): Move extern decls from here ...
23210 * lisp.h: ... to here, so that they can be checked.
23211
23212 * sysdep.c (reset_io): Now static.
23213 (wait_for_termination_signal): Remove; unused.
23214
23215 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23216 (copy_keymap_item, append_key, push_text_char_description):
23217 Now static.
23218 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
23219 (DENSE_TABLE_SIZE): Remove; unused.
23220 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23221 (describe_map_tree):
23222 Rename locals to avoid shadowing.
23223
23224 * keyboard.c: Declare functions static if they are not used elsewhere.
23225 (echo_char, echo_dash, cmd_error, top_level_2):
23226 (poll_for_input, handle_async_input): Now static.
23227 (read_char, kbd_buffer_get_event, make_lispy_position):
23228 (make_lispy_event, make_lispy_movement, apply_modifiers):
23229 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23230 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23231 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
23232 (read_key_sequence, read_char): Mark locals as initialized.
23233 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
23234
23235 * keyboard.h (make_ctrl_char): New decl.
23236 (mark_kboards): Move decl here ...
23237 * alloc.c (mark_kboards): ... from here.
23238
23239 * lisp.h (force_auto_save_soon): New decl.
23240
23241 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
23242 (DEFINE_DUMMY_FUNCTION): New macro.
23243 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23244 Use it.
23245 (main): Add casts to avoid warnings
23246 if GCC considers string literals to be constants.
23247
23248 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23249
23250 * dbusbind.c: Pointer signedness fixes.
23251 (xd_signature, xd_append_arg, xd_initialize):
23252 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23253 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23254 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23255 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23256
23257 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23258 if GCC considers string literals to be constants.
23259 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
23260
23261 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23262
23263 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23264 (print_preprocess, print_object): New macro to fix last change.
23265
23266 * print.c (print_preprocess): Don't forget font objects.
23267
23268 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
23269
23270 * emacs.c (USAGE3): Doc fixes.
23271
23272 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23273
23274 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23275 structure.
23276
23277 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
23278
23279 * lisp.h (VWindow_system, Qfile_name_history):
23280 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23281 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23282 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23283
23284 * w32select.c: Don't #include "keyboard.h".
23285 (run_protected): Add extern declaration for waiting_for_input.
23286
23287 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23288 * w32console.c (detect_input_pending, read_input_pending)
23289 (encode_terminal_code):
23290 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23291 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23292 (w32_system_caret_y, Qfile_name_history):
23293 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23294 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23295 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23296 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23297 * w32proc.c (Qlocal, report_file_error):
23298 * w32term.c (Vwindow_system, updating_frame):
23299 * w32uniscribe.c (initialized, uniscribe_font_driver):
23300 Remove unneeded extern declarations.
23301
23302 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
23303
23304 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
23305
23306 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
23307
23308 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23309 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23310 These macros can no longer be used for assignment.
23311
23312 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23313 Assign struct members directly, instead of using BUF_BEGV etc.
23314 (record_buffer_markers, fetch_buffer_markers): New functions for
23315 recording and fetching special buffer markers.
23316 (set_buffer_internal_1, set_buffer_temp): Use them.
23317
23318 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23319
23320 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23321
23322 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23323 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23324
23325 * xdisp.c (hscroll_window_tree):
23326 (reconsider_clip_changes): Use PT instead of BUF_PT.
23327
23328 2011-03-13 Eli Zaretskii <eliz@gnu.org>
23329
23330 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23331 $(EMACS_ROOT)/lib/intprops.h.
23332
23333 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23334
23335 Fix more problems found by GCC 4.5.2's static checks.
23336
23337 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23338 to unsigned char * to avoid compiler diagnostic.
23339 (xg_free_frame_widgets): Make it clear that a local variable is
23340 needed only if USE_GTK_TOOLTIP.
23341 (gdk_window_get_screen): Make it clear that this macro is needed
23342 only if USE_GTK_TOOLTIP.
23343 (int_gtk_range_get_value): New function, which avoids a diagnostic
23344 from gcc -Wbad-function-cast.
23345 (xg_set_toolkit_scroll_bar_thumb): Use it.
23346 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23347 diagnostic from gcc -Wbad-function-cast.
23348 (get_utf8_string, xg_get_file_with_chooser):
23349 Rename locals to avoid shadowing.
23350 (create_dialog): Move locals to avoid shadowing.
23351
23352 * xgselect.c (xg_select): Remove unused var.
23353
23354 * image.c (four_corners_best): Mark locals as initialized.
23355 (gif_load): Initialize transparent_p to zero (Bug#8238).
23356 Mark another local as initialized.
23357 (my_png_error, my_error_exit): Mark with NO_RETURN.
23358
23359 * image.c (clear_image_cache): Now static.
23360 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
23361 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
23362 (x_edge_detection): Remove unnecessary cast that
23363 gcc -Wbad-function-cast diagnoses.
23364 (gif_load): Fix pointer signedness.
23365 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23366 (jpeg_load, gif_load): Rename locals to avoid shadowing.
23367
23368 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
23369
23370 Improve quality of tests for time stamp overflow.
23371 For example, without this patch (encode-time 0 0 0 1 1
23372 1152921504606846976) returns the obviously-bogus value (-948597
23373 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23374 reports time overflow. See
23375 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
23376 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23377 * editfns.c: Include limits.h and intprops.h.
23378 (TIME_T_MIN, TIME_T_MAX): New macros.
23379 (time_overflow): Move earlier, to before first use.
23380 (hi_time, lo_time): New functions, for an accurate test for
23381 out-of-range times.
23382 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23383 (Fget_internal_run_time): Don't assume time_t fits in int.
23384 (make_time): Use list2 instead of Fcons twice.
23385 (Fdecode_time): More accurate test for out-of-range times.
23386 (check_tm_member): New function.
23387 (Fencode_time): Use it, to test for out-of-range times.
23388 (lisp_time_argument): Don't rely on undefined left-shift and
23389 right-shift behavior when checking for time stamp overflow.
23390
23391 * editfns.c (time_overflow): New function, refactoring common code.
23392 (Fformat_time_string, Fdecode_time, Fencode_time):
23393 (Fcurrent_time_string): Use it.
23394
23395 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23396 * dired.c (make_time): Move to ...
23397 * editfns.c (make_time): ... here.
23398 * systime.h: Note the move.
23399
23400 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23401
23402 * fringe.c (update_window_fringes): Remove unused variables.
23403
23404 * unexmacosx.c (copy_data_segment): Also copy __got section.
23405 (Bug#8223)
23406
23407 2011-03-12 Eli Zaretskii <eliz@gnu.org>
23408
23409 * termcap.c [MSDOS]: Include "msdos.h".
23410 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23411 Constify `char *' arguments and their references according to
23412 prototypes in tparam.h.
23413
23414 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
23415
23416 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23417 Adapt all references accordingly.
23418
23419 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23420
23421 2011-03-11 Tom Tromey <tromey@redhat.com>
23422
23423 * buffer.c (syms_of_buffer): Remove obsolete comment.
23424
23425 2011-03-11 Eli Zaretskii <eliz@gnu.org>
23426
23427 * termhooks.h (encode_terminal_code): Declare prototype.
23428
23429 * msdos.c (encode_terminal_code): Don't declare prototype.
23430
23431 * term.c (encode_terminal_code): Now external again, used by
23432 w32console.c and msdos.c.
23433
23434 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23435 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
23436
23437 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
23438
23439 Fix some minor problems found by GCC 4.5.2's static checks.
23440
23441 * fringe.c (update_window_fringes): Mark locals as initialized
23442 (Bug#8227).
23443 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
23444
23445 * alloc.c (mark_fringe_data): Move decl from here ...
23446 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23447 to check its interface.
23448 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23449
23450 * fontset.c (free_realized_fontset): Now static.
23451 (Fset_fontset_font): Rename local to avoid shadowing.
23452 (fontset_font): Mark local as initialized.
23453 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
23454
23455 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23456
23457 * xselect.c (x_disown_buffer_selections): Remove; not used.
23458 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
23459 (x_own_selection, Fx_disown_selection_internal): Rename locals
23460 to avoid shadowing.
23461 (x_handle_dnd_message): Remove local to avoid shadowing.
23462
23463 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23464 so that the caller can use some name other than gcpro1.
23465 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
23466 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23467 (Fx_backspace_delete_keys_p):
23468 Use them to avoid shadowing, and rename vars to avoid shadowing.
23469 (x_decode_color, x_set_name, x_window): Now static.
23470 (Fx_create_frame): Add braces to silence GCC warning.
23471 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
23472 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23473 Remove unused locals.
23474 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23475 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23476 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23477 macros.
23478
23479 * xterm.h (x_mouse_leave): New decl.
23480
23481 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23482 Remove unused functions.
23483 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23484 (x_calc_absolute_position): Now static.
23485 (XTread_socket): Don't define label "out" unless it's used.
23486 Don't declare local "event" unless it's used.
23487 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23488 unless they are used.
23489 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23490 (x_fatal_error_signal): Remove; not used.
23491 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23492 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23493 (x_error_catcher, x_connection_closed, x_error_handler):
23494 (x_error_quitter, xembed_send_message, x_iconify_frame):
23495 (my_log_handler): Rename locals to avoid shadowing.
23496 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
23497 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
23498
23499 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23500 Rename or move locals to avoid shadowing.
23501 (tty_defined_color, merge_face_heights): Now static.
23502 (free_realized_faces_for_fontset): Remove; not used.
23503 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23504 does not deduce is never used uninitialized.
23505 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23506 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
23507
23508 * terminal.c (store_terminal_param): Now static.
23509
23510 * xmenu.c (menu_highlight_callback): Now static.
23511 (set_frame_menubar): Remove unused local.
23512 (xmenu_show): Rename parameter to avoid shadowing.
23513 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23514 since they might point to immutable storage.
23515 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23516 since it's unused otherwise.
23517
23518 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
23519 Add a FIXME, since the code still doesn't look right. (Bug#8215)
23520 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23521 avoids a gcc -Wuninitialized diagnostic.
23522 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
23523 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23524 does not deduce are never used uninitialized.
23525
23526 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23527
23528 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
23529 * window.c (window_loop, size_window):
23530 (run_window_configuration_change_hook, enlarge_window): Likewise.
23531
23532 * window.c (display_buffer): Now static.
23533 (size_window): Mark variables that gcc -Wuninitialized
23534 does not deduce are never used uninitialized.
23535 * window.h (check_all_windows): New decl, to forestall
23536 gcc -Wmissing-prototypes diagnostic.
23537 * dispextern.h (bidi_dump_cached_states): Likewise.
23538
23539 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23540 shadowing.
23541 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
23542 Include <limits.h>.
23543 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23544 and to avoid gcc -Wuninitialized warning.
23545 (load_charset_map): Mark variables that gcc -Wuninitialized
23546 does not deduce are never used uninitialized.
23547 (load_charset): Abort instead of using uninitialized var (Bug#8229).
23548
23549 * coding.c (coding_set_source, coding_set_destination):
23550 Use "else { /* comment */ }" rather than "else /* comment */;"
23551 for clarity, and to avoid gcc -Wempty-body warning.
23552 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23553 a block, when the outer 'i' will do.
23554 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23555 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23556 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23557 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23558 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23559 Rename locals to avoid shadowing.
23560 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
23561 * coding.c (emacs_mule_char, encode_invocation_designation):
23562 Now static, since they're not used elsewhere.
23563 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
23564 (decode_coding_object, encode_coding_object, detect_coding_system):
23565 (decode_coding_emacs_mule): Mark variables that gcc
23566 -Wuninitialized does not deduce are never used uninitialized.
23567 (detect_coding_iso_2022): Initialize a local variable that might
23568 be used uninitialized. Leave a FIXME because it's not clear that
23569 this initialization is needed. (Bug#8211)
23570 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23571 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23572 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23573 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23574 Remove unused macros.
23575
23576 * category.c (hash_get_category_set): Remove unused local var.
23577 (copy_category_table): Now static, since it's not used elsewhere.
23578 * character.c (string_count_byte8): Likewise.
23579
23580 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23581 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23582
23583 * chartab.c (copy_sub_char_table): Now static, since it's not used
23584 elsewhere.
23585 (sub_char_table_ref_and_range, char_table_ref_and_range):
23586 Rename locals to avoid shadowing.
23587 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
23588
23589 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
23590 (BIDI_BOB): Remove unused macro.
23591
23592 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23593 deduce are never used uninitialized.
23594 * term.c (encode_terminal_code): Likewise.
23595
23596 * term.c (encode_terminal_code): Now static. Remove unused local.
23597
23598 * tparam.h: New file.
23599 * term.c, tparam.h: Include it.
23600 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23601 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23602 Move these decls to tparam.h, and make them agree with what
23603 is actually in tparam.c. The previous trick of using incompatible
23604 decls in different modules does not conform to the C standard.
23605 All callers of tparam changed to use tparam's actual API.
23606 * tparam.c (tparam1, tparam, tgoto):
23607 Use const pointers where appropriate.
23608
23609 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23610 * cm.h (struct cm): Likewise.
23611 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23612 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23613 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23614 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23615 (turn_on_face, init_tty): Likewise.
23616 * termchar.h (struct tty_display_info): Likewise.
23617
23618 * term.c (term_mouse_position): Rename local to avoid shadowing.
23619
23620 * alloc.c (mark_ttys): Move decl from here ...
23621 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23622
23623 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23624
23625 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23626
23627 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
23628
23629 * search.c (compile_pattern_1): Remove argument regp, unused since
23630 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23631 (compile_pattern): Don't pass it.
23632
23633 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23634
23635 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23636 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23637 for ! HAVE_GTK3.
23638 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23639
23640 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23641
23642 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23643 gdk_window_get_screen, gdk_window_get_geometry,
23644 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23645 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23646 (xg_get_pixbuf_from_pixmap): New function.
23647 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23648 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23649 Call xg_get_pixbuf_from_pixmap instead of
23650 gdk_pixbuf_get_from_drawable.
23651 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23652 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23653 (xg_check_special_colors): Use GtkStyleContext and its functions
23654 for HAVE_GTK3.
23655 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23656 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23657 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
23658 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23659 Call gtk_widget_get_preferred_size.
23660 (xg_frame_resized): gdk_window_get_geometry only takes 5
23661 parameters.
23662 (xg_win_to_widget, xg_event_is_for_menubar):
23663 Call gdk_x11_window_lookup_for_display.
23664 (xg_set_widget_bg): New function.
23665 (delete_cb): New function.
23666 (xg_create_frame_widgets): Connect delete-event to delete_cb.
23667 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
23668 (xg_set_background_color): Call xg_set_widget_bg.
23669 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23670 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23671 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23672 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23673 if ! HAVE_GTK3.
23674 (update_frame_tool_bar): Call gtk_widget_hide.
23675 (xg_initialize): Use GDK_KEY_g.
23676
23677 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23678 if ! HAVE_GTK3
23679 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23680
23681 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23682 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23683 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23684
23685 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
23686
23687 * w32xfns.c (select_palette): Check success of RealizePalette against
23688 GDI_ERROR, not zero.
23689
23690 See ChangeLog.11 for earlier changes.
23691
23692 ;; Local Variables:
23693 ;; coding: utf-8
23694 ;; End:
23695
23696 Copyright (C) 2011-2013 Free Software Foundation, Inc.
23697
23698 This file is part of GNU Emacs.
23699
23700 GNU Emacs is free software: you can redistribute it and/or modify
23701 it under the terms of the GNU General Public License as published by
23702 the Free Software Foundation, either version 3 of the License, or
23703 (at your option) any later version.
23704
23705 GNU Emacs is distributed in the hope that it will be useful,
23706 but WITHOUT ANY WARRANTY; without even the implied warranty of
23707 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23708 GNU General Public License for more details.
23709
23710 You should have received a copy of the GNU General Public License
23711 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.