Fix bug #14241 with posn-at-point at the beginning of an image display prop.
[bpt/emacs.git] / src / ChangeLog
1 2013-05-06 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (pos_visible_p): Use the special code for finding the
4 beginning of a display property or overlay for any "replacing"
5 display property, not just for display strings. This solves
6 incorrect reporting of position by posn-at-point. (Bug#14241)
7
8 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
9
10 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
11 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
12 Verify that ElfW (Half) fits in int.
13 (fatal): Use same signature as lisp.h.
14 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
15 configure and build with -DUNEXELF_DEBUG without worrying about
16 other modules that use DEBUG.
17 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
18 possibly-wide integers now uses it instead of plain fprintf.
19 (entry_address): New function, which avoids problems with 32-bit
20 overflow on 64-bit hosts.
21 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
22 (round_up): Don't assume the remainder fits in int.
23 (find_section): Use bool for boolean. Simplify debug code.
24 (unexec): Don't assume file sizes fit in int or size_t.
25 Omit unnecessary trailing newline in 'fatal' format.
26 Use strerror rather than outputting decimal error number.
27 Remove unused code when emacs is not defined;
28 this file relies on Emacs now.
29 Don't assume e_phnum and e_shnum are positive.
30
31 * regex.c: Fix problems when DEBUG is defined.
32 (extract_number, extract_number_and_incr): Define regardless of
33 whether DEBUG is defined; that's simpler and makes the code less
34 likely to go stale in the normal case when DEBUG is not defined.
35 Return int rather than taking an int * arg. All callers changed.
36 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
37 Remove, replacing with ...
38 (DEBUG_PRINT): New macro. All callers changed.
39 (DEBUG_COMPILES_ARGUMENTS): New macro.
40 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
41 (print_compiled_pattern, print_double_string) [DEBUG]:
42 Use prototype rather than old-style definition.
43 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
44 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
45 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
46 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
47 Don't assume ptrdiff_t, size_t, and long are the same width as int.
48 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
49 This matters only when DEBUG is defined.
50
51 2013-05-05 Eli Zaretskii <eliz@gnu.org>
52
53 * xdisp.c (set_iterator_to_next): Set the
54 ignore_overlay_strings_at_pos_p flag only if we are _really_
55 iterating over an overlay string, as indicated by the
56 current.overlay_string_index member. (Bug#14306)
57
58 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
59
60 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
61 to where it is used, to avoid autorelease issues (Bug#14050).
62
63 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
64
65 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
66 * fileio.c (syms_of_fileio): Implement this.
67 * filelock.c (create_lock_file): If symbolic links don't work, so
68 we use a regular file as a lock file, do not fsync the lock file;
69 it's not needed.
70
71 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
72
73 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
74 (syms_of_minibuf): Adjust accodingly.
75 * lread.c (Fread):
76 * callint.c (Fcall_interactively): Adjust calls accordingly.
77
78 2013-05-04 Eli Zaretskii <eliz@gnu.org>
79
80 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
81 w->contents is a buffer before computing everything else.
82 Use parentheses to disambiguate last part of the condition.
83
84 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
85 assertion violations. (Bug#14062)
86
87 2013-05-01 David Reitter <david.reitter@gmail.com>
88
89 * nsfns.m (ns_tooltip): Initialize.
90
91 2013-04-28 Eli Zaretskii <eliz@gnu.org>
92
93 * coding.c (decode_coding_gap): Don't remove the character before
94 a newline unless it's a CR character. (Bug#14287)
95
96 2013-04-28 Dan Nicolaescu <dann@gnu.org>
97
98 * dispextern.h (struct face): Move enum face_underline_type
99 earlier so that bitfields can be in the same word.
100
101 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
102
103 * nsfns.m (handlePanelKeys): New function.
104 (EmacsOpenPanel:performKeyEquivalent:)
105 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
106 arrows/function/control and copy/paste keys (Bug#14296).
107
108 2013-04-27 Juri Linkov <juri@jurta.org>
109
110 * callint.c (Fcall_interactively): Call `Qread_number' for
111 interactive code letter `n' instead of using duplicate code.
112 (Bug#14254)
113
114 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
115
116 * systime.h (make_timeval): Declare as 'const'.
117
118 2013-04-27 Kenichi Handa <handa@gnu.org>
119
120 * font.c (font_open_entity): Always open a font of manageable
121 size.
122
123 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
124
125 Port better to AIX (Bug#14258).
126 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
127 to pacify AIX xlc.
128
129 2013-04-24 Kenichi Handa <handa@gnu.org>
130
131 * coding.c (decode_coding_iso_2022): When an invalid escape
132 sequence is encountered, reset the invocation and designation
133 status to the safest one.
134
135 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
136
137 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
138 Without this fix, "make distclean" leaves stamp-h1 behind.
139
140 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
141
142 * w32fns.c (w32_fullscreen_rect): New function to compute the
143 window rectangle for the given fullscreen mode.
144 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
145 longer tunes the window size. This keeps the window's edges flush
146 with the screen and allows the taskbar to hide itself in fullboth.
147
148 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
149 window decorations and uses the entire screen.
150
151 * w32term.h (w32_fullscreen_rect) Add prototype.
152 (struct w32_output): Replace normal_width, normal_height,
153 normal_top, and normal_left members with a single normal_placement
154 struct.
155 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
156 Remove macros.
157 (FRAME_NORMAL_PLACEMENT): New macro.
158
159 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
160
161 * minibuf.c (Ftest_completion): Silence compiler warning.
162
163 2013-04-15 Eli Zaretskii <eliz@gnu.org>
164
165 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
166 bug#14062.
167
168 * frame.h (WINDOW_FRAME): Protect macro and its argument with
169 parentheses.
170
171 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
172 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
173 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
174 parentheses where appropriate.
175
176 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
177
178 * keyboard.c (timer_start_idle): Remove no-longer-used local.
179
180 2013-04-14 Eli Zaretskii <eliz@gnu.org>
181
182 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
183 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
184 Mention in the doc string that setting these variables takes
185 effect only after a call to set-window-buffer. (Bug#14200)
186
187 2013-04-13 Eli Zaretskii <eliz@gnu.org>
188
189 * indent.c (Fvertical_motion): Don't consider display strings on
190 overlay strings as display strings on the buffer position we
191 started from. This prevents vertical cursor motion from jumping
192 more than one line when there's an overlay string with a display
193 property at end of line.
194 Reported by Karl Chen <Karl.Chen@quarl.org> in
195 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
196
197 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
198
199 * window.c (select_window): `record_buffer' even if window is
200 already selected (bug#14191).
201
202 2013-04-11 Eli Zaretskii <eliz@gnu.org>
203
204 * window.c (Fwindow_end): Test more flags, including the buffer's
205 last_overlay_modified flag, to determine whether the window's
206 display is really up-to-date. Prevents the function from
207 returning a stale value. (Bug#14170)
208 (Fwindow_line_height): Fix the test for up-to-date-ness of the
209 current matrix.
210
211 2013-04-10 Eli Zaretskii <eliz@gnu.org>
212
213 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
214 garbaged only if it is not already the top frame on its TTY.
215 This prevents flickering due to constant redrawing of TTY frames when
216 there are GUI frames open in the same session. (Bug#13864)
217
218 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
219
220 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
221 of marking the idle timers directly.
222
223 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
224
225 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
226 tables (bug#14054).
227
228 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
229
230 * window.c (select_window): Don't record_buffer while the invariant is
231 temporarily broken (bug#14161).
232
233 * fns.c (Fdelq): Don't assume !NILP => CONSP.
234
235 2013-04-07 Eli Zaretskii <eliz@gnu.org>
236
237 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
238
239 2013-04-07 Romain Francoise <romain@orebokech.com>
240
241 Ignore additional platform-specific ACL errors (Bug#13702).
242 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
243 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
244
245 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
246
247 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
248 f->output_data.ns.
249
250 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
251
252 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
253 This bug was introduced by my 2013-02-25 change that simplified
254 data_start configuration. Without this change, on GNU/Linux
255 an Emacs configured with --enable-profiling fails immediately
256 due to a profiler signal.
257 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
258 with these flags. On platforms where special flags are needed
259 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
260 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
261 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
262
263 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
264
265 Get rid of some platform-specific functions examining window
266 system and its capabilities. This is a partial rework of the
267 2013-04-05 change.
268 * lisp.h (have_menus_p): Remove prototype. This function is
269 replaced with platform-independent window_system_available.
270 (check_window_system): Move to...
271 * frame.h (decode_window_system_frame, window_system_available):
272 ...here, add new prototypes.
273 * frame.c (window_system_available, decode_window_system_frame):
274 New functions.
275 (check_window_system): Platform-independent now.
276 * xterm.h (x_in_use): Remove declaration.
277 (check_x_frame):
278 * w32term.h (check_x_frame):
279 * nsterm.h (check_x_frame): Remove prototypes. This function
280 is replaced with platform-independent decode_window_system_frame.
281 * msdos.c (have_menus_p): Remove.
282 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
283 Remove platform-specific functions. Use check_window_system,
284 decode_window_system_frame and check_ns_display_info where
285 appropriate. Minor style and comment tweaks.
286 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
287 (check_x_frame): Likewise.
288 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
289 Likewise.
290 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
291 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
292 * xmenu.c, xselect.c: All related users changed.
293
294 2013-04-03 Kenichi Handa <handa@gnu.org>
295
296 The following changes is to optimize the code for reading UTF-8
297 files.
298
299 * coding.c (check_ascii): Rename from detect_ascii. Return value
300 changed. Check EOL format. Do not call adjust_coding_eol_type
301 here.
302 (check_utf_8): New function.
303 (adjust_coding_eol_type): Do nothing if already adjusted.
304 (detect_coding): Compare the return value of check_ascii with
305 coding->src_bytes. Call adjust_coding_eol_type if necessary.
306 (decode_coding_gap): Optimize for valid UTF-8.
307
308 2013-03-21 Kenichi Handa <handa@gnu.org>
309
310 * coding.c (syms_of_coding): Cancel previous change.
311
312 * insdel.c (insert_from_gap): Fix previous change.
313
314 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
315
316 Consistently use platform-specific function to detect window system.
317 * lisp.h (check_window_system): New prototype. This function is
318 going to replace check_x, check_w32 and check_ns.
319 (have_menus_p): Mention msdos.c in comment.
320 * fontset.c (check_window_system_func): Remove. Adjust all users.
321 * fontset.h (check_window_system_func): Remove prototype.
322 * nsterm.h (check_ns):
323 * xterm.h (check_x):
324 * w32term.h (check_w32): Likewise.
325 * menu.c (Fx_popup_menu): Use check_window_system.
326 * msdos.c (check_window_system): Define for MS-DOS.
327 * nsfns.m (check_window_system): Define for NS. Adjust all users.
328 * w32fns.c (check_window_system): Likewise for MS-Windows.
329 * xfns.c (check_window_system): Likewise for X.
330 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
331 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
332
333 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
334
335 Prefer < to > in range checks such as 0 <= i && i < N.
336 This makes it easier to visualize quantities on a number line.
337 This patch doesn't apply to all such range checks,
338 only to the range checks affected by the 2013-03-24 change.
339 This patch reverts most of the 2013-03-24 change.
340 * alloc.c (xpalloc, Fgarbage_collect):
341 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
342 * character.c (string_escape_byte8):
343 * charset.c (read_hex):
344 * data.c (cons_to_unsigned):
345 * dispnew.c (update_frame_1):
346 * doc.c (Fsubstitute_command_keys):
347 * doprnt.c (doprnt):
348 * editfns.c (hi_time, decode_time_components):
349 * fileio.c (file_offset):
350 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
351 * font.c (font_intern_prop):
352 * frame.c (x_set_alpha):
353 * gtkutil.c (get_utf8_string):
354 * indent.c (check_display_width):
355 * keymap.c (Fkey_description):
356 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
357 * lread.c (read1):
358 * minibuf.c (read_minibuf_noninteractive):
359 * process.c (wait_reading_process_output):
360 * search.c (Freplace_match):
361 * window.c (get_phys_cursor_glyph):
362 * xdisp.c (redisplay_internal):
363 * xsmfns.c (smc_save_yourself_CB):
364 Prefer < to > for range checks.
365 * dispnew.c (sit_for): Don't mishandle NaNs.
366 This fixes a bug introduced in the 2013-03-24 change.
367 * editfns.c (decode_time_components): Don't hoist comparison.
368 This fixes another bug introduced in the 2013-03-24 change.
369
370 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
371
372 * frame.h (struct frame): Drop scroll_bottom_vpos
373 member becaue all real users are dead long ago.
374 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
375 * xdisp.c (redisplay_internal): Adjust user.
376
377 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
378
379 * nsmenu.m (showAtX:Y:for:): setLevel to
380 NSPopUpMenuWindowLevel (Bug#13998).
381
382 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
383
384 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
385 (ns_check_pending_open_menu): Declare.
386
387 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
388 (x_activate_menubar): Update the menu with title that matches
389 ns_get_pending_menu_title, and call
390 ns_check_pending_openmenu (Bug#12698).
391 (menuWillOpen:): New method.
392 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
393
394 * nsterm.m (menu_will_open_state, menu_mouse_point)
395 (menu_pending_title): New varaibles.
396 (ns_get_pending_menu_title, ns_check_menu_open)
397 (ns_check_pending_open_menu): New functions.
398
399 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
400
401 * indent.c (current_column_bol_cache): Remove leftover which is not
402 used in Fmove_to_column any more.
403 (current_column, scan_for_column): Adjust users.
404 * keyboard.c (last_point_position_buffer, last_point_position_window):
405 Remove leftovers which are not used for recording undo any more.
406 (command_loop_1, syms_of_keyboard): Adjust users.
407 * xdisp.c (last_max_ascent): Remove leftover which is not used in
408 redisplay_window any more.
409 (move_it_to): Adjust user.
410
411 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
412
413 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
414 Update dependencies.
415
416 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
417
418 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
419 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
420 forward references.
421
422 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
423
424 * window.h (struct window): Replace hchild, vchild and buffer slots
425 with the only contents slot. This is possible because each valid
426 window may have either the child window (in vertical or horizontal
427 combination) or buffer to display (for the leaf window). Using that,
428 a lof of operations to traverse and/or change window hierarchies may
429 be simplified. New member horizontal is used to distinguish between
430 horizontal and vertical combinations of internal windows.
431 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
432 (WINDOW_VERTICAL_COMBINATION_P): New macros.
433 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
434 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
435 Use contents slot, not buffer, where appropriate.
436 (wset_combination): New function.
437 (wset_buffer): Add eassert.
438 (Fframe_first_window): Simplify the loop reaching first window.
439 (Fwindow_buffer): Use WINDOW_LEAF_P.
440 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
441 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
442 (unshow_buffer): Convert initial debugging check to eassert.
443 (replace_window, recombine_windows, Fdelete_other_windows_internal)
444 (make_parent_window, window_resize_check, window_resize_apply)
445 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
446 (Fset_window_configuration, delete_all_child_windows, save_window_save):
447 Adjust to match struct window changes.
448 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
449 (mark_window_cursors_off, count_windows, get_leaf_windows)
450 (foreach_window_1): Simplify the loop.
451 * alloc.c (mark_object): Do not check for the leaf window because
452 internal windows has no glyph matrices anyway.
453 * dispnew.c (clear_window_matrices, showing_window_margins_p)
454 (allocate_matrices_for_window_redisplay, fake_current_matrices)
455 (allocate_matrices_for_frame_redisplay, free_window_matrices)
456 (build_frame_matrix_from_window_tree, mirror_make_current)
457 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
458 (update_window_tree, set_window_update_flags): Simplify the loop.
459 (sync_window_with_frame_matrix_rows): Enforce live window.
460 Use contents slot, not buffer, where appropriate.
461 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
462 and WINDOW_HORIZONTAL_COMBINATION_P.
463 (make_frame_visible_1): Simplify the loop.
464 Use contents slot, not buffer, where appropriate.
465 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
466 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
467 (expose_window_tree): Likewise.
468 Use contents slot, not buffer, where appropriate.
469 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
470 to avoid deleted windows. Use contents slot instead of buffer.
471 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
472 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
473 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
474 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
475
476 2013-03-28 Eli Zaretskii <eliz@gnu.org>
477
478 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
479 identify the reasons for assertion violations in bug#14062 and
480 similar ones.
481 (Fx_show_tip): Fix compilation error under
482 "--enable-check-lisp-object-type". (Bug#14073)
483
484 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
485 Reported by <rzl24ozi@gmail.com>.
486
487 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
488
489 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
490 start marker...
491 (unwind_with_echo_area_buffer): ...to restore it here.
492 This is needed to ensure that...
493 (redisplay_window): ...both window markers are valid here,
494 which is verified by eassert.
495 * editfns.c (save_excursion_save): Do not assume that
496 selected_window always displays the buffer.
497 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
498 Fix comment.
499
500 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
501
502 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
503 the upcase table.
504
505 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
506
507 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
508
509 2013-03-27 Eli Zaretskii <eliz@gnu.org>
510
511 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
512 since MinGW's w32api headers do. This avoids compiler warnings.
513
514 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
515 if already defined.
516
517 2013-03-26 Eli Zaretskii <eliz@gnu.org>
518
519 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
520
521 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
522
523 * gtkutil.c (style_changed_cb): Check if frame is live and an
524 X frame (Bug#14038).
525
526 2013-03-26 Eli Zaretskii <eliz@gnu.org>
527
528 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
529 Define only for _WIN32_WINNT less than 0x0500.
530 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
531 MinGW64.
532 Move inclusion of time.h before sys/time.h, so that MinGW64 could
533 see its own definitions of 'struct timeval' and 'struct timezone'.
534
535 Fix incompatibilities between MinGW.org and MinGW64 headers.
536 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
537
538 * w32.c (REPARSE_DATA_BUFFER): Guard with
539 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
540
541 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
542
543 * xterm.c: Include X11/XKBlib.h
544 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
545
546 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
547
548 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
549 written backwards.
550 * blockinput.h (input_blocked_p): Likewise.
551 * bytecode.c (exec_byte_code): Likewise.
552 * callproc.c (call_process_kill, call_process_cleanup)
553 (Fcall_process): Likewise.
554 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
555 (Fccl_execute_on_string): Likewise.
556 * character.c (string_escape_byte8): Likewise.
557 * charset.c (read_hex): Likewise.
558 * cm.c (calccost): Likewise.
559 * data.c (cons_to_unsigned): Likewise.
560 * dired.c (directory_files_internal, file_name_completion):
561 Likewise.
562 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
563 (sit_for): Likewise.
564 * doc.c (Fsubstitute_command_keys): Likewise.
565 * doprnt.c (doprnt): Likewise.
566 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
567 * emacsgtkfixed.c: Likewise.
568 * fileio.c (file_offset, Fwrite_region): Likewise.
569 * floatfns.c (Fexpt, fmod_float): Likewise.
570 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
571 Likewise.
572 * font.c (font_intern_prop): Likewise.
573 * frame.c (x_set_alpha): Likewise.
574 * gtkutil.c (get_utf8_string): Likewise.
575 * indent.c (check_display_width): Likewise.
576 * intervals.c (create_root_interval, rotate_right, rotate_left)
577 (split_interval_right, split_interval_left)
578 (adjust_intervals_for_insertion, delete_node)
579 (interval_deletion_adjustment, adjust_intervals_for_deletion)
580 (merge_interval_right, merge_interval_left, copy_intervals)
581 (set_intervals_multibyte_1): Likewise.
582 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
583 * keymap.c (Fkey_description): Likewise.
584 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
585 * lread.c (openp, read_integer, read1, string_to_number):
586 Likewise.
587 * menu.c (ensure_menu_items): Likewise.
588 * minibuf.c (read_minibuf_noninteractive): Likewise.
589 * print.c (printchar, strout): Likewise.
590 * process.c (create_process, Faccept_process_output)
591 (wait_reading_process_output, read_process_output, send_process)
592 (wait_reading_process_output): Likewise.
593 * profiler.c (make_log, handle_profiler_signal): Likewise.
594 * regex.c (re_exec): Likewise.
595 * regex.h: Likewise.
596 * search.c (looking_at_1, Freplace_match): Likewise.
597 * sysdep.c (get_child_status, procfs_ttyname)
598 (procfs_get_total_memory): Likewise.
599 * systime.h (EMACS_TIME_VALID_P): Likewise.
600 * term.c (dissociate_if_controlling_tty): Likewise.
601 * window.c (get_phys_cursor_glyph): Likewise.
602 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
603 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
604 Likewise.
605 * xfns.c (Fx_window_property): Likewise.
606 * xmenu.c (set_frame_menubar): Likewise.
607 * xselect.c (x_get_window_property, x_handle_dnd_message):
608 Likewise.
609 * xsmfns.c (smc_save_yourself_CB): Likewise.
610 * xterm.c (x_scroll_bar_set_handle): Likewise.
611
612 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
613
614 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
615 to be optional or nil. Adjust comment and convert it to docstring.
616 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
617 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
618
619 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
620
621 Static checking by GCC 4.8-20130319.
622 * image.c (gif_load): Assume pass < 3 to pacify GCC.
623 * process.c (Fset_process_datagram_address)
624 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
625 * xdisp.c (get_char_face_and_encoding):
626 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
627 (get_glyph_face_and_encoding): Prepare face before possibly using it.
628 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
629
630 2013-03-24 Ken Brown <kbrown@cornell.edu>
631
632 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
633 fix compilation on 64-bit Cygwin, where underscores are not
634 automatically prepended.
635
636 * w32term.c (w32_initialize): Silence compiler warning.
637
638 2013-03-23 Eli Zaretskii <eliz@gnu.org>
639
640 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
641 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
642 variables, to save and restore frame dimensions.
643 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
644 after returning from a 'fullscreen' configuration.
645 use SendMessage instead of PostMessage to send the SC_RESTORE message,
646 to avoid races between the main thread and the input thread.
647
648 * w32term.h (struct w32_output): New members normal_width,
649 normal_height, normal_top, normal_left, and prev_fsmode.
650 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
651 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
652 members of a frame.
653
654 * w32term.c (w32fullscreen_hook): Record last value of the frame's
655 'fullscreen' parameter. Always record previous width and height
656 of the frame, except when switching out of maximized modes, so
657 that they could be restored correctly, instead of resetting to the
658 default frame dimensions. Send SC_RESTORE command to the frame,
659 unless we are going to send SC_MAXIMIZE, to restore the frame
660 resize hints in the mouse pointer shown by the window manager.
661 (Bug#14032)
662
663 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
664
665 * lisp.h (get_frame_param): Adjust conditions for prototype
666 declaration.
667
668 2013-03-22 Ken Brown <kbrown@cornell.edu>
669
670 * unexcw.c: Drop unneeded inclusion of w32common.h.
671 (report_sheap_usage): Declare.
672 (read_exe_header): Add magic numbers for x86_64.
673 (fixup_executable): Fix printf format specifier for unsigned long
674 argument.
675
676 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
677
678 * frame.h (struct frame): Put menu_bar_window under #ifdef
679 because this member is not needed when X toolkit is in use.
680 (fset_menu_bar_window):
681 * dispnew.c (clear_current_matrices, clear_desired_matrices)
682 (free_glyphs, update_frame):
683 * xdisp.c (expose_frame): Likewise.
684 (display_menu_bar): Likewise. Remove redundant eassert.
685 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
686 toolkit is in use.
687
688 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
689
690 Use functions and constants to manipulate Lisp_Save_Value objects.
691 This replaces code that used macros and strings and token-pasting.
692 The change makes the C source a bit easier to follow,
693 and shrinks the Emacs executable a bit.
694 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
695 (make_save_value): Change 1st arg from string to enum. All callers
696 changed.
697 (INTX): Remove.
698 (mark_object): Use if, not #if, for GC_MARK_STACK.
699 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
700 (XSAVE_OBJECT): Now functions, not macros.
701 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
702 the constant was never used.
703 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
704 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
705 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
706 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
707 New constants.
708 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
709 type3 with a single member save_type. All uses changed.
710 (save_type, set_save_pointer, set_save_integer): New functions.
711 * print.c (PRINTX): Remove.
712
713 * alloc.c: Remove redundant static declarations.
714
715 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
716
717 * window.h (struct window): Convert left_col, top_line, total_lines
718 and total_cols from Lisp_Objects to integers. Adjust comments.
719 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
720 Remove.
721 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
722 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
723 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
724 Adjust users where appropriate.
725
726 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
727
728 * frame.h (struct frame): Drop resx and resy because the same data is
729 available from window system-specific output context. Adjust users.
730 (default_pixels_per_inch_x, default_pixels_per_inch_y):
731 New functions to provide defaults when no window system available.
732 (FRAME_RES_X, FRAME_RES_Y): New macros.
733 (NUMVAL): Move from xdisp.c.
734 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
735 (Ffont_face_attributes, Fopen_font):
736 * image.c (gs_load):
737 * w32font.c (fill_in_logfont):
738 * xdisp.c (calc_pixel_width_or_height):
739 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
740 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
741
742 2013-03-20 Kenichi Handa <handa@gnu.org>
743
744 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
745 to 1 (temporary workaround until a bug related to ASCII
746 optimization is fixed).
747
748 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
749
750 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
751 Signal error if window is not internal. Adjust docstring.
752 (delete_all_child_windows): Use combination_limit to save the buffer.
753 (Fset_window_configuration): Adjust accordingly.
754 * print.c (syms_of_print): Initialize debugging output not here...
755 (init_print_once): ...but in a new function here.
756 * lisp.h (init_print_once): Add prototype.
757 * emacs.c (main): Add call to init_print_once. Adjust comments.
758
759 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
760
761 * window.c (window_resize_check, window_resize_apply)
762 (window_from_coordinates, recombine_windows, set_window_buffer)
763 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
764 (Fsplit_window_internal, Fdelete_window_internal)
765 (freeze_window_starts): Use bool for booleans.
766 * window.h (window_frame_coordinates, resize_frame_windows)
767 (freeze_window_starts, set_window_buffer): Adjust prototypes.
768
769 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
770
771 * dispnew.c (bitch_at_user): Use `user-error'.
772
773 2013-03-17 Ken Brown <kbrown@cornell.edu>
774
775 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
776 as return type of image_background. (Bug#13981)
777 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
778
779 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
780
781 * nsterm.m (updateFrameSize:): Change resize increments if needed.
782 (ns_select): Don't return with result uninitialized.
783
784 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
785 and getDirectory.
786
787 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
788 New functions.
789 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
790 directories. If filename is nil, get directory name (Bug#13932).
791 Use getFilename and getDirectory.
792 (getFilename, getDirectory): New methods for EmacsSavePanel and
793 EmacsOpenPanel.
794 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
795
796 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
797
798 * coding.c (decode_coding_gap): Fix typo caught by static checking.
799
800 2013-03-15 Kenichi Handa <handa@gnu.org>
801
802 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
803 (adjust_after_replace): Make it back to static. Delete the third
804 arg text_at_gap_tail. Cancel the code for handling it.
805
806 * coding.h (struct coding_system): New member eol_seen.
807
808 * coding.c (detect_ascii): New function.
809 (detect_coding): Set coding->head_ascii and coding->eol_seen only
810 when the source bytes are actually scanned. On detecting for
811 coding_category_utf_8_auto, call detect_ascii instead of scanning
812 source bytes directly.
813 (produce_chars): Call insert_from_gap with the new arg 0.
814 (encode_coding): Likewise.
815 (decode_coding_gap): Control ASCII optimization by the variable
816 disable_ascii_optimization instead of #ifndef .. #endif.
817 Deccode EOL format according to coding->eol_seen.
818 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
819 variable.
820
821 * lisp.h (adjust_after_replace): Cancel externing it.
822 (insert_from_gap): Adjust prototype.
823
824 2013-03-15 Eli Zaretskii <eliz@gnu.org>
825
826 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
827 FULLSCREEN_MAXIMIZED. (Bug#13935)
828
829 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
830
831 * region-cache.c (find_cache_boundary, move_cache_gap)
832 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
833 Simplify debugging check and convert to eassert. Adjust comment.
834 (pp_cache): Put under ENABLE_CHECKING.
835
836 2013-03-14 Eli Zaretskii <eliz@gnu.org>
837
838 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
839 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
840 and WM_ACTIVATEAPP.
841 (w32fullscreen_hook): If the frame is visible, reset
842 f->want_fullscreen flag after changing the frame size. If the
843 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
844 (Bug#13953)
845
846 2013-03-13 Daniel Colascione <dancol@dancol.org>
847
848 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
849 too so that these builds can use Cygwin's file conversion
850 functions. (We've been building and linking cygw32.o all along
851 and just not using it.)
852
853 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
854
855 File synchronization fixes (Bug#13944).
856 * Makefile.in (LIB_FDATASYNC): New macro.
857 (LIBES): Use it.
858 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
859 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
860 Don't worry about HAVE_FSYNC, since a substitute fsync is
861 available if the system lacks one.
862 (Fwrite_regin): Retry fsync if interrupted.
863
864 2013-03-13 Eli Zaretskii <eliz@gnu.org>
865
866 * w32term.c (w32_read_socket): If the Emacs frame is being
867 activated, call w32fullscreen_hook, to make sure the new frame
868 dimensions are in effect. (Bug#13937)
869
870 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
871
872 * xdisp.c (init_iterator): Simplify because both character and byte
873 positions are either specified or -1. Add eassert. Adjust comment.
874 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
875 character and byte positions can be obtained from marker.
876
877 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
878
879 Static checking by Sun C 5.12.
880 * alloc.c (buffer_memory_full) [REL_ALLOC]:
881 * bytecode.c (exec_byte_code):
882 * dispnew.c (init_display):
883 * eval.c (error):
884 * fileio.c (Fsubstitute_in_file_name):
885 * keyboard.c (Fevent_convert_list):
886 * keymap.c (Fsingle_key_description):
887 * term.c (maybe_fatal, fatal):
888 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
889 * xsmfns.c (Fhandle_save_session):
890 Omit unreachable code.
891 * keymap.c (map_keymap_char_table_item): Cast void * to
892 a function pointer type; the C Standard requires this.
893
894 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
895 Include <sys/param.h> unconditionally, as that works elsewhere and
896 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
897 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
898 and FreeBSD now.
899
900 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
901
902 * insdel.c (adjust_after_replace): Use bool for boolean.
903
904 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
905
906 * keyboard.c: Move keyboard decoding to read_key_sequence.
907 (decode_keyboard_code): Remove.
908 (tty_read_avail_input): Don't try to decode input.
909 (read_decoded_char): New function.
910 (read_key_sequence): Use it.
911
912 2013-03-10 Daniel Colascione <dancol@dancol.org>
913
914 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
915 (GUI_SDATA, guichar_t): Macros to abstract out differences between
916 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
917 w32fns.c.
918
919 * w32term.c (construct_drag_n_drop): Use the above macros to make
920 drag-and-drop work for non-ASCII filenames in cygw32 builds.
921
922 * w32fns.c (x_set_name, x_set_title): Use the above macros to
923 properly display non-ASCII frame titles in cygw32 builds.
924
925 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
926 call ShellExecute in cygw32 builds.
927
928 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
929 common file dialog code.
930
931 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
932 can just use du like other systems.
933
934 * coding.c (from_unicode_buffer): Declare.
935 * coding.c (from_unicode_buffer): Implement.
936
937 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
938
939 * lread.c: Minor cleanup.
940 (FROM_FILE_P): New macro.
941 (skip_dyn_bytes, unreadchar, read1): Use it.
942 (read_list): Consolidate duplicated code.
943
944 * bytecode.c (struct byte_stack): Remove `constants' when unused.
945
946 2013-03-10 Eli Zaretskii <eliz@gnu.org>
947
948 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
949 (redisplay_internal, set_cursor_from_row, try_window)
950 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
951 (display_line, notice_overwritten_cursor)
952 (mouse_face_from_buffer_pos, note_mouse_highlight):
953 Use MATRIX_ROW_DISPLAYS_TEXT_P.
954 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
955 (mouse_face_from_string_pos, fast_find_string_pos):
956 Use MATRIX_ROW_VPOS.
957
958 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
959
960 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
961
962 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
963 MATRIX_MODE_LINE_ROW.
964
965 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
966
967 2013-03-10 handa <handa@gnu.org>
968
969 * lisp.h (adjust_after_replace): Extern it.
970
971 * coding.c (detect_coding): Cound the heading ASCII bytes in the
972 case of detection for coding_category_utf_8_auto.
973 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
974 Skip decoding if all bytes are ASCII.
975
976 * insdel.c (adjust_after_replace): Make it public. New arg
977 text_at_gap_tail.
978 (adjust_after_insert): Call adjust_after_replace with the new arg
979 value 0.
980
981 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
982
983 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
984 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
985 from Elisp via unread-command-events.
986
987 * keyboard.c (access_keymap_keyremap): Accept nil return value from
988 functions to mean "no change".
989
990 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
991
992 region-cache.c, scroll.c, search.c: Use bool for booleans.
993 * lisp.h (compile_pattern):
994 * scroll.c (do_scrolling, do_direct_scrolling):
995 * search.c (struct regexp_cache, compile_pattern_1)
996 (compile_pattern, string_match_1, search_command)
997 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
998 (search_regs_saved, Fregexp_quote):
999 Use bool for boolean.
1000 * region-cache.c (region_cache_forward, region_cache_backward):
1001 Fix comments to match code: these functions return int, not boolean.
1002
1003 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1004
1005 * search.c (find_newline): Accept start and end byte positions
1006 as arguments and allow -1 if not known.
1007 (find_newline_no_quit): Likewise for start position.
1008 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1009 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1010 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1011 * editfns.c (Fconstrain_to_field): Break long line.
1012 Adjust call to find_newline.
1013 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1014 Use DEC_BOTH to start next search from the previous buffer
1015 position, where appropriate.
1016 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1017 (get_visually_first_element, move_it_vertically_backward): Likewise.
1018 Obtain byte position from the display iterator, where appropriate.
1019
1020 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1021
1022 print.c, process.c: Use bool for booleans.
1023 * lisp.h (wait_reading_process_output):
1024 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1025 (strout, debug_output_compilation_hack, float_to_string, print)
1026 (print_object):
1027 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1028 (decode_status, status_message, create_process, create_pty)
1029 (Fmake_network_process, Fnetwork_interface_info)
1030 (wait_reading_process_output, read_process_output)
1031 (write_queue_push, write_queue_pop, process_send_signal)
1032 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1033 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1034 Use bool for booleans.
1035 * process.c (Fnetwork_interface_list): Remove unused local.
1036 (connect_counter): Now EMACS_INT, not int.
1037
1038 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1039
1040 * bidi.c (bidi_fetch_char): Swap first and second arguments
1041 to match other functions accepting character and byte positions.
1042 Adjust comment.
1043 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1044 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1045 when you need just to move to the previous buffer position.
1046 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1047
1048 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1049
1050 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1051
1052 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1053
1054 Avoid character to byte conversions in motion subroutines.
1055 * indent.h (compute_motion, vmotion): Add byte position argument.
1056 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1057 Add eassert.
1058 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1059 Use list5 for return value.
1060 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1061 Adjust comments, style and calls to compute_motion.
1062 (Fvertical_motion): Adjust call to vmotion.
1063 * window.c (Fdelete_other_windows_internal): Record window start
1064 byte position and adjust call to vmotion.
1065 (window_scroll_line_based): Likewise with call to compute_motion.
1066 Use SET_PT_BOTH.
1067 (Frecenter): Adjust calls to vmotion.
1068
1069 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1070
1071 * lisp.h (list2i, list3i): New functions.
1072 (list4i): Move from window.c and make LISP_INLINE.
1073 * editfns.c (make_lisp_time):
1074 * fns.c (Flocale_info):
1075 * keyboard.c (parse_modifiers):
1076 * xterm.c (x_ewmh_activate_frame): Use list2i.
1077 * instel.c (signal_after_change):
1078 * nsfns.m (Fx_server_version, Fxw_color_values):
1079 * w32fns.c (Fxw_color_values, Fx_server_version):
1080 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1081 * fileio.c (Fvisited_file_modtime):
1082 * nsfns.m (Fns_display_usable_bounds):
1083 * w32.c (ltime): Use list4i.
1084
1085 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1086
1087 * search.c (find_newline_no_quit): Rename from find_next_newline.
1088 Add commentary.
1089
1090 * lisp.h (find_newline_no_quit): Rename prototype.
1091
1092 * xdisp.c (back_to_previous_line_start)
1093 (forward_to_next_line_start, get_visually_first_element)
1094 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1095 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1096 * bidi.c (bidi_find_paragraph_start): Callers of
1097 find_newline_no_quit changed.
1098
1099 * msdos.c: Change encoding to cp850. (Bug#13879)
1100 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1101
1102 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1103
1104 Coding system support cleanup and minor refactoring.
1105 * coding.h (enum coding_result_code): Remove
1106 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1107 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1108 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1109 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1110 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1111 (decode_coding_region, encode_coding_region, decode_coding_string):
1112 Remove unused compatibility macros.
1113 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1114 (record_conversion_result): Adjust user.
1115 (syms_of_coding): Likewise.
1116 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1117 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1118 (decode_coding_object): Simplify since xrealloc never returns NULL.
1119 Add eassert.
1120
1121 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1122
1123 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1124 * sysdep.c (list_system_processes)
1125 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1126 Make it a stub in this case; otherwise the build might fail,
1127 and this code hasn't been tested on such hosts anyway.
1128 Problem reported by Nelson H. F. Beebe in
1129 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1130 and analyzed by Jérémie Courrèges-Anglas in
1131 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1132
1133 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1134
1135 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1136 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1137 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1138 * bidi.c (bidi_find_paragraph_start): Likewise.
1139 * indent.c (vmotion): Likewise.
1140
1141 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1142
1143 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1144 * filelock.c: Include <c-ctype.h>.
1145 (MAX_LFINFO): New top-level constant.
1146 (lock_info_type): Remove members pid, boot_time. Add members at,
1147 dot, colon. Change user member to be the entire buffer, not a
1148 pointer. This allows us to handle the case where a foreign
1149 pid or boot time exceeds the local range. All uses changed.
1150 (LINKS_MIGHT_NOT_WORK): New constant.
1151 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1152 (defined_WINDOWSNT): Remove.
1153 (MAKE_LOCK_NAME, file_in_lock_file_name):
1154 Always use .#FILE (not .#-FILE) for the file lock,
1155 even if it is a regular file.
1156 (rename_lock_file): New function.
1157 (create_lock_file): Use it.
1158 (create_lock_file, read_lock_data):
1159 Prefer a symbolic link for the lock file, falling back on a
1160 regular file if symlinks don't work. Do not try to create
1161 symlinks on MS-Windows, due to security hassles. Stick with
1162 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1163 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1164 host may be using a Windowsish file system, and cannot use
1165 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1166 doesn't work. Don't fail merely because of a symlink-contents
1167 length limit in the current file system; fall back on regular
1168 files. Increase the symlink contents length limit to 8 KiB, this
1169 should be big enough for any real use and doesn't crunch the
1170 stack.
1171 (create_lock_file, lock_file_1, read_lock_data):
1172 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1173 (lock_file_1): Return error number, not bool. All callers changed.
1174 (ELOOP): New macro, if not already defined.
1175 (read_lock_data): Return size of lock file contents, not Lisp object.
1176 All callers changed. Handle a race condition if some other process
1177 replaces a regular-file lock with a symlink lock or vice versa,
1178 while we're trying to read the lock.
1179 (current_lock_owner): Parse contents more carefully, to help avoid
1180 confusing a regular-file lock with some other application's use
1181 of the file. Check for lock file contents being too long, or
1182 not parsing correctly.
1183 (current_lock_owner, lock_file):
1184 Allow foreign pid and boot times that exceed the local range.
1185 (current_lock_owner, lock_if_free, lock_file):
1186 Simplify allocation of lock file contents.
1187 * w32.c (sys_rename_replace): New function, containing most of
1188 the contents of the old sys_rename.
1189 (sys_rename): Use it.
1190 (fchmod): New dummy function.
1191 * w32.h (sys_rename_replace, fchmod): New decls.
1192
1193 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1194
1195 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1196 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1197 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1198 <dmantipov@yandex.ru>.
1199
1200 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1201
1202 * composite.c (get_composition_id, fill_gstring_header):
1203 Use make_uninit_vector where appropriate.
1204 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1205 * xselect.c (clean_local_selection_data): Likewise.
1206
1207 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1208
1209 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1210 * image.c (imagemagick_load_image): Calculate height and width
1211 after flattening the image, not before.
1212
1213 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1214
1215 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1216 * ftfont.c (ftfont_shape_by_flt): Likewise.
1217 * w32uniscribe.c (uniscribe_shape): Likewise.
1218
1219 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1220
1221 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1222 The old approach, which fell back on DIR/.#FILE.0 through
1223 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1224 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1225 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1226 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1227 because the locking mechanism was never reliable in that case).
1228 This patch fixes this and other bugs discovered by a code
1229 inspection that was prompted by
1230 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1231 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1232 to avoid interoperability problems between the MS-Windows and
1233 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1234 instances of Emacs now ignore each others' locks.
1235 * filelock.c (defined_WINDOWSNT): New constant.
1236 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1237 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1238 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1239 regular files on MS-Windows hosts.
1240 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1241 Use SAFE_ALLOCA to avoid problems with long file names.
1242 (MAX_LFINFO): Now a local constant, not a global macro.
1243 (IS_LOCK_FILE): Remove.
1244 (lock_file_1): Don't inspect errno if symlink call succeeds;
1245 that's not portable.
1246 (lock_file): Document that this function can return if lock
1247 creation fails.
1248 (lock_file): Don't access freed storage.
1249
1250 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1251
1252 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1253
1254 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1255
1256 * textprop.c: Use bool for booleans.
1257 (validate_interval_range, Fadd_text_properties)
1258 (Fremove_text_properties): Prefer bool to int when either works.
1259
1260 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1261
1262 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1263 If the interval tree changes as a side effect of calling
1264 modify_region, re-do processing starting from the call to
1265 validate_interval_range. (Bug#13743)
1266
1267 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1268
1269 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1270 (Bug#13546).
1271
1272 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1273
1274 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1275 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1276 access to the lock file until it is written and closed.
1277 (Bug#13807)
1278
1279 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1280
1281 * callint.c (Qcall_interactively):
1282 * macros.c (Qexecute_kbd_macro):
1283 Now static.
1284
1285 2013-02-26 Bastien Guerry <bzg@gnu.org>
1286
1287 * window.c (Frecenter): Tiny docstring enhancement.
1288
1289 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1290
1291 Minor textprop integer cleanup.
1292 * intervals.h, textprop.c (add_text_properties_from_list):
1293 Return void, not int, since nobody uses the return value.
1294 * textprop.c (validate_plist, add_properties, remove_properties)
1295 (Fadd_text_properties):
1296 Don't assume list length fits in int.
1297 (interval_has_all_properties, interval_has_some_properties)
1298 (interval_has_some_properties_list, add_properties, remove_properties)
1299 (Fadd_text_properties, Fremove_text_properties)
1300 (Fremove_list_of_text_properties, text_property_stickiness):
1301 Use bool for booleans.
1302 (Fadd_text_properties, Fremove_text_properties):
1303 (Fremove_list_of_text_properties):
1304 Reindent do-while as per GNU style.
1305
1306 2013-02-25 Eli Zaretskii <eliz@gnu.org>
1307
1308 Implement CLASH_DETECTION for MS-Windows.
1309
1310 * filelock.c [WINDOWSNT]: Include w32.h.
1311 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1312 function of that name. Up-case the macro arguments.
1313 (IS_LOCK_FILE): New macro.
1314 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1315 (create_lock_file): New function, with body extracted from
1316 lock_file_1.
1317 [WINDOWSNT]: Implement lock files by writing a regular file with
1318 the lock information as its contents.
1319 (read_lock_data): New function, on Posix platforms just calls
1320 emacs_readlinkat.
1321 [WINDOWSNT]: Read the lock info from the file.
1322 (current_lock_owner): Call read_lock_data instead of calling
1323 emacs_readlinkat directly.
1324 (lock_file) [WINDOWSNT]: Run the file name through
1325 dostounix_filename.
1326
1327 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1328 just check if the process by that PID exists.
1329
1330 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1331 also present, as doing so will fail to error out if the file
1332 already exists.
1333
1334 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1335
1336 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1337 (Fremove_list_of_text_properties): Skip all of the intervals in
1338 the region between START and END that already have resp. don't
1339 have the requested properties, not just the first one.
1340 Add assertions that the loop afterwards always modifies the
1341 properties. (Bug#13743)
1342
1343 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1344
1345 * callint.c (Fcall_interactively): Use the right lexical environment
1346 for `interactive' specs (bug#13811).
1347 * eval.c (Feval): Accept a lexical environment.
1348
1349 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1350
1351 Simplify data_start configuration (Bug#13783).
1352 This is a followon simplification to the fix for Bug#13650.
1353 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1354 (START_FILES): Remove. All uses removed.
1355 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1356 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1357 (buildobj.h): Use it.
1358 ($(ALLOBJS)): Depend on globals.h.
1359 (temacs$(EXEEXT)): Use $(ALLOBJS).
1360 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1361 * deps.mk (vm-limit.o):
1362 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1363 Do not depend on mem-limits.h.
1364 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1365 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1366 [__GNUC__ && !ORDINARY_LINK]: Remove.
1367 * mem-limits.h, pre-crt0.c: Remove.
1368 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1369 * unexcoff.c (etext): New decl.
1370 (make_hdr): Use DATA_START instead of start_of_data.
1371 * vm-limit.c: Move most of mem-limits.h's contents here.
1372 (data_start): New decl. It's OK if this is approximate,
1373 so simplify-away some unnecessary exactness.
1374 (POINTER): Remove; all uses removed.
1375 (data_space_start): Now char *, to avoid casts.
1376 (exceeds_lisp_ptr): New function, replacing the old
1377 EXCEEDS_LISP_PTR macro. All uses changed.
1378 (check_memory_limits): Simplify and remove casts.
1379 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1380 (memory_warnings): Use data_start instead of start_of_data.
1381
1382 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1383
1384 * xdisp.c (set_message): Only check for debug-on-message if STRING
1385 is a string. (Bug#13797)
1386
1387 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1388
1389 Fix regression introduced by July 10 filelock.c patch.
1390 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1391 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1392 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1393 and diagnosed by Andreas Schwab in
1394 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1395
1396 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1397
1398 Assume C89 or better.
1399 * ralloc.c (SIZE, POINTER, NIL):
1400 * vm-limit.c (POINTER):
1401 Remove, replacing all uses with C89 equivalents. These old
1402 symbols were present only for porting to pre-C89 platforms.
1403
1404 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
1405
1406 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1407 This avoids warning messages reported as part of Bug#13546.
1408
1409 2013-02-21 Ken Brown <kbrown@cornell.edu>
1410
1411 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1412
1413 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1414
1415 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1416
1417 * keyboard.c (Qcommand_execute): New var.
1418 (command_loop_1, read_char): Use it.
1419 (Fcommand_execute): Remove, replace by an Elisp implementation.
1420 (syms_of_keyboard): Adjust accordingly.
1421
1422 2013-02-19 Daniel Colascione <dancol@dancol.org>
1423
1424 * sheap.c (report_sheap_usage): Use message, not message1, so
1425 that we don't try to create a buffer while we're in the middle
1426 of dumping Emacs. Explain why.
1427
1428 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
1429
1430 * search.c (find_newline): Return byte position in bytepos.
1431 Adjust comment.
1432 (find_next_newline_no_quit, find_before_next_newline):
1433 Add bytepos argument.
1434 * lisp.h (find_newline, find_next_newline_no_quit)
1435 (find_before_next_newline): Adjust prototypes.
1436 * bidi.c (bidi_find_paragraph_start):
1437 * editfns.c (Fconstrain_to_field, Fline_end_position):
1438 * indent.c (compute_motion, vmotion):
1439 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1440 (get_visually_first_element, move_it_vertically_backward):
1441 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1442
1443 2013-02-19 Eli Zaretskii <eliz@gnu.org>
1444
1445 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1446 resources were not orderly released.
1447
1448 2013-02-17 Eli Zaretskii <eliz@gnu.org>
1449
1450 * xdisp.c (x_draw_vertical_border): For a window that is neither
1451 the leftmost nor the rightmost, redraw both the left and the right
1452 vertical borders. (Bug#13723)
1453
1454 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1455
1456 * xml.c (init_libxml2_functions):
1457 * sound.c (sound_warning):
1458 * sheap.c (report_sheap_usage):
1459 * process.c (wait_reading_process_output):
1460 * msdos.c (XMenuActivate):
1461 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1462 * keyboard.c (top_level_1):
1463 * editfns.c (Fmessage, Fmessage_box):
1464 * callint.c (Fcall_interactively):
1465 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1466
1467 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1468
1469 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
1470 * frame.c (syms_of_frame): ... to here.
1471
1472 2013-02-16 Eli Zaretskii <eliz@gnu.org>
1473
1474 * w32.c (sys_chown): Remove unused function.
1475
1476 * w32term.c <input_signal_count>: Declare 'volatile'
1477 unconditionally. (Bug#9066)
1478
1479 * w32.c (set_errno): Reset h_errno and don't set it to any other
1480 value. Set errno instead.
1481 (check_errno): Reset h_errno.
1482 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1483 (sys_gethostname, sys_getservbyname, sys_getpeername)
1484 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1485 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1486 h_errno.
1487 (sys_gethostbyname): Set h_errno only errors detected.
1488
1489 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1490
1491 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1492
1493 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1494
1495 * keyboard.c (read_char): Fix calculation of auto-save time out
1496 when auto-save-timeout is less than 4. (Bug#13720)
1497
1498 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
1499 time. Improve diagnostics in DebPrint. (Bug#13546)
1500
1501 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1502 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1503 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1504 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1505 make sure errno is set to an appropriate value. (Bug#13546)
1506 (socket_to_fd): Add assertion against indexing fd_info[] with a
1507 value that is out of bounds.
1508 (sys_accept): If fd is negative, do not set up the child_process
1509 structure for reading.
1510
1511 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1512
1513 * composite.c (fill_gstring_header): Remove useless prototype.
1514 Break long line.
1515 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1516 * print.c (PRINTDECLARE, print_object):
1517 * search.c (compile_pattern, fast_looking_at, search_buffer):
1518 (simple_search, boyer_moore, Freplace_match):
1519 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1520 (get_overlay_arrow_glyph_row, display_mode_element):
1521 (decode_mode_spec_coding, message3):
1522 * xfaces.c (face_at_string_position): Use bool for booleans.
1523 Adjust comments.
1524
1525 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1526
1527 Fix AIX port (Bug#13650).
1528 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1529 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1530 was #undeffed earlier, so it cannot be used as a macro here.
1531 Use the constant and not the macro.
1532
1533 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1534
1535 * w32proc.c (new_child): If no vacant slots are found in
1536 child_procs[], make another pass looking for slots whose process
1537 has exited or died. (Bug#13546)
1538
1539 * w32.c (sys_pipe): When failing due to file descriptors above
1540 MAXDESC, set errno to EMFILE.
1541 (_sys_read_ahead): Update cp->status when failing to read serial
1542 communications input, so that the status doesn't stay at
1543 STATUS_READ_IN_PROGRESS. (Bug#13546)
1544
1545 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1546
1547 * gtkutil.c (tb_size_cb): New function.
1548 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1549
1550 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1551
1552 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1553 an event.
1554
1555 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1556
1557 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1558
1559 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1560
1561 * font.c (font_range): Add pos_byte argument. Adjust comment
1562 and break long line.
1563 * font.h (font_range): Adjust prototype.
1564 * composite.c (autocmp_chars): Pass byte position to font_range.
1565 Break long line. Remove useless prototype and format comment.
1566
1567 2013-02-13 Glenn Morris <rgm@gnu.org>
1568
1569 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1570
1571 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1572
1573 Improve AIX port some more (Bug#13650).
1574 With this, it should be as good as it was in 23.3, though it's
1575 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1576 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1577 * unexaix.c (start_of_text): Remove.
1578 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1579 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1580 (orig_load_scnptr, orig_data_scnptr):
1581 Now off_t, not long, since they are file offsets.
1582 (make_hdr): Use _data, not start_of_data ().
1583 This is the key part of the fix.
1584 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1585 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1586
1587 * pre-crt0.c (data_start): Initialize to 1.
1588 This ports to compilers that optimize the external declaration
1589 'int x = 0;' as if it were 'int x;' to shrink the executable.
1590
1591 Improve AIX port (Bug#13650).
1592 This doesn't fix the bug, but it makes progress: Emacs builds now.
1593 * unexaix.c: Include inttypes.h, stdarg.h.
1594 (report_error, report_error_1): Mark as _Noreturn.
1595 (report_error): Don't report the wrong errno.
1596 (report_error_1): Now varargs. All callers changed.
1597 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1598 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1599 (write_ptr): Use %p to print address rather than %lx and a cast
1600 to unsigned long. Grow buffer a bit, to be safer.
1601
1602 2013-02-13 Eli Zaretskii <eliz@gnu.org>
1603
1604 * bidi.c (bidi_resolve_neutral): After finding the next
1605 non-neutral character, accept NEUTRAL_ON type as well, because
1606 directional control characters, such as LRE and RLE, have their
1607 type converted to that by bidi_resolve_weak. This avoids aborts
1608 when LRE/RLE follows a run of neutrals.
1609 (bidi_move_to_visually_next): Assert that return value of
1610 bidi_peek_at_next_level is non-negative. Negative values will
1611 cause an infloop.
1612
1613 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1614
1615 Minor getenv-related fixes.
1616 * callproc.c (Fcall_process_region) [!DOS_NT]:
1617 Avoid unnecessary duplicate call to getenv.
1618 * callproc.c (init_callproc):
1619 * dispnew.c (init_display):
1620 * sysdep.c (sys_subshell):
1621 Omit unnecessary cast of getenv or egetenv.
1622
1623 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
1624
1625 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1626 Update dependencies.
1627
1628 2013-02-12 Eli Zaretskii <eliz@gnu.org>
1629
1630 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1631 marker's position.
1632 (display_line): Set w->region_showing to the value of
1633 it->region_beg_charpos, not to -1. This fixes redisplay
1634 optimization when cursor is moved up after M->. (Bug#13623)
1635 (Bug#13626)
1636 (try_scrolling): Scroll text up more if point is too close to ZV
1637 and inside the scroll margin. This makes sure point is moved
1638 outside the scroll margin in these cases.
1639
1640 * window.h (struct window): region_showing can no longer be
1641 negative.
1642
1643 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1644
1645 Tune by using memchr and memrchr.
1646 * doc.c (Fsnarf_documentation):
1647 * fileio.c (Fsubstitute_in_file_name):
1648 * search.c (find_newline, scan_newline):
1649 * xdisp.c (pos_visible_p, display_count_lines):
1650 Use memchr and memrchr rather than scanning byte-by-byte.
1651 * search.c (find_newline): Rename from scan_buffer.
1652 Omit first arg TARGET, as it's always '\n'. All callers changed.
1653
1654 Clean up read_key_sequence a tiny bit more.
1655 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1656 (read_key_sequence): Remove unused locals.
1657
1658 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1659
1660 Clean up read_key_sequence a bit; reread active keymaps after first event.
1661 * keyboard.c (read_char, read_char_x_menu_prompt)
1662 (read_char_minibuf_menu_prompt):
1663 Replace nmaps+maps with a single `map' arg.
1664 (follow_key): Operate on a single map.
1665 (active_maps): New function.
1666 (test_undefined): Also return true for nil bindings.
1667 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1668 a single (composed) keymap. Remember `first_event' to choose the right
1669 set of active keymaps. Recompute the set of keymaps after receiving
1670 the first event. Remove GOBBLE_FIRST_EVENT.
1671 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1672 * keyboard.h (read_char): Update declaration.
1673 * lread.c (read_filtered_event): Adjust call to read_char.
1674
1675 2013-02-11 Eli Zaretskii <eliz@gnu.org>
1676
1677 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1678 Don't use the limitation on backwards movement when lines are truncated
1679 in the window. (Bug#13675)
1680
1681 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1682
1683 * marker.c (set_marker_internal): If desired position is passed
1684 as a marker, avoid call to buf_charpos_to_bytepos.
1685 * window.c (Fset_window_point): Omit redundant type checking.
1686 (Fset_window_start): Likewise. Format comment.
1687 (window_scroll_pixel_based): Use set_marker_restricted_both
1688 with character and byte positions obtained from an iterator.
1689 (Fset_window_configuration): Use set_marker_restricted_both.
1690 * xdisp.c (message_dolog): Likewise.
1691
1692 2013-02-10 Eli Zaretskii <eliz@gnu.org>
1693
1694 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1695 When text lines are longer than window's screen lines, don't move back
1696 too far. This speeds up some redisplay operations. (Bug#13675)
1697
1698 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1699
1700 * syntax.c (scan_sexps_forward): Fix byte position calculation
1701 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1702
1703 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1704
1705 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1706 that was not needed.
1707
1708 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1709
1710 Minor hashing refactoring.
1711 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1712 (sxhash_float): Return EMACS_UINT, for consistency with the other
1713 hash functions.
1714 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1715 non-static inline function and therefore can't use static vars.
1716 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1717 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1718 with the other hash functions.
1719
1720 2013-02-09 Eli Zaretskii <eliz@gnu.org>
1721
1722 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1723 XXXXXX part of the temporary file pattern is not downcased even
1724 when w32-downcase-file-names is non-nil. (Bug#13661)
1725
1726 * xdisp.c (decode_mode_spec): Remove handling of %t.
1727
1728 * msdos.c (careadlinkatcwd): Remove.
1729
1730 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1731
1732 * lread.c (skip_dyn_bytes): New function (bug#12598).
1733 (read1): Use it. Use getc instead of READCHAR to read bytes.
1734 (load_each_byte): Remove. Update users.
1735
1736 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1737
1738 * search.c (scan_buffer): Calculate end byte position just once.
1739 (scan_newline): Do not recalculate start_byte.
1740 (search_command): Use eassert.
1741 * syntax.c (struct lisp_parse_state): New member location_byte.
1742 (scan_sexps_forward): Record from_byte and avoid redundant
1743 character to byte position calculation ...
1744 (Fparse_partial_sexp): ... here. Break too long line.
1745
1746 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1747
1748 * lisp.h (make_uninit_vector): New function.
1749 * alloc.c (Fvector, Fmake_byte_code):
1750 * ccl.c (Fregister_ccl_program):
1751 * charset.c (Fdefine_charset_internal, define_charset_internal):
1752 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1753 * composite.c (syms_of_composite):
1754 * font.c (Fquery_font, Ffont_info, syms_of_font):
1755 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1756 * ftfont.c (ftfont_shape_by_flt):
1757 * indent.c (recompute_width_table):
1758 * nsselect.m (clean_local_selection_data):
1759 * syntax.c (init_syntax_once):
1760 * w32unsubscribe.c (uniscribe_shape):
1761 * window.c (Fcurrent_window_configuration):
1762 * xfaces.c (Fx_family_fonts):
1763 * xselect.c (selection_data_to_lisp_data): Use it.
1764
1765 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1766
1767 * coding.c (Fdefine_coding_system_internal): Use AREF where
1768 argument is known to be a vector.
1769 * fns.c (Flocale_info): Likewise for ASET.
1770 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1771 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1772
1773 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1774
1775 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1776 height.
1777
1778 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1779 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1780 updateCollectionBehaviour.
1781
1782 * nsterm.m (NEW_STYLE_FS): Remove.
1783 (ns_last_use_native_fullscreen): New variable.
1784 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1785 (x_set_window_size): Do not take title bar and tool bar into account
1786 if isFullscreen returns YES.
1787 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1788 (check_native_fs): New function.
1789 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1790 (ns_term_init): Remove NEW_STYLE_FS.
1791 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1792 and tool bar if isFullscreen returns NO.
1793 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1794 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1795 with HAVE_NATIVE_FS.
1796 (window:willUseFullScreenPresentationOptions:): New method.
1797 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1798 Hide toolbar if not enabled (Bug#13444).
1799 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1800 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1801 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1802 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1803 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1804 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1805 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1806 (syms_of_nsterm): Add ns-use-native-fullscreen.
1807
1808 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1809
1810 * fileio.c (Qchoose_write_coding_system): Now static.
1811
1812 2013-02-04 Eli Zaretskii <eliz@gnu.org>
1813
1814 * xdisp.c (window_buffer_changed): region_showing can be negative,
1815 which still means region is being displayed.
1816 (redisplay_internal): Resurrect code that forced redisplay of the
1817 whole window when showing region and the mark has changed.
1818 Record the new mark position to allow redisplay optimizations.
1819 (display_line): If it->region_beg_charpos is non-zero, set the
1820 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1821
1822 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1823 not bitfield of 1 bit.
1824
1825 2013-02-03 Daniel Colascione <dancol@dancol.org>
1826
1827 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1828 daemon mode works on cygw32 when Emacs is installed and not just
1829 during development.
1830
1831 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1832
1833 Avoid file time stamp bug on MS-Windows (Bug#13149).
1834 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1835 as FAT32 doesn't update time stamps when truncating them.
1836 Also, check that a file time stamp is not a multiple of 100 ns;
1837 this should catch all instances of the problem on MS-Windows,
1838 as its native file system resolution is 100 ns or worse, and
1839 checking for a non-multiple of 100 ns should impose only a small
1840 overhead on systems with ns resolution.
1841
1842 2013-02-02 Eli Zaretskii <eliz@gnu.org>
1843
1844 Avoid encoding file names on MS-Windows when they need to be run
1845 through dostounix_filename.
1846 * w32.c (normalize_filename): Accept an additional argument
1847 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1848 downcase it even if w32-downcase-file-names is non-nil.
1849 (dostounix_filename): Accept an additional argument MULTIBYTE and
1850 pass it to normalize_filename.
1851 (emacs_root_dir): Adjust.
1852
1853 * msdos.h (dostounix_filename): Adjust prototype.
1854
1855 * w32.h (dostounix_filename): Adjust prototype.
1856
1857 * msdos.c (dostounix_filename): Accept an additional argument and
1858 ignore it.
1859 (init_environment): Adjust callers of dostounix_filename.
1860
1861 * fileio.c (Ffile_name_directory, file_name_as_directory)
1862 (directory_file_name, Fexpand_file_name)
1863 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1864 dostounix_filename.
1865 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1866 non-nil.
1867 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1868 variables, as egetenv is case-insensitive for DOS_NT.
1869
1870 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1871 with an encoded file name.
1872
1873 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1874 Adjust calls to dostounix_filename.
1875
1876 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1877
1878 * unexw32.c (unexec): Adjust call to dostounix_filename.
1879
1880 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1881
1882 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1883 dostounix_filename.
1884
1885 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1886 dostounix_filename.
1887
1888 * callproc.c (Fcall_process): Make sure program name in PATH and
1889 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1890 is passed to exec/spawnve, which fails unless the file-name
1891 encoding is UTF-8.
1892
1893 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1894 even if w32-quote-process-args is nil.
1895
1896 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1897
1898 Fix timestamp bug when write-region appends nothing (Bug#13149).
1899 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1900 the file's time stamp doesn't change if Emacs happens to write nothing
1901 to the file, and on a buggy file system this could cause Emacs to
1902 incorrectly infer that the file system doesn't have the bug.
1903 Avoid this problem by inhibiting the inference in this case.
1904
1905 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1906
1907 * window.h (struct window): Convert base_line_number, base_line_pos
1908 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1909 Convert region_showing member from Lisp_Object to bitfield.
1910 Remove sequence_number member. Adjust comments.
1911 * window.c (sequence_number): Remove.
1912 (make_window): Initialize column_number_displayed.
1913 * print.c (print_object): Follow the printed representation of
1914 frames and print window pointer to distinguish between windows.
1915 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1916 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1917 (wset_column_number_displayed, wset_region_showing): Remove.
1918 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1919 (try_scrolling, try_cursor_movement, redisplay_window)
1920 (try_window_reusing_current_matrix, try_window_id, display_line)
1921 (display_mode_lines, decode_mode_spec): Adjust users.
1922 * .gdbinit (pwinx): Do not print sequence_number.
1923
1924 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1925
1926 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1927 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1928 * dired.c: Include <fcntl.h>.
1929 (open_directory): New function, which uses open and fdopendir
1930 rather than opendir. DOS_NT platforms still use opendir, though.
1931 (directory_files_internal, file_name_completion): Use it.
1932 (file_attributes): New function, with most of the old Ffile_attributes.
1933 (directory_files_internal, Ffile_attributes): Use it.
1934 (file_attributes, file_name_completion_stat): First arg is now fd,
1935 not dir name. All uses changed. Use fstatat rather than lstat +
1936 stat.
1937 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1938 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1939 (emacs_readlinkat): New function, with much of the old
1940 Ffile_symlink_p, but with an fd argument for speed.
1941 It uses readlinkat rather than careadlinkatcwd, so that it
1942 need not assume the working directory.
1943 (Ffile_symlink_p): Use it.
1944 * filelock.c (current_lock_owner): Use emacs_readlinkat
1945 rather than emacs_readlink.
1946 * lisp.h (emacs_readlinkat): New decl.
1947 (READLINK_BUFSIZE, emacs_readlink): Remove.
1948 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1949 (emacs_norealloc_allocator, emacs_readlink): Remove.
1950 This stuff is moved to fileio.c.
1951 * w32.c (fstatat, readlinkat): New functions.
1952 (careadlinkat): Don't check that fd == AT_FDCWD.
1953 (careadlinkatcwd): Remove; no longer needed.
1954
1955 2013-01-31 Glenn Morris <rgm@gnu.org>
1956
1957 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
1958 (Fwrite_region): Update for new choose_write_coding_system args.
1959 Move the last piece of choose_write_coding_system here. (Bug#13522)
1960 (syms_of_fileio): Add choose-write-coding-system.
1961
1962 2013-01-30 Eli Zaretskii <eliz@gnu.org>
1963
1964 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1965 (sys_close): Zero out the flags for the file descriptor before
1966 closing it. (Bug#13546)
1967
1968 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
1969 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1970 Use CharNextExA and CharPrevExA to iterate over file names encoded in
1971 DBCS. (Bug#13553)
1972
1973 * w32.c (w32_get_long_filename, init_environment, readlink):
1974 Support file names encoded in DBCS codepages.
1975 (readlink): Use the current file-name-coding-system, not the ANSI
1976 codepage, to decode and handle targets of symlinks.
1977
1978 2013-01-28 Eli Zaretskii <eliz@gnu.org>
1979
1980 * w32.c (opendir): Now accepts a 'const char *'.
1981
1982 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1983
1984 Remove obsolete redisplay code. See the discussion at
1985 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1986 * dispnew.c (preemption_period, preemption_next_check): Remove.
1987 (Vredisplay_preemption_period): Likewise.
1988 (update_frame, update_single_window, update_window, update_frame_1):
1989 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1990 used, following the 2012-06-22 change.
1991
1992 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1993
1994 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1995
1996 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1997
1998 * font.c (num_fonts): Remove the leftover from old
1999 debugging code. Adjust comment style here and there.
2000 * insdel.c (insert_1): Remove.
2001 * lisp.h (insert_1): Remove prototype.
2002 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2003
2004 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2005
2006 * w32.c (max_filename_mbslen): New function.
2007 (normalize_filename, readdir): Use it to detect locales where ANSI
2008 encoding of file names uses a double-byte character set (DBCS).
2009 If a DBCS encoding is used, advance by characters using
2010 CharNextExA, instead of incrementing a 'char *' pointer.
2011 Use _mbslwr instead of _strlwr. (Bug#13515)
2012
2013 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2014 request of memory reservation to 1.7GB. (Bug#13065)
2015
2016 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2017
2018 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2019 at check_extra_latin label. (Bug#13505)
2020
2021 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2022
2023 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2024 Avoid redundant calls to strlen.
2025
2026 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2027
2028 Drop async_visible and async_iconified fields of struct frame.
2029 This is possible because async input is gone; for details, see
2030 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2031 * frame.h (struct frame): Remove async_visible and async_iconified
2032 members, convert garbaged to unsigned bitfield. Adjust comments.
2033 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2034 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2035 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2036 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2037 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2038 * w32term.c: Ditto.
2039 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2040 properly. Likewise for obscured.
2041 * xterm.c: Ditto.
2042 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2043 properly.
2044 * nsterm.m: Ditto.
2045 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2046
2047 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2048
2049 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2050 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2051
2052 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2053
2054 * xdisp.c (message2, message2_nolog): Remove functions.
2055 (message3, message3_nolog): Extract nbytes and multibyteness directly
2056 from the string. Change all callers.
2057 (message3_nolog): Don't set message_enable_multibyte since set_message
2058 will reset it anyway.
2059 (message1, message1_nolog): Use message3.
2060 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2061 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2062 (set_message): Drop all but the second arg, which has to be a string.
2063 (set_message_1): Simplify now that we know that a1 is NULL and the
2064 second arg is a string.
2065 * frame.h (struct frame): Remove `message_buf' field.
2066 Use glyphs_initialized_p instead.
2067 (FRAME_MESSAGE_BUF): Remove macro.
2068 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2069 * lisp.h (message2, message2_nolog): Remove declarations.
2070 (message3, message3_nolog): Update declarations.
2071 * keyboard.c (read_char_minibuf_menu_text)
2072 (read_char_minibuf_menu_width): Remove vars.
2073 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2074 to correctly handle multibyte strings.
2075 * frame.c (delete_frame): Don't free message_buf any more.
2076 * editfns.c (message_text, message_length): Remove vars.
2077 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2078 * fileio.c (auto_save_error): Use message3 instead of message2.
2079 * dispnew.c (adjust_frame_message_buffer): Remove function.
2080
2081 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2082
2083 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2084 real estate used for the tool bar and the menu bar.
2085
2086 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2087
2088 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2089 hidden buffer is prepared to modification (Bug#13164).
2090
2091 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2092
2093 * window.h (struct window): Change window_end_valid member from
2094 Lisp_Object to a bitfield. Adjust comments.
2095 (wset_window_end_valid): Remove.
2096 * window.c (adjust_window_count): Clear window_end_valid.
2097 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2098 (Fwindow_line_height, set_window_buffer, Frecenter)
2099 (Fsplit_window_internal, Fdelete_other_windows_internal)
2100 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2101 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2102 * xdisp.c (check_window_end, reconsider_clip_changes)
2103 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2104 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2105 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2106
2107 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2108
2109 * xdisp.c (mark_window_display_accurate): Simplify the loop
2110 assuming that the only one of vchild, hchild or buffer window
2111 slots is non-nil. Call mark_window_display_accurate_1 for
2112 the leaf windows only.
2113 (mark_window_display_accurate_1): Always assume leaf window.
2114 Adjust comment.
2115
2116 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2117
2118 * emacs.c (Qkill_emacs_hook): Now static.
2119
2120 * fileio.c (Finsert_file_contents): Simplify.
2121 Remove unnecessary assignments and tests.
2122
2123 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2124
2125 * w32.c (acl_set_file): Don't test for errors unless
2126 set_file_security returns FALSE. Avoids spurious errors when
2127 saving files.
2128
2129 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2130
2131 * fileio.c (Finsert_file_contents): Revert code introduced at
2132 2013-01-18 in favor of the simpler and generally better fix.
2133 Save stack space by removing 'buffer' and reusing 'read_buf'
2134 where appropriate.
2135
2136 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2137
2138 * lisp.h (eabs): Define unconditionally (Bug#13419).
2139 The old "#if !defined (eabs)" was an unnecessary revenant of back
2140 when this macro was called "abs". Document 'eabs' better.
2141
2142 2013-01-19 Glenn Morris <rgm@gnu.org>
2143
2144 * fns.c (Frandom): Doc fix.
2145
2146 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2147
2148 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2149 segfault when there are lots of overlays.
2150
2151 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2152 when there are lots of overlays.
2153 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2154 for the details and a way to reproduce.
2155
2156 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2157
2158 * fileio.c: Use O_APPEND to append.
2159 This corresponds better to the natural interpretation of "append",
2160 and avoids the need to open the output file twice, or to invoke
2161 lseek when APPEND is neither nil nor a number.
2162 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2163 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2164 file possibly twice, and lseeking to its end; this avoids the
2165 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2166 at the same time: the combination is never needed and apparently
2167 it doesn't work with DOS_NT.
2168
2169 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2170 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2171
2172 Allow floating-point file offsets.
2173 Problem reported by Vitalie Spinu in
2174 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2175 * fileio.c (emacs_lseek): Remove.
2176 (file_offset): New function.
2177 (Finsert_file_contents, Fwrite_region): Use it.
2178
2179 2013-01-19 Chong Yidong <cyd@gnu.org>
2180
2181 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2182 aborting on Fsignal (Bug#13289).
2183
2184 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2185
2186 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2187 set_file_security as failure due to insufficient privileges.
2188 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2189 (fstat): Return owner and group like 'stat' and 'lstat' do.
2190
2191 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2192
2193 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2194 The bug was observed on Ubuntu operating inside a virtual machine,
2195 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2196 The workaround introduces a race condition on non-buggy hosts,
2197 but it's an unlikely race and anyway there's a nearly identical
2198 nearby race that can't be fixed.
2199 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2200 New static vars.
2201 (Fwrite_region): Test for file system time stamp bug.
2202 (init_fileio): New function.
2203 * lisp.h (init_fileio): Declare it.
2204 * emacs.c (main): Call it.
2205
2206 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2207 and make it more consistent with other stat-failure diagnostics.
2208
2209 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2210
2211 Fix crash when inserting data from non-regular files.
2212 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2213 for the error description produced by valgrind.
2214 * fileio.c (read_non_regular): Rename to read_contents.
2215 Free Lisp_Save_Value object used to pass parameters.
2216 (read_non_regular_quit): Rename to read_contents_quit.
2217 (Finsert_file_contents): Redesign internal file reading loop to adjust
2218 gap and end positions after each read and so help make_gap to work
2219 properly. Do not signal an I/O error too early and so do not leave
2220 not yet decoded characters in a buffer, which was the reason of
2221 redisplay crash. Use list2 to build return value. Adjust comments.
2222
2223 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2224
2225 Close a race when statting and reading files (Bug#13149).
2226 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2227 This avoids a race if the file is renamed between stat and open.
2228 This race is not the problem originally noted in Bug#13149;
2229 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2230
2231 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2232
2233 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2234 objects, related functions and macros.
2235 (make_save_value): Adjust prototype.
2236 (make_save_pointer): New prototype.
2237 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2238 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2239 * alloc.c (format_save_value): Rename to make_save_value.
2240 (make_save_pointer): New function.
2241 (record_xmalloc): Use make_save_pointer.
2242 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2243 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2244 Change users of make_save_value to make_save_pointer.
2245 Likewise for format_save_value and make_save_value.
2246
2247 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2248
2249 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2250 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2251 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2252 debugging stubs.
2253
2254 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2255
2256 * alloc.c (free_save_value): Now static.
2257
2258 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2259
2260 * keymap.c (map_keymap_internal): Use format_save_value.
2261 (map_keymap_char_table_item): Adjust accordingly.
2262 * fileio.c (non_regular_fd, non_regular_inserted)
2263 (non_regular_nbytes): Remove.
2264 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2265 Use format_save_value to pass parameters to read_non_regular.
2266 (read_non_regular): Use XSAVE_ macros to extract parameters.
2267 Adjust comment.
2268 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2269 format_save_value.
2270 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2271
2272 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2273
2274 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2275 extraction from any Lisp_Save_Value slot. Add type checking.
2276 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2277 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2278 * xselect.c: All users changed.
2279
2280 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2281
2282 Some convenient bits to deal with Lisp_Save_Values.
2283 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2284 (allocate_misc): Remove prototype.
2285 (format_save_value): New prototype.
2286 * alloc.c (allocate_misc): Revert back to static.
2287 (format_save_value): New function to build Lisp_Save_Value
2288 object with the specified internal structure.
2289 (make_save_value): Reimplement using format_save_value.
2290 * editfns.c (save_excursion_save): Use format_save_value.
2291 (save_excursion_restore): Use XSAVE_OBJECT.
2292
2293 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2294
2295 Avoid needless casts with XSAVE_POINTER.
2296 * alloc.c (mark_object) [GC_MARK_STACK]:
2297 * dired.c (directory_files_internal_unwind):
2298 * fileio.c (do_auto_save_unwind):
2299 * gtkutil.c (pop_down_dialog):
2300 * keymap.c (map_keymap_char_table_item):
2301 * lread.c (load_unwind):
2302 * nsmenu.m (pop_down_menu):
2303 * print.c (print_object) [GC_MARK_STACK]:
2304 * xfns.c (clean_up_file_dialog):
2305 * xmenu.c (cleanup_widget_value_tree):
2306 Omit casts between XSAVE_POINTER and a pointer type.
2307
2308 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2309
2310 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2311 * eval.c (eval_sub): Protect `form' from being GCed before its
2312 car and cdr becomes protected with the backtrace entry.
2313
2314 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2315
2316 Make Lisp_Save_Value more versatile storage for up to four objects.
2317 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2318 (struct Lisp_Save_Value): New layout. Adjust comments.
2319 (XSAVE_POINTER): New macro.
2320 (XSAVE_INTEGER): Likewise.
2321 (allocate_misc): Add prototype.
2322 (free_misc): Likewise.
2323 * alloc.c (allocate_misc): Now global.
2324 (free_misc): Likewise. Adjust comment.
2325 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2326 (free_save_value): Likewise.
2327 (mark_object): Likewise.
2328 * editfns.c (save_excursion_save): Pack everything within
2329 Lisp_Save_Value and so avoid xmalloc.
2330 (save_excursion_restore): Adjust to match new layout. Use free_misc
2331 because we do not allocate extra memory any more. Add eassert.
2332 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2333 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2334 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2335 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2336 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2337
2338 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2339
2340 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2341 (nsfont_draw): Remove disabling of LCD smoothing.
2342 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2343 Bug#11484 with LCD smoothing on.
2344
2345 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
2346
2347 Fix SIGDANGER handlers, for AIX (Bug#13408).
2348 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2349 Move handlers here from emacs.c; they were out of place.
2350
2351 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2352
2353 * xterm.c (syms_of_xterm): Adjust documentation for
2354 scroll-bar-adjust-thumb-portion.
2355
2356 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2357
2358 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2359 determine whether scroll bar thumb size should be adjusted or
2360 not. Use variable for MOTIF.
2361
2362 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2363 GTK.
2364
2365 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2366
2367 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2368 event is generated.
2369 (doCommandBySelector:): Set processingCompose to NO.
2370
2371 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2372 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2373 (nsfont_list_family): Add block/unblock_input calls.
2374 (nsfont_open): Move block_input earlier. Add unblock_input before early
2375 return.
2376 (nsfont_draw): Add block/unblock_input calls.
2377
2378 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2379
2380 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2381 for old_charpos and old_bytepos.
2382
2383 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2384
2385 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2386 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2387 Clear tzvalbuf_in_environ if this workaround is in effect.
2388 Problem and fix reported by Kazuhiro Ito.
2389
2390 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2391
2392 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2393 Fix ambiguous doc string cross-reference(s).
2394
2395 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2396 doc string cross-reference(s).
2397
2398 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2399 string cross-reference(s).
2400
2401 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2402
2403 Avoid unnecessary byte position calculation for the gap movement.
2404 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2405 anyway, all of them should use move_gap_both instead.
2406 * lisp.h (move_gap): Remove prototype.
2407 * insdel.c (move_gap): Remove.
2408 (move_gap_both): Add eassert.
2409 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2410 * xml.c (parse_region): Likewise.
2411
2412 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2413
2414 emacsclient -t should not suspend Emacs server (Bug#13387)
2415 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2416 New functions.
2417 * term.c (init_tty): Use them instead of rolling our own code.
2418 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2419 switches from 'signal' to 'pthread_sigmask', which is safer in
2420 multithreaded applications.
2421 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2422 which has already arranged for that.
2423 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2424 This is the main part of the bug fix.
2425
2426 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
2427
2428 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2429 x_last_font_name (Bug#13403).
2430
2431 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2432
2433 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2434 the type of per-buffer values where appropriate.
2435 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2436 predicate, which is how it's really used now. Adjust comment.
2437 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2438 * buffer.c (buffer_slot_type_mismatch): Remove.
2439 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2440 predicate. Adjust comment.
2441 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2442 fill-column, left-margin, tab-width, buffer-saved-size,
2443 left-margin-width, right-margin-width, left-fringe-width,
2444 right-fringe-width, scroll-bar-width and buffer-display-count.
2445 Use Qstringp for default-directory, buffer-file-name,
2446 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2447 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2448 line-spacing.
2449 * data.c (store_symval_forwarding): Adjust to call the predicate.
2450
2451 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
2452
2453 * w32.c (get_name_and_id, acl_set_file):
2454 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2455
2456 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2457
2458 * lisp.h (make_gap_1): New prototype.
2459 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2460 gap size values.
2461 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2462 naming convention.
2463 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2464 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
2465 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2466 (make_gap_1): New function to adjust the gap of any buffer.
2467 * coding.c (coding_alloc_by_making_gap): Use it.
2468 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2469 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2470
2471 2013-01-08 Juri Linkov <juri@jurta.org>
2472
2473 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2474 of (supports :underline (:style wave)). (Bug#13000)
2475
2476 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2477
2478 * undo.c (Fprimitive_undo): Move to simple.el.
2479 (syms_of_undo): Remove declarations for Sprimitive_undo.
2480
2481 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2482
2483 * keyboard.c (echo_add_key): Rename from echo_add_char.
2484
2485 2013-01-06 Chong Yidong <cyd@gnu.org>
2486
2487 * keyboard.c (echo_add_char): New function, factored out from
2488 echo_char. Don't add a space if the previous echo string was
2489 empty (Bug#13255).
2490 (echo_char): Use it.
2491 (read_key_sequence): When echoing mock input, ensure that the
2492 trailing dash is properly added.
2493
2494 2013-01-05 Eli Zaretskii <eliz@gnu.org>
2495
2496 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2497 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
2498 digits for buffer positions, before misalignment starts.
2499 Display "0" for integer "object" field.
2500 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2501 Display the newline glyph more unambiguously.
2502
2503 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2504
2505 * nsterm.m (ns_draw_underwave):
2506 * w32term.c (w32_draw_underwave):
2507 * xterm.c (x_draw_underwave): Make underwave look more triangular
2508 and also degrade gracefully for small fonts. (Bug#13000)
2509
2510 * nsterm.m (ns_draw_text_decoration):
2511 * w32term.c (x_draw_glyph_string):
2512 * xterm.c (x_draw_glyph_string): Don't use previous underline
2513 thickness and position if previous underline type is underwave.
2514
2515 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2516
2517 * fileio.c (Ffile_acl): Undocument return format.
2518
2519 2013-01-02 Glenn Morris <rgm@gnu.org>
2520
2521 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2522
2523 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2524
2525 Simplify via eabs.
2526 * dired.c (file_name_completion):
2527 * doc.c (get_doc_string):
2528 * floatfns.c (round2):
2529 * font.c (font_score, font_delete_unmatched):
2530 * fringe.c (compute_fringe_widths):
2531 * lread.c (read_list):
2532 * minibuf.c (Ftry_completion):
2533 * term.c (tty_ins_del_lines):
2534 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2535 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2536
2537 2012-12-31 Eli Zaretskii <eliz@gnu.org>
2538
2539 * w32.c (unsetenv): Set up the string passed to _putenv
2540 correctly.
2541 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
2542 for the bug this caused.
2543
2544 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2545
2546 * coding.c (Qmac): Now static.
2547
2548 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2549
2550 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2551 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2552 handlebox_widget. Set toolbar_in_hbox to false/true, set
2553 toolbar_is_packed to true.
2554 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2555 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2556 Show all on TOOLBAR_TOP_WIDGET.
2557 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2558 by TOOLBAR_TOP_WIDGET.
2559 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2560 Check toolbar_is_packed.
2561 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2562 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2563 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2564 false.
2565 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2566 (xg_update_menubar): Update title only if
2567 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2568 (xg_update_submenu): Skip tearoff only if
2569 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2570 (xg_initialize): Initialize xg_detached_menus only if
2571 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2572
2573 * xterm.h (struct x_output): Surround handlebox_widget with
2574 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2575 toolbar_in_hbox is bool.
2576
2577 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2578
2579 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2580 (LIBS_GNUSTEP): Define.
2581 (LIBES): Add $(LIBS_GNUSTEP).
2582 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2583
2584 2012-12-30 Eli Zaretskii <eliz@gnu.org>
2585
2586 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2587 continuation glyph on a TTY with an indication of an empty line.
2588 (Bug#13277)
2589
2590 2012-12-29 Eli Zaretskii <eliz@gnu.org>
2591
2592 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2593 file's SELinux context or ACLs successfully set, nil otherwise.
2594 (Bug#13298)
2595 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
2596
2597 * w32proc.c (reader_thread): Avoid passing NULL handles to
2598 SetEvent and WaitForSingleObject.
2599
2600 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2601
2602 Port EXTERNALLY_VISIBLE to Clang 3.2.
2603 * conf_post.h (__has_attribute): New macro.
2604 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2605
2606 2012-12-27 Glenn Morris <rgm@gnu.org>
2607
2608 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2609 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2610
2611 2012-12-27 Eli Zaretskii <eliz@gnu.org>
2612
2613 * fileio.c (file_name_as_directory, directory_file_name):
2614 Accept an additional argument MULTIBYTE to indicate whether the input C
2615 came from a multibyte or a unibyte Lisp string; all callers
2616 adjusted. Don't assume the input string is always multibyte.
2617 (Bug#13262)
2618 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2619 don't ENCODE_FILE them, and return a unibyte string if the input
2620 was unibyte.
2621 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2622 don't assume the input strings will always be multibyte. If the
2623 input strings are multibyte, decode strings obtained from C
2624 library functions.
2625
2626 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2627
2628 * lisp.h (toplevel): Add two notices to the comment about
2629 defining a new Lisp data type.
2630 * print.c (print_object): If Lisp_Save_Value object's pointer
2631 is the address of a memory area containing Lisp_Objects, try
2632 to print them.
2633 * alloc.c (valid_lisp_object_p): Adjust comment.
2634
2635 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2636
2637 * keyboard.c (record_asynch_buffer_change): Initialize an event
2638 only if it's really needed.
2639 * frame.h (enum output_method): Remove output_mac member since
2640 it's a leftover from the deleted code.
2641 * frame.c (Fframep): Adjust user here ...
2642 * terminal.c (Fterminal_live_p): ... and here.
2643 * coding.c (Qmac): Now here because it's only used to denote
2644 end-of-line encoding type.
2645 (syms_of_coding): DEFSYM it.
2646 * frame.h (Qmac): Remove duplicated declaration.
2647
2648 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2649
2650 * window.c (select_window_1): Now static, since it's used only here.
2651
2652 2012-12-25 Eli Zaretskii <eliz@gnu.org>
2653
2654 * window.c (window_body_cols): Subtract display margins from the
2655 window body width on TTYs as well. See
2656 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2657 for the original report.
2658
2659 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2660
2661 * xdisp.c (redisplay_window): Remove inner local variable
2662 because the outer shadowed one has the same meaning.
2663 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2664 set but never used.
2665 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2666 (xg_create_tool_bar): Adjust users.
2667
2668 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2669
2670 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2671 * buffer.c (Fget_buffer_create): Use it to set compact field of
2672 struct buffer_text to avoid accessing an uninitialized value
2673 when compact_buffer is called for the first time.
2674 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2675 (Fset_buffer_modified_p): Use buffer_window_count to check
2676 whether the buffer is displayed in some window.
2677 * xdisp.c (message_dolog): Likewise.
2678
2679 2012-12-23 Eli Zaretskii <eliz@gnu.org>
2680
2681 * w32.c (acl_set_file): If setting the file security descriptor
2682 fails, and the new DACL is identical to the existing one, silently
2683 return success. This fixes problems for users backing up their
2684 own files without having the necessary privileges for setting
2685 security descriptors.
2686
2687 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2688 values.
2689 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2690 after WaitForSingleObject returns normally. This expedites reader
2691 thread shutdown when delete_child triggers it.
2692 (reap_subprocess): More accurate commentary for why we call
2693 delete_child only when cp->fd is negative.
2694
2695 * w32.c (sys_close): Do not call delete_child on a subprocess
2696 whose handle is not yet closed. Instead, set its file descriptor
2697 to a negative value, so that reap_subprocess will call
2698 delete_child on that subprocess when its SIGCHLD arrives.
2699 This avoids closing handles used for communications between sys_select
2700 and reader_thread, which doesn't give sys_select a chance to
2701 notice that the process exited and invoke the SIGCHLD handler for
2702 it.
2703
2704 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2705
2706 * nsfns.m (Fns_do_applescript): Run event loop until script has
2707 been executed (Bug#12969).
2708 (ns_run_ascript): Chech as_script for nil, set to nil after
2709 executing script.
2710
2711 2012-12-22 Martin Rudalics <rudalics@gmx.at>
2712
2713 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2714
2715 2012-12-22 Eli Zaretskii <eliz@gnu.org>
2716
2717 * w32term.c (w32fullscreen_hook): New function.
2718 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2719
2720 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2721
2722 * fileio.c (Finsert_file_contents): Doc fix.
2723
2724 * w32proc.c (new_child, delete_child, find_child_pid): For a
2725 subprocess, consider its slot being in use as long as its process
2726 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2727 slot when a new process is started immediately after killing
2728 another one, without waiting enough time for the first process to
2729 be reaped and resources allocated for it be orderly freed.
2730 (Bug#13086)
2731 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2732
2733 2012-12-21 Chong Yidong <cyd@gnu.org>
2734
2735 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2736
2737 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2738
2739 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2740
2741 * w32.c (get_name_and_id): Always pass NULL as the first argument
2742 of lookup_account_sid. Avoids crashes with UNC file names that
2743 refer to DFS domains, not to specific machine names. (Bug#12621)
2744 Remove now unused argument FNAME; all callers changed.
2745 (get_file_owner_and_group): Remove now unused argument FNAME; all
2746 callers changed.
2747
2748 2012-12-21 Chong Yidong <cyd@gnu.org>
2749
2750 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2751 error for invalid chars, don't check for a nil return value.
2752
2753 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2754
2755 Avoid calls to CHAR_TO_BYTE if byte position is known.
2756 * editfns.c (make_buffer_string_both): Use move_gap_both.
2757 (Fbuffer_string): Use make_buffer_string_both.
2758 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2759 Adjust comment.
2760 (buf_bytepos_to_charpos): Likewise.
2761 (charpos_to_bytepos): Remove.
2762 * fileio.c (Finsert_file_contents): Use move_gap_both.
2763 * search.c (Freplace_match): Likewise.
2764 * process.c (process_send_region): Likewise. Use convenient
2765 names for byte positions.
2766 * lisp.h (charpos_to_bytepos): Remove prototype.
2767 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2768 * insdel.c (move_gap): Likewise.
2769
2770 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2771
2772 * xdisp.c (redisplay_internal): Remove now-unused local.
2773
2774 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2775
2776 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2777 (redisplay_internal): Don't bother selecting the frame to get the
2778 proper value of frame-local variables (bug#13225).
2779
2780 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2781
2782 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2783 Rename 4th argument since it may be buffer or string. Adjust comment.
2784 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2785
2786 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2787
2788 * coding.c (Fdetect_coding_region): Do not check start and end with
2789 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2790 (code_convert_region): Likewise.
2791
2792 2012-12-18 Eli Zaretskii <eliz@gnu.org>
2793
2794 * w32.c (acl_get_file, acl_set_file): Run the file name through
2795 map_w32_filename, and resolve any symlinks in the file name, like
2796 Posix platforms do.
2797 (acl_set_file): Call revert_to_self, if any privileges were
2798 enabled.
2799
2800 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
2801
2802 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2803 ($(BLD)/w32.$(O)): Update dependencies.
2804
2805 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2806
2807 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2808 propagate redisplay's scrolling (if any) to the right window.
2809 (redisplay_internal): Use ensure_selected_frame.
2810 (display_mode_lines): Complete last fix.
2811 * window.c (select_window_1): New func, extracted from select_window.
2812 (select_window): Use it.
2813 * window.h (select_window_1): Declare.
2814
2815 2012-12-17 Eli Zaretskii <eliz@gnu.org>
2816
2817 Emulate Posix ACL APIs on MS-Windows.
2818 * w32.c: Include sddl.h and sys/acl.h.
2819 (SDDL_REVISION_1): Define if not already defined.
2820 (g_b_init_get_security_descriptor_dacl)
2821 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2822 (g_b_init_is_valid_security_descriptor)
2823 (g_b_init_set_file_security): New static flags.
2824 (globals_of_w32): Initialize them to zero.
2825 (SetFileSecurity_Name): New string constant.
2826 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2827 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2828 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2829 (IsValidSecurityDescriptor_Proc): New typedefs.
2830 (get_file_security, get_security_descriptor_owner)
2831 (get_security_descriptor_group): Set errno to ENOTSUP.
2832 (set_file_security, get_security_descriptor_dacl)
2833 (is_valid_security_descriptor, convert_sd_to_sddl)
2834 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2835 (acl_free, acl_get_file, acl_set_file): New functions.
2836
2837 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2838
2839 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2840
2841 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2842 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2843 for some of that bug's symptoms can now cause Emacs to abort.
2844 Remove the workaround.
2845 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2846 The bug that caused SIGCHLD to get lost has been fixed, and the
2847 workaround for it can now cause Emacs to abort.
2848
2849 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2850
2851 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2852 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2853 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2854
2855 2012-12-16 Romain Francoise <romain@orebokech.com>
2856
2857 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2858 (Fcopy_file): Change last arg to `preserve_extended_attributes'
2859 and copy ACL entries of file in addition to SELinux context if set.
2860 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2861
2862 * Makefile.in (LIBACL_LIBS): New macro.
2863 (LIBES): Use it.
2864
2865 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2866
2867 * fileio.c (internal_delete_file): Use bool for boolean.
2868
2869 2012-12-15 Eli Zaretskii <eliz@gnu.org>
2870
2871 Fix bug #13079 on MS-Windows with temp files not being deleted.
2872 * w32.h (_child_process): New members input_file and
2873 pending_deletion.
2874 (register_child): First argument is now pid_t.
2875 (record_infile, record_pending_deletion): New prototypes.
2876
2877 * w32proc.c (new_child): Initialize input_file and
2878 pending_deletion members of the child.
2879 (delete_child): Delete the child's temporary input file, if any,
2880 that is pending deletion.
2881 (register_child): First argument is now pid_t.
2882 (record_infile, record_pending_deletion): New functions.
2883 (reap_subprocess): Fix a typo in DebPrint string.
2884 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2885
2886 * fileio.c (internal_delete_file): Return an int again: non-zero
2887 if delete-file succeeds, zero otherwise.
2888
2889 * lisp.h (internal_delete_file): Adjust prototype.
2890
2891 * callproc.c (Fcall_process): Don't overwrite infile with result
2892 of DECODE_FILE.
2893 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2894 asynchronous subprocess, record the name of the input file name,
2895 if any.
2896 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2897 delete the file, record it as pending deletion when the subprocess
2898 exits.
2899
2900 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2901
2902 * editfns.c [HAVE_PWD_H]: Include grp.h.
2903
2904 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2905
2906 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2907
2908 Fix permissions bugs with setgid directories etc. (Bug#13125)
2909 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2910 to mark it as a placeholder. The old value was often wrong.
2911 The only user of this attribute has been changed to use
2912 file-ownership-preserved-p instead, with its new group arg.
2913 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2914
2915 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2916
2917 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2918 Keep selected_window and selected_frame in sync.
2919
2920 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2921
2922 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2923 try to get accurate owner and group information from NT file
2924 security APIs. This is to make most callers of 'stat' and
2925 'lstat', which don't need that information, much faster.
2926
2927 * dired.c (Ffile_attributes) [WINDOWSNT]:
2928 Set w32_stat_get_owner_group to a non-zero value, to request accurate
2929 owner and group information from 'lstat'.
2930
2931 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2932
2933 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2934 as that confuses set-auto-coding, so insist on the head-read
2935 returning the full 1024 bytes. Let lseek compute the tail offset;
2936 less work for us. Do not ignore I/O errors when reading the tail.
2937
2938 * xdisp.c: Minor style fixes.
2939 (init_iterator): Hoist assignment out of if-expression.
2940 (markpos_of_region): Callers now test for sign, not for -1.
2941
2942 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2943
2944 Minor redisplay optimization when the region length is zero.
2945 * xdisp.c (markpos_of_region): New function.
2946 (init_iterator): Do not highlight the region of zero length.
2947 (redisplay_window): Check whether the region is of non-zero length.
2948 (try_cursor_movement): Allow if the region length is zero.
2949 (try_window_reusing_current_matrix, try_window_id): Likewise.
2950
2951 2012-12-13 Eli Zaretskii <eliz@gnu.org>
2952
2953 * search.c (search_buffer): Check the inverse translations of each
2954 character in pattern when the buffer being searched is unibyte.
2955 (Bug#13084)
2956
2957 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2958
2959 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2960 files, fixing a regression from 24.2.
2961 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
2962
2963 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2964
2965 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2966 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2967 Remove unnecessary S_ISLNK test, as (contra the comments) this
2968 function can't copy symlinks. Improve quality of error message
2969 when attempting to copy files that are neither regular files nor
2970 directories.
2971
2972 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2973
2974 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2975 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2976 * window.c (Frecenter):
2977 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2978 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2979
2980 2012-12-12 Daniel Colascione <dancol@dancol.org>
2981
2982 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
2983 the dumped Emacs is not a sparse file, greatly improving Cygwin
2984 "make bootstrap" performance.
2985
2986 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
2987
2988 * inotify.c (inotify_callback): Generate an Emacs event for every
2989 incoming inotify event.
2990
2991 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2992
2993 * xdisp.c (handle_face_prop): Fix logic of computing
2994 it->start_of_box_run_p.
2995 (append_space_for_newline): If the glyph row is R2L, reset the
2996 iterator's end_of_box_run_p flag before prepending the space glyph.
2997 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2998 iterator's start_of_box_run_p flag before prepending the stretch.
2999 (append_glyph, produce_image_glyph, append_composite_glyph)
3000 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3001 left_box_line_p and right_box_line_p flags of the glyph for R2L
3002 glyph rows. (Bug#13011)
3003
3004 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3005
3006 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3007 if changed buffer is not shown in a window.
3008 * insdel.c (prepare_to_modify_buffer): Likewise.
3009 * window.c (replace_buffer_in_windows_safely): Do nothing
3010 if buffer is not shown in a window.
3011 (Fforce_window_update): Likewise if string or buffer argument
3012 is passed.
3013
3014 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3015
3016 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3017 encoded_file_name, which is what it is.
3018
3019 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3020
3021 Consistently use marker_position and marker_byte_position.
3022 * fringe.c (Ffringe_bitmaps_at_pos):
3023 * indent.c (Fvertical_motion):
3024 * insdel.c (prepare_to_modify_buffer):
3025 * keyboard.c (make_lispy_position):
3026 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3027 (window_scroll_pixel_based, displayed_window_lines)
3028 (Fset_window_configuration):
3029 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3030 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3031 Replace direct access to marker fields with calls
3032 to marker_position and/or marker_byte_position.
3033
3034 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3035
3036 * makefile.w32-in (SIG2STR_H): New macro.
3037 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3038 ($(BLD)/w32notify.$(O)): Update dependencies.
3039
3040 2012-12-10 Daniel Colascione <dancol@dancol.org>
3041
3042 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3043 Windows file notification functionality unless WINDOWSNT.
3044
3045 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3046 declarations.
3047
3048 * w32fns.c (cache_system_info): Initialize the global hinst
3049 variable here so various initialization calls DTRT.
3050
3051 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3052 (hinst): Remove unneeded extern declaration.
3053 (_start): Remove initialization of above variables; remove
3054 initialization of hinst, as cache_system_info now does that.
3055
3056 * emacs.c (main): Call cache_system_info early in startup; we
3057 previously weren't calling it in Cygwin builds.
3058
3059 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3060 Teach the autoconf build system how to compile a Windows resource file
3061 and link it to Emacs.
3062
3063 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3064
3065 Per-buffer window counters.
3066 * buffer.h (struct buffer): New member window_count.
3067 (buffer_window_count): New function.
3068 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3069 Initialize window_count.
3070 (Fkill_buffer): Verify window_count for the buffer being killed.
3071 (modify_overlay): Do not force redisplay if buffer is not shown
3072 in any window.
3073 (init_buffer_once): Initialize window_count for buffer_defaults
3074 and buffer_local_symbols.
3075 * window.h (buffer_shared): Remove declaration.
3076 (wset_buffer): Convert from inline ...
3077 * window.c (wset_buffer): ... to an ordinary function.
3078 (adjust_window_count): New function.
3079 (make_parent_window): Use it.
3080 * xdisp.c (buffer_shared): Remove.
3081 (redisplay_internal, redisplay_window): Adjust users.
3082 (buffer_shared_and_changed): Use per-buffer window counter.
3083
3084 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3085
3086 Support for filesystem notifications on MS-Windows.
3087 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3088 and this is a TTY frame, signal the caller that keyboard input is
3089 available.
3090
3091 * w32xfns.c (drain_message_queue): Now returns an int: an
3092 indication whether any WM_EMACS_FILENOTIFY messages were found in
3093 the queue.
3094
3095 * w32inevt.c (handle_file_notifications): New function.
3096 (w32_console_read_socket): Call it to process file notifications.
3097
3098 * w32console.c (initialize_w32_display): Record the main thread ID
3099 in dwMainThreadId.
3100
3101 * deps.mk (inotify.o): New dependency list.
3102
3103 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3104
3105 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3106 (WM_EMACS_END): Bump value by 1.
3107 (notification_buffer_in_use, file_notifications)
3108 (notifications_size, notifications_desc): Declare.
3109 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3110 Add prototypes.
3111
3112 * w32term.c (lispy_file_action, queue_notifications): New functions.
3113 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3114 <Qrenamed_to>: New symbols.
3115 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3116
3117 * w32notify.c: New file, implements file event notifications for
3118 MS-Windows.
3119
3120 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3121 by posting it to the w32_read_socket queue.
3122
3123 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3124
3125 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3126 (GLOBAL_SOURCES): Add w32notify.c
3127 ($(BLD)/w32notify.$(O)): New set of dependencies.
3128
3129 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3130
3131 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3132 Handle FILE_NOTIFY_EVENT.
3133 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3134 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3135 w32notify-handle-event by default.
3136
3137 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3138 syms_of_w32notify.
3139
3140 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3141
3142 Support for filesystem notifications on GNU/Linux via inotify.
3143 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3144
3145 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3146
3147 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3148 (syms_of_keyboard): DEFSYM it.
3149 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3150 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3151 Qfile_inotify events.
3152 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3153 special-event-map to inotify-handle-event.
3154
3155 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3156
3157 * Makefile.in (base_obj): Add inotify.o.
3158
3159 * inotify.c: New file.
3160
3161 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3162
3163 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3164
3165 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3166
3167 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3168 DWORD_PTR, for compatibility with 64-bit builds.
3169
3170 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3171 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3172 (system_process_attributes): Use SIZE_T rather than DWORD, for
3173 compatibility with 64-bit builds.
3174
3175 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3176
3177 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3178
3179 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3180
3181 * indent.c (Fvertical_motion): If a display string will be
3182 displayed on the left or the right margin, don't consider it as a
3183 factor in cursor positioning. (Bug#13108)
3184
3185 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3186
3187 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3188
3189 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3190
3191 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3192 for string length.
3193
3194 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3195
3196 * w32.c (unsetenv): Return 0 if the input string is too long.
3197
3198 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3199
3200 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3201 * alloc.c (xputenv): New function.
3202 * dbusbind.c (Fdbus_init_bus):
3203 * emacs.c (main):
3204 * xterm.c (x_term_init):
3205 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3206 * editfns.c (initial_tz): Move static var decl up.
3207 (tzvalbuf_in_environ): New static var.
3208 (init_editfns): Initialize these two static vars.
3209 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3210 Save old TZ value on stack, if it's small.
3211 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3212 instead, use xputenv+unsetenv to set and restore TZ.
3213 (environbuf): Remove static var. All uses removed.
3214 (Fset_time_zone_rule): Do not save TZ and environ;
3215 no longer needed here.
3216 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3217 Move to inside set_time_zone_rule; they don't need file scope any more.
3218 (set_time_zone_rule): Maintain the TZ=value string separately.
3219 (syms_of_editfns): Don't initialize initial_tz;
3220 init_editfns now does it.
3221 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3222 * lisp.h (xputenv): New decl.
3223
3224 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3225
3226 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3227
3228 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3229
3230 * w32.c (unsetenv, sys_putenv): New functions.
3231
3232 2012-12-08 Chong Yidong <cyd@gnu.org>
3233
3234 * editfns.c (Finsert_char): Make the error message more
3235 informative (Bug#12992).
3236
3237 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3238
3239 Simplify get_lim_data.
3240 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3241 Remove USG and vlimit methods; no longer used these days.
3242 Add #error catchall just in case.
3243
3244 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3245 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3246 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3247 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3248 (deleted_pid_list, Fdelete_process, create_process)
3249 (record_child_status_change, handle_child_signal, deliver_child_signal)
3250 (init_process_emacs, syms_of_process):
3251 Assume SIGCHLD is defined.
3252 (parse_signal): Remove. All uses removed.
3253 (abbr_to_signal): New static function.
3254 (Fsignal_process): Use it to convert signal names to ints.
3255 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3256 kill (getpgrp (), ...).
3257 (emacs_sigaction_init): Assume SIGCHLD is defined.
3258 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3259 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3260 * syssignal.h (EMACS_KILLPG): Remove.
3261 All uses replaced by 'kill' with a negative pid.
3262 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3263 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3264
3265 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3266
3267 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3268 This will cause a production Emacs to dump core instead of
3269 infinite-looping.
3270
3271 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3272
3273 * frame.c (make_frame): Do not set window's buffer to t.
3274 * window.c (Fsplit_window_internal): Likewise. Previously it was
3275 used to indicate that the window is being set up. Now we use
3276 set_window_buffer for all new windows, so the condition in ...
3277 (Fset_window_buffer): ... is always true and can be removed.
3278
3279 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3280
3281 Convenient macro to check whether the buffer is hidden.
3282 * buffer.h (BUFFER_HIDDEN_P): New macro.
3283 * frame.c (make_frame): Use it. Adjust comment.
3284 * buffer.c (candidate_buffer): New function.
3285 (Fother_buffer, other_buffer_safely): Use it.
3286
3287 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3288
3289 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3290 if the child process is still running. Instead, exit the wait
3291 loop and return zero. (Bug#13086)
3292
3293 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3294
3295 * frame.h (x_char_width, x_char_height): Remove prototypes.
3296 * w32term.h (x_char_width, x_char_height): Likewise.
3297 * xfns.c (x_char_width, x_char_height): Remove.
3298 * w32fns.c (x_char_width, x_char_height): Likewise.
3299 * nsfns.c (x_char_width, x_char_height): Likewise.
3300 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3301 all window frames.
3302 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3303 * keyboard.c (command_loop_1): Remove prototype.
3304 (command_loop_2, top_level_1): Add static to match prototype.
3305
3306 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3307
3308 Fix a recently-introduced delete-process race condition.
3309 * callproc.c, process.h (record_kill_process):
3310 New function, containing part of the old call_process_kill.
3311 (call_process_kill): Use it.
3312 This does not change call_process_kill's behavior.
3313 * process.c (Fdelete_process): Use record_kill_process to fix a
3314 race condition that could cause Emacs to lose track of a child.
3315
3316 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3317
3318 Avoid code duplication between prev_frame and next_frame.
3319 * frame.c (candidate_frame): New function. Add comment.
3320 (prev_frame, next_frame): Use it. Adjust comment.
3321
3322 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3323
3324 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3325 fails, signal an error instead of continuing with an empty
3326 string. (Bug#13079)
3327 Encode expanded temp file pattern before passing it to mkstemp or
3328 mktemp.
3329
3330 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3331 Encode the file name before passing it to dostounix_filename, in
3332 case it will downcase it (under w32-downcase-file-names).
3333 (Bug#12933)
3334
3335 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3336
3337 Minor call-process cleanups.
3338 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3339 at the same time as other platforms, to simplify analysis.
3340 No need for fd0_volatile since we have synch_process_fd.
3341 Avoid needless emacs_close; arg is always negative.
3342
3343 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3344
3345 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3346 processes.
3347
3348 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3349
3350 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3351 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3352 and mouse_face_hidden members to a bitfields.
3353 * frame.h (struct frame): Remove set-but-not-used space_width member.
3354 (FRAME_SPACE_WIDTH): Remove.
3355 * nsterm.m, w32term.c, xterm.c: Adjust users.
3356 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3357 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3358 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3359 members to a bitfields.
3360
3361 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3362
3363 Don't let call-process be a zombie factory (Bug#12980).
3364 Fixing this bug required some cleanup of the signal-handling code.
3365 As a side effect, this change also fixes a longstanding rare race
3366 condition whereby Emacs could mistakenly kill unrelated processes,
3367 and it fixes a bug where a second C-g does not kill a recalcitrant
3368 synchronous process in GNU/Linux and similar platforms.
3369 The patch should also fix the last vestiges of Bug#9488,
3370 a bug which has mostly been fixed on the trunk by other changes.
3371 * callproc.c, process.h (synch_process_alive, synch_process_death)
3372 (synch_process_termsig, sync_process_retcode):
3373 Remove. All uses removed, to simplify analysis and so that
3374 less consing is done inside critical sections.
3375 * callproc.c (call_process_exited): Remove. All uses replaced
3376 with !synch_process_pid.
3377 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3378 These take the role of what used to be in unwind-protect arg.
3379 All uses changed.
3380 (block_child_signal, unblock_child_signal):
3381 New functions, to avoid races that could kill innocent-victim processes.
3382 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3383 (call_process_kill): Record killed processes as deleted, so that
3384 zombies do not clutter up the system. Do this inside a critical
3385 section, to avoid a race that would allow the clutter.
3386 (call_process_cleanup): Fix code so that the second C-g works again
3387 on common platforms such as GNU/Linux.
3388 (Fcall_process): Create the child process in a critical section,
3389 to fix a race condition. If creating an asynchronous process,
3390 record it as deleted so that zombies do not clutter up the system.
3391 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3392 light of these changes. Omit unnecessary call to emacs_close
3393 before failure, as the unwind-protect code does that.
3394 * callproc.c (call_process_cleanup):
3395 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3396 * process.c (record_deleted_pid): New function, containing
3397 code refactored out of Fdelete_process.
3398 (Fdelete_process): Use it.
3399 (process_status_retrieved): Remove. All callers changed to use
3400 child_status_change.
3401 (record_child_status_change): Remove, folding its contents into ...
3402 (handle_child_signal): ... this signal handler. Now, this
3403 function is purely a handler for SIGCHLD, and is not called after
3404 a synchronous waitpid returns; the synchronous code is moved to
3405 wait_for_termination. There is no need to worry about reaping
3406 more than one child now.
3407 * sysdep.c (get_child_status, child_status_changed): New functions.
3408 (wait_for_termination): Now takes int * status and bool
3409 interruptible arguments, too. Do not record child status change;
3410 that's now the caller's responsibility. All callers changed.
3411 Reimplement in terms of get_child_status.
3412 (wait_for_termination_1, interruptible_wait_for_termination):
3413 Remove. All callers changed to use wait_for_termination.
3414 * syswait.h: Include <stdbool.h>, for bool.
3415 (record_child_status_change, interruptible_wait_for_termination):
3416 Remove decls.
3417 (record_deleted_pid, child_status_changed): New decls.
3418 (wait_for_termination): Adjust to API changes noted above.
3419
3420 * bytecode.c, lisp.h (Qbytecode): Remove.
3421 No longer needed after 2012-11-20 interactive-p changes.
3422
3423 2012-12-03 Eli Zaretskii <eliz@gnu.org>
3424
3425 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3426 the scroll margin, move point outside the margin. (Bug#13055)
3427
3428 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3429
3430 * gtkutil.c (my_log_handler): New function.
3431 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3432
3433 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3434
3435 * lisp.h (modify_region): Rename to...
3436 (modify_region_1): ...new prototype.
3437 * textprop.c (modify_region): Now static. Adjust users.
3438 * insdel.c (modify_region): Rename to...
3439 (modify_region_1): ...new function to work with current buffer.
3440 Adjust comment and users. Use true and false for booleans.
3441
3442 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3443
3444 * alloc.c (free_save_value): New function.
3445 (safe_alloca_unwind): Use it.
3446 * lisp.h (free_save_value): New prototype.
3447 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3448 Add comment.
3449 (save_excursion_restore): Adjust to match saved data structure.
3450 Use free_save_value to offload some work from GC. Drop obsolete
3451 #if 0 code.
3452
3453 2012-12-03 Chong Yidong <cyd@gnu.org>
3454
3455 * fileio.c (Vauto_save_list_file_name): Doc fix.
3456
3457 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
3458
3459 * w32fns.c: Remove prototype of atof.
3460 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
3461 builds.
3462 (file_dialog_callback): Make it UINT_PTR.
3463
3464 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3465 with 64-bit builds.
3466
3467 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3468 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3469 defined.
3470
3471 2012-12-03 Glenn Morris <rgm@gnu.org>
3472
3473 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
3474
3475 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3476
3477 Fix xpalloc confusion after memory is exhausted.
3478 * alloc.c (xpalloc): Comment fix.
3479 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3480 and signals an error, do not clear charset_table_size, as
3481 charset_table is still valid.
3482 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3483
3484 Use execve to avoid need to munge environ (Bug#13054).
3485 * callproc.c (Fcall_process):
3486 * process.c (create_process):
3487 Don't save and restore environ; no longer needed.
3488 * callproc.c (child_setup):
3489 Use execve, not execvp, to preserve environ.
3490
3491 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3492
3493 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3494
3495 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3496
3497 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3498 display for sliced images (Bug#10500).
3499
3500 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3501
3502 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
3503
3504 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3505 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3506
3507 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3508
3509 * xdisp.c (window_outdated): Remove eassert since it hits
3510 some suspicious corner cases (see Bug#13007 and Bug#13012).
3511 (mode_line_update_needed): New function.
3512 (redisplay_internal, redisplay_window): Use it.
3513 (ensure_selected_frame): New function.
3514 (redisplay_internal, unwind_redisplay): Use it.
3515 (redisplay_internal): Move comment about buffer_shared...
3516 (buffer_shared_and_changed): ...near to its real use.
3517
3518 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3519
3520 * callproc.c (Fcall_process): Don't misreport vfork failure.
3521
3522 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3523
3524 * callproc.c (Fcall_process): Fix vfork portability problems.
3525 Do not assume that fd[0], count, filefd, and save_environ survive
3526 vfork. Fix bug whereby wrong errno value could be reported for
3527 pipe failure. Some minor cleanups, too, as follows. Move buf and
3528 bufsize to the context where they're needed. Change new_argv to
3529 be of type char **, as this is more convenient and avoids casts.
3530 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3531 Now local constants, not macros.
3532
3533 2012-11-18 Kenichi Handa <handa@gnu.org>
3534
3535 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3536 for the variable "f".
3537
3538 2012-11-13 Kenichi Handa <handa@gnu.org>
3539
3540 * font.c (font_unparse_xlfd): Exclude special characters from the
3541 generating XLFD name.
3542
3543 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3544
3545 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3546 * dired.c (stat_uname, stat_gname):
3547 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3548
3549 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3550 * dired.c (directory_files_internal, file_name_completion):
3551 Assume EAGAIN and EINTR are defined.
3552
3553 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3554 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3555 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3556 * lread.c (readbyte_from_file): Assume EINTR is defined.
3557 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3558 Assume EIO and EAGAIN are defined.
3559 * unexcoff.c (write_segment): Assume EFAULT is defined.
3560
3561 2012-11-27 Eli Zaretskii <eliz@gnu.org>
3562
3563 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3564 (Bug#11964)
3565
3566 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3567 highlighting on the frame was cleared. Prevents assertion
3568 violations when repeatedly clicking on the "Top" link of the
3569 "bread-crumbs" in Info buffers.
3570
3571 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3572
3573 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3574
3575 2012-11-24 Ken Brown <kbrown@cornell.edu>
3576
3577 * keyboard.c (HAVE_MOUSE):
3578 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3579 were always defined.
3580
3581 2012-11-24 Eli Zaretskii <eliz@gnu.org>
3582
3583 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3584 between bpos_covered and bpos_max. This fixes cursor display when
3585 several display strings follow each other.
3586
3587 * .gdbinit (pgx): If the glyph's object is a string, display the
3588 pointer to string data, rather than the value of the string object
3589 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3590
3591 * indent.c (Fvertical_motion): If the starting position is covered
3592 by a display string, return to one position before that, to avoid
3593 overshooting it inside move_it_to. (Bug#12930)
3594
3595 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3596
3597 * frame.h (struct frame): Remove display_preempted member
3598 since all users are dead long ago.
3599 * nsterm.h (struct x_output): Use the only dummy member.
3600 * w32menu.c (pending_menu_activation): Remove since not
3601 really used.
3602 (set_frame_menubar): Adjust user.
3603 * w32term.h (struct x_output): Drop outdated #if 0 code.
3604 (struct w32_output): Use bitfields for explicit_parent,
3605 asked_for_visible and menubar_active members.
3606 Drop unused pending_menu_activation member.
3607 * xterm.h (struct x_output): Drop outdated #if 0 code.
3608 Use bitfields for explicit_parent, asked_for_visible,
3609 has_been_visible and net_wm_state_hidden_seen members.
3610
3611 2012-11-23 Eli Zaretskii <eliz@gnu.org>
3612
3613 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3614 of a literal "/". (Bug#12955)
3615 (gl-stamp): Invoke fc.exe directly, not through cmd.
3616
3617 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3618
3619 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3620 * dired.c: Assume HAVE_DIRENT_H.
3621 (NAMLEN): Remove, replacing with ...
3622 (dirent_namelen): New function. All uses changed. Use the GNU macro
3623 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3624 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3625 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3626 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3627 $(NT_INC)/dirent.h.
3628 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3629 * ndir.h: Rename to ../nt/inc/dirent.h.
3630 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3631 Do not include <dirent.h>; no longer needed.
3632 * w32.c: Include <dirent.h> rather than "ndir.h".
3633
3634 2012-11-23 Chong Yidong <cyd@gnu.org>
3635
3636 * xftfont.c (xftfont_open): Remove duplicate assignment.
3637
3638 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3639
3640 * alloc.c (Fgarbage_collect): Unblock input after clearing
3641 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3642 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3643 * msdos.c (IT_frame_up_to_date): Use it here...
3644 * w32term.c (w32_frame_up_to_date): ...here...
3645 * xterm.c (XTframe_up_to_date): ...and here...
3646 * nsterm.m (ns_frame_up_to_date): ...but not here.
3647 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3648 Adjust users.
3649 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3650 Do not check whether GC is in progress.
3651
3652 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3653
3654 * xdisp.c (window_buffer_changed): New function.
3655 (update_menu_bar, update_tool_bar): Use it to
3656 simplify large 'if' statements.
3657 (redisplay_internal): Generalize commonly used
3658 'tail' and 'frame' local variables.
3659
3660 2012-11-22 Eli Zaretskii <eliz@gnu.org>
3661
3662 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3663 with Windows system header.
3664
3665 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3666
3667 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3668 * alloc.c: Assume unistd.h exists.
3669 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3670 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3671 (getwd) [USG]: Remove; no longer needed.
3672 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3673 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3674 * w32.h (getcwd): Remove decl.
3675
3676 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3677
3678 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3679 Make it set selected_window as well.
3680 (update_tool_bar): Use it.
3681
3682 2012-11-21 Ken Brown <kbrown@cornell.edu>
3683
3684 * emacs.c (main): Set the G_SLICE environment variable for all
3685 Cygwin builds, not just GTK builds. See
3686 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3687
3688 2012-11-21 Eli Zaretskii <eliz@gnu.org>
3689
3690 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3691 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3692 Define for the MSVC compiler.
3693
3694 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
3695
3696 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3697 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3698 dostounix_filename. Prevents crashes down the road, because
3699 dostounix_filename assumes it gets a unibyte string.
3700 Reported by Michel de Ruiter <michel@sentient.nl>, see
3701 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3702
3703 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3704
3705 Conflate Qnil and Qunbound for `symbol-function'.
3706 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3707 * lread.c (init_obarray): Set `function' fields to Qnil.
3708 * eval.c (Fcommandp): Ignore Qunbound.
3709 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3710 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3711 Test NILP rather than Qunbound.
3712 (Ffmakunbound): Set to Qnil.
3713 (Fsymbol_function): Never signal an error.
3714 (Finteractive_form): Ignore Qunbound.
3715
3716 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3717
3718 * eval.c (interactive_p): Remove no-longer-used decl.
3719
3720 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3721
3722 * xdisp.c (buffer_shared): Adjust comment.
3723 (buffer_shared_and_changed): New function.
3724 (prepare_menu_bars, redisplay_internal): Use it to
3725 decide whether all windows or frames should be updated.
3726 (window_outdated): New function.
3727 (text_outside_line_unchanged_p, redisplay_window): Use it.
3728 (redisplay_internal): Likewise. Fix indentation.
3729
3730 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3731
3732 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3733 (syms_of_eval): Remove corresponding defsubr.
3734 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3735
3736 2012-11-19 Daniel Colascione <dancol@dancol.org>
3737
3738 * w32fns.c (Fx_file_dialog):
3739 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3740 cygwin_convert_file_name*.
3741
3742 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3743 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3744
3745 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3746
3747 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3748
3749 2012-11-18 Eli Zaretskii <eliz@gnu.org>
3750
3751 * w32select.c: Include w32common.h before w32term.h, so that
3752 windows.h gets included before w32term.h uses some of its
3753 features, see below.
3754
3755 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3756 New typedefs.
3757 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3758 New prototypes.
3759 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3760
3761 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
3762
3763 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3764 (ns_select): Return at once if events are held (Bug#12834).
3765
3766 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
3767
3768 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3769 Needed following 2012-10-20 change. (Bug#12902)
3770
3771 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
3772
3773 * w32proc.c (waitpid): Remove unused label get_result.
3774
3775 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
3776
3777 * makefile.w32-in (SYSWAIT_H): New macro.
3778 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3779 ($(BLD)/sysdep.$(O)): Update dependencies.
3780
3781 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3782
3783 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3784 * callproc.c (relocate_fd): Assume F_DUPFD.
3785 * emacs.c, term.c (O_RDWR): Remove.
3786 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3787 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3788 * nsterm.m: Assume <fcntl.h> exists.
3789 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3790 (create_pty, Fmake_network_process, server_accept_connection)
3791 (wait_reading_process_output, init_process_emacs):
3792 Assume O_NONBLOCK.
3793 (wait_reading_process_output): Put in a special case for WINDOWSNT
3794 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3795 It's not clear this is needed, but it's a more-conservative change.
3796 (create_process): Assume FD_CLOEXEC.
3797 (create_process, create_pty): Assume O_NOCTTY.
3798 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3799 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3800 Omit if not DOS_NT, since F_GETFL is not defined there.
3801 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3802 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3803 (O_NOCTTY): Remove.
3804 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3805 lack it, since gnulib guarantees this.
3806 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3807
3808 2012-11-17 Eli Zaretskii <eliz@gnu.org>
3809
3810 * w32.c (faccessat): Pretend that directories have the execute bit
3811 set. Emacs expects that, e.g., in files.el:cd-absolute.
3812
3813 * w32proc.c (create_child): Don't clip the PID of the child
3814 process to fit into an Emacs integer, as this is no longer a
3815 restriction.
3816 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3817 reaping only the process specified by PID argument, if that is
3818 positive. Use PID instead of dead_child to know which process to
3819 reap. Wait for the child to die only if WNOHANG is not in
3820 OPTIONS.
3821 (sys_select): Don't set dead_child.
3822
3823 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3824 as it is no longer needed.
3825
3826 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3827 no longer needed.
3828 (record_child_status_change): Remove the setting of
3829 record_at_most_one_child for the !WNOHANG case.
3830
3831 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3832
3833 Fix problems in ns port found by static checking.
3834 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3835 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3836 not to process group.
3837 (ns_select): Use emacs_write, not write, as that's more robust
3838 in the presence of signals.
3839 (fd_handler:): Check for read errors.
3840
3841 2012-11-16 Glenn Morris <rgm@gnu.org>
3842
3843 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3844
3845 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
3846
3847 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3848
3849 2012-11-16 Eli Zaretskii <eliz@gnu.org>
3850
3851 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3852 use the same value of thread handle.
3853 (start_timer_thread): If the timer thread exited (due to error),
3854 clean up by closing the two handles it used. Duplicate the caller
3855 thread's handle here, so it gets duplicated only once, when
3856 launching the timer thread. Set priority of the timer thread, not
3857 the caller thread.
3858 (getitimer): Don't duplicate the caller thread's handle here.
3859 (Bug#12832)
3860
3861 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
3862
3863 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3864 called (Bug#12834).
3865
3866 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3867
3868 Remove no-longer-used pty_max_bytes variable.
3869 * process.c (pty_max_bytes): Remove; unused.
3870 (send_process): Do not set it.
3871
3872 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
3873
3874 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3875 Update dependencies.
3876
3877 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3878
3879 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3880 This follows up on the 2012-09-29 patch that removed indirection
3881 for the 'function' field. Reported by Sergey Vinokurov in
3882 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3883
3884 2012-11-14 Eli Zaretskii <eliz@gnu.org>
3885
3886 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3887 different name, as the MS runtime does not have such a function,
3888 and probably never will.) All callers changed. Ignore DIRFD
3889 value if PATH is an absolute file name, to match Posix spec
3890 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3891 symlinks.
3892
3893 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3894
3895 * xdisp.c (echo_area_display, redisplay_internal):
3896 Omit redundant check whether frame_garbaged is set.
3897
3898 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3899
3900 Use faccessat, not access, when checking file permissions (Bug#12632).
3901 This fixes a bug that has been present in Emacs since its creation.
3902 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3903 which must set some sort of record. (Torek's bug report was against
3904 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3905 same common flaw.) See Torek's Usenet posting
3906 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3907 Posted: Fri Apr 8 14:18:56 1983.
3908 * Makefile.in (LIB_EACCESS): New macro.
3909 (LIBES): Use it.
3910 * callproc.c (init_callproc):
3911 * charset.c (init_charset):
3912 * fileio.c (check_existing, check_executable, check_writable)
3913 (Ffile_readable_p):
3914 * lread.c (openp, load_path_check):
3915 * process.c (allocate_pty):
3916 * xrdb.c (file_p):
3917 Use effective UID when checking permissions, not real UID.
3918 * callproc.c (init_callproc):
3919 * charset.c (init_charset):
3920 * lread.c (load_path_check, init_lread):
3921 Test whether directories are accessible, not merely whether they exist.
3922 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3923 * fileio.c (check_existing, check_executable, check_writable)
3924 (Ffile_readable_p):
3925 Use symbolic names instead of integers for the flags, as they're
3926 portable now.
3927 (check_writable): New arg AMODE. All uses changed.
3928 Set errno on failure.
3929 (Ffile_readable_p): Use faccessat, not stat + open + close.
3930 (Ffile_writable_p): No need to call check_existing + check_writable.
3931 Just call check_writable and then look at errno. This saves a syscall.
3932 dir should never be nil; replace an unnecessary runtime check
3933 with an eassert. When checking the parent directory of a nonexistent
3934 file, check that the directory is searchable as well as writable, as
3935 we can't create files in unsearchable directories.
3936 (file_directory_p): New function, which uses 'stat' on most platforms
3937 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3938 (Ffile_directory_p, Fset_file_times): Use it.
3939 (file_accessible_directory_p): New function, which uses a single
3940 syscall for efficiency.
3941 (Ffile_accessible_directory_p): Use it.
3942 * xrdb.c (file_p): Use file_directory_p.
3943 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3944 * lread.c (openp): When opening a file, use fstat rather than
3945 stat, as that avoids a permissions race. When not opening a file,
3946 use file_directory_p rather than stat.
3947 (dir_warning): First arg is now a usage string, not a format.
3948 Use errno. All uses changed.
3949 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3950 that merely introduced a race.
3951 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3952 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3953 and similarly for the other O_* flags.
3954 * w32.c (sys_faccessat): Rename from sys_access and switch to
3955 faccessat's API. All uses changed.
3956 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3957 (magic_db): Rename from magic_file_p.
3958 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3959 char *, so that we don't have to test for file existence
3960 separately from opening the file for reading. This removes a race
3961 fixes a permission-checking problem, and simplifies the code.
3962 All uses changed.
3963 (file_p): Remove; no longer needed.
3964
3965 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3966
3967 Omit glyphs initialization at startup.
3968 * dispnew.c (glyphs_initialized_initially_p): Remove.
3969 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3970 (Fredraw_frame): Move actual code from here...
3971 (redraw_frame): ...to here. Add eassert. Adjust comment.
3972 (Fredraw_display): Use redraw_frame.
3973 * xdisp.c (clear_garbaged_frames): Likewise.
3974
3975 2012-11-13 Eli Zaretskii <eliz@gnu.org>
3976
3977 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3978 passed to pint2str and pint2hrstr to be at most the size of the
3979 frame's decode_mode_spec_buffer. This avoids crashes with very
3980 large values of FIELD_WIDTH argument to decode_mode_spec.
3981 (Bug#12867)
3982
3983 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3984
3985 Fix a race with verify-visited-file-modtime (Bug#12863).
3986 Since at least 1991 Emacs has ignored an mtime difference of no
3987 more than one second, but my guess is that this was to work around
3988 file system bugs that were fixed long ago. Since the race is
3989 causing problems now, let's remove that code.
3990 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3991 whose time stamp is off by no more than a second. Insist that the
3992 file time stamps match exactly.
3993
3994 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3995
3996 * frame.h (struct frame): Convert external_tool_bar member to
3997 1-bit unsigned bitfield.
3998 * termhooks.h (struct terminal): Remove mouse_moved member since
3999 all users are long dead. Adjust comment on mouse_position_hook.
4000
4001 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4002
4003 Simplify by using FOR_EACH_FRAME here and there.
4004 * frame.c (next_frame, prev_frame, other_visible_frames)
4005 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4006 * w32term.c (x_window_to_scroll_bar): Likewise.
4007 * window.c (window_list): Likewise.
4008 * xdisp.c (x_consider_frame_title): Likewise.
4009 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4010 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4011 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4012 * xmenu.c (menubar_id_to_frame): Likewise.
4013 * xselect.c (frame_for_x_selection): Likewise.
4014 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4015 (x_window_to_menu_bar): Likewise.
4016 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4017
4018 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4019
4020 * data.c (Qdefalias_fset_function): Now static.
4021
4022 Another tweak to vectorlike_header change.
4023 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4024 Remove, and replace all uses with ...
4025 (next_in_free_list, set_next_in_free_list):
4026 New functions, which respect C's aliasing rules better.
4027
4028 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4029
4030 * window.c (list4i): Rename from 'quad'. All uses changed.
4031 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4032
4033 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4034
4035 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4036 warning about mixing declarations and code in ISO C90.
4037
4038 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4039
4040 * window.c (Fsplit_window_internal): Set combination limit of
4041 new parent window to t iff Vwindow_combination_limit is t;
4042 fixing a regression introduced with the change from 2012-09-22.
4043 (Fset_window_combination_limit): Fix doc-string.
4044
4045 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4046
4047 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4048 amount when the scroll margins are too large. When scrolling
4049 backwards in the buffer, give up if cannot reach point or the
4050 scroll margin within a reasonable number of screen lines.
4051 Fixes point position in window under scroll-up/down-aggressively when
4052 point is positioned many lines beyond the window top/bottom.
4053 (Bug#12811)
4054
4055 * ralloc.c (relinquish): If real_morecore fails to return memory
4056 to the system, don't crash; instead, leave the last heap
4057 unchanged and return. (Bug#12774)
4058
4059 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4060
4061 * lisp.h (AUTOLOADP): New macro.
4062 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4063 * data.c (Ffset): Remove special ad-advice-info handling.
4064 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4065 (Fsubr_arity): CSE.
4066 (Finteractive_form): Simplify.
4067 (Fquo): Don't insist on having at least 2 arguments.
4068 (Qdefalias_fset_function): New var.
4069
4070 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4071
4072 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4073
4074 * nsfont.m (Qcondensed, Qexpanded): New variables.
4075 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4076 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4077
4078 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4079
4080 Fix recently introduced crash on MS-Windows (Bug#12839).
4081 * w32term.h (struct scroll_bar): Use convenient header.
4082 (SCROLL_BAR_VEC_SIZE): Remove.
4083 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4084
4085 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4086
4087 Tweak last vectorlike_header change.
4088 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4089 vectorlike object on the free list. This is introduced to avoid
4090 some (but not all) pointer casting and aliasing problems, see
4091 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4092 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4093 objects.
4094 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4095
4096 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4097
4098 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4099 been removed, so remove them here also.
4100
4101 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4102
4103 * doc.c (Fdocumentation): Handle new property
4104 dynamic-docstring-function to replace the old ad-advice-info.
4105
4106 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4107
4108 * fns.c (Qeql, hashtest_eq): Now static.
4109
4110 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4111
4112 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4113 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4114 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4115 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4116
4117 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4118
4119 Use same hash function for hashfn_profiler as for hash_string etc.
4120 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4121 * lisp.h (sxhash_combine): New inline function, with the contents
4122 of the old SXHASH_COMBINE.
4123 * profiler.c (hashfn_profiler): Use it, instead of having a
4124 special hash function containing a comparison that always yields 1.
4125
4126 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4127
4128 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4129 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4130 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4131 Remove unused vars.
4132
4133 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4134
4135 * image.c (xpm_make_color_table_h): Fix compiler error because
4136 make_hash_table changed.
4137
4138 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4139
4140 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4141
4142 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4143
4144 Use ad-hoc comparison function for the profiler's hash-tables.
4145 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4146 (make_log): Use them.
4147 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4148 call Fequal any more.
4149 (Ffunction_equal): New function.
4150 (cmpfn_profiler, hashfn_profiler): New functions.
4151 (syms_of_profiler): Initialize them.
4152 * lisp.h (struct hash_table_test): New struct.
4153 (struct Lisp_Hash_Table): Use it.
4154 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4155 * fns.c (make_hash_table): Take a struct to describe the test.
4156 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4157 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4158 (hash_lookup, hash_remove_from_table): Move assertion checking of
4159 hashfn result here. Check hash-equality before calling cmpfn.
4160 (Fmake_hash_table): Adjust call to make_hash_table.
4161 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4162 (syms_of_fns): Initialize them.
4163 * emacs.c (main): Move syms_of_fns earlier.
4164 * xterm.c (syms_of_xterm):
4165 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4166 * print.c (print_object): Adjust to new hash-table struct.
4167 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4168
4169 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4170
4171 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4172 value of w32-scroll-lock-modifier is neither nil nor one of the
4173 known key modifiers. (Bug#12806)
4174
4175 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4176
4177 Shrink struct vectorlike_header to the only size field.
4178 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4179 Adjust comment.
4180 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4181 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4182 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4183 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4184 information from the vector header. Adjust comment.
4185 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4186 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4187 layout.
4188 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4189 (struct vectorlike_header): Remove next member. Adjust comment.
4190 (struct Lisp_Subr): Add convenient header. Adjust comment.
4191 (allocate_pseudovector): Adjust prototype.
4192 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4193 (sweep_string, lisp_malloc): Remove useless prototypes.
4194 (enum mem_type): Adjust comment.
4195 (NEXT_IN_FREE_LIST): New macro.
4196 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4197 (Fmake_bool_vector): Likewise.
4198 (struct large_vector): New type to represent allocation unit for
4199 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4200 (large_vectors): Change type to struct large_vector.
4201 (allocate_vector_from_block): Simplify.
4202 (PSEUDOVECTOR_NBYTES): Replace with...
4203 (vector_nbytes): ...new function. Adjust users.
4204 (sweep_vectors): Adjust processing of large vectors.
4205 (allocate_vectorlike): Likewise.
4206 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4207 Add easserts. Adjust XSETPVECTYPESIZE usage.
4208 (allocate_buffer): Use BUFFER_PVEC_INIT.
4209 (live_vector_p): Adjust to match large vector.
4210 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4211 * buffer.h (struct buffer): Add next member.
4212 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4213 New macros.
4214 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4215 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4216 (copy_hash_table): Adjust to match vector header change.
4217 * lread.c (defsubr): Use XSETPVECTYPE.
4218 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4219 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4220 (xvecsize): New command.
4221
4222 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4223
4224 * keyboard.c (event_to_kboard): Do not dereference
4225 frame_or_window field of SELECTION_REQUEST_EVENT
4226 and SELECTION_CLEAR_EVENT events (Bug#12814).
4227 * xterm.h (struct selection_input_event): Adjust comment.
4228
4229 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4230
4231 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4232 such as Scroll Lock, if the respective keys are treated as
4233 function keys, not as modifiers. This avoids destroying non-ASCII
4234 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4235
4236 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4237
4238 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4239
4240 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4241
4242 Restore some duplicate definitions (Bug#12814).
4243 This undoes part of the 2012-11-03 changes. Some people build
4244 with plain -g rather than with -g3, and they need the duplicate
4245 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4246 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4247 Define as macros, as well as as enums or as constants.
4248
4249 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4250
4251 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4252 to keypad keys (Bug#12816).
4253
4254 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4255
4256 Minor adjustments of recently-changed frame functions.
4257 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4258 known to be a frame (we're in the FRAMEP branch).
4259 * lisp.h (Qframep): Remove decl. frame.h declares this.
4260 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4261 since they're meant for Lisp fixnum values.
4262
4263 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4264
4265 * window.c (Fwindow_combination_limit): Revert to the only
4266 required argument and adjust docstring as suggested in
4267 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4268 by Martin Rudalics <rudalics@gmx.at>.
4269
4270 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4271
4272 Widely used frame validity and checking functions.
4273 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4274 * frame.c (decode_live_frame, decode_any_frame): New functions.
4275 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4276 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4277 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4278 (Fframe_pointer_visible_p): Use decode_any_frame.
4279 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4280 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4281 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4282 (Fframe_focus): Likewise. Allow zero number of arguments.
4283 Adjust docstring.
4284 (frame_buffer_list, frame_buffer_predicate): Remove.
4285 * lisp.h (frame_buffer_predicate): Remove prototype.
4286 * buffer.c (Fother_buffer): Use decode_any_frame.
4287 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4288 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4289 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4290 (Fclose_font, Ffont_info): Use decode_live_frame.
4291 * fontset.c (check_fontset_name): Likewise.
4292 * terminal.c (Fframe_terminal): Likewise.
4293 * w32fns.c (check_x_frame): Likewise.
4294 * window.c (Fminibuffer_window, Fwindow_at)
4295 (Fcurrent_window_configuration): Likewise.
4296 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4297 Likewise. Allow zero number of arguments. Adjust docstring.
4298 * dispnew.c (Fredraw_frame): Likewise.
4299 * xfaces.c (frame_or_selected_frame): Remove.
4300 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4301 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4302 (Fframe_face_alist): Use decode_live_frame.
4303 * xfns.c (check_x_frame): Likewise.
4304
4305 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4306
4307 * window.c (quad): New function.
4308 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4309 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4310 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4311 (Fwindow_line_height): Use it.
4312 (Fwindow_fringes): Use list3.
4313 (Fwindow_scroll_bars): Use list4.
4314 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4315 (Fwindow_combination_limit): Allow zero number of arguments.
4316
4317 2012-11-05 Eli Zaretskii <eliz@gnu.org>
4318
4319 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4320
4321 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
4322 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
4323 file descriptor 2 for standard error. (Bug#12805)
4324
4325 2012-11-05 Chong Yidong <cyd@gnu.org>
4326
4327 * process.c (wait_reading_process_output): Revert previous change.
4328
4329 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4330
4331 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4332 This removes code that has been obsolete since around 1990.
4333 * callproc.c (Fcall_process):
4334 * emacs.c (main):
4335 * process.c (create_process):
4336 * term.c (dissociate_if_controlling_tty):
4337 Assume setsid exists.
4338 * callproc.c (child_setup): Assume setpgid exists and behaves as
4339 per POSIX.1-1988 or later.
4340 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4341 * emacs.c (shut_down_emacs):
4342 * sysdep.c (sys_suspend, init_foreground_group):
4343 Assume getpgrp behaves as per POSIX.1-1998 or later.
4344 * msdos.c (setpgrp): Remove.
4345 (tcgetpgrp, setpgid, setsid): New functions.
4346 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4347 * term.c (no_controlling_tty): Remove; unused.
4348 * w32proc.c (setpgrp): Remove.
4349 (setsid, tcgetpgrp): New functions.
4350
4351 Simplify by assuming __fpending.
4352 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4353 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4354 Do not assume that __fpending's result fits in int.
4355
4356 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4357
4358 Remove EMACS_OUTQSIZE+sleep hack.
4359 * dispnew.c (update_frame_1): Remove hack for terminals slower
4360 than 2400 bps, which throttled Emacs by having it sleep.
4361 This code hasn't worked since at least 2007, when the multi-tty stuff
4362 was added, and anyway those old terminals are long dead.
4363 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4364 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4365
4366 Fix data-loss with --version (Bug#9574).
4367 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4368 as we can't assume that emacs_strerror is initialized, and strerror
4369 is good enough here.
4370 (main): Invoke atexit earlier, to catch earlier instances of
4371 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4372
4373 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4374
4375 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4376 (keyDown): Remap keypad keys to X11 virtual key codes.
4377
4378 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4379
4380 Fix data-loss with --batch (Bug#9574).
4381 * emacs.c: Include <close-stream.h>.
4382 (close_output_streams): New function.
4383 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4384 and handles errors appropriately.
4385 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4386 does that now.
4387
4388 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4389 The symptom is a diagnostic "GLib-WARNING **: In call to
4390 g_spawn_sync(), exit status of a child process was requested but
4391 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4392 waitpid(), so exit status can't be returned." The diagnostic
4393 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4394 The real bug is a race condition between Emacs and glib: Emacs
4395 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4396 so that glib can't find it. Work around the bug by invoking
4397 waitpid only on subprocesses that Emacs itself creates.
4398 * process.c (create_process, record_child_status_change):
4399 Don't use special value -1 in pid field, as the caller now must
4400 know the pid rather than having the callee infer it.
4401 The inference was sometimes incorrect anyway, due to another race.
4402 (create_process): Set new 'alive' member if child is created.
4403 (process_status_retrieved): New function.
4404 (record_child_status_change): Use it.
4405 Accept negative 1st argument, which means to wait for the
4406 processes that Emacs already knows about. Move special-case code
4407 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4408 processes that have already been waited for, by testing and
4409 clearing new 'alive' member.
4410 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4411 now does this internally.
4412 (handle_child_signal): Let record_child_status_change do all
4413 the work, since we do not want to reap all exited child processes,
4414 only the child processes that Emacs itself created.
4415 * process.h (Lisp_Process): New boolean member 'alive'.
4416
4417 Omit duplicate definitions no longer needed with gcc -g3.
4418 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4419 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4420 Define only as macros. There's no longer any need to also define
4421 these symbols as enums or as constants, since we now assume
4422 gcc -g3 when debugging.
4423
4424 2012-11-03 Eli Zaretskii <eliz@gnu.org>
4425
4426 * lisp.mk: Adjust comments to the fact that term/internal is now
4427 loaded from loadup.el.
4428
4429 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4430 (msdos_fatal_signal): New function.
4431 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4432 its argument list.
4433
4434 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4435 for GCC versions before 4.
4436 (emacs_raise): Define to call msdos_fatal_signal.
4437
4438 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4439 iterator when starting in the middle of a display or overlay
4440 string. (Bug#12745)
4441
4442 2012-11-03 Chong Yidong <cyd@gnu.org>
4443
4444 * process.c (wait_reading_process_output): Clean up the last
4445 change.
4446
4447 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4448
4449 * process.c (wait_reading_process_output): Avoid a race condition
4450 with SIGIO delivery (Bug#11536).
4451
4452 2012-11-03 Chong Yidong <cyd@gnu.org>
4453
4454 * buffer.c (cursor_type): Untabify docstring.
4455
4456 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4457
4458 * frame.h (struct frame): Drop can_have_scroll_bars member
4459 which is meaningless for a long time. Adjust comments.
4460 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4461 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4462
4463 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4464
4465 * window.c (decode_next_window_args): Update window arg after
4466 calling decode_live_window and so fix crash reported at
4467 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4468 by Juanma Barranquero <lekktu@gmail.com>.
4469 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4470 * font.c (Ffont_at): Likewise.
4471
4472 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4473
4474 * widget.c (resize_cb): New function.
4475 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4476 (EmacsFrameResize): Check if all is up to date before changing frame
4477 size.
4478
4479 2012-11-02 Eli Zaretskii <eliz@gnu.org>
4480
4481 Implement backtrace output for fatal errors on MS-Windows.
4482 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4483 (BACKTRACE_LIMIT_MAX): New macro.
4484 (w32_backtrace): New function.
4485 (emacs_abort): Use w32_backtrace when the user chooses not to
4486 attach a debugger. Update the text of the abort dialog.
4487
4488 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4489
4490 Window-related stuff cleanup here and there.
4491 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4492 Use decode_any_window.
4493 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4494 * xdisp.c (Fformat_mode_line): Likewise.
4495 * font.c (Ffont_at): Use decode_live_window.
4496 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4497 * window.c (decode_next_window_args): Likewise.
4498 (decode_any_window): Remove static.
4499 * window.h (decode_any_window): Add prototype.
4500 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4501 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4502 respectively.
4503
4504 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4505
4506 Remove pad from struct input_event.
4507 * termhooks.h (struct input_event): Remove padding field.
4508 Adjust comment.
4509 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4510 member is never cons for a long time. Adjust comment.
4511 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4512 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4513 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4514 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4515
4516 2012-11-01 Eli Zaretskii <eliz@gnu.org>
4517
4518 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4519
4520 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4521
4522 Fix crash when using Emacs as commit editor for git (Bug#12697).
4523 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4524 and it is configured in conf_post.h.
4525 (Fcall_process): Don't invoke both setsid and setpgid; the former
4526 is enough, if it exists.
4527 * callproc.c (Fcall_process, child_setup):
4528 * process.c (create_process): Use setpgid.
4529 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4530 for the real thing.
4531 * dispnew.c (init_display): Initialize the foreground group
4532 if we are running a tty display.
4533 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4534 * lisp.h (init_foreground_group): New decl.
4535 * sysdep.c (inherited_pgroup): New static var.
4536 (init_foreground_group, tcsetpgrp_without_stopping)
4537 (narrow_foreground_group, widen_foreground_group): New functions.
4538 (init_sys_modes): Narrow foreground group.
4539 (reset_sys_modes): Widen foreground group.
4540
4541 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
4542
4543 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4544
4545 2012-10-31 Martin Rudalics <rudalics@gmx.at>
4546
4547 * minibuf.c (read_minibuf): Restore current buffer since
4548 choose_minibuf_frame calling Fset_frame_selected_window may
4549 change it (Bug#12766).
4550
4551 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4552
4553 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4554
4555 2012-10-30 Kenichi Handa <handa@gnu.org>
4556
4557 * font.c (Ffont_at): If WINDOW is specified and it is not
4558 displaying the current buffer, signal an error.
4559
4560 2012-10-29 Daniel Colascione <dancol@dancol.org>
4561
4562 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4563 In preparation for fixing bug#12739, move these functions from
4564 here...
4565
4566 * coding.h, coding.c: ... to here, and compile them only when
4567 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4568 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
4569
4570 2012-10-28 Eli Zaretskii <eliz@gnu.org>
4571
4572 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4573 (timer_loop, getitimer, setitimer): Use it instead of
4574 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4575 'clock'.
4576 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4577 literal 10000.
4578
4579 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4580
4581 * nsterm.m (NO_APPDEFINED_DATA): New define.
4582 (last_appdefined_event_data): New variable
4583 (last_appdefined_event): Remove.
4584 (ns_select): Initialize t from last_appdefined_event_data instead
4585 of [last_appdefined_event data1].
4586 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4587 remove last_appdefined_event (Bug#12698).
4588
4589 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4590
4591 * frame.c (x_set_font): Catch internal error.
4592
4593 2012-10-27 Eli Zaretskii <eliz@gnu.org>
4594
4595 Avoid overflow in w32 implementation of interval timers.
4596 When possible, for ITIMER_PROF count only times the main thread
4597 actually executes.
4598 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
4599 'volatile ULONGLONG' types. All the other data which was
4600 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
4601 (GetThreadTimes_Proc): New typedef.
4602 (w32_get_timer_time): New function, returns a suitable time value
4603 for the timer.
4604 (timer_loop): Enter critical section when accessing ULONGLONG
4605 values of the itimer_data struct, as these accesses are no longer
4606 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4607 Remove unused variable.
4608 (init_timers): Initialize s_pfn_Get_Thread_Times.
4609 (start_timer_thread): Don't assign itimer->caller_thread here.
4610 (getitimer): Assign itimer->caller_thread here.
4611 (setitimer): Always call getitimer to get the value of ticks_now.
4612 (sys_spawnve): Avoid compiler warning about format mismatch.
4613
4614 2012-10-26 Eli Zaretskii <eliz@gnu.org>
4615
4616 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4617 mouse movement events if the menu bar is active. This avoids
4618 producing a busy "hour-glass" cursor by Windows if the mouse
4619 pointer is positioned over a tooltip shown for some menu item.
4620
4621 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4622
4623 Don't assume process IDs fit in int.
4624 * emacs.c (shut_down_emacs) [!DOS_NT]:
4625 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4626 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4627 Use pid_t, not int, to store process IDs, as 'int'
4628 is not wide enough on a few platforms (e.g., AIX and IRIX).
4629
4630 2012-10-23 Kenichi Handa <handa@gnu.org>
4631
4632 The following change is to make face-font-rescale-alist work
4633 correctly for non-ASCII fonts.
4634
4635 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4636 (font_open_for_lface): Handle Vface_font_rescale_alist.
4637
4638 2012-10-23 Chong Yidong <cyd@gnu.org>
4639
4640 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4641
4642 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4643
4644 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4645 for screen font.
4646 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4647
4648 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4649 event (Bug#12681).
4650
4651 2012-10-21 Glenn Morris <rgm@gnu.org>
4652
4653 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4654
4655 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4656
4657 Port to OpenBSD 5.1.
4658 * frame.c (Fmouse_position, Fmouse_pixel_position):
4659 * xdisp.c (produce_stretch_glyph):
4660 Declare local vars only when they're needed.
4661 This is clearer and avoids a warning on OpenBSD about unused vars.
4662 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4663 This is safer, and avoids OpenBSD warnings about unused vars.
4664 * keyboard.c (record_menu_key): Remove unnecessary decl.
4665 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4666 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4667 as our definition clashes with OpenBSD's.
4668 * xfaces.c (load_face_colors, check_lface_attrs)
4669 (get_lface_attributes_no_remap, get_lface_attributes)
4670 (lface_fully_specified_p, x_supports_face_attributes_p)
4671 (tty_supports_face_attributes_p, face_fontset, realize_face)
4672 (realize_x_face, realize_tty_face):
4673 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4674 merely Lisp_Object *. This is more informative and avoids
4675 a warning on OpenBSD about accessing beyond an object's size.
4676
4677 2012-10-20 Chong Yidong <cyd@gnu.org>
4678
4679 * lread.c (Fload): Doc fix (Bug#12592).
4680
4681 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4682
4683 * font.c (Ffont_at): Fix previous change.
4684
4685 2012-10-19 Eli Zaretskii <eliz@gnu.org>
4686
4687 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4688 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
4689 for the reasons.
4690
4691 * alloc.c (NSTATICS): Decrease to 0x800.
4692
4693 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4694
4695 * fns.c (Fnreverse): Include the problem element when signaling an
4696 error (bug#12677).
4697
4698 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4699
4700 * nsterm.m (ns_select): Check writefds before call to
4701 FD_ISSET (Bug#12668).
4702
4703 2012-10-18 Daniel Colascione <dancol@dancol.org>
4704
4705 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4706 (staticpro): If we run out of staticpro slots, die with an
4707 informative error instead of just calling emacs_abort.
4708
4709 2012-10-18 Martin Rudalics <rudalics@gmx.at>
4710
4711 Fix two flaws reported by Dmitry Antipov.
4712 * window.c (Ftemp_output_buffer_show): Remove.
4713 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4714 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4715
4716 2012-10-17 Eli Zaretskii <eliz@gnu.org>
4717
4718 * makefile.w32-in ($(BLD)/w32.$(O)):
4719 ($(BLD)/vm-limit.$(O)):
4720 ($(BLD)/term.$(O)):
4721 ($(BLD)/unexw32.$(O)):
4722 ($(BLD)/fileio.$(O)):
4723 ($(BLD)/dispnew.$(O)): Update dependencies.
4724
4725 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4726 Add prototypes.
4727
4728 * w32proc.c: Include ctype.h.
4729
4730 * w32.h (init_environment, check_windows_init_file)
4731 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4732 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4733 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4734 (sys_link): Add prototypes.
4735
4736 * w32.c: Include w32select.h.
4737 (sys_access, e_malloc, sys_select): Add prototypes.
4738 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4739
4740 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4741
4742 * unexw32.c: Include lisp.h and w32.h.
4743
4744 * term.c [WINDOWSNT]: Include w32term.h.
4745
4746 * process.c [WINDOWSNT]: Add prototype of sys_select.
4747
4748 * fileio.c [WINDOWSNT]: Include w32.h.
4749
4750 * dispnew.c [WINDOWSNT]: Include w32.h.
4751
4752 * cygw32.c (Fcygwin_convert_path_to_windows)
4753 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4754 Lisp_Object values. (Bug#12661)
4755
4756 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4757 to Lisp_Object. (Bug#12661)
4758
4759 2012-10-17 Kenichi Handa <handa@gnu.org>
4760
4761 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4762 invalidate.
4763
4764 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4765
4766 * buffer.c (Fkill_buffer): When unchaining the marker,
4767 reset its buffer pointer to NULL (Bug#12652).
4768
4769 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4770
4771 Do not verify indirection counters of killed buffers (Bug#12579).
4772 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4773 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4774
4775 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4776
4777 * alloc.c (Fmake_byte_code): Fix typo in comment.
4778 * print.c (print_interval): Define as static to match prototype.
4779 * indent.c (disptab_matches_widthtab, recompute_width_table):
4780 Convert to eassert.
4781
4782 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4783
4784 * editfns.c (get_system_name): Remove.
4785 * lisp.h (get_system_name): Remove prototype.
4786 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4787 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4788
4789 2012-10-15 Daniel Colascione <dancol@dancol.org>
4790
4791 * dbusbind.c: Add comment explaining reason for previous change.
4792
4793 2012-10-15 Martin Rudalics <rudalics@gmx.at>
4794
4795 * window.c (Fwindow_end): Rewrite check whether cached position
4796 can be used (Bug#12600).
4797 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4798 Set windows_or_buffers_changed.
4799
4800 2012-10-15 Daniel Colascione <dancol@dancol.org>
4801
4802 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4803 enabled by undefining the symbol "interface", which the platform
4804 headers define to something incompatible.
4805
4806 2012-10-14 Daniel Colascione <dancol@dancol.org>
4807
4808 * image.c (init_tiff_functions, init_imagemagick_functions)
4809 (init_svg_functions): Fix cygw32 build break by using these
4810 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4811
4812 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4813
4814 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4815
4816 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4817
4818 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4819
4820 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4821
4822 * coding.c (detect_coding): Set coding->id before calling
4823 this->detector.
4824
4825 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4826
4827 * fileio.c: Formatting fixes.
4828
4829 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4830
4831 Fix some stat-related races.
4832 * fileio.c (Fwrite_region): Avoid race condition if a file is
4833 removed or renamed by some other process immediately after Emacs
4834 writes it but before Emacs stats it. Do not assume that stat (or
4835 fstat) succeeds.
4836 * image.c (slurp_file): Resolve the file name with fopen + fstat
4837 rather than stat + fopen.
4838 (pbm_read_file) [0]: Remove unused code with stat race.
4839 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4840 Remove ineffective code with stat race.
4841
4842 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4843
4844 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4845
4846 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4847
4848 * nsterm.m (hold_event_q): New static variable.
4849 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4850 ! q_event_ptr.
4851 (hold_event): New function.
4852 (ns_read_socket): If hold_event_q have events, store them and
4853 return (Bug#12384).
4854 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4855 is zero (Bug#12384).
4856
4857 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
4858
4859 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4860
4861 2012-10-12 Eli Zaretskii <eliz@gnu.org>
4862
4863 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4864
4865 * fileio.c (check_existing): New function.
4866 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4867 instead of calling 'stat', when what's needed is to check whether
4868 a file exists. This avoids expensive system calls on MS-Windows.
4869 (Bug#12587)
4870
4871 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
4872
4873 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4874 determine whether a file exists and is not a directory.
4875
4876 * lisp.h (check_existing): Add prototype.
4877
4878 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4879
4880 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4881
4882 2012-10-12 Glenn Morris <rgm@gnu.org>
4883
4884 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4885
4886 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4887
4888 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4889
4890 * eval.c (Fautoload): Remember previous autoload status in load-history.
4891
4892 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4893
4894 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4895 * lread.c (load_each_byte, new_backquote_flag, readchar)
4896 (read_filtered_event, lisp_file_lexically_bound_p)
4897 (safe_to_load_version, Fload, complete_filename_p, openp)
4898 (build_load_history, readevalloop, read_escape, read1)
4899 (string_to_number, read_vector, read_list):
4900 * macros.c (Fstart_kbd_macro):
4901 * marker.c (CONSIDER):
4902 * menu.c (parse_single_submenu, digest_single_submenu)
4903 (find_and_return_menu_selection, Fx_popup_menu):
4904 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4905 (Ftry_completion):
4906 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4907 (ns_menu_show):
4908 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4909 (xmenu_show, xdialog_show):
4910 Use bool for booleans.
4911 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4912 as it's not a predicate. All uses changed. Omit unnecessary
4913 buffer termination.
4914
4915 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4916
4917 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4918 (save_excursion_restore): Do not restore mark if it was not saved.
4919
4920 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4921
4922 * marker.c (cached_modiff): EMACS_INT, not int.
4923
4924 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4925 instead of having a wrong decl.
4926 * nsmenu.m (waiting_for_input): Remove wrong decl.
4927
4928 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4929
4930 keyboard.c, keymap.c: Use bool for booleans.
4931 * dispnew.c (sit_for): Distinguish between 3-way display_option
4932 and boolean do_display.
4933 * keyboard.c (single_kboard, this_command_key_count_reset)
4934 (waiting_for_input, echoing, immediate_quit, input_pending)
4935 (interrupt_input, interrupts_deferred, pop_kboard)
4936 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4937 (command_loop_1, adjust_point_for_property)
4938 (safe_run_hooks_error, input_polling_used, read_char):
4939 (help_char_p, readable_events, kbd_buffer_events_waiting)
4940 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4941 (lucid_event_type_list_p, get_input_pending):
4942 (gobble_input, menu_separator_name_p, menu_bar_item)
4943 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4944 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4945 (keyremap_step, test_undefined, read_key_sequence)
4946 (detect_input_pending, detect_input_pending_ignore_squeezables)
4947 (detect_input_pending_run_timers, requeued_events_pending_p)
4948 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4949 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4950 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4951 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4952 (accessible_keymaps_1, Fkey_description, push_key_description):
4953 (shadow_lookup, struct where_is_internal_data)
4954 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4955 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4956 (describe_map, describe_vector):
4957 * menu.c (single_menu_item):
4958 * nsmenu.m (ns_update_menubar):
4959 * process.c (wait_reading_process_output):
4960 * search.c (scan_buffer, scan_newline):
4961 Use bool for boolean.
4962 * keyboard.c (timers_run, swallow_events)
4963 (detect_input_pending_run_timers):
4964 * process.c (wait_reading_process_output):
4965 Use unsigned for counter where wraparound-on-overflow is desired,
4966 since unsigned is guaranteed to have that behavior and signed is not.
4967 (read_char): Use ptrdiff_t for string length.
4968 (get_input_pending): Remove first argument, since it was always
4969 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4970 and behave as if it had that value. Return new value of
4971 input_pending. All callers changed.
4972 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4973 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4974 a string length.
4975 * keymap.c (push_key_description): Omit last arg, which was always 1.
4976 All callers changed.
4977
4978 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4979
4980 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
4981
4982 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4983 ($(BLD)/term.$(O)): Update dependencies.
4984
4985 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4986
4987 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4988 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4989 initializer for PVEC_NORMAL_VECTOR.
4990
4991 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4992
4993 Clean out old termopts cruft.
4994 * termopts.h (flow_control, meta_key): Remove unused decls.
4995 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4996 Don't include termopts.h.
4997
4998 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4999
5000 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5001
5002 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5003
5004 * commands.h (immediate_quit): Remove duplicate decl.
5005
5006 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5007
5008 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5009 caching.
5010 (nsfont_open): Remove setting of Vfonts_in_cache.
5011 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5012
5013 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5014
5015 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5016 match what GetLastError returns. Explain why the function is
5017 needed.
5018
5019 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5020 'is_tooltip_frame', to avoid confusion with its global namesake.
5021
5022 2012-10-08 Daniel Colascione <dancol@dancol.org>
5023
5024 * xdisp.c (start_hourglass): Call w32_note_current_window when
5025 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5026 build that caused Emacs to display the hourglass cursor forever.
5027
5028 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5029 which is broken under remote desktop, calculate the number of
5030 colors available for a display based on the display's number of
5031 planes and number of bits per pixel per plane. (bug#10397).
5032
5033 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5034
5035 * nsfont.m (Vfonts_in_cache): New variable.
5036 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5037 are used. Add cached fonts to Vfonts_in_cache.
5038 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5039
5040 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5041
5042 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5043 in nt/config.nt.
5044 (FONT_H): Define after FRAME_H.
5045 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5046 Update dependencies.
5047
5048 * w32term.c: Remove leftover declaration of keyboard_codepage.
5049
5050 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5051
5052 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5053 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5054 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5055 (GLOBAL_SOURCES): Add cygw32.c.
5056 ($(BLD)/unexw32.$(O)):
5057 ($(BLD)/w32.$(O)):
5058 ($(BLD)/w32console.$(O)):
5059 ($(BLD)/w32fns.$(O)):
5060 ($(BLD)/w32heap.$(O)):
5061 ($(BLD)/w32menu.$(O)):
5062 ($(BLD)/w32proc.$(O)): Add w32common.h.
5063
5064 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5065 'const char *'.
5066 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5067
5068 2012-10-08 Daniel Colascione <dancol@dancol.org>
5069
5070 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5071 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5072 accidental message numbering hole. Change other messages to
5073 match.
5074
5075 * w32select.h (HAVE_W32SELECT): Remove.
5076
5077 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5078 w32common.h instead of w32heap.h.
5079
5080 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5081 (get_allocation_unit, get_processor_type, get_w32_major_version)
5082 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5083 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5084 (OS_NT, os_subtype, cache_system_info): Move declarations to
5085 w32common.
5086
5087 * w32heap.c: Include w32common.h.
5088 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5089 (w32_minor_version, w32_build_number, w32_subtype):
5090 Remove duplicate definitions.
5091
5092 * w32fns.c: Include w32common.h; include w32heap.h only in
5093 WINDOWSNT.
5094
5095 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5096 Use `report_file_error' instead of `error' in order to better
5097 inform users of what went wrong. Increase NTGUI_UNICODE file
5098 dialog box file name length to 32k, the maximum allowed by the NT
5099 kernel.
5100
5101 * w32common.h: New file.
5102 (ROUND_UP, ROUND_DOWN, get_page_size)
5103 (get_allocation_unit, get_processor_type, get_w32_major_version)
5104 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5105 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5106 (OS_NT, os_subtype, cache_system_info): Move here.
5107
5108 * unexw32.c, unexcw.c: Include w32common.h.
5109
5110 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5111 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5112 to call syms_of_w32select.
5113
5114 * cygw32.h: Remove obsolete EXFUN declarations.
5115
5116 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5117
5118 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5119 of w32inevt.o from SOME_MACHINE_OBJECTS.
5120
5121 2012-10-08 Daniel Colascione <dancol@dancol.org>
5122
5123 * image.c: Permanent fix for JPEG compilation issue --- limit
5124 jpeglib `boolean' redefinition to Cygwin builds.
5125
5126 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5127
5128 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5129
5130 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5131 Cygwin.
5132
5133 2012-10-08 Daniel Colascione <dancol@dancol.org>
5134
5135 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5136 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5137 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5138 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5139 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5140 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5141 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5142 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5143 now a supported configuration.
5144
5145 * Makefile.in: consolidate image variables into LIBIMAGE; add
5146 W32_OBJ and W32_LIBS. Compile new files.
5147
5148 * conf_post.h:
5149 (_DebPrint) declare tracing facility for W32 debugging. We need
5150 to unify tracing later.
5151
5152 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5153 unconditional use of W32 Unicode functions. Cygwin runs only on
5154 100% Unicode operating systems.
5155
5156 * cygw32.c: New file. Define Cygwin-specific facilities.
5157 (Fcygwin_convert_path_to_windows)
5158 (Fcygwin_convert_path_from_windows): New user functions for
5159 accessing Cygwin path-munging routines.
5160
5161 * cygw32.h: New file.
5162 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5163 UTF-16LE strings temporarily inside non-Lisp-visible string
5164 objects.
5165
5166 (w32_strerror): Just what it says on the tin.
5167
5168 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5169 also run for Cygwin; both systems have the same problem with using
5170 GUI facilities in a forked child. Also call syms_of_cygw32,
5171 syms_of_w32select in correct places.
5172
5173 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5174 needs fork-then-exec for daemon launching.
5175
5176 * font.h: Include frame.h.
5177
5178 * image.c: Use the image library cache machinery only when we're
5179 compiling for native WINDOWSNT; Cygwin can use shared libraries
5180 like any other Unixlike system.
5181
5182 * keyboard.c: Clarify a comment regarding the input loop.
5183
5184 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5185 functions directly instead of trying to detect at runtime that our
5186 host operating system supports them. We make this change for two
5187 reasons: Cygwin lacks support for the multibyte character
5188 conversion functions used by the legacy menu code, and Cygwin
5189 never needs to rely on non-Unicode APIs.
5190
5191 * unexw32.c (hinst): Declare extern.
5192
5193 * w32.c: Change header order;
5194 (w32_strerror): Move to w32fns.c because we need it for
5195 non-WINDOWSNT builds.
5196
5197 * w32.h: Add #error macro to make sure we don't include w32.h for
5198 Cygwin builds. Remove w32select declarations.
5199
5200 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5201 w32fns.c. w32console.c is WINDOWSNT-only.
5202
5203 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5204 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5205 POSIXy alternative.
5206 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5207 (w32_major_version, w32_minor_version, w32_build_number)
5208 (os_subtype, sound_type): Define here
5209 (w32_defined_color): Make color parameter const for consistency
5210 with other _defined_color functions.
5211 (w32_createwindow): Unconditionally call w32_init_class instead of
5212 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5213 through the code is complex and unnecessary because class
5214 registration is practically free.
5215 (w32_name_of_message): New EMACSDEBUG-only function.
5216 (Fset_message_beep): Move here
5217 (Fx_open_connection): Require that the display name for Windows be
5218 "w32" for consistency, emacsclient disambiguation, and maybe, one
5219 day, multi-window-system support.
5220 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5221 Cygwin files for W32 GUI facilities, since these clearly don't
5222 expect Cygwin names.
5223 (_DebPrint): Define.
5224 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5225 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5226 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5227 (w32_last_error): Remove.
5228
5229 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5230
5231 * w32heap.c (syspage_mask): Declare here.
5232 (cache_system_info): Remove.
5233
5234 * w32inevt.c (faked_key): Define globally, not statically.
5235 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5236 (w32_console_toggle_lock_key): Move to w32fns.c.
5237
5238 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5239
5240 * w32proc.c (_DebPrint): Move to w32fns.c.
5241 * w32select.c: Include string.h, stdio.h for Cygwin.
5242 * w32select.h: New File.
5243
5244 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5245 get_osfhandle.
5246 (w32_message_fd): New variable. Under Cygwin, holds the file
5247 descriptor the system used to tell us about pending thread
5248 messages.
5249
5250 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5251 that prevented compilation under non-WINDOWSNT systems.
5252
5253 (w32_initialize): Open /dev/windows and assign it to
5254 w32_message_fd. Provide w32 feature.
5255
5256 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5257 (WM_EMACS_INPUT_READY): add.
5258 (prepend_msg, w32_message_fd): Declare globally.
5259
5260 * w32xfns.c:
5261 (keyboard_handle): Use only when WINDOWSNT.
5262 (notify_msg_ready): New function. Posts a message to the main
5263 thread's message queue under CYGWIN, which wakes up the main
5264 thread from select(2) by making the /dev/windows file descriptor
5265 ready. Under WINDOWSNT, it sets an event the same way the old
5266 code did.
5267
5268 (post, prepend_msg): Actually call notify_msg_ready instead of
5269 setting the input event directly.
5270
5271 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5272
5273 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5274 but it still has blocs in it, don't return it to the system,
5275 instead of aborting. (Bug#12402)
5276
5277 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5278
5279 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5280
5281 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5282 MAC_OS_X_VERSION_10_6.
5283 (syms_of_nsterm): Remove comment about Panther and above for
5284 ns-antialias-text.
5285 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5286 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5287 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5288
5289 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5290 MAC_OS_X_VERSION_10_4.
5291
5292 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5293 MAC_OS_X_VERSION_10_2.
5294
5295 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5296
5297 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5298 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5299
5300 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5301 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
5302 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5303 Remove ns_in_resize check.
5304 (ns_clear_frame_area): Remove resize handle code.
5305
5306 * nsfns.m (ns_in_resize): Remove.
5307 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5308 Remove ns_in_resize check.
5309
5310 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5311
5312 Improve sys_siglist detection.
5313 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5314 defined as a macro, as is done in Solaris.
5315 (sys_siglist_entries): New macro.
5316 (save_strsignal): Use it.
5317 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5318 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5319
5320 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5321
5322 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5323 fullscreen/Fullscreen.
5324
5325 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5326 tobar_height is new.
5327
5328 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5329 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5330 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5331 (windowDidResize:): Check for correct window if old style fullscreen.
5332 Capitalize word in comment. Remove incorrect comment.
5333 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5334 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5335 error in drawing background.
5336 (toggleFullScreen:): Remove comment. Rearrange calls.
5337 Set toolbar values to zero, save old height in tobar_height.
5338 Restore tool bar height when leaving fullscreen.
5339 (canBecomeMainWindow): New function.
5340
5341 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5342
5343 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5344
5345 2012-10-05 Eli Zaretskii <eliz@gnu.org>
5346
5347 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5348
5349 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
5350 that time stamps of directories could also be changed.
5351 Don't request the too broad GENERIC_WRITE, only the more restrictive
5352 FILE_WRITE_ATTRIBUTES access rights.
5353
5354 * fileio.c (Fset_file_times): Special-case ignoring errors for
5355 directories only on MSDOS, not on MS-Windows.
5356
5357 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
5358
5359 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5360
5361 2012-10-04 Eli Zaretskii <eliz@gnu.org>
5362
5363 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5364 see whether CreateFile failed.
5365
5366 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5367
5368 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5369 to avoid similar races.
5370 * keyboard.c (pending_signals): Now bool, not int.
5371
5372 Port timers to OpenBSD, plus check for timer failures.
5373 OpenBSD problem reported by Han Boetes.
5374 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5375 and/or setitimer.
5376 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5377 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5378 like OpenBSD, which has timer_settime but does not declare it.
5379 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5380 whether to use itimerspec-related primitives. All uses of
5381 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5382
5383 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5384
5385 * profiler.c (handle_profiler_signal): Fix a malloc race
5386 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5387
5388 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5389
5390 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5391
5392 2012-10-02 Eli Zaretskii <eliz@gnu.org>
5393
5394 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5395 consistent with the change in return value of 'safe_strsignal'.
5396
5397 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5398
5399 Prefer plain 'static' to 'static inline' (Bug#12541).
5400 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5401 (bidi_set_sor_type, bidi_push_embedding_level)
5402 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5403 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5404 (bidi_cache_search, bidi_cache_ensure_space)
5405 (bidi_cache_iterator_state, bidi_cache_find)
5406 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5407 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5408 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5409 Now 'static', not 'static inline'.
5410
5411 Count overruns when profiling; change units to ns.
5412 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5413 Give extra weight to samples after overruns, to attempt to count
5414 the time more accurately.
5415 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5416 the underlying primitives nominally do ns.
5417 (Fprofiler_cpu_start): Document the change. Mention that
5418 the sampling intervals are only approximate.
5419
5420 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5421
5422 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5423
5424 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5425 case for the special 0 coding-system.
5426
5427 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5428 (Fmake_overlay): Remove redundant tests.
5429 (fix_start_end_in_overlays): Remove redundant recentering.
5430
5431 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
5432
5433 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5434 Update dependencies.
5435
5436 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5437
5438 Fix a malloc race condition involving strsignal.
5439 A signal can arrive in the middle of a malloc, and Emacs's signal
5440 handler can invoke strsignal, which can invoke malloc, which is
5441 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5442 Fix it by altering the signal handler so that it does not invoke
5443 strsignal.
5444 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5445 * process.c (status_message): Use const pointer, in case strsignal
5446 is #defined to safe_strsignal.
5447 * sysdep.c (sys_siglist, init_signals): Always define and
5448 initialize a substitute sys_siglist if the system does not define
5449 one, even if HAVE_STRSIGNAL.
5450 (safe_strsignal): Rename from strsignal. Always define,
5451 using sys_siglist. Return a const pointer.
5452 * syssignal.h (safe_strsignal): New decl.
5453 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5454
5455 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5456
5457 * w32proc.c (timer_loop): Fix code that waits for timer
5458 expiration, to avoid high CPU usage.
5459
5460 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5461
5462 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5463 (sweep_weak_table): Remove redundant prototypes.
5464
5465 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5466
5467 * emacs.c: Move the inclusion of TERM_HEADER after including
5468 windows.h on WINDOWSNT. This avoids compilation problems with
5469 MSVC.
5470
5471 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5472
5473 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5474 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5475 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5476 as the previous version used 'void *'.
5477
5478 * ralloc.c (ROUNDUP): Fix last change.
5479 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5480 'size_t'.
5481
5482 * w32proc.c <disable_itimers>: New static flag.
5483 (init_timers): Initialize it to zero, after creating the critical
5484 sections used by the timer threads.
5485 (term_timers): Set to 1 before deleting the critical sections.
5486 (getitimer, setitimer): If disable_itimers is non-zero, return an
5487 error indication without doing anything. Reported by Fabrice
5488 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
5489 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5490 return results.
5491 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5492 support timers.
5493
5494 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5495 term_ntproc after all the other bookkeeping, to get timers working
5496 as long as possible.
5497
5498 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5499
5500 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5501 Suggested by Juri Linkov in
5502 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5503
5504 Prefer plain 'static' to 'static inline' (Bug#12541).
5505 With static functions, modern compilers inline pretty well by
5506 themselves; advice from programmers often hurts as much as it helps.
5507 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5508 this change shrinks the text size of the Emacs executable by 1.1%
5509 without affecting CPU significantly in my benchmark.
5510 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5511 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5512 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5513 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5514 (bset_auto_fill_function, bset_auto_save_file_format)
5515 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5516 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5517 (bset_cache_long_line_scans, bset_case_fold_search)
5518 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5519 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5520 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5521 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5522 (bset_header_line_format, bset_indicate_buffer_boundaries)
5523 (bset_indicate_empty_lines, bset_invisibility_spec)
5524 (bset_left_fringe_width, bset_major_mode, bset_mark)
5525 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5526 (bset_name, bset_overwrite_mode, bset_pt_marker)
5527 (bset_right_fringe_width, bset_save_length)
5528 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5529 (bset_scroll_up_aggressively, bset_selective_display)
5530 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5531 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5532 (set_buffer_overlays_after):
5533 * category.c (bset_category_table):
5534 * charset.c (read_hex):
5535 * coding.c (produce_composition, produce_charset)
5536 (handle_composition_annotation, handle_charset_annotation)
5537 (char_encodable_p):
5538 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5539 (assign_row, set_frame_matrix_frame, make_current)
5540 (add_row_entry):
5541 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5542 * fns.c (maybe_resize_hash_table):
5543 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5544 * gmalloc.c (register_heapinfo):
5545 * image.c (lookup_image_type):
5546 * intervals.c (set_interval_object, set_interval_left)
5547 (set_interval_right, copy_interval_parent, rotate_right)
5548 (rotate_left, balance_possible_root_interval):
5549 * keyboard.c (kset_echo_string, kset_kbd_queue)
5550 (kset_keyboard_translate_table, kset_last_prefix_arg)
5551 (kset_last_repeatable_command, kset_local_function_key_map)
5552 (kset_overriding_terminal_local_map, kset_real_last_command)
5553 (kset_system_key_syms, clear_event, set_prop):
5554 * lread.c (digit_to_number):
5555 * marker.c (attach_marker, live_buffer, set_marker_internal):
5556 * nsterm.m (ns_compute_glyph_string_overhangs):
5557 * process.c (pset_buffer, pset_command)
5558 (pset_decode_coding_system, pset_decoding_buf)
5559 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5560 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5561 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5562 * syntax.c (bset_syntax_table, dec_bytepos):
5563 * terminal.c (tset_param_alist):
5564 * textprop.c (interval_has_some_properties)
5565 (interval_has_some_properties_list):
5566 * window.c (wset_combination_limit, wset_dedicated)
5567 (wset_display_table, wset_hchild, wset_left_fringe_width)
5568 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5569 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5570 (wset_right_fringe_width, wset_right_margin_cols)
5571 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5572 (wset_vertical_scroll_bar_type, wset_window_parameters):
5573 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5574 (wset_column_number_displayed, wset_region_showing)
5575 (window_box_edges, run_window_scroll_functions)
5576 (append_glyph_string_lists, prepend_glyph_string_lists)
5577 (append_glyph_string, set_glyph_string_background_width)
5578 (append_glyph, append_composite_glyph)
5579 (take_vertical_position_into_account):
5580 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5581 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5582 (lface_hash, lface_same_font_attributes_p, lookup_face):
5583 * xml.c (libxml2_loaded_p):
5584 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5585 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5586 Now 'static', not 'static inline'.
5587
5588 * bidi.c: Tune.
5589 (bidi_copy_it): Do the whole copy with a single memcpy.
5590 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5591
5592 Revert the FOLLOW-SYMLINKS change for file-attributes.
5593 Doing it right would require several changes to Tramp, and there's
5594 not enough time to get that tested before the freeze today.
5595 * dired.c (directory_files_internal, Ffile_attributes):
5596 Undo last change.
5597
5598 * frame.c (x_report_frame_params): Port better to wider ints.
5599 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5600 or that pointers can be printed in 15 decimal digits.
5601 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5602
5603 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5604
5605 Support x64 build on MS-Windows.
5606 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5607 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5608 compatibility with x64.
5609 (x_get_focus_frame): Add prototype.
5610
5611 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5612 defining an XRectangle structure.
5613
5614 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5615 arithmetics for compatibility with x64.
5616
5617 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5618 compatibility with x64.
5619
5620 * w32heap.h: Adjust prototypes and declarations.
5621
5622 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5623 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5624 DWORD, long, and unsigned long, for compatibility with x64.
5625 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5626 (sbrk): Argument is now of type ptrdiff_t.
5627
5628 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5629 less than 0x0500.
5630 (w32_msg_pump): Use WPARAM type for 'result'.
5631
5632 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5633 architecture.
5634 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5635 compatibility with x64.
5636
5637 * vm-limit.c (lim_data): Now size_t.
5638 (check_memory_limits): Adjust prototypes of real_morecore and
5639 __morecore to receive argument of type ptrdiff_t. Use size_t for
5640 five_percent and data_size.
5641
5642 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5643 variables, for compatibility with x64.
5644 (rva_to_section, offset_to_section, relocate_offset)
5645 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5646 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5647 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5648 for compatibility with x64.
5649
5650 * sysdep.c (STDERR_FILENO): Define if not already defined.
5651
5652 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5653 (__morecore): Argument type is now ptrdiff_t.
5654 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5655 (relinquish): Use ptrdiff_t type for 'excess'.
5656 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5657
5658 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5659 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5660 instead of a literal number.
5661
5662 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5663 (min): Define only if not already defined.
5664
5665 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5666 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5667 hosts.
5668
5669 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5670 'bitmaps' is a pointer.
5671
5672 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5673
5674 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5675
5676 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5677
5678 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5679 * dired.c (directory_files_internal, Ffile_attributes):
5680 New arg follow_symlinks. All uses changed.
5681
5682 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5683
5684 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5685
5686 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5687
5688 Support atimers and CPU profiler via profile.c on MS-Windows.
5689 * w32proc.c (sig_mask, crit_sig): New static variables.
5690 (sys_signal): Support SIGALRM and SIGPROF.
5691 (sigemptyset, sigaddset, sigfillset, sigprocmask)
5692 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
5693 sigfillset, and sigprocmask are no longer no-ops.
5694 (sigismember): New function.
5695 (struct itimer_data): New definition.
5696 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5697 (crit_prof): New static variables.
5698 (MAX_SINGLE_SLEEP): New definition.
5699 (timer_loop, stop_timer_thread, term_timers, init_timers)
5700 (start_timer_thread, getitimer, setitimer): New functions.
5701 (alarm): No longer a no-op, calls setitimer.
5702
5703 * w32.c (term_ntproc): Call term_timers.
5704 (init_ntproc): Make sure all signals are unblocked at startup, to
5705 erase any traces of dumping. Call init_timers.
5706
5707 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5708 Windows-specific code to display the hourglass mouse pointer is no
5709 longer used.
5710 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5711 to hourglass timer expiration.
5712 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5713 Remove, no longer used.
5714 (w32_note_current_window, show_hourglass, hide_hourglass):
5715 New functions, in support of hourglass cursor display similar to other
5716 window systems.
5717 (syms_of_w32fns): Don't initialize hourglass_timer.
5718
5719 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5720 WINDOWSNT as well.
5721 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5722
5723 * w32.h (init_timers, term_timers): Add prototypes.
5724
5725 2012-09-30 Kenichi Handa <handa@gnu.org>
5726
5727 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5728 to the buffer relocation which may be caused by ccl_driver.
5729
5730 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5731
5732 * xfns.c (Fx_file_dialog): Update comment.
5733
5734 * w32fns.c (Fx_file_dialog): Update comment.
5735
5736 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5737 Initialize panel name field if OSX >= 10.6.
5738
5739 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5740
5741 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5742
5743 * nsterm.m (NEW_STYLE_FS): New define.
5744 (ns_fullscreen_hook, windowWillEnterFullScreen)
5745 (windowDidEnterFullScreen, windowWillExitFullScreen)
5746 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5747 (setFSValue): New functions.
5748 (EmacsFSWindow): New implementation.
5749 (canBecomeKeyWindow): New function for EmacsFSWindow.
5750 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5751 (dealloc): Release nonfs_window if in fullscreen.
5752 (updateFrameSize:): Call windowDidMove to update top/left.
5753 (windowWillResize:toSize:): Check if frame is still maximized.
5754 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5755 next_maximized, maximized_width, maximized_height and nonfs_window.
5756 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5757 tbar_height.
5758 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
5759 fullscreen. Set maximized_width/height. Act on next_maximized.
5760
5761 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5762 (EmacsView): Add variables for fullscreen.
5763 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5764 (EmacsFSWindow): New interface for fullscreen.
5765
5766 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
5767
5768 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5769
5770 2012-09-30 Chong Yidong <cyd@gnu.org>
5771
5772 * fns.c (Frandom): Doc fix.
5773
5774 2012-09-30 Martin Rudalics <rudalics@gmx.at>
5775
5776 * window.c (Vwindow_combination_limit): New default value.
5777 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5778
5779 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5780
5781 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5782 Suggested by Eli Zaretskii in
5783 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5784
5785 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5786
5787 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5788 HAVE_TIMER_SETTIME is defined.
5789
5790 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5791
5792 Profiler improvements: more-accurate timers, overflow checks.
5793 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5794 signal.h, setjmp.h. Include systime.h instead.
5795 (saturated_add): New function.
5796 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5797 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5798 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5799 New static vars.
5800 (enum profiler_cpu_running): New enum.
5801 (profiler_cpu_running): Now of that enum type, not bool.
5802 All uses changed to store the new value.
5803 (handle_profiler_signal): Rename from sigprof_handler_1,
5804 for consistency with other handlers. Do not check whether
5805 cpu_log is a hash-table if garbage collecting, since it
5806 doesn't matter in that case.
5807 (deliver_profiler_signal): Rename from sigprof_handler,
5808 for consistency with other handlers.
5809 (setup_cpu_timer): New function, with much of what used to be in
5810 Fprofiler_cpu_start. Check for out-of-range argument.
5811 Prefer timer_settime if available, and prefer
5812 thread cputime clocks, then process cputime clocks, then
5813 monotonic clocks, to the old realtime clock. Use make_timeval
5814 to round more-correctly when falling back to setitimer.
5815 (Fprofiler_cpu_start): Use it.
5816 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5817 Don't assume that passing NULL as the 2nd argument of setitimer
5818 is the same as passing a pointer to all-zero storage.
5819 Ignore SIGPROF afterwards.
5820 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5821 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5822 non-fatal signal handlers. Ignore SIGPROF on startup.
5823 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5824 in profiler.c, since sysdep.c now uses it.
5825
5826 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5827 Suggested by Eli Zaretskii in
5828 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5829
5830 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
5831
5832 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5833
5834 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5835
5836 * lisp.h (struct backtrace): Remove indirection for `function' field.
5837 * xdisp.c (redisplay_internal):
5838 * profiler.c (record_backtrace, sigprof_handler_1):
5839 * alloc.c (Fgarbage_collect):
5840 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5841 (Fbacktrace_frame): Adjust accordingly.
5842
5843 2012-09-28 Glenn Morris <rgm@gnu.org>
5844
5845 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5846 (Frun_hook_with_args_until_failure): Doc fixes.
5847
5848 2012-09-28 Eli Zaretskii <eliz@gnu.org>
5849
5850 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5851 Qautomatic_redisplay and change the symbol name. All users changed.
5852
5853 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5854
5855 * profiler.c (sigprof_handler): Fix race condition.
5856
5857 2012-09-28 Glenn Morris <rgm@gnu.org>
5858
5859 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5860
5861 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5862
5863 Check more robustly for timer_settime.
5864 * Makefile.in (LIB_TIMER_TIME): New macro.
5865 (LIBES): Add it.
5866 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5867 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5868 call timer_settime.
5869
5870 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5871
5872 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5873
5874 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
5875
5876 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5877
5878 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5879
5880 * character.h (MAYBE_UNIFY_CHAR): Remove.
5881 * charset.c, charset.h (maybe_unify_char): Now static.
5882 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5883 Since this stuff is now private to charset.c, there's no need for
5884 a public macro and no need to inline by hand.
5885
5886 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5887 Stefan Monnier <monnier@iro.umontreal.ca>
5888 Juanma Barranquero <lekktu@gmail.com>
5889
5890 * profiler.c: New file.
5891 * Makefile.in (base_obj): Add profiler.o.
5892 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5893 ($(BLD)/profiler.$(O)): New target.
5894 * emacs.c (main): Call syms_of_profiler.
5895 * alloc.c (Qautomatic_gc): New constant.
5896 (MALLOC_PROBE): New macro.
5897 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5898 (total_bytes_of_live_objects): New function.
5899 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5900 Call malloc_probe for the memory profiler.
5901 (syms_of_alloc): Define Qautomatic_gc.
5902 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5903 race condition.
5904 (struct backtrace): Move definition...
5905 * lisp.h (struct backtrace): ..here.
5906 (Qautomatic_gc, profiler_memory_running): Declare vars.
5907 (malloc_probe, syms_of_profiler): Declare functions.
5908 * xdisp.c (Qautomatic_redisplay): New constant.
5909 (redisplay_internal): Record itself in backtrace_list.
5910 (syms_of_xdisp): Define Qautomatic_redisplay.
5911
5912 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5913 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5914
5915 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5916
5917 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5918
5919 Prefer POSIX timers if available.
5920 They avoid a race if the timer is too close to the current time.
5921 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5922 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
5923 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
5924
5925 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5926
5927 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5928 CHAR_STRING_ADVANCE.
5929 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5930 STRING_CHAR_ADVANCE.
5931
5932 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5933
5934 Move Vlibrary_cache to emacs.c and reset before dumping.
5935
5936 * lisp.h (reset_image_types): Declare.
5937 [WINDOWSNT] (Vlibrary_cache): Declare.
5938
5939 * image.c (reset_image_types): New function.
5940
5941 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5942 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5943 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5944
5945 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5946 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5947
5948 * w32.h (Vlibrary_cache): Do not declare.
5949
5950 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5951
5952 * w32proc.c (sys_signal): Handle all signals defined by the
5953 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5954 handlers for signals supported by Windows. Don't override
5955 term_ntproc as the handler for SIGABRT.
5956 (sigaction): Rewrite to call sys_signal instead of duplicating its
5957 code.
5958 (sys_kill): Improve commentary.
5959
5960 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5961 consistency with a signature of a signal handler. All callers
5962 changed.
5963 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5964 install term_ntproc as a signal handler for SIGABRT, as that
5965 should be done by the dumped Emacs.
5966
5967 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5968
5969 * w32select.c (term_w32select): Protect against repeated
5970 invocation by setting clipboard_owner to NULL after calling
5971 DestroyWindow.
5972
5973 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5974 and term_ntproc to their modified signatures.
5975
5976 * character.c (char_string, string_char): Remove calls to
5977 MAYBE_UNIFY_CHAR. See the discussion starting at
5978 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5979 for the details.
5980
5981 2012-09-25 Chong Yidong <cyd@gnu.org>
5982
5983 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5984
5985 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5986
5987 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5988 when encountering an unknown bytecode.
5989
5990 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5991
5992 image.c, indent.c: Use bool for booleans.
5993 * dispextern.h (struct image_type): Members valid_p, load, init
5994 now return bool, not int. All uses changed.
5995 * image.c: Omit unnecessary static decls.
5996 (x_create_bitmap_mask, x_build_heuristic_mask):
5997 Return void, not int, since callers don't care about the return value.
5998 (x_create_bitmap_mask, define_image_type, valid_image_p)
5999 (struct image_keyword, parse_image_spec, image_spec_value)
6000 (check_image_size, image_background)
6001 (image_background_transparent, x_clear_image_1)
6002 (postprocess_image, lookup_image, x_check_image_size)
6003 (x_create_x_image_and_pixmap, xbm_image_p)
6004 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6005 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6006 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6007 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6008 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6009 (png_image_p, init_png_functions, png_load_body, png_load)
6010 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6011 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6012 (init_gif_functions, gif_load, imagemagick_image_p)
6013 (imagemagick_load_image, imagemagick_load, svg_image_p)
6014 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6015 (gs_load):
6016 * nsimage.m (ns_load_image):
6017 * nsterm.m (ns_defined_color):
6018 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6019 * xfns.c (x_defined_color):
6020 * xterm.c (x_alloc_lighter_color_for_widget)
6021 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6022 (x_alloc_lighter_color):
6023 * indent.c (disptab_matches_widthtab, current_column)
6024 (scan_for_column, string_display_width, indented_beyond_p)
6025 (compute_motion, vmotion, Fvertical_motion):
6026 Use bool for booleans.
6027
6028 2012-09-24 Chong Yidong <cyd@gnu.org>
6029
6030 * chartab.c (Fset_char_table_default): Obsolete function removed.
6031
6032 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6033
6034 Move pid_t related decls out of lisp.h.
6035 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6036 (interruptible_wait_for_termination):
6037 Move these decls from lisp.h to syswait.h, since they use pid_t.
6038 Needed on FreeBSD; see Herbert J. Skuhra in
6039 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6040 * callproc.c: Include syswait.h.
6041
6042 gnutls.c, gtkutil.c: Use bool for boolean.
6043 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6044 (emacs_gnutls_handle_error):
6045 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6046 (xg_hide_tooltip, xg_create_frame_widgets)
6047 (create_dialog, xg_uses_old_file_dialog)
6048 (xg_get_file_with_chooser, xg_get_file_with_selection)
6049 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6050 (xg_item_label_same_p, xg_update_menubar)
6051 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6052 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6053 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6054 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6055 (update_frame_tool_bar, free_frame_tool_bar):
6056 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6057 * nsmenu.m (ns_update_menubar):
6058 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6059 * xfns.c (Fx_show_tip) [USE_GTK]:
6060 Use bool for boolean.
6061 * gtkutil.c (xg_update_frame_menubar):
6062 * xmenu.c (update_frame_menubar):
6063 Return void, not int, since caller ignores return value.
6064 * gtkutil.c (xg_change_toolbar_position):
6065 Return void, not 1.
6066
6067 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6068
6069 * makefile.w32-in (BLOCKINPUT_H): Remove.
6070 (SYSSIGNAL_H): New macro.
6071 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6072 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6073 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6074 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6075 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6076 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6077 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6078 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6079 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6080 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6081 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6082 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6083 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6084 ($(BLD)/w32xfns.$(O)): Update dependencies.
6085
6086 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6087
6088 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6089 fatal_error_backtrace.
6090
6091 * w32proc.c (sys_kill): Undo last change: don't do anything when
6092 invoked to deliver SIGABRT to our own process. This is now
6093 handled by emacs_raise.
6094
6095 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6096
6097 * w32term.c (w32_read_socket): Remove leftover reference to
6098 interrupt_input_pending.
6099
6100 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6101
6102 Do not use SA_NODEFER.
6103 Problem reported by Dani Moncayo in
6104 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6105 * alloc.c (die):
6106 * sysdep.c (emacs_abort): Do not reset signal handler.
6107 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6108 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6109 wanted even on POSIXish hosts, and it doesn't work on Windows.
6110
6111 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6112
6113 * xterm.c (x_term_init): Call fixup_locale before and after calling
6114 gtk_init (Bug#12392).
6115
6116 2012-09-23 Chong Yidong <cyd@gnu.org>
6117
6118 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6119 Vdynamic_library_alist.
6120
6121 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6122 (Fgnutls_available_p): Caller changed.
6123
6124 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6125 (Flibxml_parse_xml_region): Likewise.
6126
6127 * dispextern.h (struct image_type): Remove arg from init function.
6128
6129 * image.c (Finit_image_library, lookup_image_type)
6130 (define_image_type): Remove now-unneeded second arg.
6131 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6132 (init_tiff_functions, init_gif_functions, init_svg_functions):
6133 Arglist and w32_delayed_load calling convention changed.
6134 (gs_type): Remove init_gs_functions; there is no such function.
6135 (valid_image_p, make_image): Fix caller to lookup_image_type.
6136
6137 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6138
6139 Simplify and avoid signal-handling races (Bug#12471).
6140 * alloc.c (die):
6141 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6142 Avoid recursive loop if there's a fatal error in the function itself.
6143 * atimer.c (pending_atimers):
6144 * blockinput.h: Don't include "atimer.h"; no longer needed.
6145 (interrupt_input_pending): Remove. All uses removed.
6146 pending_signals now counts both atimers and ordinary interrupts.
6147 This is less racy than having three separate pending-signal flags.
6148 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6149 (input_blocked_p):
6150 Rename from their upper-case counterparts BLOCK_INPUT,
6151 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6152 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6153 This makes it easier to access volatile variables more accurately.
6154 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6155 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6156 that's more reliable if the code is buggy and sets
6157 interrupt_input_blocked to a negative value. All uses changed.
6158 * atimer.c (deliver_alarm_signal):
6159 Remove. No need to deliver this to the parent; any thread can
6160 handle this signal now. All uses replaced by underlying handler.
6161 * atimer.c (turn_on_atimers):
6162 * dispnew.c (handle_window_change_signal):
6163 * emacs.c (handle_danger_signal):
6164 * keyboard.c (kbd_buffer_get_event):
6165 Don't reestablish signal handler; not needed with sigaction.
6166 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6167 (UNBLOCK_INPUT_TO):
6168 Rework to avoid unnecessary accesses to volatile variables.
6169 (UNBLOCK_INPUT_TO): Now a function.
6170 (totally_unblock_input, unblock_input): New decls.
6171 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6172 (init_data): Remove. Necessary stuff now done in init_signal.
6173 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6174 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6175 (fatal_error_code): Remove; no longer needed.
6176 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6177 it doesn't always backtrace. All uses changed. No need to reset
6178 signal to default, since sigaction and/or die does that for us now.
6179 Use emacs_raise (FOO), not kill (getpid (), FOO).
6180 (main): Check more-accurately whether we're dumping.
6181 Move fatal-error setup to sysdep.c
6182 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6183 * gtkutil.c (xg_get_file_name, xg_get_font):
6184 Remove no-longer-needed signal-mask manipulation.
6185 * keyboard.c, process.c (POLL_FOR_INPUT):
6186 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6187 * keyboard.c (read_avail_input): Remove.
6188 All uses replaced by gobble_input.
6189 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6190 (kbd_buffer_store_event_hold, gobble_input):
6191 (record_asynch_buffer_change) [USABLE_SIGIO]:
6192 (store_user_signal_events):
6193 No need to mess with signal mask.
6194 (gobble_input): If blocking input and there are terminals, simply
6195 set pending_signals to 1 and return. All hooks changed to not
6196 worry about whether input is blocked.
6197 (process_pending_signals): Clear pending_signals before processing
6198 them, in case a signal comes in while we're processing.
6199 By convention callers now test pending_signals before calling us.
6200 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6201 New functions, to support changes to blockinput.h.
6202 (handle_input_available_signal): Now extern.
6203 (reinvoke_input_signal): Remove. All uses replaced by
6204 handle_async_input.
6205 (quit_count): Now volatile, since a signal handler uses it.
6206 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6207 All callers changed. Block SIGINT only if not already blocked.
6208 Clear sigmask reliably, even if Fsignal returns, which it can.
6209 Omit unnecessary accesses to volatile var.
6210 (quit_throw_to_read_char): No need to restore sigmask.
6211 * keyboard.c (gobble_input, handle_user_signal):
6212 * process.c (wait_reading_process_output):
6213 Call signal-handling code rather than killing ourselves.
6214 * lisp.h: Include <float.h>, for...
6215 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6216 (pending_signals): Now volatile.
6217 (syms_of_data): Now const if IEEE floating point.
6218 (handle_input_available_signal) [USABLE_SIGIO]:
6219 (terminate_due_to_signal, record_child_status_change): New decls.
6220 * process.c (create_process): Avoid disaster if memory is exhausted
6221 while we're processing a vfork, by tightening the critical section
6222 around the vfork.
6223 (send_process_frame, process_sent_to, handle_pipe_signal)
6224 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6225 ignores SIGPIPE.
6226 (send_process): No need for setjmp/longjmp any more, since the
6227 SIGPIPE stuff is now gone. Instead, report an error if errno
6228 is EPIPE.
6229 (record_child_status_change): Now extern. PID and W are now args.
6230 Return void, not bool. All callers changed.
6231 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6232 Remove. All uses removed. This bug should be fixed now in a
6233 different way.
6234 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6235 and record the child status change directly. This avoids the
6236 need to futz with the signal mask.
6237 (process_fatal_action): Move here from emacs.c.
6238 (emacs_sigaction_flags): New function, containing
6239 much of what used to be in emacs_sigaction_init.
6240 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6241 caught by emacs, to make races less likely.
6242 (deliver_process_signal): Rename from handle_on_main_thread.
6243 All uses changed.
6244 (BACKTRACE_LIMIT_MAX): Now at top level.
6245 (thread_backtrace_buffer, threadback_backtrace_pointers):
6246 New static vars.
6247 (deliver_thread_signal, deliver_fatal_thread_signal):
6248 New functions, for more-accurate delivery of thread-specific signals.
6249 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6250 (deliver_arith_signal): Handle in this thread, not
6251 in the main thread, since it's triggered by this thread.
6252 (maybe_fatal_sig): New function.
6253 (init_signals): New arg DUMPING so that we can be more accurate
6254 about whether we're dumping. Caller changed.
6255 Treat thread-specific signals differently from process-general signals.
6256 Block all signals while handling fatal error; that's safer.
6257 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6258 on IEEE hosts.
6259 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6260 Ignore SIGPIPE unless batch.
6261 (emacs_backtrace): Output backtrace for the appropriate thread,
6262 which is not necessarily the main thread.
6263 * syssignal.h: Include <stdbool.h>.
6264 (emacs_raise): New macro.
6265 * xterm.c (x_connection_signal): Remove; no longer needed
6266 now that we use sigaction.
6267 (x_connection_closed): No need to mess with sigmask now.
6268 (x_initialize): No need to reset SIGPIPE handler here, since
6269 init_signals does this for us now.
6270
6271 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6272
6273 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6274 background rect may be larger (Bug#12245).
6275
6276 2012-09-23 Chong Yidong <cyd@gnu.org>
6277
6278 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6279
6280 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6281
6282 * .gdbinit: Just stop at fatal_error_backtrace.
6283 See Stefan Monnier's request in
6284 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6285 Remove no-longer-used query of system type.
6286
6287 2012-09-22 Chong Yidong <cyd@gnu.org>
6288
6289 * search.c (Freplace_match): Doc fix (Bug#12325).
6290
6291 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6292
6293 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6294 (Fline_end_position): Doc fix.
6295
6296 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6297
6298 2012-09-22 Chong Yidong <cyd@gnu.org>
6299
6300 * dispextern.h (struct image_type): Add new slot, storing a type
6301 initialization function.
6302
6303 * image.c (define_image_type): Call the image initializer function
6304 if it is defined. Arguments and return value changed.
6305 (valid_image_p, make_image): Callers changed.
6306 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
6307 (gif_type, imagemagick_type, svg_type, gs_type):
6308 Add initialization functions.
6309 (Finit_image_library): Call lookup_image_type.
6310 (CHECK_LIB_AVAILABLE): Macro deleted.
6311 (lookup_image_type): Call define_image_type here, rather than via
6312 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6313 (syms_of_image): Move define_image_type calls for xbm_type and
6314 pbm_type to lookup_image_type.
6315
6316 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6317
6318 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6319 'idle_timers' from here ...
6320 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6321 lists, to avoid infloops when the timer does something stupid,
6322 like reinvoke itself with the same or smaller time-out.
6323 (Bug#12447)
6324
6325 2012-09-22 Martin Rudalics <rudalics@gmx.at>
6326
6327 * window.c (Fsplit_window_internal): Handle only Qt value of
6328 Vwindow_combination_limit separately.
6329 (Qtemp_buffer_resize): New symbol.
6330 (Vwindow_combination_limit): New default value.
6331 Rewrite doc-string.
6332
6333 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6334
6335 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6336 the new overlay string. (Bug#10159)
6337
6338 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6339
6340 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6341 or that fprintf is async-signal-safe. POSIX doesn't require
6342 either assumption.
6343
6344 2012-09-22 Chong Yidong <cyd@gnu.org>
6345
6346 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6347 (Bug#8207).
6348
6349 2012-09-22 Kenichi Handa <handa@gnu.org>
6350
6351 * composite.c (composition_reseat_it): Handle the case that a
6352 grapheme cluster is not covered by a single font (Bug#12352).
6353
6354 2012-09-21 Chong Yidong <cyd@gnu.org>
6355
6356 * image.c (define_image_type): Avoid adding duplicate types to
6357 image_types (Bug#12463). Suggested by Jörg Walter.
6358
6359 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6360
6361 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6362 (print_load_command_name): Add case LC_DATA_IN_CODE.
6363 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6364
6365 2012-09-21 Glenn Morris <rgm@gnu.org>
6366
6367 * eval.c (Frun_hook_with_args_until_success)
6368 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6369
6370 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
6371
6372 * fileio.c (Ffile_selinux_context): Only call freecon when
6373 lgetfilecon succeeded.
6374 (Fset_file_selinux_context): Likewise. (Bug#12444)
6375
6376 2012-09-21 Eli Zaretskii <eliz@gnu.org>
6377
6378 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6379 reordering, locate the cursor by calling set_cursor_from_row; if
6380 that fails, clear the desired glyph matrix before returning a
6381 failure indication to the caller. Fixes leaving garbled display
6382 when fast scrolling with a down-key. (Bug#12403)
6383 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6384 scrolling through multibyte text.
6385
6386 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6387
6388 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6389 calling mark_vectorlike since that's the one that marks the window.
6390 (mark_discard_killed_buffers): Mark the final cdr.
6391 * window.h (struct window): Move prev/next_buffers to the
6392 non-standard fields.
6393 * window.c (make_window): Initialize prev/next_buffers manually.
6394
6395 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6396
6397 Omit unused arg EXPECTED from socket hooks.
6398 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6399 * nsterm.m (ns_term_init):
6400 * termhooks.h (struct terminal.read_socket_hook):
6401 * w32inevt.c (w32_console_read_socket):
6402 * w32term.c (w32_read_socket):
6403 * xterm.c (XTread_socket):
6404 Omit unused arg EXPECTED. All callers changed.
6405 (store_user_signal_events): Return void, not int, since callers no
6406 longer care about the return value. All uses changed.
6407
6408 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
6409
6410 * w32gui.h (XParseGeometry): Do not declare.
6411
6412 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6413
6414 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
6415 Ignore 'expected'. See Eli Zaretskii in
6416 <http://bugs.gnu.org/12471#8> (last line).
6417
6418 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6419 (XParseGeometry): Now static. Substitute extremal values for
6420 values that are out of range.
6421
6422 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6423
6424 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6425
6426 * nsfns.m (XParseGeometry): Remove.
6427 (Fx_create_frame): Call x_set_offset to correctly interpret
6428 top_pos in geometry.
6429
6430 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
6431 (Fx_parse_geometry): If there is a space in string, call
6432 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6433
6434 2012-09-17 Eli Zaretskii <eliz@gnu.org>
6435
6436 * search.c (scan_buffer): Use character positions in calls to
6437 region_cache_forward and region_cache_backward, not byte
6438 positions. (Bug#12196)
6439
6440 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6441 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6442
6443 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6444 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6445 emacs_blocked_malloc, now deleted.
6446
6447 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6448
6449 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6450 The workaround was for improving performance on Solaris 2.4, but
6451 is getting in the way now. Emacs will still work if someone is
6452 still running Solaris 2.4 in a museum somewhere; Sun dropped
6453 support for Solaris 2.4 in 2003.
6454 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6455 * process.c (create_process) [HAVE_WORKING_VFORK]:
6456 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6457 since Emacs no longer uses vfork on that platform.
6458
6459 2012-09-17 Glenn Morris <rgm@gnu.org>
6460
6461 * emacs.c: Use COPYRIGHT.
6462
6463 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6464
6465 Remove configure's --without-sync-input option (Bug#12450).
6466 When auditing signal-handling in preparation for cleaning it up,
6467 I found that SYNC_INPUT has race conditions and would be a real
6468 pain to fix. Since it's an undocumented and deprecated
6469 configure-time option, now seems like a good time to remove it.
6470 Also see <http://bugs.gnu.org/11080#16>.
6471 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6472 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6473 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6474 (malloc_hysteresis):
6475 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6476 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6477 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6478 (dont_register_blocks, bytes_used_when_reconsidered)
6479 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6480 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6481 [!SYSTEM_MALLOC && !SYNC_INPUT]:
6482 Remove. All uses removed.
6483 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6484 implementation, one that depends on whether the new macro
6485 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6486 is defined.
6487 * atimer.c (run_timers, handle_alarm_signal):
6488 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6489 (handle_async_input, process_pending_signals)
6490 (handle_input_available_signal, init_keyboard):
6491 * nsterm.m (ns_read_socket):
6492 * process.c (wait_reading_process_output):
6493 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6494 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6495 (emacs_write):
6496 * xterm.c (XTread_socket):
6497 Assume SYNC_INPUT.
6498 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6499 * eval.c (handling_signal): Remove. All uses removed.
6500 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6501 All uses replaced with the SYNC_INPUT version.
6502 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6503 Remove decls.
6504 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6505 Now static.
6506
6507 * font.c (Ffont_shape_gstring): Remove unused local.
6508
6509 2012-09-16 Glenn Morris <rgm@gnu.org>
6510
6511 * Makefile.in (clean): No longer run nextstep's clean.
6512
6513 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6514 (ns_frag): Remove.
6515 (ns-app): Move here from ns.mk, and simplify.
6516 (clean): Simplify nextstep entry.
6517 * ns.mk: Remove file.
6518
6519 2012-09-17 Kenichi Handa <handa@gnu.org>
6520
6521 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6522 not covert the last few charactes.
6523
6524 2012-09-16 Kenichi Handa <handa@gnu.org>
6525
6526 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6527 here, but just check the validity of glyphs in the glyph-string.
6528
6529 2012-09-16 Martin Rudalics <rudalics@gmx.at>
6530
6531 * window.c (Fwindow_parameter, Fset_window_parameter):
6532 Accept any window as argument (Bug#12452).
6533
6534 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6535
6536 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6537 to ns_term_init to avoid memory leak.
6538
6539 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6540 explicit retain/release.
6541 (ns_term_init): Only allow one display. Initialize outerpool and
6542 ns_*_types.
6543
6544 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6545
6546 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6547 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6548 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6549 the Microsoft problem in a different way, by altering ../nt/config.nt.
6550
6551 2012-09-15 Eli Zaretskii <eliz@gnu.org>
6552
6553 * w32xfns.c:
6554 * w32uniscribe.c:
6555 * w32term.c:
6556 * w32select.c:
6557 * w32reg.c:
6558 * w32proc.c:
6559 * w32menu.c:
6560 * w32inevt.c:
6561 * w32heap.c:
6562 * w32font.c:
6563 * w32fns.c:
6564 * w32console.c:
6565 * w32.c:
6566 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6567 by lisp.h. This completes removal of setjmp.h inclusion
6568 erroneously announced in the previous commit. (Bug#12446)
6569
6570 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6571 more accurate.
6572
6573 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6574 not defined as a macro. The latter happens on MS-Windows.
6575 (Bug#12446)
6576
6577 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6578
6579 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6580 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
6581 Some instances of '#include <setjmp.h>' removed, if the
6582 only reason for the instance was because "lisp.h" was included.
6583 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6584 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6585 and _longjmp with the new symbols. Emacs already uses _setjmp if
6586 available, so this change affects only POSIXish hosts that have
6587 sigsetjmp but not _setjmp, such as some versions of Solaris and
6588 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6589 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6590 (png_load_body) [HAVE_PNG]:
6591 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6592 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6593 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6594 since PNG requires jmp_buf. This is the only exception to the
6595 general rule that we now use sys_setjmp and sys_longjmp.
6596 This exception is OK since this code does not change the signal
6597 mask or longjmp out of a signal handler.
6598
6599 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6600
6601 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6602 Include "syssignal.h", for 'main_thread'.
6603
6604 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6605
6606 Avoid out-of-range marker position (Bug#12426).
6607 * insdel.c (replace_range, replace_range_2):
6608 Adjust markers before overlays, as suggested by comments.
6609 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6610 Remove redundant check before calling offset_intervals.
6611
6612 2012-09-14 Martin Rudalics <rudalics@gmx.at>
6613
6614 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6615 current buffer (Bug#12387).
6616
6617 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
6618
6619 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6620
6621 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6622
6623 Use a more backwards-compatible timer format (Bug#12430).
6624 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6625 vector element, not from the 4th, since PSECS is now at the end.
6626 (Fcurrent_idle_time): Doc fix.
6627
6628 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6629
6630 Function to mark objects and remove killed buffers at once.
6631 * alloc.c (discard_killed_buffers): Rename to ...
6632 (mark_discard_killed buffers) ... new name. Add marking
6633 of remaining objects. Fix comment. Adjust users.
6634 (mark_object): Do not touch frame buffer lists here.
6635 * frame.c (delete_frame): Reset frame buffer lists here.
6636
6637 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6638
6639 Better workaround for GNOME bug when --enable-gcc-warnings.
6640 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6641 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6642 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6643
6644 Simplify SIGIO usage (Bug#12408).
6645 The code that dealt with SIGIO was crufty and confusing, e.g., it
6646 played tricks like "#undef SIGIO" but these tricks were not used
6647 consistently. Simplify mostly by not #undeffing standard symbols,
6648 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6649 or not as we please) rather than "defined SIGIO" (standard symbol
6650 that we probably shouldn't #undef).
6651 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6652 Modules that need it can include it.
6653 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6654 * dispextern.h (ignore_sigio): New decl.
6655 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6656 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6657 * emacs.c (shut_down_emacs):
6658 * keyboard.c (kbd_buffer_store_event_hold):
6659 Use ignore_sigio rather than invoking 'signal' directly.
6660 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6661 for FIONREAD.
6662 (FIONREAD, SIGIO): Do not #undef.
6663 (tty_read_avail_input): Use #error rather than a syntax error.
6664 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6665 for I_PIPE, used by SETUP_SLAVE_PTY.
6666 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6667 * sysdep.c (croak): Remove; no longer needed. This bit of
6668 temporary code, with Fred N. Fish's comment that it's temporary,
6669 has been in Emacs since at least 1992!
6670 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6671 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6672 * syssignal.h (croak): Remove decl.
6673 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6674 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6675 now that we're termios-only.
6676 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6677 * term.c (dissociate_if_controlling_tty): Use #error rather than
6678 a run-time error.
6679
6680 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6681 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6682 to work around GNOME bug 683906.
6683 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6684 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6685 This works around GCC bug 54561.
6686
6687 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6688
6689 More fixes for 'volatile' and setjmp/longjmp.
6690 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6691 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6692 (png_load_body) [HAVE_PNG]:
6693 (jpeg_load_body) [HAVE_JPEG]:
6694 New function, with most of the old parent function's body.
6695 (png_load) [HAVE_PNG]:
6696 (jpeg_load) [HAVE_JPEG]:
6697 Invoke the new function, to avoid longjmp munging our locals.
6698 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6699 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6700 longjmp is passed 2, as the C standard doesn't guarantee this.
6701 Instead, store the failure code into mgr->failure_code.
6702
6703 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6704
6705 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6706 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6707 (syms_of_keyboard): Remove support for unread-command-char.
6708
6709 2012-09-12 Eli Zaretskii <eliz@gnu.org>
6710
6711 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6712 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6713 violation. (Bug#12426)
6714
6715 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6716
6717 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6718
6719 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6720
6721 * eval.c: Add `inhibit-debugger'.
6722 (Qinhibit_debugger): New symbol.
6723 (call_debugger): Bind it instead of Qdebug_on_error.
6724 (maybe_call_debugger): Test Vinhibit_debugger.
6725 (syms_of_eval): Define inhibit-debugger.
6726 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6727 (syms_of_xdisp): Remove inhibit-debug-on-message.
6728
6729 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6730
6731 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6732 If a nonvolatile local variable is written before a _longjmp to
6733 the frame containing the variable, and is read after the _longjmp,
6734 the value read is indeterminate. Some local variables of type
6735 'struct handler' and 'struct catchtag' are used in this way, so
6736 mark each of their slots as volatile if the slot can be set before
6737 _longjmp and read afterwards.
6738 * lisp.h (struct handler): var and chosen_clause are now volatile.
6739 (struct catchtag): val, next, and pdlcount are now volatile.
6740
6741 * bidi.c (bidi_push_it, bidi_pop_it):
6742 * fns.c (copy_hash_table):
6743 * image.c (define_image_type):
6744 * keyboard.c (kbd_buffer_store_event_hold):
6745 * process.c (Fprocess_send_eof):
6746 * xfaces.c (x_create_gc) [HAVE_NS]:
6747 * xgselect.c (xg_select):
6748 Prefer assignment to memcpy when either will do.
6749
6750 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6751 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6752 time an item is removed. No need to mark this function 'inline';
6753 the compiler knows better than we do.
6754
6755 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6756
6757 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6758 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6759 to change_frame_size (Bug#12388).
6760 (windowDidResize:): Pass YES to updateFrameSize.
6761
6762 * nsterm.h: Add delay parameter to updateFrameSize.
6763
6764 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6765
6766 Discard killed buffers from deleted window and frame objects.
6767 This reduces an amount of references to killed buffers and
6768 helps GC to reclaim them faster.
6769 * alloc.c (discard_killed_buffers): New function.
6770 (mark_object): Use it for deleted windows and frames.
6771 (mark_object): If symbol's value is set up for a killed buffer
6772 or deleted frame, restore its global binding.
6773 * data.c (swap_in_global_binding): Add GC notice.
6774 (swap_in_symval_forwarding): Use convenient set_blv_where.
6775 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6776 * window.h: ... to here.
6777
6778 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6779
6780 Convenient macro to check whether the buffer is live.
6781 * buffer.h (BUFFER_LIVE_P): New macro.
6782 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6783 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6784
6785 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6786
6787 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6788 composition cases (Bug#12364).
6789
6790 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6791 overhang of succeeding glyphs overlapping box cursor.
6792
6793 * w32term.c (x_draw_glyph_string): Likewise.
6794
6795 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6796
6797 Simplify, document, and port floating-point (Bug#12381).
6798 The porting part of this patch fixes bugs on non-IEEE platforms
6799 with frexp, ldexp, logb.
6800 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6801 Now static.
6802 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6803 support, by removing commented-out code and briefly listing the
6804 C89 functions excluded. The commented-out stuff was confusing
6805 maintenance, e.g., we thought we needed cbrt but it was commented out.
6806 (logb): Remove decl; no longer needed.
6807 (isfinite): New macro, if not already supplied.
6808 (isnan): Don't replace any existing macro.
6809 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6810 are present on all C89 platforms.
6811 (Ffrexp): Do not special-case zero, as frexp does the right thing
6812 for that case.
6813 (Flogb): Do not use logb, as it doesn't have the desired meaning
6814 on hosts that use non-base-2 floating point. Instead, stick with
6815 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6816 frexp, to avoid getting an unspecified result.
6817
6818 * xdisp.c (Qinhibit_debug_on_message): Now static.
6819
6820 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6821
6822 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6823 NSBezierPath (Bug#12131).
6824
6825 2012-09-10 Chong Yidong <cyd@gnu.org>
6826
6827 * fns.c (Fdelq, Fdelete): Doc fix.
6828
6829 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6830
6831 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6832 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6833
6834 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6835
6836 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6837 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6838 Use it.
6839
6840 2012-09-09 Eli Zaretskii <eliz@gnu.org>
6841
6842 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6843 left fringe if the window has a left margin. This avoids leaving
6844 traces of the cursor because its leftmost pixel is not drawn over.
6845
6846 * dispnew.c (update_window_line): When the left margin area of a
6847 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6848 that screen line. (Bug#12277)
6849
6850 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6851
6852 Assume C89 or later for math functions (Bug#12381).
6853 This simplifies the code, and makes it a bit smaller and faster,
6854 and (most important) makes it easier to clean up signal handling
6855 since we can stop worring about floating-point exceptions in
6856 library code. That was a problem before C89, but the problem
6857 went away many years ago on all practical Emacs targets.
6858 * data.c, image.c, lread.c, print.c:
6859 Don't include <math.h>; no longer needed.
6860 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6861 might be autoconfigured, as that never happens.
6862 * data.c (fmod):
6863 * doprnt.c (DBL_MAX_10_EXP):
6864 * print.c (DBL_DIG):
6865 Remove. C89 or later always defines these.
6866 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6867 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6868 (arith_error, domain_error, domain_error2):
6869 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6870 no longer needed -- we simply return what C returns. All uses removed.
6871 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6872 the wrapped code.
6873 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6874 Remove. All uses expanded, as these macros are no longer used
6875 more than once and are now more trouble than they're worth.
6876 (Ftan): Use tan, not sin / cos.
6877 (Flogb): Assume C89 frexp.
6878 (fmod_float): Assume C89 fmod.
6879 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6880 (init_floatfns): Remove. All uses removed.
6881
6882 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6883
6884 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6885 compositeToPoint for OSX < 10.6 (Bug#12390).
6886
6887 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6888
6889 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6890 This produces more-accurate results.
6891
6892 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6893
6894 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6895 changes (Bug#12088).
6896
6897 2012-09-08 Chong Yidong <cyd@gnu.org>
6898
6899 * syntax.c (Fstring_to_syntax): Doc fix.
6900
6901 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6902
6903 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6904 in the internal border.
6905 (x_set_window_size): Remove static variables and their usage.
6906 (ns_redraw_scroll_bars): Fix NSTRACE arg.
6907 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6908 Remove fringe/internal border adjustment (Bug#11052).
6909 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6910 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6911 (ns_fix_rect_ibw): Remove.
6912 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6913 (ns_dumpglyphs_box_or_relief): Ditto.
6914 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6915 adjustment.
6916 (ns_dumpglyphs_image): Ditto.
6917 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
6918 border adjustment.
6919 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6920 their usage. Add fringe_extended_p and its use as in other terms.
6921 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6922 scroll bar was removed.
6923 (updateFrameSize): New function.
6924 (windowDidResize): Move code to updateFrameSize and call it.
6925
6926 * nsterm.h (EmacsView): Add updateFrameSize.
6927
6928 2012-09-07 Chong Yidong <cyd@gnu.org>
6929
6930 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6931
6932 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6933
6934 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6935
6936 More signal-handler cleanup (Bug#12327).
6937 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6938 Problem introduced when merging patches. Noted by Eli Zaretskii in
6939 <http://bugs.gnu.org/12327#67>.
6940 * floatfns.c: Comment fix.
6941 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6942 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6943 and anyway the declaration is harmless even if SIGDANGER is not defined.
6944 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6945 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6946 source files not surprisingly expected syssignal.h to define, or
6947 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6948 Include <sys/ioctl.h>, for FIONREAD.
6949 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6950 This eliminates a problem whereby other files mysteriously had
6951 to include "syssignal.h" before including "systty.h" if they
6952 wanted to use "#ifdef SIGIO".
6953
6954 2012-09-07 Eli Zaretskii <eliz@gnu.org>
6955
6956 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6957
6958 * w32.c (sigemptyset): Empty the set.
6959 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6960
6961 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6962
6963 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6964
6965 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6966 (mark_object): Likewise for frame objects.
6967
6968 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6969
6970 * syssignal.h (handle_on_main_thread): Always declare,
6971 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6972 This ports to platforms without HAVE_PTHREAD.
6973
6974 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6975
6976 Signal-handler cleanup (Bug#12327).
6977 Emacs's signal handlers were written in the old 4.2BSD style with
6978 sigblock and sigmask and so forth, and this led to some
6979 inefficiencies and confusion. Rewrite these to use
6980 pthread_sigmask etc. without copying signal sets around. Also,
6981 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6982 'signal', and instead use functions that do not attempt to take
6983 over the system name space. This patch causes Emacs's text
6984 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6985 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6986 Do not include <signal.h> or "syssignal.h", as these
6987 modules do not use signals.
6988 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6989 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6990 Do not include <signal.h>, as "syssignal.h" does that for us now.
6991 * atimer.c (sigmask_atimers): New function.
6992 (block_atimers, unblock_atimers): New functions,
6993 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6994 All uses replaced.
6995 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6996 no longer needed here.
6997 * emacs.c (main): Inspect existing signal handler with sigaction,
6998 so that there's no need to block and unblock SIGHUP.
6999 * sysdep.c (struct save_signal): New member 'action', replacing
7000 old member 'handler'.
7001 (save_signal_handlers, restore_signal_handlers):
7002 Use sigaction instead of 'signal' to save and restore.
7003 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7004 New function. All users of 'signal' modified to use set_sighandler
7005 if they're writeonly, and to use sys_signal if they're read+write.
7006 (emacs_sigaction_init, forwarded_signal): New functions.
7007 (sys_signal): Remove. All uses replaced by calls to sigaction
7008 and emacs_sigaction_init, or by direct calls to 'signal'.
7009 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7010 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7011 all uses replaced by pthread_sigmask etc. calls.
7012 * syssignal.h: Include <signal.h>.
7013 (emacs_sigaction_init, forwarded_signal): New decls.
7014 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7015 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7016 (sigmask, sys_sigmask): Remove; no longer needed.
7017 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7018 (sigblock, sigunblock, sigfree):
7019 (sigsetmask) [!defined sigsetmask]:
7020 Remove. All uses replaced by pthread_sigmask.
7021 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7022 no longer need to be replaced, and its typical old uses
7023 are now done via emacs_sigaction_init and sigaction.
7024 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7025 (sys_sigdel): Remove; unused.
7026 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7027
7028 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7029
7030 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7031 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7032
7033 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7034
7035 Explicitly mark buffer_defaults and buffer_local_symbols.
7036 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7037 mark_local_symbols here.
7038 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7039 since special buffers aren't marked here any more.
7040 (allocate_buffer): Chain new buffer with all_buffers here...
7041 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7042 not here.
7043 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7044 (syms_of_buffer): Remove staticpro of the above.
7045 (init_buffer_once): Set names for buffer_defaults and
7046 buffer_local_symbols.
7047
7048 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7049
7050 Use bool for booleans in font-related modules.
7051 * font.c (font_intern_prop, font_style_to_value)
7052 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7053 (generate_otf_features, font_check_otf_features, font_check_otf)
7054 (font_match_p, font_list_entities, font_at):
7055 * fontset.c (fontset_id_valid_p, reorder_font_vector
7056 (fontset_find_font, Fset_fontset_font)
7057 (face_suitable_for_char_p) [0]:
7058 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7059 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7060 (m17n_flt_initialized, ftfont_shape_by_flt):
7061 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7062 * nsfont.m (nsfont_draw):
7063 * w32font.c (w32font_draw):
7064 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7065 Use bool for booleans.
7066 * font.h: Adjust to above API changes.
7067 (struct font, struct font_driver, struct font_driver_list):
7068 Use bool for booleans.
7069 (struct font): Remove useless member encoding_type.
7070 All users removed.
7071 * fontset.c, xftfont.c: Omit unnecessary static decls.
7072
7073 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7074
7075 * alloc.c (mark_object): Revert window marking code
7076 since it's unsafe for the Fset_window_configuration.
7077
7078 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7079
7080 Fix race conditions with signal handlers and errno (Bug#12327).
7081 Be more systematic about preserving errno whenever a signal
7082 handler returns, even if it's not in the main thread. Do this by
7083 renaming signal handlers to distinguish between signal delivery
7084 and signal handling. All uses changed.
7085 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7086 * data.c (deliver_arith_signal): Rename from arith_error.
7087 * dispnew.c (deliver_window_change_signal): Rename from
7088 window_change_signal.
7089 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7090 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7091 * keyboard.c (deliver_input_available_signal): Rename from
7092 input_available_signal.
7093 (deliver_user_signal): Rename from handle_user_signal.
7094 (deliver_interrupt_signal): Rename from interrupt_signal.
7095 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7096 (deliver_child_signal): Rename from sigchld_handler.
7097 * atimer.c (handle_alarm_signal):
7098 * data.c (handle_arith_signal):
7099 * dispnew.c (handle_window_change_signal):
7100 * emacs.c (handle_fatal_signal, handle_danger_signal):
7101 * keyboard.c (handle_input_available_signal):
7102 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7103 * process.c (handle_pipe_signal, handle_child_signal):
7104 New functions, with the actual signal-handling code taken from the
7105 original respective signal handlers, sans the sporadic attempts to
7106 preserve errno, since that's now done by handle_on_main_thread.
7107 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7108 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7109 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7110 Move to sysdep.c.
7111 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7112 Move initialization of main_thread to sysdep.c's init_signals.
7113 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7114 our usage, and simplifies the mainline code.
7115 (record_child_status_change): New static function, as a helper
7116 for handle_child_signal, and with most of the old child handler's
7117 contents.
7118 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7119 (handle_child_signal): Use the above.
7120 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7121 Moved here from emacs.c.
7122 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7123 code moved here from emacs.c's main function.
7124 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7125 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7126 This lets callers save and restore errno properly.
7127
7128 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7129
7130 Remove redundant or unused things here and there.
7131 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7132 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7133 * editfns.c (Fcompare_buffer_substrings): Likewise.
7134 * frame.h (struct terminal, struct font_driver_list):
7135 Remove redundant declarations.
7136 * window.h (Qleft, Qright): Likewise.
7137
7138 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7139
7140 Do not mark objects from deleted buffers, windows and frames.
7141 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7142 (mark_object): Likewise for windows and frames.
7143
7144 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7145
7146 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7147 buffer_defaults and buffer_local_symbols as valid objects.
7148 Return special value to denote them.
7149
7150 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7151
7152 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7153 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7154 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7155 (file_name_absolute_p, Fsubstitute_in_file_name):
7156 (check_executable, check_writable, Ffile_accessible_directory_p)
7157 (Fset_file_selinux_context, Fdefault_file_modes)
7158 (Finsert_file_contents, choose_write_coding_system)
7159 (Fwrite_region, build_annotations, a_write, e_write)
7160 (Fdo_auto_save):
7161 * filelock.c (boot_time_initialized, get_boot_time)
7162 (get_boot_time_1, lock_file_1, within_one_second):
7163 * floatfns.c (in_float):
7164 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7165 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7166 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7167 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7168 * window.c (compare_window_configurations):
7169 Use bool for booleans.
7170 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7171 (Fdefault_file_modes): Now mode_t, not int, for modes.
7172 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7173 (internal_delete_file): Now returns void, not a (boolean) int,
7174 since nobody was looking at the return value.
7175 * lisp.h, window.h: Adjust to above API changes.
7176
7177 * xdisp.c (set_message): Simplify and reindent last change.
7178
7179 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7180
7181 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7182
7183 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7184
7185 * eval.c (call_debugger): Make the function non-static so that we
7186 can call it from set_message.
7187
7188 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7189 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7190
7191 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7192
7193 Give more-useful info on a fatal error (Bug#12328).
7194 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7195 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7196 of doing the work ourselves.
7197 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7198 do most of the work.
7199 (fatal_error_backtrace): New function, taken from the guts
7200 of the old fatal_error_signal, but with a new option to output
7201 a backtrace.
7202 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7203 info about the signal than just its number.
7204 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7205 * sysdep.c: Include <execinfo.h>
7206 (emacs_backtrace): New function, taken partly from the previous
7207 code of the 'die' function.
7208 (emacs_abort): Call fatal_error_backtrace rather than abort.
7209
7210 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7211
7212 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7213 eager (load-time) macro-expansion.
7214 * lisp.mk (lisp): Add macroexp.
7215
7216 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7217
7218 Simplify redefinition of 'abort' (Bug#12316).
7219 Do not try to redefine the 'abort' function. Instead, redo
7220 the code so that it calls 'emacs_abort' rather than 'abort'.
7221 This removes the need for the NO_ABORT configure-time macro
7222 and makes it easier to change the abort code to do a backtrace.
7223 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7224 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7225 Remove; sysdep.c's emacs_abort now takes its place.
7226 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7227 'abort' changed to use 'emacs_abort'.
7228 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7229 (abort) [!defined abort]: Rename to ...
7230 (emacs_abort): ... new name.
7231 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7232 the place of the old 'abort' in emacs.c.
7233 * w32.c, w32fns.c (abort): Do not #undef.
7234 * w32.c (emacs_abort): Rename from w32_abort.
7235
7236 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7237
7238 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7239 offsets[j].dv, since the y axis of the screen coordinates points
7240 down, while the y axis of the font definition coordinates points
7241 up. This fixes display of Arabic diacritics such as KASRA and
7242 KASRATAN. (Bug#11860)
7243
7244 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7245
7246 Be more systematic about _setjmp vs setjmp.
7247 * alloc.c (test_setjmp, mark_stack):
7248 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7249 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7250 (png_load, my_error_exit, jpeg_load):
7251 * process.c (send_process_trap, send_process):
7252 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7253 The underscored versions are up to 30x faster on some hosts.
7254 Formerly, the code used setjmp+longjmp sometimes and
7255 _setjmp+_longjmp at other times, with no particular reason to
7256 prefer setjmp+longjmp.
7257
7258 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7259
7260 Fix minor problem found by static checking.
7261 * buffer.c (Fdelete_all_overlays): Return nil.
7262
7263 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7264
7265 * buffer.c (Fdelete_all_overlays): New function.
7266
7267 2012-09-03 Chong Yidong <cyd@gnu.org>
7268
7269 * gtkutil.c: Add extern decl for Qxft.
7270
7271 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7272
7273 * emacs.c, eval.c: Use bool for boolean.
7274 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7275 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7276 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7277 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7278 (main, decode_env_path, Fdaemon_initialized):
7279 * eval.c (call_debugger, Finteractive_p, interactive_p):
7280 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7281 (maybe_call_debugger, Fbacktrace):
7282 * process.c (read_process_output, exec_sentinel):
7283 Use bool for booleans.
7284 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7285 All callers changed.
7286 * eval.c (interactive_p): Omit always-true boolean argument
7287 EXCLUDE_SUBRS_P. All callers changed.
7288 * dispextern.h, lisp.h: Reflect above API changes.
7289 * firstfile.c (dummy): Use the address of 'main', whose signature
7290 won't change, instead of the address of 'initialize', whose
7291 signature just changed from int to bool.
7292 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7293 * msdos.c (fatal_error_in_progress): ... from here.
7294 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7295 of incrementing it.
7296 (redisplay_internal, unwind_redisplay): Simply clear
7297 REDISPLAYING_P when unwinding, instead of saving its previous,
7298 always-false value and then restoring it.
7299
7300 Clean up some extern decls.
7301 Mostly, this hoists extern decls out of .c files and into .h files.
7302 That way, we're more likely to catch errors if the interfaces change.
7303 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7304 declare xg_mark_data.
7305 * dispextern.h (x_frame_parm_handlers):
7306 * font.h (Qxft):
7307 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7308 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7309 (Qultra_bold, Qoblique, Qitalic):
7310 Move extern decl here from .c file.
7311 * alloc.c (xg_mark_data) [USE_GTK]:
7312 * doc.c (Qclosure):
7313 * eval.c (Qlexical_binding):
7314 * fns.c (time) [!HAVE_UNISTD_H]:
7315 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7316 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7317 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7318 * lread.c (Qinternal_interpreter_environment):
7319 * minibuf.c (Qbuffer):
7320 * process.c (QCfamily, QCfilter):
7321 * widget.c (free_frame_faces):
7322 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7323 * xfont.c (x_clear_errors):
7324 * xterm.c (x_frame_parm_handlers):
7325 Remove now-redundant extern decls.
7326 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7327 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7328 Now static.
7329 * xfaces.c: Remove unnecessary static decls.
7330 * xterm.c (updating_frame): Remove decl of nonexistent object.
7331
7332 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7333 when building globals.h, as the objects that are not built on
7334 this host are not needed to compile C files on this host.
7335
7336 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7337
7338 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7339
7340 * frame.h: Add missing prototype for x_wm_set_size_hint.
7341
7342 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7343
7344 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7345 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7346 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7347 (Fsubstitute_command_keys):
7348 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7349 (save_excursion_save, save_excursion_restore)
7350 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7351 (format_time_string, general_insert_function)
7352 (make_buffer_string, make_buffer_string_both)
7353 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7354 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7355 (copy_text, insert_1, insert_1_both, insert_from_string)
7356 (insert_from_string_before_markers, insert_from_string_1)
7357 (insert_from_buffer, insert_from_buffer_1, replace_range)
7358 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7359 (del_range_2, modify_region):
7360 * intervals.c (intervals_equal, balance_possible_root_interval)
7361 (adjust_intervals_for_insertion, merge_properties_sticky)
7362 (graft_intervals_into_buffer, lookup_char_property)
7363 (adjust_for_invis_intang, set_point_both)
7364 (get_property_and_range, compare_string_intervals)
7365 (set_intervals_multibyte_1, set_intervals_multibyte):
7366 * keyboard.c (decode_timer):
7367 Use bool for boolean.
7368 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7369 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7370
7371 2012-09-02 Chong Yidong <cyd@gnu.org>
7372
7373 * keymap.c (push_key_description): Print M-TAB as C-M-i
7374 (Bug#11758).
7375
7376 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
7377
7378 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7379 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7380 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7381 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7382 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7383 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7384 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7385
7386 2012-09-01 Eli Zaretskii <eliz@gnu.org>
7387
7388 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7389 more than one grapheme cluster passed to the shaper: compute the
7390 offset adjustment values separately for each cluster. (Bug#11860)
7391
7392 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7393 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7394 about implicit conversions from integer to pointer.
7395
7396 2012-09-01 Daniel Colascione <dancol@dancol.org>
7397
7398 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7399 system used too early.
7400
7401 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7402
7403 Better seed support for (random).
7404 * emacs.c (main): Call init_random.
7405 * fns.c (Frandom): Set the seed from a string argument, if given.
7406 Remove long-obsolete Gentzel cruft.
7407 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7408 (init_random): New function.
7409
7410 2012-09-01 Daniel Colascione <dancol@dancol.org>
7411
7412 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7413 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7414 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7415 x_wm_set_size_hint, x_query_colors, x_real_positions,
7416 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7417 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7418 all of which have been moved to common code.
7419
7420 * xfaces.c: Include TERM_HEADER instead of listing all possible
7421 window-system headers.
7422
7423 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7424 to match header.
7425
7426 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7427 directly accessing frame internals.
7428
7429 * w32font.h: Include font.h. Define syms_of_w32font and
7430 globals_of_w32font.
7431
7432 * process.c: Include TERM_HEADER instead of listing all possible
7433 window-system headers.
7434
7435 * nsterm.h: Remove declarations now in frame.h.
7436 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
7437
7438 * menu.c: Include TERM_HEADER instead of listing all possible
7439 window-system headers.
7440
7441 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7442 window system.
7443
7444 * keyboard.c: Include TERM_HEADER instead of listing all possible
7445 window-system headers.
7446
7447 * image.c: Include TERM_HEADER instead of listing all possible
7448 window-system headers. Declare Vlibrary_cache when compiling for
7449 Windows.
7450
7451 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7452 window system declarations.
7453
7454 * frame.h: Move common functions here: set_frame_menubar,
7455 x_set_window_size, x_sync, x_get_focus_frame,
7456 x_set_mouse_position, x_set_mouse_pixel_position,
7457 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7458 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7459 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7460 x_activate_menubar, x_real_positions, x_bitmap_icon,
7461 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7462 and x_query_colors.
7463
7464 * frame.c: Include TERM_HEADER instead of listing all possible
7465 window-system headers.
7466
7467 * font.c: Include TERM_HEADER instead of listing all possible
7468 window-system headers.
7469
7470 * emacs.c: Include TERM_HEADER.
7471
7472 * dispnew.c: Include TERM_HEADER instead of listing all possible
7473 window-system headers.
7474
7475 * ccl.h: Include character.h.
7476
7477 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7478 the current window system; include in list of objects to link into
7479 Emacs.
7480
7481 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7482
7483 Remove mark_ttys function and fix tty_display_info initialization.
7484 * lisp.h (mark_ttys): Remove prototype.
7485 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7486 to mark_ttys because all possible values of 'top_frame' slot are
7487 the frames which are reachable from Vframe_list.
7488 * term.c (mark_ttys): Remove.
7489 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7490
7491 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7492
7493 Change struct frame bitfields from unsigned char to unsigned.
7494 * frame.h (struct frame): Change type of 'display_preempted',
7495 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7496 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7497 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7498 bitfields from unsigned char to unsigned.
7499
7500 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7501
7502 Remove unused member of struct x_output and struct w32_output.
7503 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7504 * w32term.h (struct w32_output): Likewise.
7505
7506 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7507
7508 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7509 does not become zero (Bug#12234).
7510
7511 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7512
7513 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7514 for GCC 4.7.1 x86-64.
7515
7516 2012-08-30 Glenn Morris <rgm@gnu.org>
7517
7518 * lread.c (init_lread): For out-of-tree builds, only add the
7519 source directory's site-lisp dir to the load-path if it exists,
7520 consistent with in-tree builds. (Bug#12302)
7521
7522 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7523
7524 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
7525 button_values to NULL. Call setStykeMask so dialogs get a close button.
7526 (windowShouldClose:): Set window_closed.
7527 (dealloc): New member, free button_values.
7528 (process_dialog:): Make member function. Remove window argument,
7529 replace window with self. Count buttons and allocate and store values
7530 in button_values.
7531 (addButton:value:row:): value is int with the name tag. Call setTag
7532 with tag. Remove return self, declare return value as void.
7533 (addString:row:): Remove return self, declare return value as void.
7534 (addSplit): Remove return self, declare return value as void.
7535 (clicked:): Remove return self, declare return value as void.
7536 Set dialog_return to button_values[seltag]. Code formatting change.
7537 (initFromContents:isQuestion:): Adjust call to process_dialog.
7538 Code formatting change.
7539 (timeout_handler:): Set timer_fired to YES.
7540 (runDialogAt:): Set timer_fired to NO.
7541 Handle click on close button as quit.
7542
7543 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7544 Add window_closed and button_values. Add void as return value for
7545 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7546 Add process_dialog as new member.
7547
7548 2012-08-28 Eli Zaretskii <eliz@gnu.org>
7549
7550 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7551 is not one of the heaps we manage. (Bug#12242)
7552
7553 2012-08-28 Glenn Morris <rgm@gnu.org>
7554
7555 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7556
7557 2012-08-28 Martin Rudalics <rudalics@gmx.at>
7558
7559 * window.c (Fset_window_configuration): Remove handling of
7560 auto-buffer-name window parameter. Install revision of reverted
7561 fix.
7562
7563 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7564
7565 Do not allow to set major mode for a dead buffer.
7566 * buffer.c (Fset_buffer_major_mode): Signal an error
7567 if the buffer is dead.
7568 (Fother_buffer, other_buffer_safely): Remove redundant
7569 nested declaration.
7570
7571 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7572
7573 Always use set_buffer_if_live to restore original buffer at unwind.
7574 * buffer.h (record_unwind_current_buffer): New function.
7575 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7576 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7577 * undo.c, window.c: Adjust users.
7578 * buffer.c (set_buffer_if_live): Fix comment.
7579
7580 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7581
7582 Fix usage of set_buffer_internal.
7583 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7584 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7585 * coding.c (decode_coding): Omit redundant test.
7586 * fileio.c (decide_coding_unwind): Likewise.
7587 * fns.c (secure_hash): Likewise.
7588 * insdel.c (modify_region): Likewise.
7589 * keyboard.c (command_loop_1): Likewise.
7590 * print.c (PRINTFINISH): Likewise.
7591 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7592
7593 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7594
7595 * dispnew.c: Use bool for boolean.
7596 (frame_garbaged, display_completed, delayed_size_change)
7597 (fonts_changed_p, add_window_display_history)
7598 (add_frame_display_history, verify_row_hash)
7599 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7600 (row_equal_p, realloc_glyph_pool)
7601 (allocate_matrices_for_frame_redisplay)
7602 (showing_window_margins_p)
7603 (adjust_frame_glyphs_for_frame_redisplay)
7604 (build_frame_matrix_from_leaf_window, make_current)
7605 (mirrored_line_dance, mirror_line_dance, update_frame)
7606 (update_window_tree, update_single_window)
7607 (check_current_matrix_flags, update_window, update_text_area)
7608 (update_window_line, set_window_update_flags, scrolling_window)
7609 (update_frame_1, scrolling, buffer_posn_from_coords)
7610 (do_pending_window_change, change_frame_size)
7611 (change_frame_size_1, sit_for):
7612 Use bool for boolean.
7613 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7614 and remove last int (actually boolean) argument, which was always 0.
7615 All callers changed.
7616 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7617 * dispextern.h (struct composition_it): Use bool for boolean.
7618 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7619 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7620 * dired.c (file_name_completion):
7621 Use bool for boolean. (This was missed in an earlier change.)
7622
7623 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7624
7625 * window.c (Fset_window_configuration): Revert first part of
7626 last change.
7627
7628 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7629
7630 * nsterm.h (NSPanel): New class variable dialog_return.
7631
7632 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7633 Initialize dialog_return.
7634 (windowShouldClose:): Use stop instead of stopModalWithCode.
7635 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7636 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7637 event.
7638 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7639 modal loop returns.
7640
7641 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7642
7643 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7644 * composite.c (find_composition, composition_gstring_p)
7645 (composition_reseat_it, find_automatic_composition):
7646 * data.c (let_shadows_buffer_binding_p)
7647 (let_shadows_global_binding_p, set_internal, make_blv)
7648 (Fmake_variable_buffer_local, Fmake_local_variable)
7649 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7650 (cons_to_signed, arith_driver):
7651 * dbusbind.c (xd_in_read_queued_messages):
7652 * dired.c (directory_files_internal, file_name_completion):
7653 Use bool for booleans.
7654 * dired.c (file_name_completion):
7655 * process.h (fd_callback):
7656 Omit int (actually boolean) argument. It wasn't being used.
7657 All uses changed.
7658 * composite.h, lisp.h: Reflect above API changes.
7659
7660 * cmds.c, coding.c: Use bool for booleans.
7661 * cmds.c (move_point, Fself_insert_command):
7662 * coding.h (struct composition status, struct coding_system):
7663 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7664 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7665 (emacs_mule_char, decode_coding_emacs_mule)
7666 (encode_coding_emacs_mule, detect_coding_iso_2022)
7667 (decode_coding_iso_2022, encode_invocation_designation)
7668 (encode_designation_at_bol, encode_coding_iso_2022)
7669 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7670 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7671 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7672 (encode_coding_raw_text, detect_coding_charset)
7673 (decode_coding_charset, encode_coding_charset, detect_eol)
7674 (detect_coding, get_translation_table, produce_chars)
7675 (consume_chars, reused_workbuf_in_use)
7676 (make_conversion_work_buffer, code_conversion_save)
7677 (decode_coding_object, encode_coding_object)
7678 (detect_coding_system, char_encodable_p)
7679 (Funencodable_char_position, code_convert_region)
7680 (code_convert_string, code_convert_string_norecord)
7681 (Fset_coding_system_priority):
7682 * fileio.c (Finsert_file_contents):
7683 Use bool for booleans.
7684 * coding.h, lisp.h: Reflect above API changes.
7685 * coding.c: Remove unnecessary static function decls.
7686 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7687 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7688 not a boolean 'int', since callers never look at the return value.
7689 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7690 * coding.h (decoding_buffer_size, encoding_buffer_size)
7691 (emacs_mule_string_char): Remove unused extern decls.
7692 (struct iso_2022_spec, struct coding_system):
7693 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7694 (struct emacs_mule_spec): Remove unused field 'full_support'.
7695 All initializations removed.
7696 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7697
7698 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7699
7700 Fix spare memory change (Bug#12286).
7701 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7702 (valid_lisp_object_p): Likewise.
7703
7704 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7705
7706 * window.c (Fset_window_configuration): Record any window's old
7707 buffer if it's replaced (see Bug#8789). If the new current
7708 buffer doesn't appear in the selected window, go to its old
7709 point (Bug#12208).
7710
7711 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7712
7713 Special MEM_TYPE_SPARE to denote reserved memory.
7714 * alloc.c (enum mem_type): New memory type.
7715 (refill_memory_reserve): Use new type for spare memory.
7716 This prevents live_cons_p and live_string_p from incorrect
7717 detection of uninitialized objects from spare memory as live.
7718
7719 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7720
7721 Spelling fixes.
7722 * Makefile.in (.PHONY): versioclean -> versionclean.
7723
7724 Remove unused external symbols.
7725 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7726 * window.c (Qwindow_valid_p, decode_valid_window):
7727 Now static, not extern.
7728 * data.c (Qinterval): Remove; unused.
7729 (syms_of_data): Do not define 'interval'.
7730 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7731 * window.h (decode_valid_window):
7732 Remove decls.
7733
7734 * character.c, charset.c, chartab.c: Use bool for booleans.
7735 * character.c (lisp_string_width, string_count_byte8)
7736 (string_escape_byte8):
7737 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7738 (load_charset_map_from_file, map_charset_chars)
7739 (Fdefine_charset_internal, define_charset_internal)
7740 (Fdeclare_equiv_charset, find_charsets_in_text)
7741 (Ffind_charset_region, char_charset, Fiso_charset):
7742 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7743 (sub_char_table_set, sub_char_table_set_range)
7744 (char_table_set_range, optimize_sub_char_table)
7745 (map_sub_char_table):
7746 Use bool for boolean.
7747 * character.c (str_to_unibyte): Omit last boolean argument; it was
7748 always 0. All callers changed.
7749 * character.h, charset.h: Adjust to match previous changes.
7750 * character.h (char_printable_p): Remove decl of nonexistent function.
7751 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7752 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7753 are all boolean, so make them single-bit bitfields.
7754
7755 * lisp.h (ASET): Remove attempt to detect side effects.
7756 It was meant to be temporary and it often doesn't work,
7757 because when IDX has side effects the behavior of IDX==IDX
7758 is undefined. See Stefan Monnier in
7759 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7760
7761 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7762
7763 * lisp.h (functionp): New function (extracted from Ffunctionp).
7764 (FUNCTIONP): Use it.
7765 * eval.c (Ffunctionp): Use it.
7766
7767 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7768
7769 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7770 as that's faster and simpler than static storage. Don't bother
7771 with the g_main_context_query overhead if g_main_context_pending
7772 says no events are pending.
7773 (gfds, gfds_size): Remove these static vars.
7774 (xgselect_initialize): Remove; no longer needed.
7775 All uses and decls removed.
7776
7777 * emacs.c (fatal_error_signal_hook): Remove.
7778 All uses removed. This leftover from old code was always 0.
7779
7780 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7781 * casefiddle.c (casify_object, casify_region):
7782 * casetab.c (set_case_table):
7783 * category.c, category.h (word_boundary_p):
7784 * category.h (CHAR_HAS_CATEGORY):
7785 Use bool for booleans, instead of int.
7786
7787 2012-08-25 Eli Zaretskii <eliz@gnu.org>
7788
7789 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7790
7791 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7792
7793 On assertion failure, print backtrace if available.
7794 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7795 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7796 * Makefile.in (LIB_EXECINFO): New macro.
7797 (LIBES): Use it.
7798
7799 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7800 * bytecode.c (exec_byte_code):
7801 * callint.c (check_mark, Fcall_interactively):
7802 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7803 (getenv_internal, sync_process_alive, call_process_exited):
7804 * lisp.h (USE_SAFE_ALLOCA):
7805 Use bool for booleans, instead of int.
7806 * lisp.h, process.h: Adjust prototypes to match above changes.
7807 * callint.c (Fcall_interactively): Don't assume the mark's
7808 offset fits in 'int'.
7809
7810 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7811
7812 * buffer.c, buffer.h: Use bool for boolean.
7813 * buffer.c (reset_buffer_local_variables)
7814 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7815 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7816 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7817 (overlay_touches_p, overlay_strings, Foverlay_put)
7818 (report_overlay_modification, call_overlay_mod_hooks):
7819 (mmap_enlarge, mmap_set_vars):
7820 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7821 Use bool for booleans, instead of int.
7822 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7823 since the 1-or-0 return value is always ignored anyway.
7824 (mmap_initialized_p):
7825 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7826 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7827
7828 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7829
7830 * bidi.c: Use bool for boolean.
7831 This is a bit more readable, and makes the text segment of bidi.o
7832 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7833 Presumably it's faster too.
7834 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7835 Now bool.
7836 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7837 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7838 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7839 (bidi_explicit_dir_char, bidi_level_of_next_char)
7840 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7841 Use bool for booleans, instead of int.
7842 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7843 (bidi_unshelve_cache): Adjust decls to match code.
7844
7845 2012-08-23 Martin Rudalics <rudalics@gmx.at>
7846
7847 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7848 argument.
7849
7850 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7851
7852 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7853 * atimer.h: Include <stdbool.h>.
7854
7855 2012-08-22 Dan Nicolaescu <dann@gnu.org>
7856
7857 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7858 compile time tests instead of run time tests on systems that do
7859 not use them.
7860 (FRAME_MAC_P): Remove leftover from deleted code.
7861 * frame.c (syms_of_frame): Remove leftover from deleted code.
7862
7863 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7864
7865 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7866
7867 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7868
7869 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7870 Otherwise, the compiler complains about (A?B:C) where B is void
7871 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
7872 (fontset_add): Return void, for FONTSET_ADD.
7873
7874 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7875
7876 * alloc.c: Use bool for booleans.
7877 (gc_in_progress, abort_on_gc)
7878 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7879 (dont_register_blocks) [GC_MALLOC_CHECK]:
7880 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7881 (check_string_bytes, make_specified_string, memory_full)
7882 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7883 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7884 (mark_stack, valid_pointer_p, make_pure_string)
7885 (Fgarbage_collect, survives_gc_p, gc_sweep):
7886 Use bool for booleans, instead of int.
7887 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7888 Remove unused local.
7889 * alloc.c (PURE_POINTER_P):
7890 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7891 * editfns.c (Fformat):
7892 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7893 (Fdo_auto_save):
7894 * fns.c (sweep_weak_table):
7895 * lisp.h (suppress_checking, push_message, survives_gc_p)
7896 (make_pure_string, gc_in_progress, abort_on_gc):
7897 * lread.c (readchar, read1):
7898 * print.c (Fprin1_to_string):
7899 * xdisp.c (push_message):
7900 Use bool for booleans affected directly or indirectly by
7901 alloc.c's changes.
7902
7903 Make recently-introduced setters macros.
7904 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7905 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7906 (set_fontset_default, set_fontset_fallback): Rename from their
7907 upper-case counterparts, and make them functions rather than macros.
7908 This is more consistent with the other recently-introduced setters.
7909 These don't need to be inline, since they're local.
7910
7911 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7912
7913 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7914 the loop (Bug#12247).
7915
7916 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7917
7918 * lisp.h (vcopy): Use memcpy rather than our own loop.
7919 This fixes a performance regression introduced by the recent
7920 addition of vcopy. This means 'vcopy' will need to be modified
7921 for a copying collector, but that's OK. Also, tighten the
7922 checking in the assertion.
7923
7924 2012-08-21 Eli Zaretskii <eliz@gnu.org>
7925
7926 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7927 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7928 non-base glyph for the width of the base character, according to
7929 what x_draw_composite_glyph_string_foreground expects.
7930 Generate WADJUST value according to composition_gstring_width's
7931 expectations, to produce correct width of the composed character.
7932 Reverse the sign of the DU offset produced by ScriptPlace.
7933
7934 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7935
7936 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7937
7938 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7939
7940 Avoid direct writes to contents member of struct Lisp_Vector.
7941 * lisp.h (vcopy): New function to copy data into vector.
7942 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7943 * fns.c (Ffillarray): Use ASET.
7944 * keyboard.c (timer_check_2): Use AREF and ASET.
7945 (append_tool_bar_item, Frecent_keys): Use vcopy.
7946 * lread.c (read_vector): Use ASET.
7947 * msdos.c (Frecent_doskeys): Use vcopy.
7948 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7949 (Finternal_merge_in_global_face): Use ASET and vcopy.
7950 * xfont.c (xfont_list_pattern): Likewise.
7951
7952 2012-08-21 Martin Rudalics <rudalics@gmx.at>
7953
7954 * window.c (Fwindow_point): For the selected window always return
7955 the position of its buffer's point.
7956 (Fset_window_point): For the selected window always go in its
7957 buffer to the specified position.
7958
7959 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7960
7961 Setter macros for fontsets.
7962 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7963 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7964 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7965 Adjust users.
7966
7967 2012-08-20 Glenn Morris <rgm@gnu.org>
7968
7969 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7970 Don't assume that `ln -f' works.
7971
7972 2012-08-20 Eli Zaretskii <eliz@gnu.org>
7973
7974 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7975 and later about non-assignments with no effect. See discussion at
7976 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7977 details.
7978
7979 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7980
7981 Inline setter functions for Lisp_Objects slots of struct specbinding.
7982 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7983 Adjust users.
7984
7985 2012-08-20 Martin Rudalics <rudalics@gmx.at>
7986
7987 * window.c (select_window): Always make selected window's buffer
7988 current.
7989
7990 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7991
7992 Use AREF and ASET for docstrings of category tables.
7993 * category.h (CATEGORY_DOCSTRING): Use AREF.
7994 (SET_CATEGORY_DOCSTRING): Use ASET.
7995 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7996
7997 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7998
7999 Inline setter functions for hash table members.
8000 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8001 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8002 (set_hash_key_and_value, set_hash_index, set_hash_next)
8003 (set_hash_hash): New functions.
8004 * charset.c, fns.c: Adjust users.
8005
8006 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8007
8008 Inline getter and setter functions for per-buffer values.
8009 * buffer.h (per_buffer_default, set_per_buffer_default)
8010 (per_buffer_value, set_per_buffer_value): New functions.
8011 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8012 * buffer.c, data.c: Adjust users.
8013
8014 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8015
8016 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8017
8018 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8019
8020 Rely on <config.h> + <unistd.h> to declare 'environ',
8021 as gnulib does this if the system doesn't.
8022 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8023 Remove declaration. MS-Windows declares it on stdlib.h which is
8024 included by conf_post.h.
8025 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8026 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8027 * vm-limit.c: Include <unistd.h>, for 'environ'.
8028
8029 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8030 (start_of_data): Remove decl; mem-limits.h provides it.
8031
8032 * xdisp.c (handle_invisible_prop): Make it a bit faster
8033 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8034
8035 2012-08-19 Chong Yidong <cyd@gnu.org>
8036
8037 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8038 ends (Bug#3874).
8039
8040 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8041
8042 * .gdbinit: Use call instead of set when calling a function in the
8043 inferior.
8044
8045 * data.c (set_internal): Don't use set_blv_found.
8046 (Fkill_local_variable): Likewise.
8047
8048 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8049
8050 * nsfont.m (ns_ascii_average_width): Ensure the string
8051 ascii_printable is initialized with a null-terminated character
8052 array. Otherwise, it can contain undesired extra characters.
8053
8054 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8055
8056 port new setting code to Sun C 5.8 2005/10/13
8057 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8058 Return void, not Lisp_Object. Otherwise, the compiler
8059 complains about (A?B:C) where B is void and C is Lisp_Object
8060 when compiling CHAR_TABLE_SET, due to the recent change to
8061 the API of sub_char_table_set_contents.
8062
8063 2012-08-18 Chong Yidong <cyd@gnu.org>
8064
8065 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8066 for the string case (Bug#3874).
8067
8068 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8069
8070 * buffer.h (BSET): Remove (Bug#12215).
8071 Replace all uses with calls to new setter functions.
8072 (bset_bidi_paragraph_direction, bset_case_canon_table)
8073 (bset_case_eqv_table, bset_directory, bset_display_count)
8074 (bset_display_time, bset_downcase_table)
8075 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8076 (bset_last_selected_window, bset_local_var_alist)
8077 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8078 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8079 (bset_width_table):
8080 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8081 (bset_auto_fill_function, bset_auto_save_file_format)
8082 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8083 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8084 (bset_cache_long_line_scans, bset_case_fold_search)
8085 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8086 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8087 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8088 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8089 (bset_header_line_format, bset_indicate_buffer_boundaries)
8090 (bset_indicate_empty_lines, bset_invisibility_spec)
8091 (bset_left_fringe_width, bset_major_mode, bset_mark)
8092 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8093 (bset_name, bset_overwrite_mode, bset_pt_marker)
8094 (bset_right_fringe_width, bset_save_length)
8095 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8096 (bset_scroll_up_aggressively, bset_selective_display)
8097 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8098 (bset_word_wrap, bset_zv_marker):
8099 * category.c (bset_category_table):
8100 * syntax.c (bset_syntax_table):
8101 New setter functions.
8102
8103 * process.h (PSET): Remove (Bug#12215).
8104 Replace all uses with calls to new setter functions.
8105 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8106 (PROCESS_INLINE): New macro.
8107 (pset_childp): New setter function.
8108 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8109 * process.c (PROCESS_INLINE):
8110 Define to EXTERN_INLINE, so that the corresponding functions
8111 are compiled into code.
8112 (pset_buffer, pset_command, pset_decode_coding_system)
8113 (pset_decoding_buf, pset_encode_coding_system)
8114 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8115 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8116 (pset_type, pset_write_queue): New setter functions.
8117
8118 * window.h (WSET): Remove (Bug#12215).
8119 Replace all uses with calls to new setter functions.
8120 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8121 (WINDOW_INLINE): New macro.
8122 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8123 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8124 (wset_total_lines, wset_vertical_scroll_bar)
8125 (wset_window_end_pos, wset_window_end_valid)
8126 (wset_window_end_vpos): New setter functions.
8127 * window.c (WINDOW_INLINE):
8128 Define to EXTERN_INLINE, so that the corresponding functions
8129 are compiled into code.
8130 (wset_combination_limit, wset_dedicated, wset_display_table)
8131 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8132 (wset_new_normal, wset_new_total, wset_next_buffers)
8133 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8134 (wset_prev_buffers, wset_right_fringe_width)
8135 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8136 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8137 (wset_window_parameters):
8138 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8139 (wset_column_number_displayed, wset_region_showing):
8140 New setter functions.
8141
8142 * termhooks.h (TSET): Remove (Bug#12215).
8143 Replace all uses with calls to new setter functions.
8144 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8145 (TERMHOOKS_INLINE): New macro.
8146 (tset_charset_list, tset_selection_alist): New setter functions.
8147 * terminal.c (TERMHOOKS_INLINE):
8148 Define to EXTERN_INLINE, so that the corresponding functions
8149 are compiled into code.
8150 (tset_param_alist): New setter function.
8151
8152 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8153
8154 * keyboard.h (KSET): Remove (Bug#12215).
8155 Replace all uses with calls to new setter functions.
8156 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8157 (KEYBOARD_INLINE): New macro.
8158 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8159 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8160 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8161 New setter functions.
8162 * keyboard.c (KEYBOARD_INLINE):
8163 Define to EXTERN_INLINE, so that the corresponding functions
8164 are compiled into code.
8165 (kset_echo_string, kset_kbd_queue)
8166 (kset_keyboard_translate_table, kset_last_prefix_arg)
8167 (kset_last_repeatable_command, kset_local_function_key_map)
8168 (kset_overriding_terminal_local_map, kset_real_last_command)
8169 (kset_system_key_syms): New setter functions.
8170
8171 * frame.h (FSET): Remove (Bug#12215).
8172 Replace all uses with calls to new setter functions.
8173 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8174 (FRAME_INLINE): New macro.
8175 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8176 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8177 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8178 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8179 (fset_param_alist, fset_root_window, fset_scroll_bars)
8180 (fset_selected_window, fset_title, fset_tool_bar_items)
8181 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8182 * frame.c (FRAME_INLINE):
8183 Define to EXTERN_INLINE, so that the corresponding functions
8184 are compiled into code.
8185 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8186
8187 A few more naming-convention fixes for getters and setters.
8188 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8189 and rename from buffer_overlays_set_before.
8190 (set_buffer_overlays_after): Move here from buffer.h, and rename
8191 from buffer_overlays_set_after.
8192 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8193 All uses changed.
8194 (set_buffer_intervals): Rename from buffer_set_intervals.
8195 * intervals.c (set_interval_object): Move here from intervals.h,
8196 and rename from interval_set_object.
8197 (set_interval_left): Move here from intervals.h, and rename from
8198 interval_set_left.
8199 (set_interval_right): Move here from intervals.h, and rename from
8200 interval_set_right.
8201 (copy_interval_parent): Move here from intervals.h, and rename from
8202 interval_copy_parent.
8203 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8204 (set_interval_plist): Rename from interval_set_plist.
8205 Return void, not Lisp_Object, since no caller uses the result.
8206 * lisp.h (string_intervals): Rename from string_get_intervals.
8207 (set_string_intervals): Rename from string_set_intervals.
8208
8209 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8210 (set_char_table_contents): Rename from char_table_set_contents.
8211 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8212 All uses changed. See the end of
8213 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8214
8215 * lisp.h (CSET): Remove (Bug#12215).
8216 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8217 (set_char_table_purpose): New functions,
8218 replacing CSET. All uses changed. For example, replace
8219 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8220 "set_char_table_parent (char_table, parent);".
8221 The old version was confusing because it used the same name
8222 'parent' for two different things.
8223
8224 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8225
8226 Functions to get and set Lisp_Object fields of buffer-local variables.
8227 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8228 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8229 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8230 * data.c, eval.c, frame.c: Adjust users.
8231
8232 2012-08-17 Chong Yidong <cyd@gnu.org>
8233
8234 * xfaces.c (merge_face_vectors): If the target font specfies a
8235 font spec, make the font's attributes take precedence over
8236 directly-specified attributes.
8237 (merge_face_ref): Recognize :font.
8238
8239 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8240
8241 Do not use memcpy for copying intervals.
8242 * intervals.c (reproduce_interval): New function.
8243 (reproduce_tree, reproduce_tree_obj): Use it.
8244 (reproduce_tree_obj): Remove prototype.
8245
8246 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8247
8248 * lisp.h (duration_to_sec_usec): Remove unused decl.
8249
8250 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8251
8252 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8253 to an allocated instance of NSString, not to the class itself.
8254
8255 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8256
8257 * makefile.w32-in (C_CTYPE_H): New macro.
8258 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8259 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8260 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8261
8262 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8263
8264 Use ASCII tests for character types.
8265 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8266 * xfns.c, xterm.c:
8267 Don't include <ctype.h>; was not needed.
8268 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8269 * sysdep.c, xfaces.c:
8270 Include <c-ctype.h> instead of <ctype.h>.
8271 * nsterm.m: Include <c-ctype.h>.
8272 * charset.c (read_hex):
8273 * doc.c (Fsnarf_documentation):
8274 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8275 (DRIVE_LETTER) [DOS_NT]:
8276 (Ffile_name_directory, Fexpand_file_name)
8277 (Fsubstitute_in_file_name):
8278 * font.c (font_parse_xlfd, font_parse_fcname):
8279 * frame.c (x_set_font_backend):
8280 * gtkutil.c (xg_get_font):
8281 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8282 * nsimage.m (hexchar):
8283 * nsterm.m (ns_xlfd_to_fontname):
8284 * sysdep.c (system_process_attributes):
8285 * xfaces.c (hash_string_case_insensitive):
8286 Use C-locale tests instead of locale-specific tests for character
8287 types, since we want the ASCII interpretation here, not the
8288 interpretation suitable for whatever happens to be the current locale.
8289
8290 2012-08-16 Martin Rudalics <rudalics@gmx.at>
8291
8292 Consistently check windows for validity/liveness
8293 (Bug#11984, Bug#12025, Bug#12026).
8294 * lisp.h (CHECK_VALID_WINDOW): New macro.
8295 * window.c (decode_window): Rename to decode_live_window.
8296 (decode_valid_window, Fwindow_valid_p): New functions.
8297 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8298 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8299 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8300 (Fwindow_prev_sibling, Fwindow_combination_limit)
8301 (Fset_window_combination_limit, Fwindow_use_time)
8302 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8303 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8304 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8305 (Fwindow_hscroll, Fset_window_hscroll)
8306 (Fwindow_redisplay_end_trigger)
8307 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8308 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8309 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8310 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8311 (Fwindow_end, Fset_window_point, Fset_window_start)
8312 (Fpos_visible_in_window_p, Fwindow_line_height)
8313 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8314 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8315 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8316 (Fset_window_parameter, Fwindow_display_table)
8317 (Fset_window_display_table, Fdelete_other_windows_internal)
8318 (Fset_window_buffer, Fset_window_new_total)
8319 (Fset_window_new_normal, Fdelete_window_internal)
8320 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8321 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8322 (Fwindow_scroll_bars): Check whether argument window is a valid or
8323 live window. Update doc-strings.
8324 (syms_of_window): New symbol Qwindow_valid_p.
8325 * keyboard.c (Fposn_at_x_y): Check whether argument
8326 frame_or_window denotes a valid window.
8327
8328 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8329
8330 Fix previous char table change.
8331 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8332 * chartab.c (optimize_sub_char_table): Likewise.
8333
8334 2012-08-16 Chong Yidong <cyd@gnu.org>
8335
8336 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8337
8338 * xfont.c (xfont_open):
8339 * xftfont.c (xftfont_open): Set the font's max_width field.
8340
8341 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8342 min_width to space_width and average_width to the average over
8343 printable ASCII characters.
8344 (ns_char_width): Code cleanup.
8345 (ns_ascii_average_width): New utility function.
8346
8347 * font.h (struct font): Update comments.
8348
8349 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8350
8351 Simple interface to set Lisp_Object fields of character tables.
8352 * lisp.h (CSET): New macro.
8353 (char_table_set_extras, char_table_set_contents)
8354 (sub_char_table_set_contents): New function.
8355 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8356 * syntax.c: Adjust users.
8357
8358 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8359
8360 * eval.c (eval_sub): Bind lexical-binding.
8361 * lread.c (Qlexical_binding): Make non-static.
8362
8363 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8364
8365 * nsmenu.m (popupSession): Remove.
8366 (pop_down_menu): Remove endModalSession.
8367 (timeout_handler:): New method.
8368 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8369 Call runModalForWindow. Check timer_fired when it returns.
8370 If not set, cancel timer and break out of loop.
8371 Otherwise loop again, with a new timeout.
8372
8373 * nsterm.m: Include fcntl.h if present.
8374 (fd_entry, t_readfds, inNsSelect): Remove.
8375 (select_writefds, select_valid, select_timeout, selfds)
8376 (select_mutex, apploopnr): Add.
8377 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8378 Otherwise call kbd_buffer_store_event.
8379 (ns_send_appdefined): Remove release of fd_entry.
8380 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8381 Increment and decrement apploopnr.
8382 (ns_select): If no file descriptors, just do a NSTimer.
8383 Otherwise copy read/write masks and start select thread (fd_handler).
8384 Start main loop and wait for application defined event.
8385 Inform select thread to stop selecting after main loop is exited.
8386 (ns_term_init): Create selfds pipe and set non-blocking.
8387 Initialize select_mutex. Start the select thread (fd_handler).
8388 (fd_handler:): Loop forever, wait for info from the main thread
8389 to either start or stop selecting. When select returns, send
8390 and appdefined event.
8391 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8392 If not call kbd_buffer_store_event.
8393
8394 * nsterm.h (EmacsApp): fd_handler takes id argument.
8395 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8396
8397 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8398
8399 2012-08-15 Eli Zaretskii <eliz@gnu.org>
8400
8401 * region-cache.c (move_cache_gap): Update gap_len using the actual
8402 growth of the boundaries array. Do not change cache_len.
8403 (Bug#12196)
8404
8405 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8406
8407 Generalize and cleanup font subsystem checks.
8408 * font.h (FONT_DEBUG, font_assert): Remove.
8409 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8410 Change font_assert to eassert. Use eassert where appropriate.
8411
8412 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8413
8414 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8415
8416 2012-08-15 Chong Yidong <cyd@gnu.org>
8417
8418 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8419 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8420 extract the font descriptor instead of just the font name.
8421 In that case, return a font spec instead of a string.
8422 (x_last_font_name): Move to this file from xfns.c.
8423
8424 * xfns.c (Fx_select_font): The return value can also be a font
8425 spec. Move x_last_font_name management to gtkutil.c.
8426
8427 * xfaces.c: Make font weight and style symbols non-static.
8428
8429 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8430
8431 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8432 (bug#12117).
8433
8434 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8435
8436 * alloc.c (Fgarbage_collect): Use plural form consistently.
8437
8438 2012-08-14 Eli Zaretskii <eliz@gnu.org>
8439
8440 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8441 iteration through the command loop. Fixes a problem whereby mouse
8442 movements are ignored until the first mouse click.
8443
8444 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8445
8446 Use bool, not int, for Lisp booleans.
8447 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8448 makes Emacs a bit smaller and presumably a bit faster.
8449 * lisp.h: Include <stdbool.h>.
8450 (struct Lisp_Boolfwd, defvar_bool):
8451 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8452 * regex.c [!emacs]: Include <stdbool.h>.
8453 (false, true): Remove; <stdbool.h> does this for us now.
8454
8455 2012-08-14 Chong Yidong <cyd@gnu.org>
8456
8457 * character.c (Fcharacterp): Doc fix (Bug#12076).
8458
8459 * data.c (Findirect_variable): Doc fix (Bug#11040).
8460
8461 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8462
8463 * editfns.c (Fformat): Doc fix (Bug#12059).
8464 (Fsave_current_buffer): Doc fix (Bug#11542).
8465
8466 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8467
8468 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8469 (bug#12022).
8470
8471 2012-08-14 Martin Rudalics <rudalics@gmx.at>
8472
8473 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8474 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8475 * minibuf.c (choose_minibuf_frame, read_minibuf):
8476 * w32fns.c (x_create_tip_frame):
8477 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8478 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8479
8480 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8481
8482 * intervals.c (offset_intervals): Remove obsolete comment.
8483
8484 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8485
8486 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8487
8488 2012-08-14 Gergely Risko <gergely@risko.hu>
8489
8490 * coding.c (decode_coding): Record buffer modification before
8491 disabling undo_list (Bug#11773).
8492
8493 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8494
8495 Revert and cleanup some recent overlay changes.
8496 * buffer.h (enum overlay_type): Remove.
8497 (buffer_get_overlays, buffer_set_overlays): Likewise.
8498 (buffer_set_overlays_before, buffer_set_overlays_after):
8499 New function. Adjust users.
8500 (unchain_both): Add eassert.
8501
8502 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8503
8504 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8505
8506 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8507
8508 * gtkutil.c (xg_mark_data): Don't assume C99.
8509
8510 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8511
8512 * gtkutil.c (xg_frame_tb_info): New struct.
8513 (TB_INFO_KEY): New define.
8514 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8515 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8516 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8517 if not present.
8518 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
8519 is up to date. Otherwise store new data.
8520 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8521
8522 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8523
8524 Use KSET for write access to Lisp_Object members of struct kboard.
8525 * keyboard.h (KSET): New macro.
8526 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8527 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8528 * xterm.c: Adjust users.
8529
8530 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8531
8532 Use BSET for write access to Lisp_Object members of struct buffer.
8533 * buffer.h (BSET): New macro.
8534 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8535 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8536 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8537 * window.c, xdisp.c, xfns.c: Adjust users.
8538
8539 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8540
8541 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8542
8543 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8544
8545 * nsterm.m (not_in_argv): New function.
8546 (application:openFile, application:openTempFile:):
8547 (application:openFileWithoutUI:, application:openFiles:): Open file
8548 if not_in_argv returns non-zero (bug#12171).
8549
8550 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
8551 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8552 Define for Gtk+ versions less than 3.2.
8553 (xg_get_font_name): Use those functions/macros here.
8554 Reported by Frans Oilinki <moilinki@gmail.com>.
8555
8556 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8557
8558 * unexmacosx.c (copy_data_segment): Copy initialized data in
8559 statically linked libraries from input file rather than memory.
8560
8561 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8562 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8563 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8564
8565 2012-08-10 Glenn Morris <rgm@gnu.org>
8566
8567 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8568 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8569
8570 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8571
8572 Fix last change to allow compilation with low optimization levels.
8573 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8574 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8575
8576 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8577
8578 Use common inline syntax in intervals.h.
8579 * intervals.h (INTERVALS_INLINE): New macro.
8580 Change all users from LISP_INLINE.
8581
8582 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8583
8584 Define Qnone once for all platforms.
8585 * frame.c (Qnone): Define here.
8586 (syms_of_frame): DEFSYM it.
8587 * lisp.h (Qnone): New declaration.
8588 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8589 * xfns.c: Remove duplication. Adjust users.
8590
8591 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8592
8593 Remove unused macros from intervals.h.
8594 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8595 * intervals.c: Adjust comment.
8596
8597 2012-08-10 Eli Zaretskii <eliz@gnu.org>
8598
8599 * w32fns.c <w32_unicode_gui>: New static variable.
8600 (globals_of_w32fns): Initialize it according to os_subtype.
8601 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8602 testing os_subtype.
8603
8604 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
8605 Eli Zaretskii <eliz@gnu.org>
8606
8607 Fix bug #10299 with Unicode characters sent by customized
8608 keyboards created by MSKLC.
8609 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8610 (w32_init_class): Use it to initialize the Emacs class with either
8611 ANSI or Unicode API calls.
8612 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8613 later.
8614 (w32_wnd_proc): If the character code sent by WM_CHAR or
8615 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8616 original message. Call DefWindowProcW on NT and later.
8617
8618 2012-08-10 Glenn Morris <rgm@gnu.org>
8619
8620 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8621
8622 * lisp.h (DIRECTORY_SEP): Let configure set it.
8623
8624 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8625
8626 Use TSET for write access to Lisp_Object slots of struct terminal.
8627 * termhooks.h (TSET): New macro.
8628 * coding.c, terminal.c, xselect.c: Adjust users.
8629
8630 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8631
8632 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8633 the failing expression, include them in the error message.
8634 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8635 * lisp.h (internal_condition_case_n): Update declaration.
8636
8637 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8638
8639 Inline functions to examine and change buffer overlays.
8640 * buffer.c (unchain_both): New function.
8641 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8642 (buffer_has_overlays): New function.
8643 (enum overlay_type): New enum.
8644 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8645 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8646
8647 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8648
8649 Inline functions to examine and change buffer intervals.
8650 * alloc.c (mark_interval_tree): Remove.
8651 (MARK_INTERVAL_TREE): Simplify.
8652 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8653 * intervals.c (buffer_balance_intervals): New function.
8654 (graft_intervals_into_buffer): Adjust indentation.
8655 (set_intervals_multibyte): Simplify.
8656 * buffer.h (BUF_INTERVALS): Remove.
8657 (buffer_get_intervals, buffer_set_intervals): New function.
8658 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8659 * intervals.c, textprop.c: Adjust users.
8660
8661 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8662
8663 Inline functions to examine and change string intervals.
8664 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8665 (string_get_intervals, string_set_intervals): New function.
8666 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8667 * lread.c, print.c, textprop.c: Adjust users.
8668
8669 2012-08-08 Glenn Morris <rgm@gnu.org>
8670
8671 * lisp.mk (lisp): Remove language/persian.elc.
8672
8673 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8674
8675 Cleanup intervals.
8676 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8677 (NULL_INTERVAL_P): Likewise. Adjust users.
8678 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8679 Adjust comment. Move under #if 0.
8680 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8681 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8682
8683 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8684
8685 Check total length of intervals with eassert.
8686 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8687 * intervals.c: Change all users to eassert.
8688
8689 2012-08-07 Eli Zaretskii <eliz@gnu.org>
8690
8691 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8692 Rename fields to match removal of FGET and WGET and disuse of
8693 INTERNAL_FIELD in Lisp_Cons.
8694
8695 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8696
8697 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8698 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8699 name since all xname users are fixed long time ago. Do not
8700 use INTERNAL_FIELD.
8701 (set_symbol_name, set_symbol_function, set_symbol_plist):
8702 (set_symbol_next, set_overlay_plist): New function.
8703 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8704 (struct Lisp_Overlay): Likewise.
8705 (CVAR, MVAR, SVAR): Remove.
8706 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8707 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8708 * xterm.c: Adjust users.
8709 * .gdbinit: Change to use name field of struct Lisp_Symbol
8710 where appropriate.
8711
8712 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8713
8714 Basic functions to set Lisp_Object and pointer slots of intervals.
8715 * intervals.h (interval_set_parent, interval_set_object):
8716 (interval_set_left, interval_set_right, interval_set_plist):
8717 (interval_copy_parent): New function.
8718 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
8719 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8720 Adjust indentation.
8721 (INTERVAL_SIZE): Remove. Adjust users.
8722 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8723
8724 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8725
8726 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8727 * process.h (PGET): Remove.
8728 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8729 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8730
8731 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8732
8733 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8734 * window.h (WGET): Remove.
8735 (struct window): Do not use INTERNAL_FIELD.
8736 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8737 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8738 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8739 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8740 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8741 Adjust users.
8742
8743 2012-08-07 Chong Yidong <cyd@gnu.org>
8744
8745 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8746 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8747 (Fdelete_window_internal): Signal an error if the window is not on
8748 a live frame (Bug#12025).
8749
8750 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8751
8752 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8753 * frame.h (FGET): Remove.
8754 (struct frame): Do not use INTERNAL_FIELD.
8755 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8756 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8757 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8758 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8759
8760 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
8761
8762 * w32.c: Silence compiler warnings.
8763 (map_w32_filename): Remove unused variable `is_fat'.
8764 (chase_symlinks): Add parentheses around expression.
8765
8766 2012-08-06 Glenn Morris <rgm@gnu.org>
8767
8768 * sysdep.c: Respect BROKEN_GETWD.
8769
8770 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8771 Let configure handle it.
8772 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8773
8774 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8775
8776 Use GCALIGNMENT where appropriate.
8777 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8778 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8779 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8780
8781 2012-08-06 Eli Zaretskii <eliz@gnu.org>
8782
8783 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8784 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
8785
8786 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8787
8788 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8789 that should be sufficient for everyone.
8790
8791 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8792
8793 * keyboard.c (timer_check_2): Add break so timer_check returns next
8794 timeout.
8795
8796 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8797
8798 Fix Windows build errors introduced after converting to WGET and WSET.
8799 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8800 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8801
8802 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8803
8804 * nsterm.m (ns_frame_rehighlight): Use FSET.
8805
8806 * nsmenu.m (ns_update_menubar): Use FSET.
8807
8808 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8809
8810 Separate read and write access to Lisp_Object slots of Lisp_Process.
8811 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8812 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8813
8814 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8815
8816 Separate read and write access to Lisp_Object slots of struct window.
8817 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8818 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8819 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8820 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8821 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8822 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8823 Adjust users.
8824
8825 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8826
8827 Fix Windows build errors introduced after converting to FGET and FSET.
8828 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8829 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8830 (w32_judge_scroll_bars): Change to use FSET.
8831 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8832
8833 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8834
8835 Fix replacement typo.
8836 * window.c (replace_window): Set root_window instead of
8837 selected_window. This fixes a total window subsystem
8838 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8839
8840 2012-08-06 Glenn Morris <rgm@gnu.org>
8841
8842 * lisp.mk (lisp): Add language/persian.elc.
8843
8844 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8845
8846 Separate read and write access to Lisp_Object slots of struct frame.
8847 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8848 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8849 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8850 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8851 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8852
8853 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8854
8855 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8856
8857 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8858
8859 Generalize common compile-time constants.
8860 * lisp.h (header_size, bool_header_size, word_size): Now here.
8861 (struct Lisp_Vector): Add comment.
8862 (struct Lisp_Bool_Vector): Move up to define handy constants.
8863 (VECSIZE, PSEUDOVECSIZE): Simplify.
8864 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8865 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8866 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8867 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8868 * xfont.c, xmenu.c: Use word_size where appropriate.
8869
8870 2012-08-05 Lawrence Mitchell <wence@gmx.li>
8871
8872 * search.c (Freplace_match): Treat \? in the replacement text
8873 literally (Bug#8161).
8874
8875 2012-08-05 Chong Yidong <cyd@gnu.org>
8876
8877 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8878 * frame.c (Vdelete_frame_functions):
8879 * emacs.c (Vkill_emacs_hook): Doc fix.
8880
8881 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8882
8883 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8884 --with-x-toolkit=no builds.
8885 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8886
8887 2012-08-04 Chong Yidong <cyd@gnu.org>
8888
8889 * syntax.c (Fmodify_syntax_entry): Doc fix.
8890
8891 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8892
8893 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8894 * w32.c (init_environment): Change the default values of many
8895 environment variables in dflt_envvars[] to NULL, to avoid pushing
8896 them into environment when they were not already defined.
8897 Remove the code that deletes site-lisp subdirectories from the default
8898 value of EMACSLOADPATH, as it is no longer needed.
8899 (check_windows_init_file): Now external, not static.
8900 Use Vload_path as is, without adding anything, as this function is now
8901 called when Vload_path is already set up.
8902
8903 * w32.h (check_windows_init_file): Add prototype.
8904
8905 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8906 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8907 compatibility with Posix platforms.
8908 (main): Move the call to check_windows_init_file to here from
8909 w32.c.
8910 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8911 any, in the DEFALT argument into the root of the Emacs build or
8912 installation tree, as appropriate.
8913
8914 * callproc.c (init_callproc_1): Call decode_env_path instead of
8915 doing its equivalent by hand.
8916 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8917 the code that sets Vexec_path run on MS-Windows.
8918
8919 * lread.c (init_lread): Add comments to #ifdef's.
8920
8921 * msdos.c (dos_set_window_size, IT_update_begin)
8922 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8923 instead of direct references.
8924
8925 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8926
8927 Export DEFAULT_REHASH_* to GDB.
8928 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8929 Now constants, not macros.
8930
8931 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8932
8933 Remove unnecessary casts involving pointers.
8934 These casts are no longer needed now that we assume C89 or later,
8935 since they involve casting to or from void *.
8936 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8937 (make_pure_float, make_pure_vector):
8938 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8939 * macros.c (Fstart_kbd_macro):
8940 * menu.c (find_and_return_menu_selection):
8941 * minibuf.c (read_minibuf_noninteractive):
8942 * sysdep.c (closedir):
8943 * xdisp.c (x_produce_glyphs):
8944 * xfaces.c (compare_fonts_by_sort_order):
8945 * xfns.c (x_real_positions, select_visual):
8946 * xselect.c (x_stop_queuing_selection_requests)
8947 (x_get_window_property, x_get_window_property_as_lisp_data):
8948 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8949 Remove unnecessary pointer casts.
8950 * alloc.c (record_xmalloc): New function.
8951 * lisp.h (record_xmalloc): New decl.
8952 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8953 more like a function. This is because the pointer cast is not
8954 needed. All uses changed.
8955 * print.c (print_string, print_error_message): Avoid length recalc.
8956
8957 Improve fix for macroexp crash with debugging (Bug#12118).
8958 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8959 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8960 not supposed to be invoked from the garbage collector.
8961 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8962 (gc_aset): New function, which is like ASET but can be
8963 used in the garbage collector.
8964 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8965 (set_hash_index): Use it instead of ASET.
8966
8967 2012-08-03 Eli Zaretskii <eliz@gnu.org>
8968
8969 Support symlinks on latest versions of MS-Windows.
8970 * w32.c: Include winioctl.h and aclapi.h.
8971 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8972 (revert_to_self): Forward declarations of static functions.
8973 <static BOOL g_b_init_get_security_info>:
8974 <g_b_init_create_symbolic_link>: New static flags.
8975 (globals_of_w32): Initialize them to zero.
8976 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8977 (map_w32_filename): Improve commentary. Simplify switch.
8978 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8979 headers (most versions of MinGW w32api don't).
8980 (get_security_info, create_symbolic_link)
8981 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8982 New functions.
8983 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8984 in the argument file name.
8985 (sys_access): Call unc_volume_file_attributes only if
8986 GetFileAttributes fails with network-related error codes.
8987 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8988 have the required privileges.
8989 (get_file_security_desc_by_name): Rename from
8990 get_file_security_desc.
8991 (stat_worker): New function, with most of the guts of 'stat', and
8992 with addition of handling of symlinks and support for 'lstat'.
8993 If possible, get file's attributes and security information by
8994 handle, not by name. Produce S_IFLNK bit for symlinks, when
8995 called from 'lstat'.
8996 (stat, lstat): New functions, call 'stat_worker'.
8997 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8998 symlinks when the underlying filesystem supports them.
8999
9000 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9001
9002 Fix macroexp crash on Windows with debugging (Bug#12118).
9003 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9004 checking subscripts; problem introduced with the recent
9005 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9006 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9007 since it's used in non-static inline functions now.
9008
9009 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9010 Don't assume buffer size fits in 'int'. Remove unused local.
9011
9012 Use C99-style 'extern inline' if available.
9013 * buffer.h (BUFFER_INLINE):
9014 * category.h (CATEGORY_INLINE):
9015 * character.h (CHARACTER_INLINE):
9016 * charset.h (CHARSET_INLINE):
9017 * composite.h (COMPOSITE_INLINE):
9018 * dispextern.h (DISPEXTERN_INLINE):
9019 * lisp.h (LISP_INLINE):
9020 * systime.h (SYSTIME_INLINE):
9021 New macro, replacing 'static inline' in this header.
9022 * buffer.h, category.h, character.h, charset.h, composite.h:
9023 * dispextern.h, lisp.h, systime.h:
9024 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9025 * alloc.c (LISP_INLINE):
9026 * buffer.c (BUFFER_INLINE):
9027 * category.c (CATEGORY_INLINE):
9028 * character.c (CHARACTER_INLINE):
9029 * charset.c (CHARSET_INLINE):
9030 * composite.c (COMPOSITE_INLINE):
9031 * dispnew.c (DISPEXTERN_INLINE):
9032 * sysdep.c (SYSTIME_INLINE):
9033 Define to EXTERN_INLINE, so that the corresponding functions
9034 are compiled into code.
9035 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9036 (INLINE_HEADER_END): New macros.
9037 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9038 since it's used in non-static inline functions now.
9039 (VALMASK) [!USE_LSB_TAG]: Likewise.
9040
9041 2012-08-02 Glenn Morris <rgm@gnu.org>
9042
9043 * s/: Remove empty directory.
9044
9045 * s/ms-w32.h: Move to ../nt/inc.
9046 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9047 Update for new ms-w32.h location.
9048
9049 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9050
9051 Port to Solaris 8.
9052 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9053
9054 2012-08-02 Glenn Morris <rgm@gnu.org>
9055
9056 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9057 hard-coding the path separator.
9058
9059 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9060
9061 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9062 This how ASET and AREF are supposed to work, and makes
9063 it easier to think about future improvements. See
9064 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9065 * charset.h (set_charset_attr): New function.
9066 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9067 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9068 (aref_addr): New function. All uses of &AREF(...) changed.
9069 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9070 (set_hash_index): New functions. All lvalue-style uses of
9071 HASH_KEY etc. changed.
9072 * keyboard.c (set_prop): New function. All lvalue-style uses
9073 of PROP changed.
9074
9075 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9076
9077 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9078 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9079 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9080 * nsfns.m (ns_set_name_as_filename): Likewise.
9081 * nsmenu.m (ns_update_menubar): Likewise.
9082 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9083
9084 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9085
9086 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9087 Adapt to latest changes in field names of the corresponding Lisp
9088 objects.
9089
9090 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9091
9092 2012-08-01 Glenn Morris <rgm@gnu.org>
9093
9094 * s/msdos.h: Remove file.
9095 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9096 * Makefile.in (S_FILE): Remove.
9097 (config_h): Remove S_FILE.
9098
9099 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9100
9101 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9102 Remove; moved to nt/config.nt.
9103
9104 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9105
9106 Use INTERNAL_FIELD for conses and overlays.
9107 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9108 Remove obsolete comment.
9109 (MVAR): New macro.
9110 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9111 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9112
9113 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9114
9115 Use INTERNAL_FIELD for symbols.
9116 * lisp.h (SVAR): New macro. Adjust users.
9117 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9118 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9119
9120 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9121
9122 Use INTERNAL_FIELD for processes.
9123 * process.h (PVAR): New macro. Adjust style.
9124 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9125 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9126
9127 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9128
9129 Use INTERNAL_FIELD for windows.
9130 * window.h (WVAR): New macro.
9131 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9132 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9133 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9134 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9135 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9136 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9137
9138 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9139
9140 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9141
9142 2012-08-01 Glenn Morris <rgm@gnu.org>
9143
9144 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9145 Move to configure.ac.
9146
9147 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9148
9149 * makefile.w32-in (CONFIG_H): Update dependencies.
9150 (CONF_POST_H): New macro.
9151
9152 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9153
9154 2012-07-31 Glenn Morris <rgm@gnu.org>
9155
9156 * Makefile.in (S_FILE): No longer set by configure.
9157
9158 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9159 is available.
9160 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9161
9162 * process.h (NULL_DEVICE):
9163 * emacs.c (SEPCHAR):
9164 * editfns.c (USER_FULL_NAME): Let configure set them.
9165
9166 * s/README, s/template.h: Remove files.
9167
9168 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9169
9170 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9171 Move to configure.ac.
9172
9173 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9174
9175 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9176 resulting renaming of 'struct frame' members.
9177
9178 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9179
9180 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9181 after introduction of FVAR.
9182
9183 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9184
9185 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9186
9187 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9188 instead of compositeToPoint.
9189 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9190
9191 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9192
9193 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9194
9195 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9196 * lisp.h (INTERNAL_FIELD): New macro.
9197 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9198 (BVAR): Change to use INTERNAL_FIELD.
9199 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9200 (KVAR): Change to use INTERNAL_FIELD.
9201 * frame.h (FVAR): New macro.
9202 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9203 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9204 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9205 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9206 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9207
9208 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9209
9210 Miscellaneous fixes for non-default X toolkits.
9211 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9212 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9213 Move under #ifdef USE_LUCID.
9214 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9215 definition and usage to avoid warnings.
9216
9217 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9218
9219 * nsterm.m (openFiles): Fix previous checkin.
9220
9221 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9222
9223 * indent.c (compute_motion): Remove unused local.
9224
9225 2012-07-31 Glenn Morris <rgm@gnu.org>
9226
9227 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9228
9229 * conf_post.h [USG5_4]:
9230 Move remaining contents of s/usg5-4-common.h here.
9231 * s/usg5-4-common.h: Remove file.
9232
9233 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9234 * s/irix6-5.h: Remove file.
9235
9236 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9237 * s/darwin.h: Remove file.
9238
9239 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9240 * s/hpux10-20.h: Remove file, which is now empty.
9241
9242 2012-07-30 Glenn Morris <rgm@gnu.org>
9243
9244 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9245 * Makefile.in (config_h): Add conf_post.h.
9246 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9247
9248 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9249
9250 * nsterm.m (ns_do_open_file): New variable.
9251 (ns_term_init): Set ns_do_open_file to YES after run returns.
9252 (openFile, openTempFile, openFileWithoutUI, openFiles):
9253 Open files only if ns_do_open_file.
9254
9255 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9256
9257 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9258 This no-op macro hasn't been needed for many years.
9259 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9260
9261 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9262 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9263 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9264 gdb_make_enums_visible.
9265 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9266 (DIRECTORY_SEP): Now a constant, not a macro.
9267
9268 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9269
9270 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9271 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9272
9273 * w32term.c <w32_keyboard_codepage>: Renamed from
9274 keyboard_codepage and now external. All users changed.
9275
9276 * w32term.h: Add declaration of w32_keyboard_codepage.
9277
9278 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9279 the codepage to translate keys to Unicode. If this argument is
9280 -1, use the value returned by GetConsoleCP. All callers changed.
9281
9282 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9283
9284 Update .PHONY listings in makefiles.
9285 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9286 bootstrap-clean, distclean, maintainer-clean, versioclean,
9287 extraclean, frc.
9288
9289 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9290 This is a bit clearer. Fix some commentary typos.
9291
9292 2012-07-30 Glenn Morris <rgm@gnu.org>
9293
9294 * s/netbsd.h: Let configure include signal.h if needed.
9295 Remove file, which is now empty.
9296
9297 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9298 Let configure set them.
9299 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9300 No more need to undefine.
9301
9302 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9303
9304 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9305 non-single-byte char when adding meta modifier. (Bug#12090)
9306
9307 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9308
9309 Convert safe_call to use variable number of arguments.
9310 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9311 (safe_call2): Fix comment.
9312 * lisp.h (safe_call): Adjust prototype.
9313 * coding.c (encode_coding_object): Change to use safe_call2.
9314 * xfaces.c (merge_face_heights): Change to use safe_call1.
9315
9316 2012-07-30 Glenn Morris <rgm@gnu.org>
9317
9318 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
9319 does that unconditionally. Remove file, which is now empty.
9320
9321 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9322 Remove empty files.
9323
9324 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9325
9326 Export to GDB most of lisp.h's remaining object-like macros.
9327 * lisp.h (min, max): Move earlier, because they're used earlier now.
9328 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9329 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9330 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9331 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9332 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9333 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9334 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9335 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9336 Now constants, for GDB. They need not be macros.
9337 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9338 Now constants, for GDB, as well as macros, for static initializers.
9339 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9340 Move to after the definition of struct Lisp_Char_Table,
9341 since the former now needs that type defined.
9342 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9343 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9344 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9345 New enums, for gdb_make_enums_visible.
9346 (GLYPH_MODE_LINE_FACE): Remove; unused.
9347 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
9348 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9349 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9350 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9351 enum maxargs, enum MAX_ALLOCA.
9352 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9353 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9354 no longer needed, now that they are done in lisp.h.
9355
9356 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9357
9358 Cleanup string bytes checking.
9359 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9360 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9361 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9362 (check_sblock, compact_small_strings): Simplify.
9363
9364 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9365
9366 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9367 These macros are confusing and no longer need to be defined, as
9368 the enum values now suffice. All uses replaced with definiens.
9369 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9370
9371 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
9372
9373 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9374 ($(BLD)/w32console.$(O)): Update dependencies.
9375
9376 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9377
9378 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9379 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9380 time. Adjust users.
9381 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9382
9383 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9384
9385 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9386 setting sitelisp (Bug#12010).
9387
9388 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9389
9390 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
9391
9392 * w32heap.c (cache_system_info):
9393 * w32.c (sys_rename):
9394 * w32proc.c (find_child_console, sys_kill): All users changed.
9395
9396 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9397
9398 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9399
9400 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9401
9402 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9403
9404 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9405
9406 Cleanup statistics calculation in Fgarbage_collect.
9407 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9408 Fix zombies percentage calculation. Simplify elapsed time calculation.
9409
9410 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9411
9412 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9413 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9414 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9415 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9416 (replace_range, replace_range_2, del_range_2): Change to eassert.
9417 * marker.c (byte_char_debug_check): Adjust style.
9418
9419 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9420
9421 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9422 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9423 long-ago-commented-out code that talks about "WIN32".
9424 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9425 All uses changed.
9426
9427 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9428
9429 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9430 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9431 Simplify by using alignof.
9432 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9433 * lisp.h: Include <stdalign.h>.
9434 (GCALIGNMENT): New macro and constant.
9435 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9436 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9437 (stdalign): New macro, if not already defined.
9438
9439 2012-07-28 Eli Zaretskii <eliz@gnu.org>
9440
9441 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9442 * w32inevt.c: Include w32inevt.h.
9443 (w32_read_console_input): New inline function, calls either
9444 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9445 w32_console_unicode_input.
9446 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9447 (w32_kbd_patch_key, key_event): Use the codepage returned by
9448 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9449 (key_event): use uChar.UnicodeChar only if
9450 w32_console_unicode_input is non-zero.
9451
9452 * w32console.c: Include w32heap.h.
9453 <w32_console_unicode_input>: New global variable.
9454 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9455 family of Windows, zero otherwise.
9456
9457 * w32inevt.h: Declare w32_console_unicode_input.
9458
9459 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9460 --without-x. (Bug#11742)
9461
9462 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9463
9464 Adjust GDB to reflect pvec_type changes (Bug#12036).
9465 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
9466 2012-07-04 changes to pseudovector representation.
9467 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
9468
9469 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
9470
9471 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9472 bus address.
9473 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9474
9475 2012-07-27 Eli Zaretskii <eliz@gnu.org>
9476
9477 * alloc.c (listn): Fix the order the arguments are consed onto the
9478 list.
9479
9480 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9481 enumeration constants, as PURE and HEAP are too general, and clash
9482 with other headers and sources, such as gmalloc.c and the
9483 MS-Windows system headers. All users changed.
9484
9485 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9486
9487 Revert last save_excursion_save and save_excursion_restore changes.
9488 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9489 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9490
9491 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9492
9493 Fix recently-introduced typos in Windows port.
9494 Reported by Martin Rudalics <rudalics@gmx.at>.
9495 * w32.c (init_environment): Replace comma with semicolon.
9496 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
9497
9498 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9499
9500 Improve GDB symbol export (Bug#12036).
9501 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9502 arms of an 'if', not using conditional expressions; otherwise GDB
9503 complains about the types in the unevaluated arm when the argument
9504 is an integer literal.
9505 (xgetint): Simplify expression.
9506 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9507 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9508 Zaretskii in <http://bugs.gnu.org/12036#13>.
9509 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9510 needed now that we have gdb_make_enums_visible.
9511 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9512 (enum enum_USE_LSB_TAG):
9513 New enum types, packaging up enums that need to be exported to GDB.
9514
9515 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9516
9517 Utility function to make a list from specified amount of objects.
9518 * lisp.h (enum constype): New datatype.
9519 (listn): New prototype.
9520 * alloc.c (listn): New function.
9521 (Fmemory_use_count, syms_of_alloc): Use it.
9522 * buffer.c (syms_of_buffer): Likewise.
9523 * callint.c (syms_of_callint): Likewise.
9524 * charset.c (define_charset_internal): Likewise.
9525 * coding.c (syms_of_coding): Likewise.
9526 * keymap.c (syms_of_keymap): Likewise.
9527 * search.c (syms_of_search): Likewise.
9528 * syntax.c (syms_of_syntax): Likewise.
9529 * w32.c (init_environment): Likewise.
9530 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9531 * xdisp.c (syms_of_xdisp): Likewise.
9532 * xfns.c (syms_of_xfns): Likewise.
9533
9534 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9535
9536 Fast save_excursion_save and save_excursion_restore.
9537 * lisp.h (struct Lisp_Excursion): New data type.
9538 (PVEC_EXCURSION): New pseudovector type.
9539 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9540 to deal with it. Adjust comments.
9541 (init_marker, attach_marker): New prototype.
9542 (unchain_marker): Adjust prototype.
9543 * marker.c (attach_marker): Change to global.
9544 (init_marker): New function.
9545 * alloc.c (Fmake_marker, build_marker): Use it.
9546 (build_marker): More easserts.
9547 (mark_object): Handle struct Lisp_Excursion.
9548 * editfns.c (save_excursion_save, save_excursion_restore):
9549 Reimplement to use struct Lisp_Excursion. Add comments.
9550
9551 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9552
9553 Fix export of symbols to GDB (Bug#12036).
9554 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9555 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9556 emacs.c, as this is a more-suitable home. Had this been done earlier
9557 the fix for 12036 would have avoided some of the problems noted in
9558 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9559 would have been more obvious.
9560 * emacs.c: Do not include <verify.h>; no longer needed.
9561 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
9562 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9563 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9564 Remove; now done in lisp.h.
9565 * lisp.h (PUBLISH_TO_GDB): New macro.
9566 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9567 (DATA_SEG_BITS): Use it.
9568 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9569 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9570 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9571 not be usable in #if. This simplifies things.
9572
9573 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
9574
9575 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9576
9577 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9578
9579 Simplify export of symbols to GDB (Bug#12036).
9580 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9581 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9582 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9583 Adjust to changes in lisp.h and emacs.c, by using
9584 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9585 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9586 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9587 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9588 instead of gdb_valbits.
9589 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9590 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9591 instead of gdb_array_mark_flag.
9592 (xboolvector): Get size from $->size, not $->header.size.
9593 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9594 (xreload, hook-run, hookpost-run): Remove.
9595 * emacs.c: Include <verify.h>.
9596 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9597 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9598 Remove.
9599 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9600 (gdb_USE_LSB_TAG): New enum constants.
9601 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9602 Also define these as enum constants, so they're visible to GDB.
9603 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9604 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9605 as constants, so they're visible to GDB.
9606 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9607 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9608 Now enum constants, not macros, so they're visible to GDB.
9609 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9610 more convenient now. All uses changed.
9611 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9612 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9613
9614 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9615
9616 Explicitly free restriction data that are not needed anymore.
9617 * editfns.c (save_restriction_restore): Free restriction data.
9618
9619 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9620
9621 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9622 add argument, tune behavior, and adjust all callers.
9623
9624 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9625
9626 Use typedef for EMACS_INT, EMACS_UINT.
9627 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9628 than macros. This simplifies debugging in the usual case, since
9629 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9630 and it allows expressions involving EMACS_INT casts.
9631 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9632
9633 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9634
9635 * nsterm.m (ns_read_socket): Return early if there is a modal
9636 window (Bug#12043).
9637
9638 2012-07-25 Martin Rudalics <rudalics@gmx.at>
9639
9640 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9641 that FOCUS-FRAME can be omitted.
9642
9643 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9644
9645 Adjust buffer text indirection counters at the end of Fkill_buffer.
9646 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9647 buffer is definitely dead. This should really fix an issue reported
9648 by Christoph Scholtes again. (Bug#12007).
9649 (init_buffer_once): Initialize indirection counters of
9650 buffer_defaults and buffer_local_symbols (for sanity and safety).
9651
9652 2012-07-24 Eli Zaretskii <eliz@gnu.org>
9653
9654 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9655 and continuation glyphs on tooltip frames, leave them at zero.
9656 Avoids continued lines in tooltips. (Bug#11832)
9657
9658 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9659
9660 Simplify copy_overlay.
9661 * buffer.c (copy_overlay): Simplify. Use build_marker.
9662 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9663
9664 2012-07-23 Eli Zaretskii <eliz@gnu.org>
9665
9666 * print.c (print_object): Don't crash when a frame's name is nil
9667 or invalid. (Bug#12025)
9668
9669 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9670 it signals an error when a tooltip frame is being created.
9671
9672 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9673
9674 Cleanup miscellaneous objects allocation and initialization.
9675 * alloc.c (allocate_misc): Change to static. Add argument to
9676 specify the subtype. Adjust comment and users.
9677 (build_overlay): New function.
9678 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9679 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9680 (allocate_misc): Remove prototype.
9681 (build_overlay): Add prototype.
9682
9683 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9684
9685 Swap buffer text indirection counters in Fbuffer_swap_text.
9686 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9687 This avoids crash reported by Christoph Scholtes at
9688 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9689
9690 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9691
9692 * nsmenu.m (Popdown_data): New struct.
9693 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9694 free Popdown_data.
9695 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9696 (initWithContentRect): Make imgView and contentView non-static
9697 and autorelease them. Also autorelease img and matrix (Bug#12005).
9698 (dealloc): Remove (Bug#12005).
9699
9700 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9701
9702 Adjust consing_since_gc when objects are explicitly freed.
9703 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9704 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9705 (free_cons, free_misc): Subtract object size from consing_since_gc.
9706
9707 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9708
9709 Simplify and cleanup markers positioning code.
9710 * marker.c (attach_marker): More useful eassert.
9711 (live_buffer, set_marker_internal): New function.
9712 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9713 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9714
9715 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9716
9717 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9718 as it's limited by the amount of memory, not by INT_MAX.
9719
9720 2012-07-21 Eli Zaretskii <eliz@gnu.org>
9721
9722 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9723 in special-event-map. See the discussion at
9724 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9725 for the reasons.
9726
9727 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
9728 info.dwItemData. Fixes crashes on 64-bit Windows.
9729 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
9730
9731 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9732
9733 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
9734 (conversationIdentifier): Return value is NSInteger.
9735 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
9736
9737 2012-07-21 Chong Yidong <cyd@gnu.org>
9738
9739 * window.c (decode_any_window): Signal an error if the window is
9740 on a dead frame (Bug#11984).
9741
9742 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9743
9744 Add indirection counting to speed up Fkill_buffer.
9745 * buffer.h (struct buffer): New member.
9746 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9747 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9748 base buffer indirection counter.
9749 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9750 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9751 through buffer list if indirection counter is 0.
9752
9753 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9754
9755 Extend the value returned by Fgarbage_collect with heap statistics.
9756 * alloc.c (Qheap): New symbol.
9757 (syms_of_alloc): DEFSYM it.
9758 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9759 (Fmemory_free): Remove.
9760 (syms_of_alloc): Don't defsubr it.
9761 * buffer.c (Fcompact_buffer): Remove.
9762 (syms_of_buffer): Don't defsubr it.
9763
9764 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9765
9766 Make maybe_gc inline.
9767 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9768 * lisp.h (consing_since_gc, gc_relative_threshold)
9769 (memory_full_cons_threshold): Revert declaration.
9770 (maybe_gc): Remove prototype, define as inline.
9771 * alloc.c: Remove old commented-out code.
9772 (consing_since_gc, gc_relative_threshold)
9773 (memory_full_cons_threshold): Revert to global.
9774 (maybe_gc): Remove.
9775
9776 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9777
9778 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9779 * lisp.h (build_unibyte_string): New function.
9780 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9781 * sysdep.c, w32fns.c, xfns.c: Use it.
9782 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9783 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9784 Adjust users accordingly.
9785 * font.h (font_open_by_name): Adjust prototype.
9786
9787 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9788
9789 Cleanup calls to Fgarbage_collect.
9790 * lisp.h (maybe_gc): New prototype.
9791 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9792 Remove declarations.
9793 * alloc.c (maybe_gc): New function.
9794 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9795 Make them static.
9796 * bytecode.c (MAYBE_GC): Use maybe_gc.
9797 * eval.c (eval_sub, Ffuncall): Likewise.
9798 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9799 to avoid dependency from auto-save feature.
9800
9801 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9802
9803 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9804 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9805 'for_each_per_buffer_object_at'.
9806 All uses changed. It's better to use upper-case for macros that
9807 cannot be implemented as functions, to give the reader a clue
9808 that they're special.
9809
9810 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9811
9812 * alloc.c (Fgarbage_collect): Tweak docstring.
9813
9814 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9815
9816 Tweak the value returned from Fgarbage_collect again.
9817 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9818 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9819 Adjust documentation.
9820 (total_vector_bytes): Rename to total_vector_slots, adjust
9821 accounting.
9822 (total_free_vector_bytes): Rename to total_free_vector_slots,
9823 adjust accounting.
9824 (Qstring_bytes, Qvector_slots): New symbols.
9825 (syms_of_alloc): DEFSYM them.
9826
9827 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9828
9829 Buffer compaction primitive which may be used from Lisp.
9830 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9831 (syms_of_buffer): Register Fcompact_buffer.
9832 * alloc.c (Fgarbage_collect): Use compact_buffer.
9833 * buffer.h (compact_buffer): New prototype.
9834 (struct buffer_text): New member.
9835
9836 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9837
9838 New macro to iterate over all buffers, miscellaneous cleanups.
9839 * lisp.h (all_buffers): Remove declaration.
9840 * buffer.h (all_buffers): Add declaration, with comment.
9841 (for_each_buffer): New macro.
9842 * alloc.c (Fgarbage_collect, mark_object): Use it.
9843 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9844 (init_buffer): Likewise.
9845 * data.c (Fset_default): Likewise.
9846 * coding.c (code_conversion_restore): Remove redundant check
9847 for dead buffer.
9848 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9849
9850 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9851
9852 Fix bug that created negative-length intervals.
9853 * intervals.c (merge_interval_right, merge_interval_left):
9854 Do not zero out this interval if it is absorbed by its children,
9855 as this interval's total length doesn't change in that case. See
9856 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9857
9858 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9859
9860 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9861 when invoking (make-bool-vector N t) and N is a positive
9862 multiple of 8 -- the last 8 bits were mistakenly cleared.
9863
9864 Remove some struct layout assumptions in bool vectors.
9865 * alloc.c (bool_header_size): New constant.
9866 (header_size, word_size): Move earlier, as they're now used earlier.
9867 Use 'word_size' in a few more places, where it's appropriate.
9868 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9869 padding before the data member of a bool vector.
9870 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9871 than doing the check by hand with an abort ().
9872
9873 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9874
9875 * eval.c (Fdefvar): Don't check constants since we only set the var if
9876 it's not yet defined anyway (bug#11904).
9877
9878 * lisp.h (last_undo_boundary): Declare new var.
9879 * keyboard.c (command_loop_1): Set it.
9880 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9881 were auto-added by the command loop (bug#11774).
9882
9883 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9884
9885 * w32font.c (Qsymbol): Remove local definition.
9886 (syms_of_w32font): Don't DEFSYM it.
9887
9888 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9889
9890 Fix sweep_vectors to handle large bool vectors correctly.
9891 * alloc.c (sweep_vectors): Account total_vector_bytes for
9892 bool vectors larger than VBLOCK_BYTES_MAX.
9893
9894 2012-07-18 Chong Yidong <cyd@gnu.org>
9895
9896 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9897 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9898
9899 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9900
9901 Return more descriptive data from Fgarbage_collect.
9902 Suggested by Stefan Monnier in
9903 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9904 * alloc.c (bounded_number): New function.
9905 (total_buffers, total_vectors): New variable.
9906 (total_string_size): Rename to total_string_bytes, adjust users.
9907 (total_vector_size): Rename to total_vector_bytes, adjust users.
9908 (sweep_vectors): Account total_vectors and total_vector_bytes.
9909 (Fgarbage_collect): New return value. Adjust documentation.
9910 (gc_sweep): Account total_buffers.
9911 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9912 (VECTOR_SIZE): Remove.
9913 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9914 (Qinterval, Qmisc): New symbols.
9915 (syms_of_data): Initialize them.
9916 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9917 (Qcons, Qbuffer): New declarations.
9918
9919 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9920
9921 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9922 Round up, not down. Improve doc.
9923
9924 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9925
9926 Restore old code in allocate_string_data to avoid Faset breakage.
9927 Reported by Julien Danjou <julien@danjou.info> in
9928 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9929 * alloc.c (allocate_string_data): Restore old code with minor
9930 adjustments, fix comment to explain this subtle issue.
9931
9932 2012-07-17 Eli Zaretskii <eliz@gnu.org>
9933
9934 Remove FILE_SYSTEM_CASE.
9935 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9936
9937 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9938 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9939 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9940 call-process-region passes it through expand-file-name.
9941
9942 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9943
9944 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9945
9946 Fix crash when creating indirect buffer (Bug#11917)
9947 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9948 Don't handle unbound variables specially if non-zero.
9949 (Fbuffer_local_variables): Pass zero.
9950 (clone_per_buffer_values): Pass non-zero.
9951
9952 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9953
9954 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9955 to make the loop interruptible.
9956
9957 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9958
9959 * gnutls.c (emacs_gnutls_handshake): Only retry if
9960 GNUTLS_E_INTERRUPTED.
9961
9962 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9963
9964 Cleanup and convert miscellaneous checks to eassert.
9965 * alloc.c (mark_interval): Fix comment, partially rephrase
9966 old comment from intervals.h (see below).
9967 * intervals.c (find_interval, adjust_intervals_for_insertion)
9968 (delete_interval, adjust_intervals_for_deletion)
9969 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9970 Convert to eassert.
9971 (adjust_intervals_for_insertion, make_new_interval):
9972 Remove obsolete and unused code.
9973 * intervals.h (struct interval): Remove obsolete comment.
9974 * textprotp.c (erase_properties): Remove unused code.
9975 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9976 (Fremove_list_of_text_properties): Convert to eassert.
9977
9978 2012-07-17 Chong Yidong <cyd@gnu.org>
9979
9980 * editfns.c (Finsert_char): Doc fix.
9981
9982 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9983
9984 Fix previous change to make Fmemory_free always accurate.
9985 * alloc.c (make_interval): Update total_free_intervals.
9986 (make_float): Likewise for total_free_floats.
9987 (free_cons, Fcons): Likewise for total_free_conses.
9988 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9989 Likewise for total_free_vector_bytes.
9990 (Fmake_symbol): Likewise for total_free_symbols.
9991 (bytes_free): Remove.
9992
9993 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9994
9995 Simple free memory accounting feature.
9996 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9997 (sweep_vectors): Accumulate size of free vectors.
9998 (Fgarbage_collect): Setup bytes_free.
9999 (Fmemory_free): New function.
10000 (syms_of_alloc): Register it.
10001
10002 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10003
10004 Cleanup overlays checking.
10005 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10006 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10007 eassert and OVERLAYP.
10008 (sort_overlays): Change to use OVERLAYP.
10009
10010 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10011
10012 * editfns.c (Finsert_char): Make it interactive, and make the
10013 second arg optional. Copy interactive spec and docstring from
10014 ucs-insert.
10015
10016 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10017
10018 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10019 Unlike the other wrapped functions, fabs has an unspecified
10020 effect on errno.
10021
10022 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10023
10024 * nsterm.m (keyDown): Interpret flags without left/right bits
10025 as the left key (Bug#11670).
10026
10027 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10028
10029 Remove empty and useless init functions.
10030 * lisp.h (init_character_once, init_fns, init_image)
10031 (init_filelock, init_sound): Remove prototype.
10032 * character.c (init_character_once): Remove.
10033 * filelock.c (init_filelock): Likewise.
10034 * fns.c (init_fns): Likewise.
10035 * image.c (init_image): Likewise.
10036 * sound.c (init_sound): Likewise.
10037 * emacs.c (main): Adjust accordingly.
10038
10039 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10040
10041 * gtkutil.h: Tiny cleanups.
10042 (use_old_gtk_file_dialog): Remove useless declaration.
10043 (xg_uses_old_file_dialog): Add suggested const attribute.
10044
10045 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10046
10047 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10048 (bidi_paragraph_init): Use it to limit search forward for a strong
10049 directional character in abnormally large paragraphs full of
10050 neutral or weak characters. (Bug#11943)
10051
10052 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10053
10054 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10055 the toolbar (Bug#9451).
10056 (xg_make_tool_item): Give the widget event box a transparent
10057 background.
10058
10059 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10060
10061 Cleanup basic allocation variables and functions.
10062 * alloc.c (ignore_warnings, init_intervals, init_float)
10063 (init_cons, init_symbol, init_marker): Remove.
10064 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10065 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10066 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10067 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10068 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10069 (staticidx, init_alloc_once, init_strings, free_ablock):
10070 Remove redundant initialization.
10071 * fns.c (init_weak_hash_tables): Remove.
10072 * lisp.h (init_weak_hash_tables): Remove prototype.
10073
10074 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10075
10076 Use zero_vector where appropriate.
10077 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10078 accordingly.
10079 * lisp.h (zero_vector): New declaration.
10080 * font.c (null_vector): Remove.
10081 (syms_of_font): Remove initialization and staticpro.
10082 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10083 * keymap.c (Faccessible_keymaps): Likewise.
10084
10085 2012-07-15 Leo Liu <sdl.web@gmail.com>
10086
10087 * fringe.c: Fix typo in comments.
10088
10089 2012-07-14 Leo Liu <sdl.web@gmail.com>
10090
10091 * fringe.c: Add a new bitmap exclamation-mark.
10092
10093 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10094
10095 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10096
10097 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10098 (HAVE_MENUS): Don't define, defined by editing config.in with
10099 msdos/sed2v2.inp.
10100 (GMALLOC_INHIBIT_VALLOC): Don't define.
10101 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10102
10103 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10104
10105 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10106
10107 2012-07-14 Glenn Morris <rgm@gnu.org>
10108
10109 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10110 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10111 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10112
10113 2012-07-13 Glenn Morris <rgm@gnu.org>
10114
10115 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10116
10117 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10118 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10119
10120 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10121
10122 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10123 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10124 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10125 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10126 where appropriate.
10127 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10128 as boolean expression.
10129 (x_set_window_size): Remove unused variable toolbar.
10130 (ns_get_color_default, ns_mod_to_lisp): Remove.
10131 (ns_mouse_position): Remove unused variables xchar and ychar.
10132 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10133 (ns_set_vertical_scroll_bar): Remove unused variable count.
10134 (ns_delete_terminal): Remove unused variable i.
10135 (ns_term_init): Remove unused variables r, g and b.
10136 (mouseDown): Remove unused variable window.
10137 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10138 (initFrameFromEmacs): Remove unused variable vbextra.
10139 (mouseEntered): Remove unused variables p and dpyinfo.
10140 (mouseExited): Remove unused variables p and r.
10141 (ns_define_frame_cursor, ns_clear_frame_area)
10142 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10143 (menuDown): Assign [sender tag] to variable and cast the variable.
10144
10145 * nsterm.h (menuDown): Add id as type to argument sender.
10146 (ns_display_info_for_name): Add Lisp_Object argument.
10147 (ns_term_init): Add Lisp_Object argument.
10148 (ns_map_event_to_object): Add void argument.
10149 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10150 prototype with arguments and only declare if __OBJC__.
10151 (nxatoms_of_nsselect): Add void argument.
10152 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10153 (ns_alloc_autorelease_pool): Add void argument.
10154 (ns_release_autorelease_pool): Add void* argument.
10155 (ns_get_defaults_value): Add const char* argument.
10156
10157 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10158 (initFromContents): Use SSDATA where appropriate.
10159 (ns_update_menubar): Add braces to ambigous if-else.
10160 (initWithTitle): Put () around assignment in if statement.
10161 (ns_menu_show): Remove unused variables window and keymap.
10162 (update_frame_tool_bar): Remove unused variable selected_p.
10163 (initWithContentRect): Remove unused variable this_cmd_name.
10164
10165 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10166 appropriate.
10167 (setXBMColor): Remove unused variable len.
10168 (setPixmapData): Put () around assignment in loop statement.
10169
10170 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10171 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10172 where appropriate.
10173 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10174 around assignment in loop statement.
10175 (nsfont_open): Remove unused variable i.
10176 (nsfont_open): Remove unused variable len.
10177 (nsfont_draw): Remove unused variable cs.
10178
10179 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10180 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10181 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10182 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10183 (Fns_font_name, Fns_perform_service)
10184 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10185 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10186 (ns_set_name): Remove unused variable view.
10187 (x_set_menu_bar_lines): Remove unused variable olines.
10188 (x_set_tool_bar_lines): Remove unused variable root_window.
10189 (Fns_list_colors): Put () around assignment in while statement.
10190 (Fns_perform_service): Remove unused variable len.
10191 (Fns_display_usable_bounds): Remove unused variable top.
10192 (syms_of_nsfns): Remove unused variable i.
10193
10194 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10195 memcpy (Bug#11907).
10196
10197 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10198
10199 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10200 and free it with DestroyExceptionInfo (Bug#11558).
10201
10202 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10203
10204 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10205 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10206 Set here, not in nt/config.nt.
10207
10208 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10209
10210 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10211 cursor overflow into the last glyph on display line when the right
10212 fringe is off. (Bug#11832)
10213
10214 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10215
10216 * xdisp.c (produce_special_glyphs): Now static.
10217 * dispextern.h (produce_special_glyphs): Remove decl.
10218
10219 2012-07-13 Glenn Morris <rgm@gnu.org>
10220
10221 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10222 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10223
10224 * s/usg5-4-common.h (USG, USG5):
10225 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10226 * s/sol2-6.h (SOLARIS2):
10227 * s/irix6-5.h (IRIX6_5):
10228 * s/hpux10-20.h (USG, USG5, HPUX):
10229 * s/gnu-linux.h (USG, GNU_LINUX):
10230 * s/freebsd.h (BSD_SYSTEM):
10231 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10232 * s/cygwin.h (CYGWIN):
10233 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10234 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10235
10236 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10237
10238 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10239
10240 2012-07-13 Glenn Morris <rgm@gnu.org>
10241
10242 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10243
10244 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10245
10246 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10247 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10248
10249 2012-07-12 Glenn Morris <rgm@gnu.org>
10250
10251 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10252
10253 * process.c (init_process_emacs): Rename from init_process.
10254 The old name is also the name of a Mach system call.
10255 * lisp.h, emacs.c: Update for this name change.
10256 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10257 longer needed.
10258
10259 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10260
10261 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10262 memmove call that removes glyphs covered by the left truncation
10263 glyph. Improve commentary.
10264 (display_line): Fix display of continuation glyphs on GUI frames
10265 when the right fringe is turned off and variable-size fonts are
10266 used in the window. Move the code that appends a stretch glyph to
10267 produce_special_glyphs, so that it could be used for truncation
10268 and continuation glyphs alike.
10269 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10270 glyph of a suitably computed width, to align the special glyphs at
10271 the window margin. Code moved from display_line. (Bug#11832)
10272
10273 2012-07-12 Glenn Morris <rgm@gnu.org>
10274
10275 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10276
10277 * s/gnu-linux.h, s/hpux10-20.h:
10278 Do not unconditionally define HAVE_XRMSETDATABASE.
10279
10280 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10281
10282 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10283
10284 Fix typos that broke OS X build.
10285 Reported by Randal L. Schwartz in
10286 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10287 * nsterm.m (ns_timeout): Add missing local decl.
10288 (ns_get_color): snprintf -> sprintf, to fix typo.
10289
10290 2012-07-12 Glenn Morris <rgm@gnu.org>
10291
10292 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10293 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10294 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10295 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10296
10297 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10298 Move PTY_OPEN to configure.
10299
10300 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10301 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10302 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10303
10304 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10305
10306 Use empty_unibyte_string where applicable.
10307 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10308 * lread.c (read1): Likewise.
10309 * xsettings.c (syms_of_xsettings): Likewise.
10310
10311 2012-07-12 Glenn Morris <rgm@gnu.org>
10312
10313 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10314 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
10315 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10316 * s/hpux10-20.h (RUN_TIME_REMAP):
10317 * s/bsd-common.h (TABDLY): Move to configure.
10318
10319 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10320
10321 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10322
10323 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10324 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
10325
10326 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
10327
10328 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10329 * s/template.h: Move NARROWPROTO to configure.
10330
10331 2012-07-11 Glenn Morris <rgm@gnu.org>
10332
10333 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10334 unused since 2011-01-17 change to systty.h.
10335
10336 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10337 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10338 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10339
10340 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10341
10342 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10343
10344 2012-07-11 Glenn Morris <rgm@gnu.org>
10345
10346 * s/darwin.h, s/gnu-linux.h, s/template.h:
10347 Move INTERRUPT_INPUT to configure.
10348
10349 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10350
10351 Minor adjustments to interning code.
10352 * lisp.h (intern, intern_c_string): Redefine as static inline
10353 wrappers for intern_1 and intern_c_string_1, respectively.
10354 (intern_1, intern_c_string_1): Rename prototypes.
10355 * lread.c (intern_1, intern_c_string_1, oblookup):
10356 Simplify Vobarray checking.
10357 * font.c (font_intern_prop): Likewise. Adjust comment.
10358 * w32font.c (intern_font_name): Likewise.
10359
10360 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10361
10362 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10363
10364 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10365 of Fcar/Fcdr if possible.
10366 * font.c (check_otf_features): Likewise.
10367 * fontset.c (Fnew_fontset): Likewise.
10368 * gnutls.c (Fgnutls_boot): Likewise.
10369 * minibuf.c (read_minibuf): Likewise.
10370 * msdos.c (IT_set_frame_parameters): Likewise.
10371 * xmenu.c (Fx_popup_dialog): Likewise.
10372 * w32menu.c (Fx_popup_dialog): Likewise.
10373
10374 2012-07-11 Glenn Morris <rgm@gnu.org>
10375
10376 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10377 since nothing has defined it on these platforms.
10378
10379 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10380 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10381
10382 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10383 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10384 Move CLASH_DETECTION to configure.
10385
10386 * s/gnu.h: Remove file, which is now empty.
10387
10388 * s/gnu.h, s/gnu-linux.h:
10389 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10390
10391 2012-07-11 John Wiegley <johnw@newartisans.com>
10392
10393 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10394 function attribute, so we only use it if it exists in the
10395 compiler.
10396
10397 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10398
10399 Avoid call to strlen in fast_c_string_match_ignore_case.
10400 * search.c (fast_c_string_match_ignore_case): Change to use
10401 length argument. Adjust users accordingly.
10402 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10403
10404 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10405
10406 Assume mkdir, rmdir.
10407 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10408 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10409
10410 Assume rename.
10411 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10412
10413 Assume perror.
10414 * s/hpux10-20.h (HAVE_PERROR): Remove.
10415 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10416 Remove dummy definition, as this problem was obsolete long ago.
10417
10418 Assume strerror.
10419 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10420
10421 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10422
10423 Avoid calls to strlen in font processing functions.
10424 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
10425 (font_open_by_name): Change to use length argument.
10426 Adjust users accordingly.
10427 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10428 Adjust prototypes.
10429 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10430 Change to return ptrdiff_t.
10431 (xfont_list_pattern, xfont_match): Use length returned by
10432 xfont_decode_coding_xlfd.
10433 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10434
10435 2012-07-11 Glenn Morris <rgm@gnu.org>
10436
10437 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10438 Move DONT_REOPEN_PTY to configure.
10439
10440 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10441 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10442
10443 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10444
10445 Remove "#define unix" that is no longer needed (Bug#11905).
10446 * s/aix4-2.h (unix): Remove; no longer needed.
10447
10448 EMACS_TIME simplification (Bug#11875).
10449 This replaces macros (which typically do not work in GDB)
10450 with functions, typedefs and enums, making the code easier to debug.
10451 The functional style also makes code easier to read and maintain.
10452 * systime.h: Include <sys/time.h> on all hosts, not just if
10453 WINDOWSNT, since 'struct timeval' is needed in general.
10454 (EMACS_TIME): Now a typedef, not a macro.
10455 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10456 not macros.
10457 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10458 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10459 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10460 (EMACS_TIME_LE): Now functions, not macros.
10461 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10462 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10463 which are not functions. All uses rewritten to use:
10464 (make_emacs_time): New function.
10465 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10466 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10467 not functions. All uses rewritten to use the following, respectively:
10468 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10469 (add_emacs_time, sub_emacs_time): New functions.
10470 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
10471 * fileio.c (Fcopy_file):
10472 * xterm.c (XTflash): Get the current time closer to when it's used.
10473 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10474
10475 * bytecode.c (targets): Suppress -Woverride-init warnings.
10476
10477 Simplify by avoiding confusing use of strncpy etc.
10478 * doc.c (Fsnarf_documentation):
10479 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10480 * frame.c (Fmake_terminal_frame):
10481 * gtkutil.c (get_utf8_string):
10482 * lread.c (openp):
10483 * nsmenu.m (ns_update_menubar):
10484 * regex.c (regerror):
10485 Prefer memcpy to strncpy and strncat when either will do.
10486 * fileio.c (Fsubstitute_in_file_name):
10487 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10488 (menu_separator_name_p):
10489 * nsmenu.m (ns_update_menubar):
10490 Prefer memcmp to strncmp when either will do.
10491 * nsterm.m: Include <ftoastr.h>.
10492 (ns_get_color):
10493 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10494 Prefer snprintf to strncpy.
10495 * nsterm.m (ns_term_init):
10496 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10497 * nsterm.m (ns_term_init):
10498 Avoid the need for strncpy, by using build_string or
10499 make_unibyte_string directly. Use dtoastr, not snprintf.
10500 * process.c (Fmake_network_process): Diagnose service names that
10501 are too long, rather than silently truncating them or creating
10502 non-null-terminated names.
10503 (Fnetwork_interface_info): Likewise, for interface names.
10504 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10505 Prefer sprintf to strncat.
10506 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10507 Prefer vsnprintf to vsprintf + strncpy.
10508
10509 2012-07-10 Glenn Morris <rgm@gnu.org>
10510
10511 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10512 Clarify fallback case.
10513
10514 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10515
10516 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10517 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10518 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
10519 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
10520 where argument type is known to be a Lisp_Cons.
10521
10522 2012-07-10 Tom Tromey <tromey@redhat.com>
10523
10524 * bytecode.c (BYTE_CODE_THREADED): New macro.
10525 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10526 (enum byte_code_op): New type.
10527 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10528 (exec_byte_code): Use them. Use token threading when applicable.
10529
10530 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10531
10532 Optimize pure C strings initialization.
10533 * lisp.h (make_pure_string): Fix prototype.
10534 (build_pure_c_string): New function, defined as static inline. This
10535 provides a better opportunity to optimize away calls to strlen when
10536 the function is called with compile-time constant argument.
10537 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10538 argument, adjust users accordingly. Use build_pure_c_string where
10539 appropriate.
10540 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10541 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10542 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10543
10544 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10545
10546 Avoid calls to strlen in miscellaneous functions.
10547 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10548 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10549 * lread.c (openp): Likewise.
10550
10551 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10552
10553 Avoid calls to strlen in path processing functions.
10554 * fileio.c (file_name_as_directory): Add comment. Change to add
10555 srclen argument and return the length of result. Adjust users
10556 accordingly.
10557 (directory_file_name): Fix comment. Change to add srclen argument,
10558 swap 1st and 2nd arguments to obey the common convention.
10559 Adjust users accordingly.
10560 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10561
10562 2012-07-10 Glenn Morris <rgm@gnu.org>
10563
10564 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10565 Move PENDING_OUTPUT_COUNT definition to configure.
10566
10567 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10568 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10569 * s/gnu.h (DATA_START): Move definitions to configure.
10570
10571 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10572 We include usg5-4-common.h, which defines them both.
10573
10574 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10575 O_RDONLY already includes it).
10576
10577 Stop ns builds setting the EMACSLOADPATH environment variable.
10578 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10579 Now it does not set EMACSLOADPATH, just returns the load-path string.
10580 * nsterm.h: Update accordingly.
10581 * lread.c [HAVE_NS]: Include nsterm.h.
10582 (init_lread) [HAVE_NS]: Use ns_load_path.
10583 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10584
10585 2012-07-09 Glenn Morris <rgm@gnu.org>
10586
10587 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10588 since the included bsd-common.h does so.
10589
10590 Stop ns builds setting the EMACSPATH environment variable.
10591 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10592 (ns_init_paths): Do not set EMACSPATH.
10593 * nsterm.h (ns_exec_path): Add it.
10594 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10595 Use ns_exec_path.
10596
10597 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10598
10599 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10600
10601 * process.c (wait_reading_process_output): 'waitchannels' was unset
10602 when read_kbd || !NILP (wait_for_cell); fix this.
10603
10604 Add GCC-style 'const' attribute to functions that can use it.
10605 * character.h (char_resolve_modifier_mask):
10606 * keyboard.h (make_ctrl_char):
10607 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10608 (init_character_once, next_almost_prime, init_fns, init_image)
10609 (flush_pending_output, init_sound):
10610 * mem-limits.h (start_of_data):
10611 * menu.h (finish_menu_items):
10612 Add ATTRIBUTE_CONST.
10613 * emacs.c (DEFINE_DUMMY_FUNCTION):
10614 Declare the dummy function with ATTRIBUTE_CONST.
10615 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10616 Add decls with ATTRIBUTE_CONST.
10617
10618 Minor improvements to make_formatted_string.
10619 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10620 where int is good enough, as vsprintf returns an int.
10621 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10622
10623 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10624
10625 Use make_formatted_string to avoid double length calculation.
10626 * lisp.h (make_formatted_string): New prototype.
10627 * alloc.c (make_formatted_string): New function.
10628 * buffer.c (Fgenerate_new_buffer_name): Use it.
10629 * dbusbind.c (syms_of_dbusbind): Likewise.
10630 * editfns.c (Fcurrent_time_zone): Likewise.
10631 * filelock.c (get_boot_time): Likewise.
10632 * frame.c (make_terminal_frame, set_term_frame_name)
10633 (x_report_frame_params): Likewise.
10634 * image.c (gs_load): Likewise.
10635 * minibuf.c (get_minibuffer): Likewise.
10636 * msdos.c (dos_set_window_size): Likewise.
10637 * process.c (make_process): Likewise.
10638 * xdisp.c (ensure_echo_area_buffers): Likewise.
10639 * xsettings.c (apply_xft_settings): Likewise.
10640
10641 2012-07-09 Glenn Morris <rgm@gnu.org>
10642
10643 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10644 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10645 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10646 * nsterm.h (ns_etc_directory): Add it.
10647 * callproc.c [HAVE_NS]: Include nsterm.h.
10648 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10649
10650 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10651
10652 Move marker debugging code under MARKER_DEBUG.
10653 * marker.c (MARKER_DEBUG): Move marker debugging code under
10654 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10655 for bootstrap with --enable-checking (~3x slowdown reported
10656 by Juanma Barranquero <lekktu@gmail.com>).
10657 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10658
10659 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10660
10661 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10662 See <http://bugs.gnu.org/11825#29>.
10663
10664 2012-07-08 Eli Zaretskii <eliz@gnu.org>
10665
10666 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10667 has no font, use the frame's font. (Bug#11813)
10668 (display_line): Add commentary about displaying truncation glyphs
10669 on GUI frames.
10670 (produce_special_glyphs): Move here from term.c.
10671
10672 * term.c (produce_special_glyphs): Move to xdisp.c.
10673
10674 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10675 section.
10676
10677 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10678
10679 * xdisp.c (display_line): Avoid warning about implicit declaration
10680 of FRAME_FONT.
10681
10682 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10683
10684 * lisp.h: Remove empty conditional.
10685
10686 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10687
10688 * lread.c (load_path_check): Now static.
10689
10690 Fix some minor --with-ns problems found by static checking.
10691 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10692 (x_set_font) [!HAVE_X_WINDOWS]:
10693 * image.c (xpm_load_image) [HAVE_NS]:
10694 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10695 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10696 Remove unused local.
10697 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10698 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10699 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10700 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10701 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10702 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10703 Fix pointer signedness problem.
10704 * xfaces.c (FRAME_X_FONT_TABLE):
10705 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10706
10707 2012-07-07 Glenn Morris <rgm@gnu.org>
10708
10709 * lread.c (load_path_check): New function, split from init_lread.
10710 (init_lread): Reorganize. Motivation:
10711 If EMACSLOADPATH is set, check/warn about that rather than the
10712 defaults, which we are not going to use. Hence we can remove
10713 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10714 Don't warn if site-lisp directories are missing.
10715 If not installed, start from a blank load-path, since
10716 PATH_LOADSEARCH refers to the eventual installation directories.
10717
10718 2012-07-07 Eli Zaretskii <eliz@gnu.org>
10719
10720 Support truncation and continuation glyphs on GUI frames, when
10721 fringes are disabled. (Bug#11832)
10722 * xdisp.c (init_iterator): Get dimensions of truncation and
10723 continuation glyphs even if on GUI frames.
10724 Adjust it->last_visible_x on GUI frames when the left or right fringes,
10725 or both, are absent.
10726 (start_display, move_it_in_display_line_to): Handle the case of a
10727 GUI frame without a fringe to display continuation or truncation
10728 glyphs.
10729 (insert_left_trunc_glyphs): Support GUI frames: make sure
10730 truncation glyphs overwrite enough glyphs from the current line to
10731 have sufficient space in pixels.
10732 (display_line): Support truncation and continuation glyphs on GUI
10733 frames. If some spare pixels are left on the line after inserting
10734 the truncation glyphs, fill that space with a stretch glyph of a
10735 suitably computed width.
10736
10737 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10738 produce_glyphs, to support GUI sessions.
10739
10740 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10741
10742 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10743
10744 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10745
10746 Do not require float-time's arg to fit in time_t (Bug#11825).
10747 This works better on hosts where time_t is unsigned, and where
10748 float-time is applied to the (negative) difference between two times.
10749 * editfns.c (decode_time_components): Last arg is now double *,
10750 not int *, and means to store all the result as a double, without
10751 worrying about whether the seconds part fits in time_t.
10752 All callers changed.
10753 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10754 All callers changed.
10755 (Ffloat_time): Do not fail merely because the specified time falls
10756 outside of time_t range.
10757
10758 2012-07-07 Glenn Morris <rgm@gnu.org>
10759
10760 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10761 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10762 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10763
10764 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
10765
10766 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10767 Update dependencies.
10768
10769 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10770
10771 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10772
10773 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10774 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10775 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10776 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10777 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10778 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10779
10780 * xfont.c (compare_font_names): Redo to omit the need for casts.
10781
10782 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10783
10784 * xfns.c (Fx_change_window_property): Doc fix.
10785 * w32fns.c (Fx_change_window_property): Doc fix.
10786
10787 * w32fns.c (Fx_window_property): Accept the same arguments as the
10788 X Windows version. Doc fix.
10789 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10790
10791 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
10792 Eli Zaretskii <eliz@gnu.org>
10793
10794 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10795 Windows-specific code from nt/config.nt moved here.
10796 Obsolete settings removed.
10797
10798 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10799
10800 * process.c: Avoid unnecessary calls to gettime.
10801 (wait_reading_process_output): Don't get the time of day
10802 when gobbling data immediately and not waiting, as there's no need
10803 for it in that case. This removes a FIXME.
10804
10805 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10806
10807 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10808 is defined (Bug#11768).
10809
10810 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10811
10812 Fix marker debugging code.
10813 * marker.c (byte_char_debug_check): Do not perform the check
10814 if buffer is not multibyte.
10815 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10816 Call byte_char_debug_check with correct arguments.
10817
10818 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10819
10820 Compile marker debugging code only if ENABLE_CHECKING is defined.
10821 * marker.c (byte_char_debug_check, count_markers):
10822 Use only if ENABLE_CHECKING is defined.
10823 (byte_debug_flag): Remove.
10824 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10825 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10826
10827 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10828
10829 Avoid code repetition in marker-related functions.
10830 * marker.c (attach_marker): New function.
10831 (Fset_marker, set_marker_restricted, set_marker_both)
10832 (set_marker_restricted_both): Use it.
10833 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10834 Consistently rename charno to charpos.
10835 (marker_position): Add eassert.
10836 (marker_byte_position): Convert to eassert.
10837
10838 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10839
10840 Simplify list operations in unchain_overlay and unchain_marker.
10841 * buffer.c (unchain_overlay): Simplify. Add comment.
10842 * marker.c (unchain_marker): Simplify. Fix comments.
10843
10844 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10845
10846 Introduce fast path for the widely used marker operation.
10847 * alloc.c (build_marker): New function.
10848 * lisp.h (build_marker): New prototype.
10849 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10850 * composite.c (autocmp_chars): Likewise.
10851 * editfns.c (buildmark): Remove.
10852 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10853 (save_restriction_save): Use build_marker.
10854 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10855 * window.c (save_window_save): Likewise.
10856
10857 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10858
10859 Do not use Fdelete_overlay in delete_all_overlays
10860 to avoid redundant calls to unchain_overlay.
10861 * buffer.c (drop_overlay): New function.
10862 (delete_all_overlays, Fdelete_overlay): Use it.
10863 * minibuf.c (get_minibuffer): Fix comment.
10864
10865 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10866
10867 Port to OpenBSD 5.1 amd64.
10868 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10869 This is needed for OpenBSD, and should be harmless on all BSD systems.
10870 Also, include <sys/sysctl.h>, as it should be available on all
10871 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10872 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10873 use p_pid member, not kp_proc.pid.
10874
10875 2012-07-06 Glenn Morris <rgm@gnu.org>
10876
10877 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10878
10879 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10880
10881 More xmalloc and related cleanup.
10882 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10883 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10884 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10885 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10886 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10887 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10888 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10889 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10890 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10891 * xterm.c:
10892 Omit needless casts involving void * pointers and allocation.
10893 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10894 as the former is more robust if P's type is changed.
10895 Prefer xzalloc to xmalloc + memset 0.
10896 Simplify malloc-or-realloc to realloc.
10897 Don't worry about xmalloc returning a null pointer.
10898 Prefer xstrdup to xmalloc + strcpy.
10899 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10900 growing it.
10901 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10902 alloca of a constant.
10903
10904 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10905
10906 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10907 hscroll is larger than the line width. Fixes long and futile
10908 looping inside extend_face_to_end_of_line (on a TTY) producing
10909 glyphs that are not needed and thrown away.
10910
10911 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10912
10913 * marker.c (set_marker_restricted_both): Simplify by using
10914 clip_to_bounds.
10915
10916 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10917
10918 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10919
10920 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10921
10922 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10923 not defined (Bug#11768).
10924 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10925 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10926 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10927 followed by gtk_box_set_homogeneous (Bug#11768).
10928 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
10929 (update_theme_scrollbar_width, xg_create_scroll_bar):
10930 Use gtk_scrollbar_new (Bug#11768).
10931 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10932 (is_box_type): New function (Bug#11768).
10933 (xg_tool_item_stale_p): Call is_box_type.
10934 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
10935 with default display (Bug#11768).
10936
10937 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10938
10939 * xdisp.c (window_hscroll_limited): New function.
10940 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10941 coordinates when window's hscroll is set to insanely large
10942 values. (Bug#11857)
10943
10944 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
10945
10946 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10947 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10948
10949 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10950
10951 Cleanup xmalloc.
10952 * lisp.h (xzalloc): New prototype. Omit needless casts.
10953 * alloc.c (xzalloc): New function. Omit needless casts.
10954 * charset.c: Omit needless casts. Convert all calls to
10955 xmalloc with following memset to xzalloc.
10956 * dispnew.c: Likewise.
10957 * fringe.c: Likewise.
10958 * image.c: Likewise.
10959 * sound.c: Likewise.
10960 * term.c: Likewise.
10961 * w32fns.c: Likewise.
10962 * w32font.c: Likewise.
10963 * w32term.c: Likewise.
10964 * xfaces.c: Likewise.
10965 * xfns.c: Likewise.
10966 * xterm.c: Likewise.
10967 * atimer.c: Omit needless casts.
10968 * buffer.c: Likewise.
10969 * callproc.c: Likewise.
10970 * ccl.c: Likewise.
10971 * coding.c: Likewise.
10972 * composite.c: Likewise.
10973 * doc.c: Likewise.
10974 * doprnt.c: Likewise.
10975 * editfns.c: Likewise.
10976 * emacs.c: Likewise.
10977 * eval.c: Likewise.
10978 * filelock.c: Likewise.
10979 * fns.c: Likewise.
10980 * gtkutil.c: Likewise.
10981 * keyboard.c: Likewise.
10982 * lisp.h: Likewise.
10983 * lread.c: Likewise.
10984 * minibuf.c: Likewise.
10985 * msdos.c: Likewise.
10986 * print.c: Likewise.
10987 * process.c: Likewise.
10988 * region-cache.c: Likewise.
10989 * search.c: Likewise.
10990 * sysdep.c: Likewise.
10991 * termcap.c: Likewise.
10992 * terminal.c: Likewise.
10993 * tparam.c: Likewise.
10994 * w16select.c: Likewise.
10995 * w32.c: Likewise.
10996 * w32reg.c: Likewise.
10997 * w32select.c: Likewise.
10998 * w32uniscribe.c: Likewise.
10999 * widget.c: Likewise.
11000 * xdisp.c: Likewise.
11001 * xmenu.c: Likewise.
11002 * xrdb.c: Likewise.
11003 * xselect.c: Likewise.
11004
11005 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11006
11007 * fileio.c (time_error_value): Check the right error number.
11008 Problem reported by Troels Nielsen in
11009 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11010
11011 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11012
11013 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11014 This should be fixed in a better way; see Eli Zaretskii in
11015 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11016 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11017
11018 * fileio.c (time_error_value): Rename from special_mtime.
11019 The old name's problems were noted by Eli Zaretskii in
11020 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11021
11022 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11023 This variable's comment says Emacs needs at least one GDB-visible
11024 symbol of type enum pvec_type, to work around GDB problems.
11025 The symbol's value doesn't matter.
11026
11027 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11028 that causes compilation to fail on pre-C99 compilers.
11029
11030 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11031
11032 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11033 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11034
11035 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11036
11037 * buffer.c (init_buffer_once): Fix initialization of
11038 headers for buffer_defaults and buffer_local_symbols.
11039 Reported by Juanma Barranquero <lekktu@gmail.com>.
11040
11041 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11042
11043 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11044 * lisp.h (enum pvec_type): Use fewer bits.
11045 (PSEUDOVECTOR_SIZE_BITS): New constant.
11046 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11047 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11048 change in pvec_type.
11049 (PSEUDOVECTOR_TYPEP): New macro.
11050 (TYPED_PSEUDOVECTORP): Use it.
11051 * fns.c (internal_equal): Adapt code to extract pvectype.
11052 * emacs.c (gdb_pvec_type): Update type.
11053 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11054 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11055 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11056 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11057 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11058 abusing vector->header.next.nbytes.
11059 (live_vector_p): Use PVEC_TYPE.
11060 (mark_object): Adapt code to extract pvectype. Use switch.
11061
11062 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11063
11064 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11065 Tighten new eassert a bit.
11066
11067 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11068
11069 Fix compilation with --enable-gcc-warnings and -O1
11070 optimization level.
11071 * doprnt.c (doprnt): Change type of tem to int, initialize
11072 to avoid compiler warning. Add eassert.
11073 * search.c (simple_search): Initialize match_byte to avoid
11074 compiler warning. Add eassert.
11075
11076 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11077
11078 Avoid weird behavior with large horizontal scrolls.
11079 Without this change, for example, large hscroll values would
11080 mess up Emacs's display on Fedora 15 x86, presumably due to
11081 overflows in int calculations in the display code.
11082 Also, if buffers had long lines, Emacs would freeze.
11083 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11084 (set_window_hscroll): New function, containing the old guts of
11085 Fset_window_hscroll. Return the clipped value.
11086 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11087 This avoids the need to check against PTRDIFF_MAX.
11088
11089 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11090
11091 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11092
11093 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11094
11095 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11096
11097 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11098 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11099 since GCC 4.4.6 issues a bogus warning for them.
11100
11101 Fix bugs in file timestamp newness comparisons.
11102 * fileio.c (Ffile_newer_than_file_p):
11103 * lread.c (Fload): Use full timestamp resolution of files,
11104 not just the 1-second resolution, so that files that are only
11105 slightly newer still count as newer.
11106 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11107 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11108
11109 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11110
11111 * fileio.c: Improve handling of file time marker. (Bug#11852)
11112 (special_mtime): New function.
11113 (Finsert_file_contents, Fverify_visited_file_modtime):
11114 Use it to set special mtime values consistently.
11115
11116 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11117
11118 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11119 marker for non-existing file. (Bug#11852)
11120
11121 2012-07-03 Glenn Morris <rgm@gnu.org>
11122
11123 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11124 and did not make it into globals.h).
11125
11126 2012-07-03 Tom Tromey <tromey@redhat.com>
11127
11128 * window.c (Fset_window_margins, Fset_window_fringes)
11129 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11130 * textprop.c (Fprevious_property_change): No longer static.
11131 * syntax.c (Fsyntax_table_p): No longer static.
11132 * process.c (Fget_process, Fprocess_datagram_address): No longer
11133 static.
11134 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11135 * keyboard.c (Fcommand_execute): No longer static.
11136 Remove EXFUN.
11137 * insdel.c (Fcombine_after_change_execute): No longer static.
11138 * image.c (Finit_image_library): No longer static.
11139 * fileio.c (Fmake_symbolic_link): No longer static.
11140 * eval.c (Ffetch_bytecode): No longer static.
11141 * editfns.c (Fuser_full_name): No longer static.
11142 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11143 No longer static.
11144 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11145 static.
11146 * dired.c (Ffile_attributes): No longer static.
11147 * composite.c (Fcomposition_get_gstring): No longer static.
11148 * callproc.c (Fgetenv_internal): No longer static.
11149
11150 * ccl.h: Remove EXFUNs.
11151 * buffer.h: Remove EXFUNs.
11152 * dispextern.h: Remove EXFUNs.
11153 * intervals.h: Remove EXFUNs.
11154 * fontset.h: Remove EXFUN.
11155 * font.h: Remove EXFUNs.
11156 * dosfns.c (system_process_attributes): Remove EXFUN.
11157 * keymap.h: Remove EXFUNs.
11158 * lisp.h: Remove EXFUNs.
11159 * w32term.h: Remove EXFUNs.
11160 * window.h: Remove EXFUNs.
11161 * xsettings.h: Remove EXFUN.
11162 * xterm.h: Remove EXFUN.
11163
11164 2012-07-03 Glenn Morris <rgm@gnu.org>
11165
11166 * lisp.h (Frandom): Make it visible to C.
11167 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11168 buffer for invisible buffers. (Bug#1229)
11169
11170 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11171
11172 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11173 values which aren't power of 2.
11174 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11175 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11176 accordingly.
11177
11178 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11179
11180 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11181
11182 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11183
11184 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11185
11186 * alloc.c (allocate_vector_block): Remove redundant
11187 calls to mallopt if DOUG_LEA_MALLOC is defined.
11188 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11189 avoid calls to mallopt if zero_vector is returned.
11190
11191 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11192
11193 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11194 is enabled, avoid dereferencing NULL current_sblock if
11195 running undumped.
11196
11197 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11198
11199 Cleanup basic buffer management.
11200 * buffer.h (struct buffer): Change layout to use generic vector
11201 marking code. Fix some comments. Change type of 'clip_changed'
11202 to bitfield. Remove unused #ifndef old.
11203 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11204 (GET_OVERLAYS_AT): Fix indentation.
11205 (for_each_per_buffer_object_at): New macro.
11206 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11207 (Fbuffer_local_variables): Use it.
11208 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11209 * alloc.c (allocate_buffer): Adjust to match new layout of
11210 struct buffer. Fix comment.
11211 (mark_overlay): New function.
11212 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11213 Lisp area of struct buffer.
11214 (mark_object): Use it. Adjust marking of misc objects
11215 and related comments.
11216
11217 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11218
11219 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11220 wrapper that is not needed because the wrapped code is a no-op (zero
11221 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11222 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11223
11224 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11225
11226 * alloc.c (mark_buffer): Simplify. Remove prototype.
11227 (mark_object): Add comment. Reorganize marking of vector-like
11228 objects. Use CHECK_LIVE for all vector-like objects except buffers
11229 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11230 Avoid redundant calls to mark_vectorlike for bool vectors.
11231
11232 2012-06-30 Glenn Morris <rgm@gnu.org>
11233
11234 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11235
11236 * epaths.in (PATH_SITELOADSEARCH): New.
11237 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11238 This is rather than relying on --enable-locallisppath elements
11239 having "site-lisp" in their names. (Bug#10208#25, 11658)
11240
11241 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11242
11243 * w32proc.c (sys_select): Accept and ignore one more argument.
11244
11245 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11246
11247 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11248 (pselect) [!MS_DOS]: Redirect to sys_select.
11249
11250 * sysdep.c: Don't include dos.h and dosfns.h.
11251
11252 * process.c (sys_select):
11253 * msdos.c (sys_select): Accept one more argument and ignore it.
11254
11255 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11256 adapt data types and code to that.
11257
11258 * dosfns.c:
11259 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11260 which clashes with the gnulib function of the same name.
11261
11262 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11263
11264 * font.c (font_style_to_value, font_style_symbolic)
11265 (font_prop_validate_style): Add type checks for values in
11266 font_style_table.
11267
11268 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11269 argument.
11270 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11271 uses.
11272
11273 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11274
11275 * xdisp.c (try_window_id): Undo last change.
11276
11277 * w32.c (getwd): Adjust commentary about startup_dir.
11278 (init_environment): Always call sys_access, even in non-MSVC
11279 builds. Don't chdir to the directory of the Emacs executable.
11280 This undoes code from 1997 which was justified by the need to
11281 "avoid conflicts when removing and renaming directories". But its
11282 downside was that every relative file name was being interpreted
11283 relative to the directory of the Emacs executable, which can never
11284 be TRT. In particular, it broke sys_access when called with
11285 relative file names.
11286 (sys_access): Map GetLastError to errno.
11287
11288 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11289
11290 * window.h (struct window): Change type of 'fringes_outside_margins'
11291 to bitfield. Fix comment. Adjust users accordingly.
11292 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
11293 Adjust comment.
11294 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11295 to ptrdiff_t.
11296
11297 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
11298
11299 * gnutls.c (emacs_gnutls_handshake):
11300 Add QUIT to make the loop interruptible.
11301
11302 2012-06-29 Glenn Morris <rgm@gnu.org>
11303
11304 * charset.c (init_charset): Make lack of etc/charsets fatal.
11305
11306 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11307
11308 * editfns.c (region_limit): Fix type mismatch.
11309
11310 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11311
11312 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11313 undefined. Convert from xassert to eassert.
11314 * nsmenu.m: Convert from xassert to eassert.
11315 * nsterm.m: Likewise.
11316
11317 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11318
11319 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11320
11321 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11322
11323 Avoid integer overflow on scroll-left and scroll-right.
11324 * window.c (HSCROLL_MAX): New macro.
11325 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11326 overflow when requested scroll falls outside ptrdiff_t range.
11327
11328 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11329
11330 * window.h (struct window): Change type of 'hscroll',
11331 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11332 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11333 Adjust users accordingly.
11334 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11335 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11336 from EMACS_INT to ptrdiff_t.
11337 (make_window): Omit redundant initialization.
11338
11339 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
11340
11341 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11342
11343 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11344
11345 * window.h (struct window): Change type of 'use_time' and
11346 'sequence_number' from Lisp_Object to int.
11347 * frame.c (make_frame): Adjust users accordingly.
11348 * print.c (print_object): Likewise.
11349 * window.c (select_window, Fwindow_use_time, make_parent_window)
11350 (make_window): Likewise.
11351
11352 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11353
11354 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11355 enabled with --enable-checking=[all,glyphs] configure option.
11356 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11357 adjust comments accordingly.
11358 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11359 undefined, adjust comments accordingly.
11360 * image.c: Likewise.
11361 * scroll.c: Likewise.
11362 * w32fns.c: Likewise.
11363 * w32term.c: Likewise.
11364 * xdisp.c: Likewise.
11365 * xfaces.c: Likewise.
11366 * xfns.c: Likewise.
11367 * xterm.c: Likewise.
11368
11369 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11370
11371 Generalize run-time debugging checks.
11372 * dispextern.h (XASSERTS): Remove.
11373 * fontset.c (xassert): Remove.
11374 Convert from xassert to eassert.
11375 * alloc.c: Convert from xassert to eassert.
11376 * bidi.c: Likewise.
11377 * dispnew.c: Likewise.
11378 * fns.c: Likewise.
11379 * fringe.c: Likewise.
11380 * ftfont.c: Likewise.
11381 * gtkutil.c: Likewise.
11382 * image.c: Likewise.
11383 * keyboard.c: Likewise.
11384 * menu.c: Likewise.
11385 * process.c: Likewise.
11386 * scroll.c: Likewise.
11387 * sound.c: Likewise.
11388 * term.c: Likewise.
11389 * w32console.c: Likewise.
11390 * w32fns.c: Likewise.
11391 * w32term.c: Likewise.
11392 * window.c: Likewise.
11393 * xdisp.c: Likewise.
11394 * xfaces.c: Likewise.
11395 * xfns.c: Likewise.
11396 * xselect.c: Likewise.
11397 * xterm.c: Likewise.
11398
11399 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11400
11401 * fns.c (maybe_resize_hash_table): Output message when growing the
11402 purify-hashtable.
11403
11404 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11405
11406 * alloc.c (allocate_string_data): Remove dead code.
11407 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11408 avoid GCC warning about unused macro.
11409
11410 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11411
11412 * alloc.c (allocate_string): Omit intervals initialization.
11413 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11414 as in make_pure_string and make_pure_c_string.
11415
11416 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11417
11418 * alloc.c (allocate_string): Fix last change.
11419
11420 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11421
11422 * alloc.c (allocate_string): Remove two redundant calls
11423 to memset, add explicit initialization where appropriate.
11424
11425 2012-06-27 Glenn Morris <rgm@gnu.org>
11426
11427 * lisp.mk (lisp): Remove paths.elc.
11428
11429 2012-06-27 Chong Yidong <cyd@gnu.org>
11430
11431 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11432
11433 2012-06-26 John Wiegley <johnw@newartisans.com>
11434
11435 * unexmacosx.c (copy_data_segment): Add two section names used
11436 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11437
11438 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11439 when building with Clang.
11440
11441 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11442
11443 * eval.c (Fapply): Allow calling it with a single argument.
11444
11445 2012-06-26 Eli Zaretskii <eliz@gnu.org>
11446
11447 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11448 _stricmp and _strnicmp.
11449 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11450
11451 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11452
11453 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11454 allocated window.
11455 (allocate_process): Likewise for new process.
11456 (allocate_terminal): Change to use offsetof.
11457 (allocate_frame): Likewise.
11458 * frame.c (make_frame): Omit redundant initialization.
11459 * window.c (make_parent_window): Use memset.
11460 (make_window): Omit redundant initialization.
11461 * process.c (make_process): Omit redundant initialization.
11462 * terminal.c (create_terminal): Likewise.
11463
11464 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11465
11466 * term.c (delete_tty): Remove redundant call to memset.
11467
11468 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11469
11470 * alloc.c: Remove build_string.
11471 * lisp.h: Define build_string as static inline. This provides
11472 a better opportunity to optimize away calls to strlen when the
11473 function is called with compile-time constant argument.
11474 * image.c (imagemagick_error): Convert to build_string.
11475 * w32proc.c (sys_spawnve): Likewise.
11476 * xterm.c (x_term_init): Likewise.
11477
11478 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11479
11480 Use sprintf return value instead of invoking strlen on result.
11481 In the old days this wasn't portable, since some sprintf
11482 implementations returned char *. But they died out years ago and
11483 Emacs already assumes sprintf returns int.
11484 Similarly for float_to_string.
11485 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11486 * ccl.c (ccl_driver):
11487 * character.c (string_escape_byte8):
11488 * data.c (Fnumber_to_string):
11489 * doprnt.c (doprnt):
11490 * print.c (print_object):
11491 * xdisp.c (message_dolog):
11492 * xfns.c (syms_of_xfns):
11493 Use sprintf or float_to_string result to avoid need to call strlen.
11494 * data.c (Fnumber_to_string):
11495 Use make_unibyte_string, since the string must be ASCII.
11496 * lisp.h, print.c (float_to_string): Now returns int length.
11497 * term.c (produce_glyphless_glyph):
11498 Use sprintf result rather than recomputing it.
11499
11500 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11501 * Makefile.in (ALL_CFLAGS):
11502 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11503 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11504
11505 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11506
11507 * dispextern.h (xstrcasecmp): Define to library function
11508 strcasecmp if available.
11509 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11510
11511 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11512
11513 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11514 Avoid comma operator.
11515 * menu.c (push_submenu_start, push_submenu_end)
11516 (push_left_right_boundary, push_menu_pane): Likewise.
11517 * msdos.c (dos_rawgetc): Likewise.
11518
11519 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11520
11521 * xfns.c (xic_create_fontsetname): Remove redundant calls
11522 to memset.
11523
11524 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11525
11526 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11527 sprintf already null-terminates its output.
11528
11529 * xfns.c (x_window): Remove redundant cast.
11530
11531 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11532
11533 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11534 `const char *' to `char *' to avoid compiler warning.
11535
11536 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11537
11538 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11539 instead of truncating it to 63 (admittedly a generous limit).
11540
11541 * process.c: Fix spelling and caps in comments.
11542
11543 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11544
11545 * emacs.c (setpgrp): Remove definition, unused.
11546 * sysdep.c (setpgrp): Remove definition, not used in this file.
11547
11548 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
11549
11550 * makefile.w32-in: Update dependencies.
11551
11552 2012-06-24 Eli Zaretskii <eliz@gnu.org>
11553
11554 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11555 (SYSTIME_H): Add nt/inc/sys/time.h.
11556
11557 * systime.h [WINDOWSNT]: Include sys/time.h.
11558
11559 * s/ms-w32.h (struct timespec): Definition moved from
11560 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11561
11562 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11563
11564 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11565 * buffer.h (buffer_slot_type_mismatch):
11566 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11567 * eval.c (unwind_to_catch):
11568 * image.c (my_png_error, my_error_exit):
11569 * keyboard.c (quit_throw_to_read_char, user_error)
11570 (Fexit_recursive_edit, Fabort_recursive_edit):
11571 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11572 (wrong_type_argument, buffer_overflow, __executable_start)
11573 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11574 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11575 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11576 (fatal):
11577 (child_setup) [!DOS_NT]:
11578 * lread.c (end_of_file_error, invalid_syntax):
11579 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11580 * puresize.h (pure_write_error):
11581 * search.c (matcher_overflow):
11582 * sound.c (sound_perror, alsa_sound_perror):
11583 * sysdep.c, syssignal.h (croak):
11584 * term.c (maybe_fatal, vfatal):
11585 * textprop.c (text_read_only):
11586 * undo.c (user_error):
11587 * unexmacosx.c (unexec_error):
11588 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11589 Use _Noreturn rather than NO_RETURN.
11590 No need for separate decl merely because of _Noreturn.
11591 * sound.c (sound_warning, parse_sound):
11592 Remove unnecessary forward decls.
11593
11594 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11595
11596 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11597 * lisp.h (WAIT_READING_MAX): New macro.
11598 * dispnew.c (Fsleep_for, sit_for):
11599 * keyboard.c (kbd_buffer_get_event):
11600 * process.c (Faccept_process_output):
11601 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11602 This improves on the previous patch, which introduced a bug
11603 when time_t is unsigned and as wide as intmax_t.
11604 See <http://bugs.gnu.org/9000#51>.
11605
11606 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11607
11608 * dispnew.c (sit_for, Fsleep_for):
11609 * keyboard.c (kbd_buffer_get_event):
11610 * process.c (Faccept_process_output): Avoid compiler warnings when
11611 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11612
11613 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
11614
11615 * makefile.w32-in: Update dependencies.
11616
11617 * w32.c (ltime): Add return type and declare static.
11618 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11619
11620 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11621
11622 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11623 Privately reported by Herbert J. Skuhra.
11624 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11625 All uses changed.
11626 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11627 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11628
11629 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11630
11631 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11632 last argument of make_unibyte_string.
11633
11634 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11635 language ID in the event parameters.
11636
11637 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11638 event.code, not the obscure "character set ID".
11639
11640 2012-06-23 Chong Yidong <cyd@gnu.org>
11641
11642 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11643
11644 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11645
11646 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11647 * w32.c (fdutimens): New function.
11648
11649 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11650
11651 * s/ms-w32.h (pselect): Redirect to sys_select.
11652
11653 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11654
11655 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11656 in the logic of incrementing and decrementing the value of
11657 use_relocatable_buffers.
11658
11659 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11660
11661 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11662 Privately reported by Herbert J. Skuhra.
11663 [__FreeBSD__]: Remove "*/" typo after "#include".
11664 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11665 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11666 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11667 Don't assume EMACS_TIME and struct timeval are the same type.
11668
11669 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11670
11671 Support higher-resolution time stamps (Bug#9000).
11672 The time stamps are only nanosecond-resolution at the C level,
11673 since that's the best that any real-world system supports now.
11674 But they are picosecond-resolution at the Lisp level, as that's
11675 easy, and leaves room for future OS improvements.
11676
11677 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11678 (LIBES): Use it.
11679
11680 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11681 Don't get current time unless it's needed.
11682
11683 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11684 now provides it if it's absent.
11685 (start_atimer): Port to higher-res time stamps.
11686 Check for time stamp overflow. Don't get current time more
11687 often than is needed.
11688
11689 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11690 Include systime.h, not time.h.
11691 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11692
11693 * dired.c: Include stat-time.h.
11694 (Ffile-attributes): File times now have higher resolution.
11695
11696 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11697 (struct image): Timestamp now has higher resolution.
11698
11699 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11700 has at least microseconds now. All uses removed.
11701 (update_frame, update_single_window, update_window, update_frame_1)
11702 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
11703 (duration_to_sec_usec): Remove; no longer needed.
11704
11705 * editfns.c (time_overflow): Now extern.
11706 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11707 (float-time, Fformat_time_string, Fcurrent_time_string)
11708 (Fcurrent_time_zone): Accept and generate higher-resolution
11709 time stamps.
11710 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11711 (decode_time_components, lisp_seconds_argument): New functions.
11712 (make_time): Now static.
11713 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11714 Report an error if the time is invalid, rather than having the caller
11715 do that.
11716
11717 * fileio.c: Include <stat-time.h>
11718 (Fcopy_file): Copy higher-resolution time stamps.
11719 Prefer to set the time stamp via a file descriptor if that works.
11720 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11721 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11722 (Fvisited_file_modtime, Fset_visited_file_modtime):
11723 Support higher-resolution time stamps.
11724
11725 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11726
11727 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11728
11729 * image.c (prepare_image_for_display, clear_image_cache)
11730 (lookup_image): Port to higer-resolution time stamps.
11731
11732 * keyboard.c (start_polling, bind_polling_period):
11733 Check for time stamp overflow.
11734 (read_char, kbd_buffer_get_event, timer_start_idle)
11735 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11736 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11737 Port to higher-resolution time stamps. Do not assume time_t is signed.
11738 (decode_timer): New function. Timers are now vectors of length 9,
11739 not 8, to accommodate the picosecond component.
11740 (timer_check_2): Use it.
11741
11742 * nsterm.m (select_timeout, timeval_subtract): Remove.
11743 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11744 as they're a bit more accurate and handle overflow better.
11745 (ns_select): Change prototype to be compatible with pselect.
11746 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11747 * nsterm.h (ns_select): Adjust prototype.
11748
11749 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11750 us-resolution time stamps.
11751 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11752
11753 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11754
11755 * lisp.h (time_overflow): New decl.
11756 (wait_reading_process_output): First arg is now intmax_t, not int,
11757 to accommodate larger waits.
11758
11759 * process.h (struct Lisp_Process.read_output_delay):
11760 Now counts nanoseconds, not microseconds.
11761 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11762 EMACS_HAS_USECS.
11763 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11764 (wait_reading_process_output):
11765 Port to ns-resolution time stamps.
11766 (Faccept_process_output, wait_reading_process_output):
11767 Check for time stamp overflow. Do not assume time_t is signed.
11768 (select_wrapper): Remove; we now use pselect.
11769 (Fprocess_attributes): Now generates ns-resolution time stamps.
11770
11771 * sysdep.c: Include utimens.h. Don't include utime.h
11772 or worry about struct utimbuf; gnulib does that for us now.
11773 (gettimeofday): Remove; gnulib provides a substitute.
11774 (make_timeval): New function.
11775 (set_file_times): Now sets ns-resolution time stamps.
11776 New arg FD; all uses changed.
11777 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11778 (system_process_attributes):
11779 Now returns ns-resolution time stamp. All uses changed.
11780 Check for time stamp overflow.
11781
11782 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11783 provides a substitute now.
11784
11785 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11786 since it guarantees struct timespec.
11787 (EMACS_TIME): Now struct timespec, so that we can support
11788 ns-resolution time stamps.
11789 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11790 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11791 (EMACS_USECS): Remove.
11792 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11793 so multiply the arg by 1000 before storing it.
11794 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11795 New macros.
11796 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11797 Port to ns-resolution time stamps.
11798 (EMACS_TIME_NEG_P): Remove; replaced by....
11799 (EMACS_TIME_SIGN): New macro.
11800 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11801 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11802 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11803 (make_timeval, make_lisp_time, decode_time_components): New decls.
11804 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11805 that it mishandled time_t overflow. You can't compare by subtracting!
11806 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11807 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11808
11809 * term.c: Include <sys/time.h>.
11810 (timeval_to_Time): New function, for proper overflow wraparound.
11811 (term_mouse_position, term_mouse_click): Use it.
11812
11813 * undo.c (record_first_change): Support higher-resolution time stamps
11814 in the undo buffer.
11815 (Fprimitive_undo): Use them when restoring time stamps.
11816
11817 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11818 (w32_get_internal_run_time):
11819 Port to higher-resolution Emacs time stamps.
11820 (ltime): Now accepts single 64-bit integer, as that's more convenient
11821 for callers.
11822
11823 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11824
11825 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11826 for compatibility with pselect. Support ns-resolution time stamps.
11827
11828 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11829
11830 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11831 Check for time stamp overflow, and support ns-resolution time stamps.
11832
11833 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11834 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11835 (timeval_subtract): Remove; no longer needed.
11836 (XTflash, XTring_bell, x_wait_for_event):
11837 Port to ns-resolution time stamps. Don't assume time_t is signed.
11838
11839 2012-06-22 Chong Yidong <cyd@gnu.org>
11840
11841 * xdisp.c (x_consider_frame_title): Revert last change.
11842
11843 2012-06-22 Eli Zaretskii <eliz@gnu.org>
11844
11845 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11846 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11847 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11848 staticidx goes up to 1597 out of 1600 = 0x640.)
11849
11850 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11851
11852 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11853 Otherwise, the umask might be mistakenly 0 while handling input signals.
11854
11855 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11856
11857 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11858
11859 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11860
11861 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11862 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11863 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11864 access to `contents' member of Lisp_Vector objects with AREF and ASET
11865 where appropriate.
11866
11867 2012-06-19 Chong Yidong <cyd@gnu.org>
11868
11869 * frame.c (delete_frame): When selecting a frame on a different
11870 text terminal, do not alter the terminal's top-frame.
11871
11872 * xdisp.c (format_mode_line_unwind_data): Record the target
11873 frame's selected window and its terminal's top-frame.
11874 (unwind_format_mode_line): Restore them.
11875 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11876 Callers changed.
11877 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11878 since tty frames can be explicitly named.
11879 (prepare_menu_bars): Likewise.
11880
11881 * term.c (Ftty_top_frame): New function.
11882
11883 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11884
11885 Port byte-code-meter to modern targets.
11886 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11887 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
11888 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
11889 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11890 (METER_1, METER_2): Simplify.
11891
11892 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11893
11894 * data.c (Fdefalias): Return `symbol' (bug#11686).
11895
11896 2012-06-18 Martin Rudalics <rudalics@gmx.at>
11897
11898 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
11899 gets killed during executing of this function (Bug#11665).
11900 Try to always return Qt when the buffer has been actually killed.
11901 (Vkill_buffer_query_functions): In doc-string say that functions
11902 run by this hook should not change the current buffer.
11903
11904 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11905
11906 Fix recently-introduced process.c problems found by static checking.
11907 * process.c (write_queue_push, write_queue_pop, send_process):
11908 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11909 (write_queue_pop): Fix pointer signedness problem.
11910 (send_process): Remove unused local.
11911
11912 2012-06-17 Chong Yidong <cyd@gnu.org>
11913
11914 * xdisp.c (redisplay_internal): No need to redisplay terminal
11915 frames that are not on top.
11916
11917 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
11918
11919 * process.c (make_process): Initialize write_queue.
11920 (write_queue_push, write_queue_pop): New functions.
11921 (send_process): Use them to maintain correct ordering of process
11922 writes (Bug#10815).
11923
11924 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11925
11926 * lisp.h (eassert): Assume C89 or later.
11927 This removes the need for CHECK.
11928 (CHECK): Remove. Its comments about always evaluating its
11929 argument were confusing, as 'eassert' typically does not evaluate
11930 its argument.
11931
11932 * coding.c (produce_chars): Use ptrdiff_t, not int.
11933
11934 * xterm.c (x_draw_underwave): Check for integer overflow.
11935 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11936
11937 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
11938
11939 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11940 referenced (Bug#11583).
11941
11942 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11943
11944 Implement wave-style variant of underlining.
11945 * dispextern.h (face_underline_type): New enum.
11946 (face): Add field for underline type.
11947 * nsterm.m (ns_draw_underwave): New function.
11948 (ns_draw_text_decoration): Use it.
11949 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11950 New functions.
11951 (x_draw_glyph_string): Use them.
11952 * xfaces.c (Qline, Qwave): New Lisp objects.
11953 (check_lface_attrs, merge_face_ref)
11954 (Finternal_set_lisp_face_attribute, realize_x_face):
11955 Handle wave-style underline face attributes.
11956 * xterm.c (x_draw_underwave): New function.
11957 (x_draw_glyph_string): Use it.
11958
11959 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
11960
11961 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11962 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11963 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11964 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11965 ($(BLD)/w32select.$(O)): Update dependencies.
11966
11967 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11968
11969 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11970 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11971 * character.c (_fetch_multibyte_char_p): Remove.
11972 * alloc.c: Include "character.h" before "buffer.h".
11973 * bidi.c: Likewise.
11974 * buffer.c: Likewise.
11975 * bytecode.c: Likewise.
11976 * callint.c: Likewise.
11977 * callproc.c: Likewise.
11978 * casefiddle.c: Likewise.
11979 * casetab.c: Likewise.
11980 * category.c: Likewise.
11981 * cmds.c: Likewise.
11982 * coding.c: Likewise.
11983 * composite.c: Likewise.
11984 * dired.c: Likewise.
11985 * dispnew.c: Likewise.
11986 * doc.c: Likewise.
11987 * dosfns.c: Likewise.
11988 * editfns.c: Likewise.
11989 * emacs.c: Likewise.
11990 * fileio.c: Likewise.
11991 * filelock.c: Likewise.
11992 * font.c: Likewise.
11993 * fontset.c: Likewise.
11994 * fringe.c: Likewise.
11995 * indent.c: Likewise.
11996 * insdel.c: Likewise.
11997 * intervals.c: Likewise.
11998 * keyboard.c: Likewise.
11999 * keymap.c: Likewise.
12000 * lread.c: Likewise.
12001 * macros.c: Likewise.
12002 * marker.c: Likewise.
12003 * minibuf.c: Likewise.
12004 * nsfns.m: Likewise.
12005 * nsmenu.m: Likewise.
12006 * print.c: Likewise.
12007 * process.c: Likewise.
12008 * regex.c: Likewise.
12009 * region-cache.c: Likewise.
12010 * search.c: Likewise.
12011 * syntax.c: Likewise.
12012 * term.c: Likewise.
12013 * textprop.c: Likewise.
12014 * undo.c: Likewise.
12015 * unexsol.c: Likewise.
12016 * w16select.c: Likewise.
12017 * w32fns.c: Likewise.
12018 * w32menu.c: Likewise.
12019 * window.c: Likewise.
12020 * xdisp.c: Likewise.
12021 * xfns.c: Likewise.
12022 * xmenu.c: Likewise.
12023 * xml.c: Likewise.
12024 * xselect.c: Likewise.
12025
12026 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12027
12028 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12029 If all the glyphs of the glyph row came from strings, and we have no
12030 cursor positioning clues, put the cursor on the first glyph of the
12031 row.
12032 (handle_face_prop): Use chunk-relative overlay string index when
12033 indexing into it->string_overlays array. (Bug#11653)
12034 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12035 the rightmost. (Bug#11720)
12036
12037 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12038
12039 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12040 (CATEGORY_MEMBER): Enforce 1/0 value.
12041 * category.c (_temp_category_set): Remove.
12042
12043 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12044
12045 * window.c (Fdelete_other_windows_internal)
12046 (Fdelete_window_internal): Don't access frame's mouse highlight
12047 info of the initial frame. (Bug#11677)
12048
12049 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12050
12051 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12052 Assume USE_2_TAGS_FOR_INTS.
12053 (xreload): Adjust $tagmask width to match recent lisp.h change.
12054
12055 Simplify lisp.h in minor ways that should not affect code.
12056 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12057 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12058 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12059 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12060 (INTTYPEBITS): New macro, for clarity.
12061 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12062 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12063 Simplify now that USE_LSB_TAG is always defined.
12064 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12065 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12066
12067 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12068
12069 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12070
12071 2012-06-13 Glenn Morris <rgm@gnu.org>
12072
12073 * s/bsd-common.h (BSD4_3):
12074 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12075
12076 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12077
12078 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12079 instead of union.
12080 (XLI, XIL): Define.
12081 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12082 Use them.
12083 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12084 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12085 * alloc.c (widen_to_Lisp_Object): Remove.
12086 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12087 * frame.c (delete_frame): Remove outdated comment.
12088 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12089 USE_LISP_UNION_TYPE.
12090 (Fw32_unregister_hot_key): Likewise.
12091 (Fw32_toggle_lock_key): Likewise.
12092 * w32menu.c (add_menu_item): Likewise.
12093 (w32_menu_display_help): Use XIL instead of checking
12094 USE_LISP_UNION_TYPE.
12095 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12096 (init_heap): Likewise.
12097 * w32term.c (w32_read_socket): Update comment.
12098
12099 2012-06-13 Glenn Morris <rgm@gnu.org>
12100
12101 * s/usg5-4-common.h, src/s/unixware.h:
12102 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12103
12104 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12105
12106 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12107
12108 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12109 * alloc.c (make_number) [!defined make_number]:
12110 Remove, as lisp.h always defines this now.
12111 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12112 (roundup_size): Verify that it is a power of 2.
12113 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12114 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12115 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12116 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12117 USE_LSB_TAG now is always defined to be either 0 or 1.
12118 All uses changed.
12119 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12120 code works fine either way, and efficiency is not a concern here,
12121 as the union type is for debugging, not for production.
12122 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12123 Use an inline function on all platforms when using the union type,
12124 since this is simpler and 'static inline' can be used portably
12125 within Emacs now.
12126 (LISP_INITIALLY_ZERO): New macro.
12127 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12128 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12129
12130 2012-06-12 Glenn Morris <rgm@gnu.org>
12131
12132 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12133
12134 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12135
12136 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12137 Move BROKEN_SIGIO to configure.
12138
12139 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12140 Move NO_TERMIO to configure.
12141
12142 2012-06-12 Chong Yidong <cyd@gnu.org>
12143
12144 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12145 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12146 MagickExportImagePixels is undefined.
12147
12148 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12149
12150 * image.c (imagemagick_load_image): Remove unused label.
12151
12152 2012-06-11 Glenn Morris <rgm@gnu.org>
12153
12154 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12155 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12156 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12157 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12158
12159 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12160
12161 * alloc.c (make_byte_code): New function.
12162 (Fmake_byte_code): Use it. Don't purify here.
12163 * lread.c (read1): Use it as well to avoid extra allocation.
12164
12165 2012-06-11 Chong Yidong <cyd@gnu.org>
12166
12167 * image.c (imagemagick_load_image): Implement transparency.
12168
12169 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12170
12171 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12172 account for preceding backslashes. (Bug#11663)
12173
12174 2012-06-09 Chong Yidong <cyd@gnu.org>
12175
12176 * term.c: Support italics in capable terminals (Bug#9652).
12177 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12178 (turn_on_face): Output using TS_enter_italic_mode if available.
12179 Don't handle unused blinking and alt-charset cases.
12180 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12181 and tty_alt_charset_p cases.
12182 (tty_capable_p, init_tty): Support italics.
12183
12184 * termchar.h (struct tty_display_info): Add field for italics.
12185 Remove unused blink field.
12186
12187 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12188 Handle slant.
12189
12190 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12191 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12192 tty_alt_charset_p. Add tty_italic_p.
12193
12194 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12195
12196 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12197 dbus_type_is_basic if available.
12198 (xd_extract_signed, xd_extract_unsigned): Rename from
12199 extract_signed and extract_unsigned, respectively. Adapt callers.
12200
12201 2012-06-09 Chong Yidong <cyd@gnu.org>
12202
12203 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12204
12205 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12206 case (Bug#9752).
12207
12208 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12209
12210 * xdisp.c (vmessage): Treat frame message as multibyte.
12211 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12212 would generate the diagnostic "Making \302\247 buffer-local while
12213 let-bound!".
12214
12215 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12216
12217 * dispnew.c (showing_window_margins_p): Undo last change, which
12218 was done due to an inadvertent commit.
12219 (adjust_frame_glyphs_for_frame_redisplay): Do call
12220 showing_window_margins_p.
12221
12222 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12223
12224 * eval.c (Fmake_var_non_special): New primitive.
12225 (syms_of_eval): Defsubr it.
12226 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12227
12228 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12229
12230 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12231 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12232
12233 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12234
12235 * alloc.c (allocate_vectorlike): Fix last change.
12236
12237 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12238
12239 Block-based vector allocation of small vectors.
12240 * lisp.h (struct vectorlike_header): New field `nbytes',
12241 adjust comment accordingly.
12242 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12243 to denote vector blocks. Adjust users (live_vector_p,
12244 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12245 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12246 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12247 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12248 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12249 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12250 (roundup_size): New constant.
12251 (struct vector_block): New data type.
12252 (vector_blocks, vector_free_lists, zero_vector): New variables.
12253 (all_vectors): Rename to `large_vectors'.
12254 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12255 (sweep_vectors): New functions.
12256 (allocate_vectorlike): Return `zero_vector' as the only vector of
12257 0 items. Allocate new vector from block if vector size is less than
12258 or equal to VBLOCK_BYTES_MAX.
12259 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12260 (init_alloc_once): Add call to init_vectors.
12261
12262 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12263
12264 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12265
12266 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12267
12268 * doprnt.c (doprnt): Truncate multibyte char correctly.
12269 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12270 would mishandle a string argument "Xc" if X was a multibyte
12271 character of length 2: it would truncate after X's first byte
12272 rather than including all of X.
12273
12274 2012-06-06 Chong Yidong <cyd@gnu.org>
12275
12276 * buffer.c (word_wrap): Doc fix.
12277
12278 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12279
12280 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12281
12282 2012-06-03 Glenn Morris <rgm@gnu.org>
12283
12284 * xdisp.c (tool-bar-style): Doc fix.
12285
12286 2012-06-03 Ulrich Müller <ulm@gentoo.org>
12287
12288 * Makefile.in (PAXCTL): Define.
12289 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12290 binary via PaX flags if the paxctl utility is available.
12291 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12292 Restore PaX flags to their default. (Bug#11398)
12293
12294 2012-06-03 Chong Yidong <cyd@gnu.org>
12295
12296 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12297 buffer (Bug#11226).
12298
12299 2012-06-03 Chong Yidong <cyd@gnu.org>
12300
12301 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12302 (note_mode_line_or_margin_highlight): If there is no help echo,
12303 use mode-line-default-help-echo. Handle the case where the mouse
12304 position is past the end of the mode line string.
12305
12306 * buffer.c (buffer_local_value_1): New function, split from
12307 Fbuffer_local_value; can return Qunbound.
12308 (Fbuffer_local_value): Use it.
12309 (Vmode_line_format): Docstring tweaks.
12310
12311 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12312
12313 * sysdep.c (system_process_attributes): Improve comment.
12314
12315 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12316
12317 * keyboard.c: Export real-this-command to Elisp.
12318 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12319 and DEFVAR it. Update all users.
12320
12321 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12322
12323 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12324
12325 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12326 Convert pctcpu and pctmem to Lisp float properly.
12327 Let the compiler fold better, as 100.0/0x8000 is exact.
12328
12329 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12330
12331 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12332 cons_block.
12333
12334 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12335
12336 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12337
12338 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12339
12340 For a 'struct window', replace some Lisp_Object fields to
12341 bitfields where appropriate, remove unused fields.
12342 * window.h (struct window): Remove unused 'last_mark_x' and
12343 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
12344 change its type from Lisp_Object to bitfield.
12345 Change type of 'force_start', 'optional_new_start',
12346 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
12347 fields from Lisp_Object to bitfield. Adjust users accordingly.
12348
12349 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12350
12351 Pacify gcc -Wdouble-precision when using Xaw.
12352 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12353 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12354 Use 'float' consistently, rather than 'float' in most places
12355 and 'double' in a couple of places.
12356
12357 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12358
12359 * xdisp.c (handle_stop): Detect whether we have overlay strings
12360 loaded by testing it->current.overlay_string_index to be
12361 non-negative, instead of checking whether n_overlay_strings is
12362 positive. (Bug#11587)
12363
12364 2012-05-31 Chong Yidong <cyd@gnu.org>
12365
12366 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12367
12368 * doc.c (Fsubstitute_command_keys): Doc fix.
12369
12370 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12371
12372 * search.c (search_buffer): Remove calls to
12373 r_alloc_inhibit_buffer_relocation, as it is now called by
12374 maybe_unify_char, which was the cause of relocation of buffer text
12375 in bug#11519.
12376
12377 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12378
12379 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12380 for the duration of call to load_charset, to avoid problems with
12381 callers of maybe_unify_char that access buffer text through C
12382 pointers.
12383
12384 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12385 decrement the inhibition flag, instead of just setting or
12386 resetting it.
12387
12388 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12389
12390 Remove obsolete '#define static' cruft.
12391 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12392 This #undef was "temporary" in 2000; it is no longer needed
12393 now that '#define static' has gone away.
12394 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12395 (gray_bitmap_bits): Remove; no longer needed.
12396 All uses replaced with definiens.
12397 * xterm.c: Include "bitmaps/gray.xbm".
12398
12399 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12400
12401 Clean up __executable_start, monstartup when --enable-profiling.
12402 The following changes affect the code only when profiling.
12403 * dispnew.c (__executable_start): Rename from safe_bcopy.
12404 Define only on platforms that need it.
12405 * emacs.c: Include <sys/gmon.h> when profiling.
12406 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12407 (__executable_start): Remove decl, since lisp.h does it now.
12408 (safe_bcopy): Remove decl; no longer has that name.
12409 (main): Coalesce #if into single bit of code, for simplicity.
12410 Cast pointers to uintptr_t, since standard libraries want integers
12411 and not pointers.
12412 * lisp.h (__executable_start): New decl.
12413
12414 2012-05-31 Glenn Morris <rgm@gnu.org>
12415
12416 * image.c (Fimagemagick_types): Doc fix.
12417
12418 2012-05-30 Jim Meyering <meyering@redhat.com>
12419
12420 * callproc.c (Fcall_process_region): Include directory component
12421 in mkstemp error message (Bug#11586).
12422
12423 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12424
12425 * alloc.c, lisp.h (make_pure_vector): Now static.
12426
12427 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12428
12429 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12430 Move to byte-run.el.
12431 (Fautoload): Do the hash-doc more carefully.
12432 * data.c (Fdefalias): Purify definition, except for keymaps.
12433 (Qdefun): Move from eval.c.
12434 * lisp.h (Qdefun): Remove.
12435 * lread.c (read1): Tiny simplification.
12436
12437 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
12438
12439 Do not create empty overlays with the evaporate property (Bug#9642).
12440 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12441 Bug#9642, but explicitly check that the buffer the overlay would
12442 be moved to is live and rearrange lines to make sure that errors
12443 will not put the overlay in an inconsistent state.
12444 (Fdelete_overlay): Cosmetics.
12445
12446 2012-05-28 Eli Zaretskii <eliz@gnu.org>
12447
12448 * w32term.c (my_bring_window_to_top): New function.
12449 (x_raise_frame): Use handle returned by DeferWindowPos, which
12450 could be different from the original one.
12451 Call my_bring_window_to_top instead of my_set_foreground_window.
12452 (Bug#11513)
12453
12454 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12455 by calling BringWindowToTop.
12456
12457 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12458 (WM_EMACS_END): Increase by one.
12459
12460 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12461
12462 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12463 This avoids undefined behavior that might cause the eassert
12464 to not catch an out-of-range value.
12465
12466 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
12467
12468 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12469 Update dependencies.
12470
12471 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12472
12473 * bidi.c (bidi_mirror_char): Fix last change.
12474
12475 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12476
12477 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12478 when referring to sectname field in printf format.
12479
12480 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12481
12482 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12483 Only r_alloc_inhibit_buffer_relocation needed to be added;
12484 the others were already declared.
12485
12486 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12487 before checking whether it's out of range. Put the check inside
12488 eassert. See
12489 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12490
12491 2012-05-27 Ken Brown <kbrown@cornell.edu>
12492
12493 * callproc.c (Fcall_process): Restore a line that was accidentally
12494 commented out in the 2011-02-13 change (bug#11547).
12495
12496 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12497
12498 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12499 defined on ralloc.c.
12500
12501 * buffer.c [REL_ALLOC]: Remove prototypes of
12502 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12503 they are now on lisp.h.
12504
12505 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12506
12507 * search.c (search_buffer): Use it to inhibit relocation of buffer
12508 text while re_search_2 is doing its job, because re_search_2 is
12509 passed C pointers to buffer text. (Bug#11519)
12510
12511 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12512 Update value to 24.
12513
12514 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12515 state after an additional call to move_it_in_display_line_to, keep
12516 the values of it->max_ascent and it->max_descent found for the
12517 entire line.
12518 (pos_visible_p): Revert the comparison against bottom_y to what it
12519 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12520 (Bug#11464)
12521
12522 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12523
12524 Fix coding-related core dumps with gcc -ftrapv.
12525 The code was computing A - B, where A and B are pointers, and B is
12526 random garbage. This can lead to core dumps on platforms that
12527 have special pointer registers, and it also leads to core dumps on
12528 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12529 A - B only when B is initialized properly.
12530 * coding.c (coding_set_source, coding_set_destination): Return void.
12531 (coding_change_source, coding_change_destinations): New functions,
12532 with the old behaviors of coding_set_source and coding_set_destination.
12533 All callers that need an offset changed to use these new functions.
12534
12535 2012-05-26 Glenn Morris <rgm@gnu.org>
12536
12537 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12538
12539 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12540
12541 Extend mouse support on W32 text-mode console.
12542 * xdisp.c (draw_row_with_mouse_face):
12543 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
12544
12545 * w32console.c: Include window.h.
12546 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12547 New functions.
12548 (initialize_w32_display): Initialize mouse-highlight data.
12549
12550 * w32inevt.c: Include termchar.h and window.h.
12551 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12552 moves, call note_mouse_highlight. If help_echo changed, call
12553 gen_help_event to produce help-echo message in the echo area.
12554 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12555 highlight info.
12556
12557 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12558
12559 * lread.c (read1): Simplify slightly to avoid an overflow warning
12560 with GCC 4.7.0 on x86-64.
12561
12562 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12563
12564 * bidi.c (bidi_mirror_char): Revert last change: an int is
12565 definitely wide enough here.
12566
12567 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
12568
12569 Fix integer width and related bugs (Bug#9874).
12570 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
12571 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12572 (string_bytes, check_sblock, allocate_string_data):
12573 (compact_small_strings, Fmake_bool_vector, make_string)
12574 (make_unibyte_string, make_multibyte_string)
12575 (make_string_from_bytes, make_specified_string)
12576 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12577 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12578 (mark_vectorlike):
12579 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12580 (allocate_pseudovector):
12581 Use int, not EMACS_INT, where int is wide enough.
12582 (inhibit_garbage_collection, Fgarbage_collect):
12583 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12584 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12585 int might not be wide enough.
12586 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12587 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12588 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12589 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12590 (bidi_level_of_next_char, bidi_move_to_visually_next):
12591 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12592 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12593 (Fkill_buffer, Fset_buffer_major_mode)
12594 (advance_to_char_boundary, Fbuffer_swap_text)
12595 (Fset_buffer_multibyte, overlays_at, overlays_in)
12596 (overlay_touches_p, struct sortvec, record_overlay_string)
12597 (overlay_strings, recenter_overlay_lists)
12598 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12599 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12600 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12601 (Foverlay_recenter, last_overlay_modification_hooks_used)
12602 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12603 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12604 (validate_region): Omit unnecessary test for b <= e,
12605 since that's guaranteed by the previous test.
12606 (adjust_overlays_for_delete): Avoid pos + length overflow.
12607 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12608 (report_overlay_modification):
12609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12610 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12611 Omit pointer cast, which isn't needed anyway, and doesn't work
12612 after the EMACS_INT -> ptrdiff_t change.
12613 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
12614 * buffer.h: Adjust decls to match defn changes elsewhere.
12615 (struct buffer_text, struct buffer):
12616 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12617 Use EMACS_INT, not int, where int might not be wide enough.
12618 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12619 not int, to avoid needless 32-bit limit on 64-bit hosts.
12620 (exec_byte_code): Use tighter memory-full test, one that checks
12621 for alloca overflow. Don't compute the address of the object just
12622 before an array, as that's not portable. Use EMACS_INT, not
12623 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
12624 * callint.c (Fcall_interactively):
12625 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12626 * callproc.c (call_process_kill, Fcall_process):
12627 Don't assume pid_t fits into an Emacs fixnum.
12628 (call_process_cleanup, Fcall_process, child_setup):
12629 Don't assume pid_t fits into int.
12630 (call_process_cleanup, Fcall_process, delete_temp_file)
12631 (Fcall_process_region):
12632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12633 (Fcall_process): Simplify handling of volatile integers.
12634 Use int, not EMACS_INT, where int will do.
12635 * casefiddle.c (casify_object, casify_region, operate_on_word)
12636 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12638 (casify_object): Avoid integer overflow when overallocating buffer.
12639 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
12640 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
12641 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12642 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12643 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12644 integers are now checked earlier. All uses replaced with XINT.
12645 (ccl_driver):
12646 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12647 For CCL_MapSingle, check that content and value are in int range.
12648 (ccl_driver, Fregister_code_conversion_map):
12649 Check that Vcode_version_map_vector is a vector.
12650 (resolve_symbol_ccl_program): Check that vector header is in range.
12651 Always copy the vector, so that we can check its contents reliably
12652 now rather than having to recheck each instruction as it's being
12653 executed. Check that vector words fit in 'int'.
12654 (ccl_get_compiled_code, Fregister_ccl_program)
12655 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12656 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12657 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12658 contents are in range.
12659 (Fccl_execute_on_string): Check that status is in range.
12660 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12661 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12662 Accept and return EMACS_INT, not int, because callers can pass values
12663 out of 'int' range.
12664 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12665 (multibyte_chars_in_text, parse_str_as_multibyte)
12666 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12667 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12668 (string_escape_byte8, Fget_byte):
12669 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12670 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
12671 avoid mishandling large integers.
12672 * character.h: Adjust decls to match defn changes elsewhere.
12673 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12674 (Ffind_charset_region):
12675 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12676 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12677 (load_charset_map_from_vector, Fdefine_charset_internal):
12678 Don't assume fixnum fits in int.
12679 (load_charset_map_from_vector, Fmap_charset_chars):
12680 Remove now-unnecessary CHECK_NATNUMs.
12681 (Fdefine_charset_internal): Check ranges here, more carefully.
12682 Don't rely on undefined behavior with signed left shift overflow.
12683 Don't assume unsigned int fits into fixnum, or that fixnum fits
12684 into unsigned int. Don't require max_code to be a valid fixnum;
12685 that's not true for gb10830 4-byte on a 32-bit host. Allow
12686 invalid_code to be a cons, for the same reason. Require code_offset
12687 to be a character. Avoid int overflow if max_char is close
12688 to INT_MAX.
12689 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12690 this is intended anyway and avoids some undefined behavior.
12691 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12692 INDEX_TO_CODE_POINT, as that's what it expects.
12693 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
12694 * charset.h (DECODE_CHAR): Return int, not unsigned;
12695 this is what was intended anyway, and it avoids undefined behavior.
12696 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12697 integer-overflow issues.
12698 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12699 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12700 where the argument is EMACS_INT, and this behavior is not intended.
12701 * chartab.c (Fmake_char_table, Fset_char_table_range)
12702 (uniprop_get_decoder, uniprop_get_encoder):
12703 Don't assume fixnum fits in int.
12704 * cmds.c (move_point): New function, that does the gist of
12705 Fforward_char and Fbackward_char, but does so while checking
12706 for integer overflow more accurately.
12707 (Fforward_char, Fbackward_char): Use it.
12708 (Fforward_line, Fend_of_line, internal_self_insert)
12709 (internal_self_insert):
12710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12711 Fix a FIXME, by checking for integer overflow when calculating
12712 target_clm and actual_clm.
12713 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
12714 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
12715 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12716 (coding_alloc_by_making_gap, alloc_destination)
12717 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12718 (encode_coding_utf_16, detect_coding_emacs_mule)
12719 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12720 (detect_coding_iso_2022, decode_coding_iso_2022)
12721 (encode_invocation_designation, encode_designation_at_bol)
12722 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12723 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12724 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12725 (encode_coding_ccl, encode_coding_raw_text)
12726 (detect_coding_charset, decode_coding_charset)
12727 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12728 (produce_composition, produce_charset, produce_annotation)
12729 (decode_coding, handle_composition_annotation)
12730 (handle_charset_annotation, consume_chars, decode_coding_gap)
12731 (decode_coding_object, encode_coding_object, detect_coding_system)
12732 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12733 (code_convert_region, code_convert_string)
12734 (Fdefine_coding_system_internal)
12735 (coding_set_source, coding_set_destination):
12736 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12737 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12738 (Fdefine_coding_system_internal):
12739 Don't assume fixnums fit in int.
12740 (decode_coding_gap, decode_coding_object, encode_coding_object)
12741 (Fread_coding_system, Fdetect_coding_region)
12742 (Funencodable_char_position, Fcheck_coding_systems_region)
12743 (get_translation, handle_composition_annotation, consume_chars):
12744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12745 (consume_chars): Rewrite to not calculate an address outside buffer.
12746 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
12747 Don't access memory outside of the args array.
12748 (Fdefine_coding_system_internal): Check for charset-id overflow.
12749 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12750 result of ENCODE_CHAR.
12751 * coding.h: Adjust decls to match defn changes elsewhere.
12752 (struct coding_system):
12753 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12754 * composite.c (get_composition_id, find_composition)
12755 (run_composition_function, update_compositions)
12756 (compose_text, composition_gstring_put_cache)
12757 (composition_gstring_p, composition_gstring_width)
12758 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12759 (composition_compute_stop_pos, composition_reseat_it)
12760 (composition_update_it, struct position_record)
12761 (find_automatic_composition, composition_adjust_point)
12762 (Fcomposition_get_gstring, Ffind_composition_internal):
12763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12764 (update_compositions):
12765 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12766 * composite.h: Adjust decls to match defn changes elsewhere.
12767 (struct composition):
12768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12769 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12770 Do not attempt to compute the address of the object just before a
12771 buffer; this is not portable.
12772 (Faref, Faset):
12773 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12774 (Faset): Use int, not EMACS_INT, where int is wide enough.
12775 (Fstring_to_number): Don't assume fixnums fit in int.
12776 (Frem): Don't assume arg is nonnegative.
12777 * dbusbind.c (xd_append_arg): Check for integers out of range.
12778 (Fdbus_call_method): Don't overflow the timeout int.
12779 (extract_signed, extract_unsigned): New functions.
12780 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12781 (xd_get_connection_references): Return ptrdiff_t, not int.
12782 All uses changed.
12783 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12784 (xd_read_message_1):
12785 Use int, not unsigned, where the dbus API uses int.
12786 (Fdbus_message_internal): Don't overflow mtype.
12787 (syms_of_dbusbind): Allocate right-sized buffer for integers.
12788 * dired.c (directory_files_internal, file_name_completion, scmp)
12789 (file_name_completion_stat):
12790 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12791 (file_name_completion): Don't overflow matchcount.
12792 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12793 * dispextern.h: Adjust decls to match defn changes elsewhere.
12794 (struct text_pos, struct glyph, struct bidi_saved_info)
12795 (struct bidi_string_data, struct bidi_it, struct composition_it)
12796 (struct it):
12797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12798 (struct display_pos, struct composition_it, struct it):
12799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12800 * dispnew.c (increment_matrix_positions)
12801 (increment_row_positions, mode_line_string)
12802 (marginal_area_string):
12803 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12804 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
12805 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12806 (duration_to_sec_usec): New function, to check for overflow better.
12807 (Fsleep_for, sit_for): Use it.
12808 * doc.c (get_doc_string, store_function_docstring):
12809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12810 (get_doc_string, Fsnarf_documentation):
12811 Use int, not EMACS_INT, where int is wide enough.
12812 (get_doc_string):
12813 Use SAFE_ALLOCA, not alloca.
12814 Check for overflow when converting EMACS_INT to off_t.
12815 * doprnt.c (doprnt):
12816 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12817 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12818 Don't assume uid_t fits into fixnum.
12819 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12820 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12821 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12822 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12823 (general_insert_function)
12824 (Finsert_char, make_buffer_string, make_buffer_string_both)
12825 (update_buffer_properties, Fbuffer_substring)
12826 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12827 (Fsubst_char_in_region, check_translation)
12828 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12829 (transpose_markers, Ftranspose_regions):
12830 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12831 (clip_to_bounds): Move to lisp.h as an inline function).
12832 (Fconstrain_to_field): Don't assume integers are nonnegative.
12833 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12834 (Fsubst_char_in_region, Fsave_restriction):
12835 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12836 (Femacs_pid): Don't assume pid_t fits into fixnum.
12837 (lo_time): Use int, not EMACS_INT, when int suffices.
12838 (lisp_time_argument): Check for usec out of range.
12839 (Fencode_time): Don't assume fixnum fits in int.
12840 (Fuser_login_name, Fuser_full_name): Signal an error
12841 if a uid argument is out of range, rather than relying on
12842 undefined behavior.
12843 (Fformat_time_string): Remove now-unnecessary check.
12844 lisp_time_argument checks for out-of-range usec now.
12845 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
12846 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12847 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12848 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12849 (init_cmdargs, Fdump_emacs):
12850 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12851 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12852 the bottom (typically) 32 bits of the fixnum.
12853 * eval.c (specpdl_size, call_debugger):
12854 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12855 (when_entered_debugger, Fbacktrace_debug):
12856 Don't assume fixnum can fit in int.
12857 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12858 the object just before a buffer; this is not portable.
12859 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12860 (grow_specpdl, unbind_to):
12861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12862 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12863 (grow_specpdl): Simplify allocation by using xpalloc.
12864 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
12865 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12866 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12867 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12868 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12869 (a_write, e_write):
12870 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12871 (Fcopy_file, non_regular_nbytes, read_non_regular)
12872 (Finsert_file_contents):
12873 Use int, not EMACS_INT, where int is wide enough.
12874 (READ_BUF_SIZE): Verify that it fits in int.
12875 (Finsert_file_contents): Check that counts are in proper range,
12876 rather than assuming fixnums fit into ptrdiff_t etc.
12877 Don't assume fixnums fit into int.
12878 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
12879 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12880 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
12881 (string_char_to_byte, string_byte_to_char)
12882 (string_make_multibyte, string_to_multibyte)
12883 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12884 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12885 (substring_both, Fdelete, internal_equal, Ffillarray)
12886 (Fclear_string, mapcar1)
12887 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12888 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12889 (larger_vector, make_hash_table, maybe_resize_hash_table)
12890 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12891 (Fmaphash, secure_hash):
12892 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12893 (concat): Check for string index and length overflow.
12894 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12895 (Frequire):
12896 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12897 (larger_vector): New API (vec, incr_min, size_max) replaces old
12898 one (vec, new_size, init). This catches size overflow.
12899 INIT was removed because it was always Qnil.
12900 All callers changed.
12901 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12902 the upper bound on a hash table index size.
12903 (make_hash_table, maybe_resize_hash_table): Use it.
12904 (secure_hash): Computer start_byte and end_byte only after
12905 they're known to be in ptrdiff_t range.
12906 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12907 (Ffont_get_glyphs, Ffont_at):
12908 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12909 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12910 (Flist_fonts, Fopen_font):
12911 Don't assume fixnum can fit in int.
12912 (check_gstring): Don't assume index can fit in int.
12913 (font_match_p): Check that fixnum is a character, not a nonnegative
12914 fixnum, since the later code needs to stuff it into an int.
12915 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12916 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12917 conversion overflow issues.
12918 (Fopen_font): Check for integer out of range.
12919 (Ffont_get_glyphs): Don't assume index can fit in int.
12920 * font.h: Adjust decls to match defn changes elsewhere.
12921 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12922 integer overflow.
12923 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12924 printmax_t, where ptrdiff_t is wide enough.
12925 (Finternal_char_font):
12926 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12927 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12928 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12929 (Fset_frame_position, x_set_frame_parameters)
12930 (x_set_line_spacing, x_set_border_width)
12931 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12932 Check that fixnums are in proper range for system types.
12933 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12934 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12935 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12936 Use SAFE_ALLOCA_LISP, not alloca.
12937 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12938 intptr_t is wide enough.
12939 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12940 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12941 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12942 Check for fixnum out of range.
12943 * ftfont.c (ftfont_list): Don't assume index fits in int.
12944 Check that fixnums are in proper range for system types.
12945 (ftfont_shape_by_flt):
12946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12947 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12949 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12950 Check that fixnums are in proper range for system types.
12951 * gnutls.h: Adjust decls to match defn changes elsewhere.
12952 * gtkutil.c (xg_dialog_run):
12953 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12954 (update_frame_tool_bar):
12955 Check that fixnums are in proper range for system types.
12956 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
12957 (lookup_image): Check that fixnums are in range for system types.
12958 * indent.c (last_known_column, last_known_column_point):
12959 (current_column_bol_cache):
12960 (skip_invisible, current_column, check_display_width):
12961 (check_display_width, scan_for_column, current_column_1)
12962 (Findent_to, Fcurrent_indentation, position_indentation)
12963 (indented_beyond_p, Fmove_to_column, compute_motion):
12964 (Fcompute_motion, Fvertical_motion):
12965 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12966 (last_known_column_modified): Use EMACS_INT, not int.
12967 (check_display_width):
12968 (Fcompute_motion):
12969 Check that fixnums and floats are in proper range for system types.
12970 (compute_motion): Don't assume index or fixnum fits in int.
12971 (compute_motion, Fcompute_motion):
12972 Use int, not EMACS_INT, when it is wide enough.
12973 (vmotion): Omit local var start_hpos that is always 0; that way
12974 we don't need to worry about overflow in expressions involving it.
12975 * indent.h: Adjust decls to match defn changes elsewhere.
12976 (struct position):
12977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12978 Use int, not EMACS_INT, where int is wide enough.
12979 Remove unused members ovstring_chars_done and tab_offset;
12980 all uses removed.
12981 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12982 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12983 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12984 (make_gap, copy_text, insert, insert_and_inherit)
12985 (insert_before_markers, insert_before_markers_and_inherit)
12986 (insert_1, count_combining_before, count_combining_after)
12987 (insert_1_both, insert_from_string)
12988 (insert_from_string_before_markers, insert_from_string_1)
12989 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12990 (adjust_after_replace, adjust_after_insert, replace_range)
12991 (replace_range_2, del_range, del_range_1, del_range_byte)
12992 (del_range_both, del_range_2, modify_region)
12993 (prepare_to_modify_buffer, signal_before_change)
12994 (signal_after_change, Fcombine_after_change_execute):
12995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12996 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12997 (balance_an_interval, split_interval_right, split_interval_left)
12998 (find_interval, next_interval, update_interval)
12999 (adjust_intervals_for_insertion, delete_node, delete_interval)
13000 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13001 (static_offset_intervals, offset_intervals)
13002 (merge_interval_right, merge_interval_left, make_new_interval)
13003 (graft_intervals_into_buffer, temp_set_point_both)
13004 (temp_set_point, set_point, adjust_for_invis_intang)
13005 (set_point_both, move_if_not_intangible, get_property_and_range)
13006 (get_local_map, copy_intervals, copy_intervals_to_string)
13007 (compare_string_intervals, set_intervals_multibyte_1):
13008 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13009 * intervals.h: Adjust decls to match defn changes elsewhere.
13010 (struct interval):
13011 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13012 * keyboard.c (this_command_key_count, this_single_command_key_start)
13013 (before_command_key_count, before_command_echo_length, echo_now)
13014 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13015 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13016 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13017 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13018 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13019 (last_non_minibuf_size, last_point_position, echo_truncate)
13020 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13021 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13022 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13023 (stuff_buffered_input):
13024 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13025 (last_auto_save, command_loop_1, read_char):
13026 Use EMACS_INT, not int, to avoid integer overflow.
13027 (record_char): Avoid overflow in total_keys computation.
13028 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13029 * keyboard.h: Adjust decls to match defn changes elsewhere.
13030 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13031 (Fkey_description, Fdescribe_vector, Flookup_key):
13032 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13033 (click_position): New function, to check that positions are in range.
13034 (Fcurrent_active_maps):
13035 (describe_command):
13036 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13037 (Faccessible_keymaps, Fkey_description):
13038 (preferred_sequence_p):
13039 Don't assume fixnum can fit into int.
13040 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13041 Check for integer overflow in size calculations.
13042 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13043 avoid mishandling large integers.
13044 * lisp.h: Adjust decls to match defn changes elsewhere.
13045 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13046 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13047 (struct Lisp_Marker):
13048 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13049 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13050 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13051 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13052 All callers changed.
13053 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13054 Assume the arg has valid form, since it always does.
13055 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13056 unsigned integer system type.
13057 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13058 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13059 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13060 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13061 (duration_to_sec_usec): New decl.
13062 * lread.c (read_from_string_index, read_from_string_index_byte)
13063 (read_from_string_limit, readchar, unreadchar, openp)
13064 (read_internal_start, read1, oblookup):
13065 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13066 (Fload, readevalloop, Feval_buffer, Feval_region):
13067 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13068 (openp): Check for out-of-range argument to 'access'.
13069 (read1): Use int, not EMACS_INT, where int is wide enough.
13070 Don't assume fixnum fits into int.
13071 Fix off-by-one error that can read outside a buffer.
13072 (read_filtered_event): Use duration_to_sec_usec
13073 to do proper overflow checking on durations.
13074 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13075 in size calculation.
13076 (Fexecute_kbd_macro):
13077 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13078 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13079 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13080 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13081 (set_marker_both, set_marker_restricted_both, marker_position)
13082 (marker_byte_position, Fbuffer_has_markers_at):
13083 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13084 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13085 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13086 It now merely ensures that the menu is large enough, without
13087 necessarily growing it, as this avoids some integer overflow issues.
13088 All callers changed.
13089 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13090 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13091 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13092 Use SAFE_ALLOCA_LISP, not alloca.
13093 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13094 to EMACS_INT. Check that fixnums are in proper range for system types.
13095 * minibuf.c (minibuf_prompt_width, string_to_object)
13096 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13097 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13098 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13099 (get_minibuffer, read_minibuf_unwind):
13100 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13101 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13102 this simplifies overflow checking. All callers changed.
13103 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13104 (Ftest_completion):
13105 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13106 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13107 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13108 Check that fixnums are in proper range for system types.
13109 (Fx_create_frame, Fx_show_tip):
13110 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13111 * nsfont.m (ns_findfonts, nsfont_list_family):
13112 Don't assume fixnum fits in long.
13113 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13114 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13115 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13116 wide enough.
13117 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13118 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13119 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13120 (PRINTDECLARE, PRINTPREPARE):
13121 (strout, print_string):
13122 (print, print_preprocess, print_check_string_charset_prop)
13123 (print_object):
13124 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13125 (PRINTDECLARE):
13126 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13127 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13128 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13129 (printchar, strout): Use xpalloc to catch size calculation overflow.
13130 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13131 (print_error_message): Use SAFE_ALLOCA, not alloca.
13132 (print_object): Use int, not EMACS_INT, where int is wide enough.
13133 (print_depth, new_backquote_output, print_number_index):
13134 Use ptrdiff_t, not int, where int might not be wide enough.
13135 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13136 (Fset_process_window_size, Fformat_network_address)
13137 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13138 (sigchld_handler):
13139 Check that fixnums are in proper range for system types.
13140 (Fsignal_process): Simplify by avoiding a goto.
13141 Check for process-ids out of pid_t range rather than relying on
13142 undefined behavior.
13143 (process_tick, update_tick): Use EMACS_INT, not int.
13144 (Fformat_network_address, read_process_output, send_process)
13145 (Fprocess_send_region, status_notify):
13146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13147 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13148 (wait_reading_process_output, read_process_output, exec_sentinel):
13149 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13150 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13151 (Faccept_process_output): Use duration_to_sec_usec to do proper
13152 overflow checking on durations.
13153 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13154 Don't assume pid_t fits in int.
13155 * process.h (struct Lisp_Process): Members tick and update_tick
13156 are now of type EMACS_INT, not int.
13157 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13158 configured --with-wide-int.
13159 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13160 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13161 * search.c (looking_at_1, string_match_1):
13162 (fast_string_match, fast_c_string_match_ignore_case)
13163 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13164 (scan_newline, find_before_next_newline, search_command)
13165 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13166 (set_search_regs, wordify):
13167 (Freplace_match):
13168 (Fmatch_data):
13169 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13170 (string_match_1, search_buffer, set_search_regs):
13171 (Fmatch_data):
13172 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13173 (wordify): Check for overflow in size calculation.
13174 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13175 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13176 Check that fixnums are in proper range for system types.
13177 * sound.c (struct sound_device)
13178 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13180 (Fplay_sound_internal):
13181 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13182 * syntax.c (struct lisp_parse_state, find_start_modiff)
13183 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13184 (Fparse_partial_sexp):
13185 Don't assume fixnums can fit in int.
13186 (struct lisp_parse_state, find_start_pos, find_start_value)
13187 (find_start_value_byte, find_start_begv)
13188 (update_syntax_table, char_quoted, dec_bytepos)
13189 (find_defun_start, prev_char_comend_first, back_comment):
13190 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13191 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13193 (Finternal_describe_syntax_value): Check that match_lisp is a
13194 character, not an integer, since the code stuffs it into int.
13195 (scan_words, scan_sexps_forward):
13196 Check that fixnums are in proper range for system types.
13197 (Fforward_word):
13198 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13199 (scan_sexps_forward):
13200 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13201 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13202 * syntax.h: Adjust decls to match defn changes elsewhere.
13203 (struct gl_state_s):
13204 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13205 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13206 MOST_POSITIVE_FIXNUM.
13207 * sysdep.c (wait_for_termination_1, wait_for_termination)
13208 (interruptible_wait_for_termination, mkdir):
13209 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13210 (emacs_read, emacs_write):
13211 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13212 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13213 and double all fit in int.
13214 * term.c (set_tty_color_mode):
13215 Check that fixnums are in proper range for system types.
13216 * termhooks.h (struct input_event):
13217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13218 * textprop.c (validate_interval_range, interval_of)
13219 (Fadd_text_properties, set_text_properties_1)
13220 (Fremove_text_properties, Fremove_list_of_text_properties)
13221 (Ftext_property_any, Ftext_property_not_all)
13222 (copy_text_properties, text_property_list, extend_property_ranges)
13223 (verify_interval_modification):
13224 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13225 (Fnext_single_char_property_change)
13226 (Fprevious_single_char_property_change):
13227 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13228 (copy_text_properties):
13229 Check for integer overflow in index calculation.
13230 * undo.c (last_boundary_position, record_point, record_insert)
13231 (record_delete, record_marker_adjustment, record_change)
13232 (record_property_change):
13233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13234 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13235 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13236 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13237 (Fx_hide_tip, Fx_file_dialog):
13238 * w32menu.c (set_frame_menubar):
13239 Use ptrdiff_t, not int, for consistency with rest of code.
13240 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13241 (select_window, Fdelete_other_windows_internal)
13242 (window_scroll_pixel_based, window_scroll_line_based)
13243 (Frecenter, Fset_window_configuration):
13244 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13245 (Fset_window_hscroll, run_window_configuration_change_hook)
13246 (set_window_buffer, temp_output_buffer_show, scroll_command)
13247 (Fscroll_other_window, Frecenter):
13248 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13249 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13250 Don't assume fixnum fits in int.
13251 (Fset_window_scroll_bars):
13252 Check that fixnums are in proper range for system types.
13253 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13254 (string_pos, c_string_pos, number_of_chars, init_iterator)
13255 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13256 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13257 (compute_display_string_end, handle_face_prop)
13258 (face_before_or_after_it_pos, handle_invisible_prop)
13259 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13260 (display_prop_intangible_p, string_buffer_position_lim)
13261 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13262 (get_overlay_strings_1, get_overlay_strings)
13263 (iterate_out_of_display_property, forward_to_next_line_start)
13264 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13265 (get_next_display_element, set_iterator_to_next)
13266 (get_visually_first_element, compute_stop_pos_backwards)
13267 (handle_stop_backwards, next_element_from_buffer)
13268 (move_it_in_display_line_to, move_it_in_display_line)
13269 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13270 (add_to_log, message_dolog, message_log_check_duplicate)
13271 (message2, message2_nolog, message3, message3_nolog
13272 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13273 (current_message_1, truncate_echo_area, truncate_message_1)
13274 (set_message, set_message_1, store_mode_line_noprop)
13275 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13276 (text_outside_line_unchanged_p, check_point_in_composition)
13277 (reconsider_clip_changes)
13278 (redisplay_internal, set_cursor_from_row, try_scrolling)
13279 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13280 (redisplay_window, find_last_unchanged_at_beg_row)
13281 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13282 (trailing_whitespace_p, find_row_edges, display_line)
13283 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13284 (display_mode_element, store_mode_line_string)
13285 (pint2str, pint2hrstr, decode_mode_spec)
13286 (display_count_lines, display_string, draw_glyphs)
13287 (x_produce_glyphs, x_insert_glyphs)
13288 (rows_from_pos_range, mouse_face_from_buffer_pos)
13289 (fast_find_string_pos, mouse_face_from_string_pos)
13290 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13291 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13292 (safe_call, init_from_display_pos, handle_fontified_prop)
13293 (handle_single_display_spec, load_overlay_strings)
13294 (with_echo_area_buffer, setup_echo_area_for_printing)
13295 (display_echo_area, echo_area_display)
13296 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13297 (update_tool_bar, hscroll_window_tree, redisplay_internal)
13298 (redisplay_window, dump_glyph_row, display_mode_line)
13299 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
13300 (handle_display_spec, display_prop_string_p):
13301 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13302 (handle_single_display_spec, build_desired_tool_bar_string)
13303 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13304 (get_specified_cursor_type):
13305 Check that fixnums are in proper range for system types.
13306 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13307 (Flookup_image_map):
13308 Don't assume fixnums fit in int.
13309 (compare_overlay_entries):
13310 Avoid mishandling comparisons due to subtraction overflow.
13311 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13312 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13313 (handle_tool_bar_click):
13314 Use int, not unsigned, since we prefer signed and the signedness
13315 doesn't matter here.
13316 (get_next_display_element, next_element_from_display_vector):
13317 Use int, not EMACS_INT, when int is wide enough.
13318 (start_hourglass): Use duration_to_sec_usec to do proper
13319 overflow checking on durations.
13320 * xfaces.c (Fbitmap_spec_p):
13321 Check that fixnums are in proper range for system types.
13322 (compare_fonts_by_sort_order):
13323 Avoid mishandling comparisons due to subtraction overflow.
13324 (Fx_family_fonts, realize_basic_faces):
13325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13326 (Fx_family_fonts):
13327 Don't assume fixnum fits in int.
13328 Use SAFE_ALLOCA_LISP, not alloca.
13329 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13330 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13331 (face_at_buffer_position, face_for_overlay_string)
13332 (face_at_string_position):
13333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13334 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13335 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13336 (Fx_show_tip):
13337 Check that fixnums are in proper range for system types.
13338 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13339 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13340 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13341 (Fx_change_window_property): Don't assume fixnums fit in int.
13342 * xfont.c (xfont_chars_supported):
13343 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13344 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13345 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13346 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13347 * xml.c (parse_region):
13348 * xrdb.c (magic_file_p):
13349 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13350 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13351 (x_get_local_selection, x_reply_selection_request)
13352 (x_handle_selection_request, wait_for_property_change):
13353 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13354 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13355 short is wide enough.
13356 (x_send_client_event): Don't assume fixnum fits in int.
13357 * xterm.c (x_x_to_emacs_modifiers):
13358 Don't assume EMACS_INT overflows nicely into int.
13359 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13360 may come from Lisp.
13361 (handle_one_xevent): NATNUMP can eval its arg twice.
13362 (x_connection_closed):
13363 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13364 * xterm.h: Adjust decls to match defn changes elsewhere.
13365 (struct scroll_bar): Use struct vectorlike_header
13366 rather than rolling our own approximation.
13367 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13368
13369 2012-05-25 Glenn Morris <rgm@gnu.org>
13370
13371 * lisp.mk (lisp): Update for more files being compiled now.
13372
13373 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13374
13375 * lread.c: Remove `read_pure' which makes no difference.
13376 (read_pure): Remove var.
13377 (unreadpure): Remove function.
13378 (readevalloop): Don't call read_list with -1 flag.
13379 (read1, read_vector): Don't test read_pure any more.
13380 (read_list): Simplify.
13381
13382 * fileio.c, character.h: Minor style tweaks.
13383
13384 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13385
13386 * window.h (clip_changed): Remove useless declaration.
13387
13388 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
13389
13390 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13391 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13392
13393 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13394
13395 Remove src/m/*.
13396 This directory predates autoconf and is no longer needed nowadays.
13397 Move its few remaining bits of functionality to where they're needed.
13398 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13399 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13400 * m/template.h: Remove.
13401 * Makefile.in (M_FILE): Remove. All uses removed.
13402 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13403 * lisp.h (USE_LSB_TAG):
13404 * mem-limits.h (EXCEEDS_LISP_PTR):
13405 Use VAL_MAX, not VALBITS, in #if.
13406 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13407 (EMACS_UINT): Define unconditionally now.
13408 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13409 (BITS_PER_EMACS_INT): New constants, replacing
13410 what used to be in config.h, but not useful in #if.
13411 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13412 define them any more.
13413 (VAL_MAX): New macro.
13414 (VALMASK): Use it.
13415 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13416 BITS_PER_EMACS_INT, in #if.
13417 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13418 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13419 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13420 * s/ms-w32.h (DATA_START):
13421 Move here from removed file m/intel386.h.
13422 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13423 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13424
13425 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13426
13427 Assume C89 or later.
13428 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13429 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13430 (xrealloc):
13431 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13432 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13433 * textprop.c, tparam.c (NULL): Remove.
13434 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13435 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13436 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13437 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13438 * xterm.c (input_signal_count): Assume volatile works.
13439
13440 2012-05-21 Ken Brown <kbrown@cornell.edu>
13441
13442 * xgselect.c (xg_select): Fix first argument in call to 'select'
13443 (bug#11508).
13444
13445 2012-05-20 Ken Brown <kbrown@cornell.edu>
13446
13447 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
13448 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
13449
13450 2012-05-19 Ken Brown <kbrown@cornell.edu>
13451
13452 * xfns.c (x_in_use): Remove `static' qualifier.
13453 * xterm.h (x_in_use): Declare.
13454 * xgselect.c: Include xterm.h.
13455 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13456 and `display_arg' (bug#9754).
13457
13458 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13459
13460 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13461
13462 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13463 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13464
13465 2012-05-18 Eli Zaretskii <eliz@gnu.org>
13466
13467 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13468
13469 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
13470 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
13471
13472 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13473 reference to image_cache->refcount.
13474 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13475
13476 2012-05-17 Juri Linkov <juri@jurta.org>
13477
13478 * search.c (Fword_search_regexp, Fword_search_backward)
13479 (Fword_search_forward, Fword_search_backward_lax)
13480 (Fword_search_forward_lax): Move functions to isearch.el
13481 (bug#10145, bug#11381).
13482
13483 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13484
13485 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13486
13487 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13488
13489 * lread.c (init_obarray): Declare Qt and Qnil as special.
13490
13491 2012-05-14 Glenn Morris <rgm@gnu.org>
13492
13493 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
13494 Put "libexec" before "bin", for the sake of init_callproc_1.
13495
13496 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13497
13498 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13499
13500 * unexaix.c: Port to more-recent AIX compilers.
13501 (report_error, report_error_1, make_hdr, copy_sym)
13502 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13503 Make arguments const char *, not char *, to avoid violations of C
13504 standard and to fix some AIX warnings reported by Gilles Pion.
13505
13506 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13507
13508 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13509 already have overlays loaded.
13510 (handle_single_display_spec): Before returning without displaying
13511 fringe bitmap, synchronize the bidi iterator with the main display
13512 iterator, by calling iterate_out_of_display_property.
13513 (iterate_out_of_display_property): Detect buffer iteration by
13514 testing that it->string is a Lisp string.
13515 (get_next_display_element): When the current object is exhausted,
13516 and there's something on it->stack, call set_iterator_to_next to
13517 proceed with what's on the stack, instead of returning zero.
13518 (set_iterator_to_next): If called at the end of a Lisp string,
13519 proceed to consider_string_end without incrementing string
13520 position. Don't increment display vector index past the end of
13521 the display vector. (Bug#11417)
13522 (pos_visible_p): Don't report a position visible when move_it_to
13523 stopped at the last line of window, which happens to be scanned
13524 backwards by the bidi iteration. (Bug#11464)
13525
13526 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13527
13528 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13529 and right-margin display specs even if the spec is invalid or we
13530 are on a TTY, and thus unable to display on the fringes.
13531 That's because the text with the property will not be displayed anyway,
13532 so we need to signal to the caller that this is a "replacing"
13533 display spec. This fixes display when the spec is invalid or we
13534 are on a TTY.
13535
13536 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13537
13538 * unexaix.c (make_hdr): Fix typo in prototype.
13539 This bug broke the build on AIX. Problem reported by Gilles Pion.
13540
13541 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
13542
13543 * keyboard.c (kbd_buffer_get_event): Read special events also in
13544 batch mode. (Bug#11415)
13545
13546 2012-05-12 Glenn Morris <rgm@gnu.org>
13547
13548 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13549
13550 2012-05-12 Eli Zaretskii <eliz@gnu.org>
13551
13552 * lisp.mk (lisp): Add newcomment.elc.
13553
13554 2012-05-12 Glenn Morris <rgm@gnu.org>
13555
13556 * Makefile.in (MKDIR_P): New, set by configure.
13557 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13558
13559 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13560
13561 Remove unused function hourglass_started.
13562 * dispextern.h (hourglass_started):
13563 * w32fns.c (hourglass_started):
13564 * xdisp.c (hourglass_started): Remove.
13565
13566 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
13567
13568 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13569 Update dependencies.
13570
13571 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13572
13573 * xgselect.c (xg_select): Put maxfds+1 into a var.
13574 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13575
13576 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13577
13578 2012-05-10 Dave Abrahams <dave@boostpro.com>
13579
13580 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13581 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13582
13583 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
13584
13585 * dbusbind.c (xd_registered_buses): New internal Lisp object.
13586 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
13587 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13588 Initialize xd_registered_buses.
13589
13590 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13591
13592 Untag more efficiently if USE_LSB_TAG.
13593 This is based on a proposal by YAMAMOTO Mitsuharu in
13594 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13595 For an admittedly artificial (nth 8000 longlist) benchmark on
13596 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13597 Emacs's overall text size by 1%.
13598 * lisp.h (XUNTAG): New macro.
13599 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13600 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13601 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13602 * eval.c (Fautoload):
13603 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13604 * frame.h (XFRAME): Use XUNTAG.
13605
13606 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13607 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13608 Remove unportable assumptions about print widths of types like
13609 dbus_uint32_t.
13610 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13611 intptr_t when converting between pointer and integer, to avoid GCC
13612 warnings about wrong width.
13613
13614 2012-05-09 Eli Zaretskii <eliz@gnu.org>
13615
13616 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13617 stack for each reader_thread, instead of defaulting to 8MB
13618 determined by the linker. This avoids failures in creating
13619 subprocesses on Windows 7, see the discussion in this thread:
13620 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13621
13622 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13623
13624 Fix up display of the *Minibuf-0* buffer in the mini window.
13625 * keyboard.c (read_char): Don't clear the echo area if there's no
13626 message to clear.
13627 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
13628 contents of *Minibuf-0*) if there's no message displayed in its stead.
13629
13630 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
13631
13632 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13633 batch mode.
13634
13635 2012-05-06 Chong Yidong <cyd@gnu.org>
13636
13637 * lisp.mk (lisp): Update.
13638
13639 2012-05-05 Jim Meyering <meyering@redhat.com>
13640
13641 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13642
13643 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13644
13645 * data.c (PUT_ERROR): New macro.
13646 (syms_of_data): Use it. Add new error type `user-error'.
13647 * undo.c (user_error): New function.
13648 (Fprimitive_undo): Use it.
13649 * print.c (print_error_message): Adjust print style for `user-error'.
13650 * keyboard.c (user_error): New function.
13651 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13652
13653 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13654
13655 Do not limit current-time-string to years 1000..9999.
13656 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13657 (Fcurrent_time_string): Support any year that is supported by the
13658 underlying localtime representation. Don't use asctime, as it
13659 has undefined behavior for years outside the range -999..9999.
13660
13661 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13662
13663 Fix race conditions involving setenv, gmtime, localtime, asctime.
13664 Without this fix, interrupts could mess up code that uses these
13665 nonreentrant functions, since setting TZ invalidates existing
13666 tm_zone or tzname values, and since most of these functions return
13667 pointers to static storage.
13668 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13669 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13670 Grow the critical sections to include not just invoking
13671 localtime/gmtime, but also accessing these functions' results
13672 including their tm_zone values if any, and any related TZ setting.
13673 (format_time_string): Last arg is now struct tm *, not struct tm **,
13674 so that the struct tm is saved in the critical section.
13675 All callers changed. Simplify allocation of initial buffer, partly
13676 motivated by the fact that memory allocation needs to be outside
13677 the critical section.
13678
13679 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13680
13681 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13682 with RESET_INTERVAL.
13683
13684 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13685 Remove duplicated buffer name initialization.
13686
13687 2012-05-02 Jim Meyering <jim@meyering.net>
13688
13689 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13690
13691 * xfns.c (x_window): Use xstrdup (Bug#11375).
13692
13693 2012-05-02 Eli Zaretskii <eliz@gnu.org>
13694
13695 * xdisp.c (pos_visible_p): If already at a newline from the
13696 display string before the 'while' loop, don't walk back the glyphs
13697 from it3.glyph_row. Solves assertion violation when the display
13698 string begins with a newline (egg.el). (Bug#11367)
13699
13700 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13701
13702 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13703 Move to simple.el.
13704
13705 2012-05-01 Glenn Morris <rgm@gnu.org>
13706
13707 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13708 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13709 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13710 All were removed before 23.1.
13711
13712 * dispnew.c: Remove HAVE_LIBNCURSES test;
13713 it is always true on relevant platforms.
13714
13715 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13716 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13717
13718 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13719
13720 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13721
13722 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13723 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13724 Remove.
13725
13726 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13727
13728 Do not avoid creating empty evaporating overlays (Bug#9642).
13729 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13730 That is, do not delete an evaporating overlay if it becomes
13731 empty after its bounds are adjusted to fit within its buffer.
13732 This fix caused other problems, and I'm reverting it until we get
13733 to the bottom of them.
13734
13735 2012-04-27 Chong Yidong <cyd@gnu.org>
13736
13737 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13738
13739 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13740
13741 * xdisp.c (pos_visible_p): If the window start position is beyond
13742 ZV, start the display from buffer beginning. Prevents assertion
13743 violation in init_iterator when the minibuffer window is scrolled
13744 via the scroll bar.
13745
13746 * window.c (window_scroll_pixel_based): Likewise.
13747
13748 2012-04-27 Chong Yidong <cyd@gnu.org>
13749
13750 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13751
13752 2012-04-27 Glenn Morris <rgm@gnu.org>
13753
13754 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13755 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13756
13757 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13758
13759 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13760 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
13761
13762 2012-04-26 Eli Zaretskii <eliz@gnu.org>
13763
13764 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13765 display element, check also the underlying string or buffer
13766 character. (Bug#11341)
13767
13768 * w32menu.c: Include w32heap.h.
13769 (add_menu_item): If the call to AppendMenuW (via
13770 unicode_append_menu) fails, disable Unicode menus only if we are
13771 running on Windows 9X/Me.
13772
13773 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13774
13775 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13776 (xgetint): Add missing shift for LSB tags.
13777
13778 2012-04-24 Martin Rudalics <rudalics@gmx.at>
13779
13780 * keyboard.c (read_char): Don't wipe echo area for select window
13781 events: These might get delayed via `mouse-autoselect-window'
13782 (Bug#11304).
13783
13784 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
13785
13786 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13787 manipulation of :loaded-from data.
13788
13789 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
13790
13791 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13792 now a cons (bug#11311).
13793
13794 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13795
13796 Do not create empty overlays with the evaporate property (Bug#9642).
13797 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13798 if it becomes empty after its bounds are adjusted to fit within
13799 its buffer. Without this fix, in a nonempty buffer (let ((o
13800 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13801 yields an empty overlay that has the evaporate property, which is
13802 not supposed to happen.
13803
13804 Fix minor GTK3 problems found by static checking.
13805 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13806 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13807 (struct _EmacsFixedClass, emacs_fixed_get_type):
13808 Move decls here from emacsgtkfixed.h, since they needn't be public.
13809 (emacs_fixed_get_type): Now static.
13810 (emacs_fixed_class_init): Omit unused local.
13811 (emacs_fixed_child_type): Remove; unused.
13812 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13813 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13814 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13815 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13816 (EMACS_FIXED_GET_CLASS): Remove; unused.
13817 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13818
13819 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13820 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13821
13822 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13823
13824 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
13825 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
13826 (__malloc_size_t, __malloc_ptrdiff_t):
13827 Remove. All uses removed, replaced by the definiens if needed,
13828 since we can assume C89 or better now.
13829 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13830 (protect_malloc_state, align, get_contiguous_space)
13831 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13832 (malloc_atfork_handler_child, malloc_enable_thread)
13833 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13834 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13835 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13836 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13837 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13838 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13839 Define using prototypes, not old style.
13840 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13841 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13842 (align): Don't assume that signed integer overflow wraps around.
13843 Omit unused local var.
13844 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13845 (_free_internal_nolock, memalign, mallochook, reallochook):
13846 Omit no-longer-needed casts.
13847 (valloc): Use getpagesize, not __getpagesize.
13848 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13849 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13850
13851 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13852
13853 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
13854
13855 Move functions from C to Lisp. Make non-blocking method calls
13856 the default. Implement further D-Bus standard interfaces.
13857
13858 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13859 (QCdbus_request_name_allow_replacement)
13860 (QCdbus_request_name_replace_existing)
13861 (QCdbus_request_name_do_not_queue)
13862 (QCdbus_request_name_reply_primary_owner)
13863 (QCdbus_request_name_reply_in_queue)
13864 (QCdbus_request_name_reply_exists)
13865 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13866 (QCdbus_registered_serial, QCdbus_registered_method)
13867 (QCdbus_registered_signal): New Lisp objects.
13868 (XD_DEBUG_MESSAGE): Use sizeof.
13869 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13870 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13871 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13872 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13873 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13874 (xd_signature, xd_append_arg): Allow float for integer types.
13875 (xd_get_connection_references): New function.
13876 (xd_get_connection_address): Rename from xd_initialize.
13877 Return cached address.
13878 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13879 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13880 level.
13881 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
13882 Return number of refcounts.
13883 (Fdbus_get_unique_name): Make stronger parameter check.
13884 (Fdbus_message_internal): New defun.
13885 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13886 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13887 (Fdbus_send_signal, Fdbus_register_service)
13888 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13889 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13890 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13891 (Vdbus_compiled_version, Vdbus_runtime_version)
13892 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13893 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13894 (Vdbus_message_type_signal): New defvars.
13895 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13896 Adapt docstring.
13897
13898 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13899
13900 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13901 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13902 Do not assume ptrdiff_t is the same width as 'int'.
13903
13904 * alloc.c: Handle unusual debugging option combinations.
13905 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13906 since the two debugging options are incompatible.
13907 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13908 is defined.
13909 (mem_init, mem_insert, mem_insert_fixup):
13910 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13911 (NEED_MEM_INSERT): Remove; no longer needed.
13912
13913 2012-04-22 Leo Liu <sdl.web@gmail.com>
13914
13915 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13916
13917 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13918
13919 * sysdep.c [__FreeBSD__]: Minor cleanups.
13920 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13921 Use Emacs indenting style more consistently. Avoid some casts.
13922 Use 'double' consistently rather than mixing 'float' and 'double'.
13923
13924 2012-04-21 Eduard Wiebe <usenet@pusto.de>
13925
13926 * sysdep.c (list_system_processes, system_process_attributes):
13927 Add implementation for FreeBSD (Bug#5243).
13928
13929 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13930
13931 * lisp.mk (lisp): Update.
13932
13933 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13934
13935 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13936 It is never used otherwise.
13937
13938 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13939
13940 * print.c (print_preprocess): Only check print_depth if print-circle
13941 is nil.
13942 (print_object): Check for cycles even when print-circle is nil and
13943 print-gensym is t, but only check print_depth if print-circle is nil.
13944
13945 2012-04-20 Chong Yidong <cyd@gnu.org>
13946
13947 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13948 set the status to "failed" and ensure that sentinel is run.
13949
13950 2012-04-20 Glenn Morris <rgm@gnu.org>
13951
13952 * process.c (Fset_process_inherit_coding_system_flag)
13953 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
13954 (Fmake_network_process, Fmake_serial_process): Doc fix.
13955
13956 2012-04-20 Eli Zaretskii <eliz@gnu.org>
13957
13958 * xdisp.c (string_buffer_position_lim): Limit starting position to
13959 BEGV.
13960 (set_cursor_from_row): If called for a mode-line or header-line
13961 row, return zero immediately.
13962 (try_cursor_movement): If inside continuation line, don't back up
13963 farther than the first row after the header line, if any.
13964 Don't consider the header-line row as "partially visible", even if
13965 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13966
13967 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13968
13969 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13970 (bug#11238).
13971
13972 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
13973 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
13974
13975 configure: new option --enable-gcc-warnings (Bug#11207)
13976 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13977 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13978 (ALL_CFLAGS): Use new macros rather than old.
13979 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13980 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13981 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13982 -Wunused-result, -Wunused-variable. This should go away once
13983 the Emacs and Gnulib regex code is merged.
13984 (xmalloc, xrealloc): Now static.
13985
13986 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13987
13988 * dired.c (Fsystem_groups): Remove unused local.
13989
13990 2012-04-17 Glenn Morris <rgm@gnu.org>
13991
13992 * dired.c (Fsystem_users): Doc fix.
13993
13994 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13995
13996 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13997 (syms_of_dired): Add them.
13998
13999 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14000
14001 Fix minor alloc.c problems found by static checking.
14002 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14003 New extern decls, to avoid calling undeclared functions.
14004 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14005 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14006 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14007 (NEED_MEM_INSERT): New macro.
14008 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14009 Remove one incorrect comment and fix another.
14010
14011 Fix minor ralloc.c problems found by static checking.
14012 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14013 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14014 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14015 (r_alloc_sbrk): Now static.
14016
14017 Improve ralloc.c interface checking.
14018 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14019 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14020 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14021 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14022 [REL_ALLOC]: ... to here, to check interface.
14023 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14024 Remove decls. This fixes an "It stinks!".
14025
14026 * alloc.c (which_symbols): Fix alignment issue / type clash.
14027
14028 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14029
14030 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14031 (struct Lisp_Misc_Any): Likewise.
14032 (struct Lisp_Free): Likewise.
14033 * alloc.c (union aligned_Lisp_Symbol): Define.
14034 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14035 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14036 (union aligned_Lisp_Misc): Define.
14037 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14038 aligned_Lisp_Misc instead of union Lisp_Misc.
14039 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14040
14041 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14042
14043 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14044 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14045 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14046 * s/netbsd.h, s/sol2-6.h:
14047 Remove definition of GC_MARK_STACK, since the default now works.
14048 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14049 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14050 no longer the default.
14051 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14052
14053 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14054
14055 * lread.c (lisp_file_lexically_bound_p):
14056 Fix hang at ";-*-\n" (bug#11238).
14057
14058 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14059
14060 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14061 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14062
14063 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14064
14065 * nsterm.m (constrainFrameRect): Always constrain when there is only
14066 one screen (Bug#10962).
14067
14068 2012-04-13 Ken Brown <kbrown@cornell.edu>
14069
14070 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14071
14072 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14073
14074 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14075
14076 2012-04-11 Daniel Colascione <dancol@dancol.org>
14077
14078 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14079 against is gone. It's better to use vfork now so that when Cygwin
14080 gains a new, working vfork, we use it automatically (bug#10398).
14081
14082 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14083
14084 * window.c (save_window_save): Obey window-point-insertion-type.
14085
14086 2012-04-11 Glenn Morris <rgm@gnu.org>
14087
14088 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14089
14090 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14091
14092 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14093
14094 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14095
14096 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14097 (force_quit_count): New var.
14098 (handle_interrupt): Use it.
14099
14100 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14101
14102 * w32.c (w32_delayed_load): Record the full path of the library
14103 being loaded (bug#10424).
14104
14105 2012-04-09 Glenn Morris <rgm@gnu.org>
14106
14107 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14108 not just in the obarray, before snarfing them. (Bug#11036)
14109
14110 * Makefile.in ($(leimdir)/leim-list.el):
14111 Pass EMACS rather than BUILT_EMACS.
14112
14113 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14114
14115 * process.c (make_process):
14116 * process.h: Add integer `gnutls_handshakes_tried' member to
14117 process struct.
14118
14119 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14120 Add convenience `GNUTLS_LOG2i' macro.
14121
14122 * gnutls.c (gnutls_log_function2i): Convenience log function.
14123 (emacs_gnutls_read): Use new log functions,
14124 `gnutls_handshakes_tried' process member, and
14125 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14126 attempts per process (connection).
14127
14128 2012-04-09 Chong Yidong <cyd@gnu.org>
14129
14130 * eval.c (Fuser_variable_p, user_variable_p_eh)
14131 (lisp_indirect_variable): Functions deleted.
14132 (Fdefvar): Caller changed.
14133
14134 * callint.c (Finteractive, Fcall_interactively):
14135 * minibuf.c (Fread_variable): Callers changed.
14136
14137 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14138
14139 * xdisp.c (set_cursor_from_row): If the display string appears in
14140 the buffer at position that is closer to point than the position
14141 after the display string, display the cursor on the first glyph of
14142 the display string. Fixes cursor display when a 'display' text
14143 property immediately follows invisible text. (Bug#11094)
14144
14145 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14146
14147 composite.c: use 'double' consistently
14148 * composite.c (get_composition_id): Use 'double' consistently
14149 instead of converting 'float' to 'double' and vice versa; this is
14150 easier to understand and avoids a GCC warning.
14151
14152 2012-04-09 Glenn Morris <rgm@gnu.org>
14153
14154 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14155 preparation for dumping it with emacs. (Bug#4789)
14156 (leimdir): New variable.
14157 ($(leimdir)/leim-list.el): New rule.
14158 (emacs$(EXEEXT)): Depend on leim-list.el.
14159
14160 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14161 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14162 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14163
14164 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14165
14166 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14167 proper alignment.
14168
14169 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14170
14171 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14172 Remove unused local variable.
14173
14174 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14175
14176 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14177 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14178 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14179 objects, as mark_maybe_pointer will catch them otherwise.
14180 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14181 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14182
14183 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14184
14185 Fix typo that broke non-Windows builds.
14186 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14187
14188 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14189
14190 Support building on MS-Windows with libxml2.
14191
14192 * makefile.w32-in (OBJ2): Add xml.$(O).
14193 (GLOBAL_SOURCES): Add xml.c.
14194 ($(BLD)/xml.$(O)): New dependency list.
14195
14196 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14197 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14198 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14199 [!WINDOWSNT]: New macros.
14200 (init_libxml2_functions, libxml2_loaded_p): New functions.
14201 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14202 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14203 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14204 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14205 linked in).
14206 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14207 Call init_libxml2_functions before calling libxml2 functions.
14208 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14209
14210 * emacs.c: Don't include libxml/parser.h.
14211 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14212 xmlCleanupParser directly.
14213
14214 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14215
14216 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14217
14218 * indent.c (Fvertical_motion): If there is a display string at
14219 point, use it.vpos to compute how many lines to backtrack after
14220 move_it_to point. (Bug#11133)
14221
14222 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14223
14224 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14225 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14226 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14227 macros related to unification of CJK characters. For the details,
14228 see the discussion following the message here:
14229 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14230
14231 2012-04-04 Chong Yidong <cyd@gnu.org>
14232
14233 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14234
14235 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14236
14237 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14238 instead of alloca. (Bug#11138)
14239
14240 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14241
14242 * w32menu.c (is_simple_dialog): Properly check lisp types.
14243 (Bug#11141)
14244
14245 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14246
14247 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14248 position we get to after a call to move_it_to fails the
14249 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14250 only if we wind up in a string from display property. (Bug#11063)
14251
14252 * window.c (Fdelete_other_windows_internal): Invalidate the row
14253 and column information about mouse highlight, so that redisplay
14254 restores it after reallocating the glyph matrices. (Bug#7464)
14255
14256 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14257 string comes from a `display' text property, use the buffer
14258 position of that property as if we actually saw that position in
14259 the row's glyphs.
14260 (move_it_by_lines): Remove the assertion that
14261 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14262 violated when there's a before-string at the beginning of a line.
14263 (Bug#11063)
14264
14265 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14266
14267 * xdisp.c (append_space_for_newline): If the default face was
14268 remapped, use the remapped face for the appended newline.
14269 (extend_face_to_end_of_line): Use the remapped default face for
14270 extending the face to the end of the line.
14271 (display_line): Call extend_face_to_end_of_line when the default
14272 face was remapped. (Bug#11068)
14273
14274 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14275
14276 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14277
14278 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14279
14280 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14281
14282 2012-03-27 Glenn Morris <rgm@gnu.org>
14283
14284 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14285 Doc fixes.
14286
14287 2012-03-26 Kenichi Handa <handa@m17n.org>
14288
14289 * dispextern.h (struct glyph): Fix previous change. Change the
14290 bit length of glyphless.ch to 25 (Bug#11082).
14291
14292 2012-03-26 Chong Yidong <cyd@gnu.org>
14293
14294 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14295 (command_loop_1): Use it; inhibit selection update for
14296 handle-select-window too (Bug#8996).
14297
14298 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14299
14300 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
14301
14302 2012-03-25 Kenichi Handa <handa@m17n.org>
14303
14304 * dispextern.h (struct glyph): Change the bit length of
14305 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14306
14307 2012-03-24 Eli Zaretskii <eliz@gnu.org>
14308
14309 * s/ms-w32.h (tzname): Include time.h before redirecting to
14310 _tzname. Fixes the MSVC build. (Bug#9960)
14311
14312 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14313
14314 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14315 characters.
14316
14317 * xterm.c (XTread_socket): Only modify handling_signal if
14318 !SYNC_INPUT. (Bug#11080)
14319
14320 2012-03-23 Eli Zaretskii <eliz@gnu.org>
14321
14322 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14323 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14324 when fetching a multibyte character consumes more bytes than
14325 CHAR_BYTES returns, due to unification of CJK characters in
14326 string_char. (Bug#11073)
14327
14328 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14329
14330 * process.c (wait_reading_process_output): Handle pty disconnect
14331 by refraining from sending oneself a SIGCHLD (bug#10933).
14332
14333 2012-03-22 Chong Yidong <cyd@gnu.org>
14334
14335 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14336
14337 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
14338 Mark string as coming from a prefix property.
14339 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14340 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14341
14342 2012-03-21 Chong Yidong <cyd@gnu.org>
14343
14344 * xfaces.c (Vface_remapping_alist): Doc fix.
14345
14346 2012-03-20 Eli Zaretskii <eliz@gnu.org>
14347
14348 * w32proc.c (Fw32_set_console_codepage)
14349 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14350 Doc fixes.
14351
14352 2012-03-20 Chong Yidong <cyd@gnu.org>
14353
14354 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14355 to reflect default non-nil value of redisplay-dont-pause.
14356
14357 2012-03-19 Kenichi Handa <handa@m17n.org>
14358
14359 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14360 it fit in a valid range (Bug#11003).
14361
14362 2012-03-18 Eli Zaretskii <eliz@gnu.org>
14363
14364 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14365 that is not from display property, accept the row as a "cursor
14366 row" if one of the string's character has a non-nil `cursor'
14367 property. Fixes cursor positioning when there are newlines in
14368 overlay strings, e.g. in icomplete.el. (Bug#11035)
14369
14370 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14371
14372 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14373
14374 2012-03-12 Chong Yidong <cyd@gnu.org>
14375
14376 * eval.c (inhibit_lisp_code): Rename from
14377 inhibit_window_configuration_change_hook; move from window.c.
14378
14379 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14380 * window.c (run_window_configuration_change_hook)
14381 (syms_of_window): Callers changed.
14382
14383 2012-03-11 Chong Yidong <cyd@gnu.org>
14384
14385 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14386
14387 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14388
14389 2012-03-10 Chong Yidong <cyd@gnu.org>
14390
14391 * frame.c (other_visible_frames): Don't assume the selected frame
14392 is visible (Bug#10955).
14393
14394 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14395
14396 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14397
14398 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14399
14400 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14401 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14402 zero (Bug#10954).
14403
14404 2012-03-03 Glenn Morris <rgm@gnu.org>
14405
14406 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
14407
14408 2012-03-02 Eli Zaretskii <eliz@gnu.org>
14409
14410 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14411 position past the first glyph_row that ends at ZV. (Bug#10902)
14412 (redisplay_window, next_element_from_string): Fix typos in
14413 comments.
14414 (redisplay_window): Pass to move_it_vertically the margin in
14415 pixels, not in screen lines.
14416
14417 2012-03-02 Glenn Morris <rgm@gnu.org>
14418
14419 * buffer.c (buffer-list-update-hook): Doc fix.
14420
14421 2012-02-29 Eli Zaretskii <eliz@gnu.org>
14422
14423 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14424 push_it before setting up the iterator for the first overlay
14425 string, even if we have an empty string loaded.
14426 (next_overlay_string): If there's an empty string on the iterator
14427 stack, pop the stack. (Bug#10903)
14428
14429 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14430
14431 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14432 Suggested by Stefan Monnier in
14433 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14434 * alloc.c (widen_to_Lisp_Object): New static function.
14435 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14436 and widening them to Lisp_Objects. This would work even if
14437 USE_LSB_TAG is defined and wide integers are used, which might
14438 happen in a future version of Emacs.
14439
14440 2012-02-25 Chong Yidong <cyd@gnu.org>
14441
14442 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14443 Doc fix.
14444
14445 * xselect.c (Fx_selection_exists_p): Doc fix.
14446 (x_clipboard_manager_save_all): Print an informative message
14447 before saving to clipboard manager.
14448
14449 2012-02-24 Chong Yidong <cyd@gnu.org>
14450
14451 * keyboard.c (process_special_events): Handle all X selection
14452 requests in kbd_buffer, not just the next one (Bug#8869).
14453
14454 2012-02-23 Chong Yidong <cyd@gnu.org>
14455
14456 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14457 call when setting menu-bar-lines and tool-bar-lines parameters.
14458 (unwind_create_frame_1): New helper function.
14459
14460 * window.c (inhibit_window_configuration_change_hook): New var.
14461 (run_window_configuration_change_hook): Obey it.
14462 (syms_of_window): Initialize it.
14463
14464 2012-02-22 Chong Yidong <cyd@gnu.org>
14465
14466 * xterm.c (x_draw_image_relief): Add missing type check for
14467 Vtool_bar_button_margin (Bug#10743).
14468
14469 2012-02-21 Chong Yidong <cyd@gnu.org>
14470
14471 * fileio.c (Vfile_name_handler_alist): Doc fix.
14472
14473 * buffer.c (Fget_file_buffer): Protect against invalid file
14474 handler return value.
14475
14476 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14477
14478 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14479 when computing $valmask.
14480
14481 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14482 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14483 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14484 It's useless in that case, and it can cause problems on hosts
14485 that allocate halves of EMACS_INT values separately.
14486 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14487 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14488 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14489 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14490 it avoids undefined behavior on hosts where shifting right by more
14491 than the word width has undefined behavior.
14492
14493 2012-02-19 Chong Yidong <cyd@gnu.org>
14494
14495 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14496 (Funhandled_file_name_directory, Ffile_name_as_directory)
14497 (Fdirectory_file_name, Fexpand_file_name)
14498 (Fsubstitute_in_file_name): Protect against invalid file handler
14499 return values (Bug#10845).
14500
14501 2012-02-18 Eli Zaretskii <eliz@gnu.org>
14502
14503 * .gdbinit (pitx): Fix incorrect references to fields of the
14504 iterator stack.
14505
14506 2012-02-17 Chong Yidong <cyd@gnu.org>
14507
14508 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14509
14510 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14511
14512 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14513 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14514
14515 2012-02-15 Chong Yidong <cyd@gnu.org>
14516
14517 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14518 marked as special. Also, starting docstrings with * is obsolete.
14519
14520 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14521
14522 * gnutls.c (emacs_gnutls_write): Fix last change.
14523
14524 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14525
14526 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14527 send_process.
14528
14529 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14530
14531 * keymap.c (Fsingle_key_description): Handle char ranges.
14532
14533 2012-02-12 Chong Yidong <cyd@gnu.org>
14534
14535 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14536 as that creates a dangerous corner case.
14537
14538 * window.c (Fdelete_window_internal): Invalidate the mouse
14539 highlight (Bug#9904).
14540
14541 2012-02-12 Glenn Morris <rgm@gnu.org>
14542
14543 * xselect.c (Fx_own_selection_internal)
14544 (Fx_get_selection_internal, Fx_disown_selection_internal)
14545 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14546 * nsselect.m (Fx_own_selection_internal)
14547 (Fx_disown_selection_internal, Fx_selection_exists_p)
14548 (Fx_selection_owner_p, Fx_get_selection_internal):
14549 Sync docs and argument specs with the xselect.c versions.
14550
14551 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14552
14553 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14554
14555 2012-02-11 Eli Zaretskii <eliz@gnu.org>
14556
14557 * w32select.c (Fx_selection_exists_p): Sync doc string and
14558 argument list with xselect.c. (Bug#10783)
14559
14560 * w16select.c (Fx_selection_exists_p): Sync doc string and
14561 argument list with xselect.c. (Bug#10783)
14562
14563 2012-02-10 Glenn Morris <rgm@gnu.org>
14564
14565 * fns.c (Fsecure_hash): Doc fix.
14566
14567 2012-02-09 Kenichi Handa <handa@m17n.org>
14568
14569 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14570
14571 2012-02-07 Chong Yidong <cyd@gnu.org>
14572
14573 * buffer.c (Fbuffer_local_variables)
14574 (buffer_lisp_local_variables): Handle unbound vars correctly;
14575 don't let Qunbound leak into Lisp.
14576
14577 2012-02-07 Glenn Morris <rgm@gnu.org>
14578
14579 * image.c (Fimagemagick_types): Doc fix.
14580
14581 * image.c (imagemagick-render-type): Change it from a lisp object
14582 to an integer. Move the doc here from the lisp manual.
14583 Treat all values not equal to 0 the same.
14584
14585 2012-02-06 Chong Yidong <cyd@gnu.org>
14586
14587 * doc.c (store_function_docstring): Avoid applying docstring of
14588 alias to base function (Bug#2603).
14589
14590 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14591
14592 * .gdbinit (pp1, pv1): Remove redundant defines.
14593 (pr): Use pp.
14594
14595 2012-02-04 Chong Yidong <cyd@gnu.org>
14596
14597 * nsterm.m: Declare a global (Bug#10694).
14598
14599 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14600
14601 * w32.c (get_emacs_configuration_options):
14602 Include --enable-checking, if specified, in the return value.
14603
14604 2012-02-04 Martin Rudalics <rudalics@gmx.at>
14605
14606 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14607 after rounding frame sizes. (Bug#9723)
14608
14609 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14610
14611 * keyboard.c (adjust_point_for_property): Don't position point
14612 before BEGV. (Bug#10696)
14613
14614 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14615
14616 Handle overflow when computing char display width (Bug#9496).
14617 * character.c (char_width): Return EMACS_INT, not int.
14618 (char_width, c_string_width): Check for overflow when
14619 computing the width; this is possible now that individual
14620 characters can have unbounded width. Problem introduced
14621 by merge from Emacs 23 on 2012-01-19.
14622
14623 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
14624
14625 * dbusbind.c (Fdbus_register_method): Mention the return value
14626 :ignore in the docstring.
14627
14628 2012-02-02 Glenn Morris <rgm@gnu.org>
14629
14630 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14631
14632 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14633 Unconditionally set to t. (Bug#10673)
14634 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14635 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14636 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14637
14638 2012-02-02 Kenichi Handa <handa@m17n.org>
14639
14640 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14641 0, do not call append_composite_glyph.
14642
14643 2012-02-02 Kenichi Handa <handa@m17n.org>
14644
14645 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14646 NULL (Bug#6988).
14647 (x_produce_glyphs): If the component of a composition is a null
14648 string, set it->pixel_width to 1 to avoid zero-width glyph.
14649
14650 2012-02-01 Eli Zaretskii <eliz@gnu.org>
14651
14652 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14653 first 2 arguments are identical. This makes inserting large
14654 output from a subprocess an order of magnitude faster on
14655 MS-Windows, where all sbrk'ed memory is always contiguous.
14656
14657 2012-01-31 Glenn Morris <rgm@gnu.org>
14658
14659 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14660 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14661 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14662
14663 2012-01-29 Glenn Morris <rgm@gnu.org>
14664
14665 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14666
14667 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14668
14669 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14670
14671 2012-01-28 Chong Yidong <cyd@gnu.org>
14672
14673 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14674
14675 2012-01-26 Chong Yidong <cyd@gnu.org>
14676
14677 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14678
14679 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14680 repeat counts (Bug#10507).
14681
14682 2012-01-26 Glenn Morris <rgm@gnu.org>
14683
14684 * lread.c (syms_of_lread): Doc fix.
14685
14686 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14687
14688 * coding.c (encode_designation_at_bol): Change return value to
14689 EMACS_INT.
14690
14691 2012-01-25 Chong Yidong <cyd@gnu.org>
14692
14693 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14694
14695 2012-01-21 Chong Yidong <cyd@gnu.org>
14696
14697 * floatfns.c (Fcopysign): Make the second argument non-optional,
14698 since nil is not allowed anyway.
14699
14700 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14701
14702 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14703 (send_process): Likewise.
14704
14705 2012-01-19 Martin Rudalics <rudalics@gmx.at>
14706
14707 * window.c (save_window_save, Fcurrent_window_configuration)
14708 (Vwindow_persistent_parameters): Do not use Qstate.
14709 Rewrite doc-strings.
14710
14711 2012-01-19 Kenichi Handa <handa@m17n.org>
14712
14713 * character.c (char_width): New function.
14714 (Fchar_width, c_string_width, lisp_string_width):
14715 Use char_width (Bug#9496).
14716
14717 2012-01-16 Martin Rudalics <rudalics@gmx.at>
14718
14719 * window.c (Vwindow_persistent_parameters): New variable.
14720 (Fset_window_configuration, save_window_save): Handle persistent
14721 window parameters.
14722
14723 2012-01-14 Eli Zaretskii <eliz@gnu.org>
14724
14725 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14726 thrashing the stack of the thread. (Bug#9087)
14727
14728 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14729
14730 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14731
14732 2012-01-11 Eli Zaretskii <eliz@gnu.org>
14733
14734 * xdisp.c (rows_from_pos_range): Handle the case where the
14735 highlight ends on a newline. (Bug#10464)
14736 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14737 he end column for display of highlight that ends on a newline
14738 before a R2L line.
14739
14740 2012-01-11 Glenn Morris <rgm@gnu.org>
14741
14742 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14743 from load-path also when installation-directory is nil. (Bug#10208)
14744
14745 2012-01-10 Glenn Morris <rgm@gnu.org>
14746
14747 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14748
14749 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14750 Update template values to be closer to their typical values these days.
14751
14752 2012-01-09 Eli Zaretskii <eliz@gnu.org>
14753
14754 * xdisp.c (rows_from_pos_range): Accept additional argument
14755 DISP_STRING, and accept any glyph in a row whose object is that
14756 string as eligible for mouse highlight. Fixes mouse highlight of
14757 display strings from overlays. (Bug#10464)
14758
14759 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
14760
14761 emacs: fix an auto-save permissions race condition (Bug#10400)
14762 * fileio.c (auto_saving_dir_umask): New static var.
14763 (Fmake_directory_internal): Use it.
14764 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14765 creating the directory. The old code temporarily assigns
14766 too-generous permissions to the directory.
14767 (do_auto_save_eh): Clear it.
14768 (Fdo_auto_save): Catch all errors, not just file errors, so
14769 that the var is always cleared.
14770
14771 2012-01-07 Eli Zaretskii <eliz@gnu.org>
14772
14773 * search.c (scan_buffer): Pass character positions to
14774 know_region_cache, not byte positions. (Bug#6540)
14775
14776 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
14777
14778 * w32.c (sys_rename): Report EXDEV when rename of a directory
14779 fails because the target is on another logical disk. (Bug#10284)
14780
14781 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14782
14783 * xterm.c (x_embed_request_focus): New function.
14784
14785 * xterm.h: Add prototype.
14786
14787 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14788
14789 2012-01-05 Glenn Morris <rgm@gnu.org>
14790
14791 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14792
14793 2012-01-01 Eli Zaretskii <eliz@gnu.org>
14794
14795 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14796 Load gnutls_transport_set_lowat only if GnuTLS version is below
14797 2.11.1.
14798 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14799 GnuTLS versions below 2.11.1.
14800
14801 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14802
14803 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14804 to the doc string advising against its use for altering the way
14805 windows are scrolled.
14806
14807 2011-12-28 Kenichi Handa <handa@m17n.org>
14808
14809 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14810 coding-system ASCII compatible only when it does not produce BOM
14811 on encoding (Bug#10383).
14812
14813 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14814
14815 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14816 can scroll.
14817 (create_and_show_popup_menu): Always use menu_position_func for
14818 Gtk3 (Bug#10361).
14819
14820 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14821
14822 * callint.c (Fcall_interactively): Don't truncate prompt string.
14823
14824 2011-12-23 Eli Zaretskii <eliz@gnu.org>
14825
14826 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14827 property that ends at ZV, so that the bidi iteration could be
14828 resumed from there (after widening). (Bug#10360)
14829
14830 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14831
14832 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14833
14834 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14835
14836 * nsterm.m (x_free_frame_resources):
14837 Release f->output_data.ns->miniimage.
14838 (ns_index_color): Fix indentation. Do not retain
14839 color_table->colors[i].
14840
14841 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14842 before returning.
14843
14844 * nsfns.m (x_set_background_color): Assign return value from
14845 ns_index_color to face-background instead of NSColor*.
14846 (ns_implicitly_set_icon_type): Fix indentation.
14847 Change assignment in for loop to comparison.
14848
14849 * emacs.c (ns_pool): New variable.
14850 (main): Assign ns_pool.
14851 (Fkill_emacs): Call ns_release_autorelease_pool.
14852
14853 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14854 autorelease fdesc, release fdAttrs and tdict.
14855 (ns_get_covering_families): Release charset.
14856 (ns_findfonts): Release NSFontDescriptor created with new.
14857 (ns_uni_to_glyphs): Fix indentation.
14858 (setString): Release attrStr before assigning new value.
14859
14860 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14861
14862 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14863 and NS_IMPL_COCOA.
14864 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14865 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14866
14867 2011-12-18 David Reitter <reitter@cmu.edu>
14868
14869 * nsterm.m (ns_term_init): Subscribe for notifications
14870 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14871 to method trackingNotification in EmacsMenu.
14872
14873 * nsmenu.m (trackingMenu): New variable.
14874 (trackingNotification): New method (from Aquamacs).
14875 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
14876 from Aquamacs (Bug#7030).
14877
14878 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14879
14880 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14881 (symbol_to_nsstring): Fix indentation.
14882 (ns_symbol_to_pb): New function.
14883 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14884 (Fns_rotate_cut_buffers_internal): Remove.
14885 (Fns_store_selection_internal): Rename from
14886 Fns_store_cut_buffer_internal.
14887 (ns_get_foreign_selection, Fx_own_selection_internal)
14888 (Fx_disown_selection_internal, Fx_selection_exists_p)
14889 (Fns_get_selection_internal, Fns_store_selection_internal):
14890 Use ns_symbol_to_pb and check if return value is nil.
14891 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14892 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
14893 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14894 renamed to Sns_store_selection_internal.
14895 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14896 and remove this function.
14897 (ns_handle_selection_clear): Remove, never used.
14898 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14899 here.
14900
14901 2011-12-17 Ken Brown <kbrown@cornell.edu>
14902
14903 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14904 GID is unknown (Bug#10257).
14905
14906 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14907
14908 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14909 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14910 which caused a build failure on GNU/Linux IA-64. This problem was
14911 introduced by my 2011-10-07 patch.
14912
14913 2011-12-15 Juri Linkov <juri@jurta.org>
14914
14915 * image.c (imagemagick_error): New function. (Bug#10112)
14916 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14917 Use `imagemagick_error' where ImageMagick functions return
14918 `MagickFalse'.
14919 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14920 proper order.
14921
14922 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14923
14924 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14925 fill background (Bug#8992).
14926
14927 2011-12-13 Martin Rudalics <rudalics@gmx.at>
14928
14929 * window.c (Vwindow_combination_resize)
14930 (Vwindow_combination_limit): Use t instead of non-nil in
14931 doc-strings.
14932 (Vrecenter_redisplay): Add first sentence of doc-string on
14933 separate line.
14934 (Frecenter): Fix doc-string typo.
14935
14936 2011-12-11 Kenichi Handa <handa@m17n.org>
14937
14938 * coding.c (Funencodable_char_position): Pay attention to the
14939 buffer text relocation (Bug#9389).
14940
14941 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14942
14943 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14944 gtk_init (Bug#10100).
14945
14946 2011-12-10 Eli Zaretskii <eliz@gnu.org>
14947
14948 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14949 IT->string is nil. (Bug#10263)
14950
14951 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14952
14953 * nsterm.h (x_free_frame_resources): Declare.
14954
14955 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14956 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14957
14958 * nsterm.h (ns_get_defaults_value): Declare.
14959
14960 * nsterm.m (ns_default): Call ns_get_defaults_value.
14961
14962 2011-12-09 Eli Zaretskii <eliz@gnu.org>
14963
14964 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14965 (Bug#10170)
14966
14967 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14968
14969 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14970 that where the value of an _OBJC_* symbol points to is in the .bss
14971 section (Bug#10240).
14972
14973 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14974
14975 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
14976 after the loop to call ccl_driver at least once (Bug#8619).
14977
14978 2011-12-08 Kenichi Handa <handa@m17n.org>
14979
14980 * ftfont.c (get_adstyle_property): Fix previous change
14981 (Bug#10233).
14982
14983 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
14984
14985 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14986 dirs from the default value of EMACSLOADPATH (bug#10208).
14987
14988 2011-12-07 Glenn Morris <rgm@gnu.org>
14989
14990 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14991 installation and source directories as well. (Bug#10208)
14992
14993 2011-12-06 Chong Yidong <cyd@gnu.org>
14994
14995 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14996
14997 2011-12-06 Glenn Morris <rgm@gnu.org>
14998
14999 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15000 as an error, not just -1. (Bug#10217)
15001
15002 2011-12-05 Chong Yidong <cyd@gnu.org>
15003
15004 * keyboard.c (process_special_events): New function.
15005 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15006
15007 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15008
15009 * coding.c (encode_designation_at_bol): Don't use uninitialized
15010 local variable (Bug#9318).
15011
15012 2011-12-05 Kenichi Handa <handa@m17n.org>
15013
15014 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15015 return Qnil (Bug#8046, Bug#10193).
15016
15017 2011-12-05 Kenichi Handa <handa@m17n.org>
15018
15019 * coding.c (encode_designation_at_bol): New args charbuf_end and
15020 dst. Return the number of produced bytes. Callers changed.
15021 (coding_set_source): Return how many bytes coding->source was
15022 relocated.
15023 (coding_set_destination): Return how many bytes
15024 coding->destination was relocated.
15025 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15026 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15027
15028 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15029
15030 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15031 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15032 macro (Bug#9318).
15033
15034 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15035
15036 The following changes are to fix Bug#9318.
15037
15038 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15039 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15040 (encode_coding_iso_2022, encode_coding_sjis)
15041 (encode_coding_big5, encode_coding_charset): Use the above macros.
15042
15043 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15044
15045 * lisp.h (process_quit_flag): Fix external declaration.
15046
15047 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15048
15049 Don't macro-inline non-performance-critical code.
15050 * eval.c (process_quit_flag): New function.
15051 * lisp.h (QUIT): Use it.
15052
15053 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15054
15055 * nsfns.m (get_geometry_from_preferences): New function.
15056 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15057
15058 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15059
15060 * emacs.c (Qkill_emacs): Define.
15061 (syms_of_emacs): Initialize it.
15062 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15063 Qquit_flag to `kill-emacs' instead.
15064 (quit_throw_to_read_char): Add parameter `from_signal'.
15065 All callers changed. Call Fkill_emacs if requested and safe.
15066 * lisp.h (QUIT): Call Fkill_emacs if requested.
15067
15068 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15069
15070 * widget.c (update_wm_hints): Return if wmshell is null.
15071 (widget_update_wm_size_hints): New function.
15072
15073 * widget.h (widget_update_wm_size_hints): Declare.
15074
15075 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15076 widget_update_wm_size_hints (Bug#10104).
15077
15078 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15079
15080 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15081 before a newline, prepare the bidi iterator for consuming the
15082 newline, and keep the current paragraph direction. (Bug#10183)
15083 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15084
15085 2011-12-02 Juri Linkov <juri@jurta.org>
15086
15087 * search.c (Fword_search_regexp): New Lisp function created from
15088 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15089 (Fword_search_backward, Fword_search_forward)
15090 (Fword_search_backward_lax, Fword_search_forward_lax):
15091 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15092 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15093
15094 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15095
15096 * fileio.c (Finsert_file_contents): Move after-change-function call
15097 to before the "handled:" label, since all "goto handled" appear in
15098 cases where the *-change-functions have already been properly called
15099 (bug#10117).
15100
15101 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15102
15103 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15104 waiting for input. (Bug#10169)
15105
15106 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15107
15108 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15109 verifies glyph row's hash code--we have just reallocated the
15110 glyphs, so their contents can be complete garbage. (Bug#10164)
15111
15112 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15113
15114 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15115
15116 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15117
15118 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15119 attributes are tested _before_ calling verify_row_hash, to protect
15120 against GCC re-ordering of the tests. (Bug#10164)
15121
15122 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15123
15124 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15125
15126 * xterm.c (handle_one_xevent): Only set async_visible and friends
15127 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15128 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15129 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15130
15131 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15132
15133 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15134 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15135 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15136 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15137 All uses changed to use GCPRO1 etc.
15138 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15139 Revert to old implementation (i.e., before 2011-03-11).
15140
15141 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15142
15143 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15144 of scroll runs so as to avoid assigning disabled bogus rows and
15145 unnecessary graphics copy operations.
15146
15147 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15148
15149 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15150 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15151 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15152 (malloc, free, realloc, calloc): Redirect to e_* only when
15153 compiling Emacs.
15154
15155 * lisp.h (GCTYPEBITS): Move before first use.
15156 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15157 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15158 this macro definition.
15159
15160 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15161 _MSC_VER.
15162
15163 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15164
15165 * gtkutil.c (xg_create_frame_widgets):
15166 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15167 present with Gtk+ 2.0.
15168
15169 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15170
15171 * fileio.c (Finsert_file_contents): Undo previous change; see
15172 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15173
15174 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15175
15176 Rename locals to avoid shadowing.
15177 * fileio.c (Finsert_file_contents):
15178 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15179 * process.c (wait_reading_process_output):
15180 Rename inner 'proc' to 'p' to avoid shadowing.
15181 Indent for consistency with usual Emacs style.
15182
15183 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15184
15185 * xdisp.c (redisplay_window): If cursor row is not fully visible
15186 after recentering, and scroll-conservatively is set to a large
15187 number, scroll window by a few more lines to make the cursor fully
15188 visible and out of scroll-margin. (Bug#10105)
15189 (start_display): Don't move to the next line if the display should
15190 start at a newline that is part of a display vector or an overlay
15191 string. (Bug#10119)
15192
15193 2011-11-24 Juri Linkov <juri@jurta.org>
15194
15195 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15196 after the `MagickPingImage' call. (Bug#10112)
15197
15198 2011-11-23 Chong Yidong <cyd@gnu.org>
15199
15200 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15201
15202 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15203
15204 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15205 making another buffer current. (Bug#10114)
15206
15207 2011-11-23 Glenn Morris <rgm@gnu.org>
15208
15209 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15210
15211 2011-11-23 Chong Yidong <cyd@gnu.org>
15212
15213 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15214 using it (Bug#5984).
15215
15216 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15217
15218 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15219 and header-lines, as they don't have one computed for them.
15220 (Bug#10098)
15221
15222 * .gdbinit (prow): Make displayed values more self-explaining.
15223 Add row's hash code.
15224
15225 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15226
15227 * process.c (wait_reading_process_output): Fix asynchrounous
15228 GnuTLS socket handling on some versions of the GnuTLS library.
15229 (wait_reading_process_output): Add comment and URL.
15230
15231 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15232
15233 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15234
15235 2011-11-21 Chong Yidong <cyd@gnu.org>
15236
15237 * window.c (Fnext_window, Fprevious_window): Doc fix.
15238
15239 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15240
15241 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15242
15243 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15244
15245 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15246
15247 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15248
15249 * window.c (Fset_window_combination_limit): Rename argument
15250 STATUS to LIMIT.
15251 (Vwindow_combination_limit): Remove "status" from doc-string.
15252
15253 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15254
15255 * m/ibms390.h: Remove.
15256 * m/ibms390x.h: Don't include "ibms390.h".
15257
15258 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15259
15260 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15261 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15262
15263 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15264
15265 * casetab.c (Fset_case_table):
15266 * charset.c (Fcharset_after): Fix typos.
15267
15268 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15269
15270 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15271 Otherwise, valgrind does not work on some platforms.
15272 Problem reported by Andreas Schwab in
15273 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15274 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15275 is set, removing the need for VIRT_ADDRESS_VARIES.
15276 (PURE_P): Use a more-efficient implementation that needs just one
15277 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15278 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15279 to 4 (xorl, subq, cmpq, setbe).
15280 * alloc.c (pure): Always extern now, since that's the
15281 VIRT_ADDR_VARIES behavior.
15282 (PURE_POINTER_P): Use a single comparison, not two, for
15283 consistency with the new puresize.h.
15284 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15285 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15286 Remove VIRT_ADDR_VARIES no longer needed.
15287
15288 2011-11-19 Eli Zaretskii <eliz@gnu.org>
15289
15290 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15291 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15292 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15293 behave as if the cursor position were at the window margin.
15294
15295 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15296 and the cursor position is out of bounds, behave as if the cursor
15297 position were at the window margin. (Bug#10075)
15298
15299 2011-11-18 Chong Yidong <cyd@gnu.org>
15300
15301 * window.c (Fwindow_combination_limit): Make first argument
15302 non-optional, since it is meaningless for live windows like the
15303 selected window.
15304
15305 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15306
15307 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15308
15309 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15310
15311 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15312 (graft_intervals_into_buffer): Simplify.
15313
15314 2011-11-18 Eli Zaretskii <eliz@gnu.org>
15315
15316 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15317 hash values of the two rows.
15318 (copy_row_except_pointers): Preserve the used[] arrays and the
15319 hash values of the two rows. (Bug#10035)
15320 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
15321
15322 * xdisp.c (row_hash): New function, body extracted from
15323 compute_line_metrics.
15324 (compute_line_metrics): Call row_hash, instead of computing the
15325 hash code inline.
15326
15327 * dispnew.c (verify_row_hash): Call row_hash for computing the
15328 hash code of a row, instead of duplicating code from xdisp.c.
15329
15330 * dispextern.h (row_hash): Add prototype.
15331
15332 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15333
15334 * frame.c (delete_frame): Don't delete the terminal when the last
15335 X frame is closed if emacs is built with GTK toolkit.
15336
15337 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
15338
15339 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15340
15341 2011-11-17 Martin Rudalics <rudalics@gmx.at>
15342
15343 * window.c (Vwindow_splits): Rename to
15344 Vwindow_combination_resize. Suggested by Juri Linkov.
15345 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15346 of Vwindow_splits.
15347
15348 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
15349
15350 * nsfns.m (Fns_font_name):
15351 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
15352
15353 2011-11-16 Martin Rudalics <rudalics@gmx.at>
15354
15355 * window.h (window): Rename slot "nest" to "combination_limit".
15356 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15357 (Fset_window_nest): Rename to Fset_window_combination_limit.
15358 (Vwindow_nest): Rename to Vwindow_combination_limit.
15359 (recombine_windows, make_parent_window, make_window)
15360 (Fsplit_window_internal, saved_window)
15361 (Fset_window_configuration, save_window_save): Rename all
15362 occurrences of window_nest to window_combination_limit.
15363
15364 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
15365
15366 * image.c (imagemagick_load_image): Fix typo.
15367
15368 2011-11-14 Eli Zaretskii <eliz@gnu.org>
15369
15370 * xdisp.c (display_line): Move the call to
15371 highlight_trailing_whitespace before the call to
15372 compute_line_metrics, since the latter needs to see the final
15373 faces of all the glyphs to compute ROW's hash value.
15374 Fixes assertion violations in row_equal_p. (Bug#10035)
15375
15376 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
15377
15378 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15379 just return (bug#10044).
15380
15381 2011-11-12 Eli Zaretskii <eliz@gnu.org>
15382
15383 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15384 with user-defined heap size. Bump the default size of the temacs
15385 heap to 27MB, to avoid memory warning when running temacs.
15386 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15387
15388 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15389 current_matrix and desired_matrix. (Bug#9990)
15390 (verify_row_hash) [XASSERTS]: New function.
15391 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15392 that the hash value of glyph rows is correct.
15393
15394 2011-11-12 Martin Rudalics <rudalics@gmx.at>
15395
15396 * window.h (window): Remove splits slot.
15397 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15398 (Fdelete_other_windows_internal, make_parent_window)
15399 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15400 (Fset_window_configuration, save_window_save): Don't deal with
15401 split status of windows.
15402 (saved_window): Remove splits slot.
15403 (Vwindow_splits): Rewrite doc-string.
15404
15405 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15406
15407 * xfns.c (unwind_create_frame):
15408 * nsfns.m (unwind_create_frame):
15409 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15410 Vframe_list (Bug#9999).
15411
15412 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15413
15414 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
15415
15416 2011-11-11 Kenichi Handa <handa@m17n.org>
15417
15418 * callproc.c (Fcall_process): Set the member dst_multibyte of
15419 process_coding.
15420
15421 2011-11-11 Johan Bockgård <bojohan@gnu.org>
15422
15423 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15424 avoid a crash (bug#9496).
15425
15426 2011-11-09 Chong Yidong <cyd@gnu.org>
15427
15428 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15429 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15430
15431 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15432
15433 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15434
15435 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15436
15437 Avoid some portability problems by eschewing 'extern inline' functions.
15438 The trivial performance wins aren't worth the portability hassles; see
15439 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15440 et seq.
15441 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15442 (window_box_width, window_box_left, window_box_left_offset)
15443 (window_box_right, window_box_right_offset): Undo previous change,
15444 by removing the "extern"s.
15445 * intervals.c (adjust_intervals_for_insertion)
15446 (adjust_intervals_for_deletion): Undo previous change,
15447 making these static again.
15448 (offset_intervals, temp_set_point_both, temp_set_point)
15449 (copy_intervals_to_string): No longer inline.
15450 * xdisp.c (window_text_bottom_y, window_box_width)
15451 (window_box_height, window_box_left_offset)
15452 (window_box_right_offset, window_box_left, window_box_right)
15453 (window_box): No longer inline.
15454
15455 2011-11-08 Chong Yidong <cyd@gnu.org>
15456
15457 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
15458 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15459 Signal an error if not a live window.
15460 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15461 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15462
15463 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
15464
15465 * lisp.h (syms_of_abbrev): Remove declaration.
15466 Reported by CHENG Gao <chenggao@royau.me>.
15467
15468 2011-11-07 Eli Zaretskii <eliz@gnu.org>
15469
15470 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15471 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15472 of temacs in GUI mode.
15473
15474 2011-11-07 Martin Rudalics <rudalics@gmx.at>
15475
15476 * window.h: Declare delete_all_child_windows instead of
15477 delete_all_subwindows.
15478 * window.c (Fwindow_nest, Fset_window_nest)
15479 (Fset_window_new_total, Fset_window_new_normal)
15480 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15481 (delete_all_subwindows): Rename to delete_all_child_windows.
15482 (Fdelete_other_windows_internal, Fset_window_configuration):
15483 Call delete_all_child_windows instead of delete_all_subwindows.
15484 * frame.c (delete_frame): Call delete_all_child_windows instead
15485 of delete_all_subwindows.
15486
15487 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15488
15489 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15490 This is also needed for porting to any host where GC_MARK_STACK is
15491 not GC_MAKE_GCPROS_NOOPS.
15492 (which_symbols): Use it.
15493
15494 2011-11-07 Kenichi Handa <handa@m17n.org>
15495
15496 * coding.c (coding_set_destination): Check coding->src_pos only
15497 when coding->src_object is a buffer (bug#9910).
15498
15499 * process.c (send_process): Set the member src_multibyte of coding
15500 to 0 (bug#9911) when sending a unibyte text.
15501
15502 * callproc.c (Fcall_process): Set the member src_multibyte of
15503 process_coding to 0 (bug#9912).
15504
15505 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15506
15507 * xmenu.c (cleanup_widget_value_tree): New function.
15508 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15509 calling free_menubar_widget_value_tree directly (Bug#9830).
15510
15511 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15512
15513 Fix some portability problems with 'inline'.
15514 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15515 (window_box_width, window_box_left, window_box_left_offset)
15516 (window_box_right, window_box_right_offset): Declare extern.
15517 Otherwise, these inline functions do not conform to C99 and
15518 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15519 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15520 * intervals.c (adjust_intervals_for_insertion)
15521 (adjust_intervals_for_deletion): Now extern, because otherwise the
15522 extern inline functions 'offset_intervals' couldn't refer to it.
15523 (static_offset_intervals): Remove.
15524 (offset_intervals): Rewrite using the old contents of
15525 static_offset_intervals. The old version didn't conform to C99
15526 because an extern inline function contained a reference to an
15527 identifier with static linkage.
15528
15529 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15530
15531 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15532 GC.
15533
15534 2011-11-06 Eli Zaretskii <eliz@gnu.org>
15535
15536 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15537 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15538 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15539 return Qleft_to_right.
15540
15541 2011-11-06 Chong Yidong <cyd@gnu.org>
15542
15543 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15544 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15545 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15546 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15547 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15548 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15549 (Fwindow_vscroll): Doc fix.
15550 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15551 argument, since it makes no sense to pass a live window and for
15552 consistency with window-child.
15553
15554 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15555
15556 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15557 support MSVC.
15558
15559 2011-11-05 Jason Rumney <jasonr@gnu.org>
15560
15561 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15562 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15563 fonts (Bug#6029).
15564 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15565 bitwise arithmetic preventing use of unicode-sip and non-truetype
15566 opentype fonts.
15567
15568 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15569
15570 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15571 "emacs"-only part.
15572
15573 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15574 initialization code to keep similarity to xfns.c after changes
15575 from 2011-11-05.
15576
15577 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15578
15579 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15580 (unwind_create_frame): New function (Bug#9943).
15581 (Fx_create_frame): Restructure code to be more similar to the one in
15582 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15583 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15584 Move terminal->reference_count++ just before making the frame official
15585 (Bug#9943).
15586
15587 * nsterm.m (x_free_frame_resources): New function.
15588 (x_destroy_window): Move code to x_free_frame_resources.
15589
15590 * xfns.c (unwind_create_frame): Fix comment.
15591 (Fx_create_frame, x_create_tip_frame):
15592 Move terminal->reference_count++ just before making the frame
15593 official. Move initialization of image_cache_refcount and
15594 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15595
15596 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15597
15598 Support MSVC build with newer versions of Visual Studio.
15599 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15600 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15601 nt/gmake.defs.
15602
15603 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15604 which are not supported by MSVC.
15605 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15606 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15607 bitfields.
15608 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15609 types in bitfields.
15610 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15611
15612 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15613
15614 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
15615
15616 Support MSVC build with newer versions of Visual Studio.
15617 * w32.c: Don't include w32api.h for MSVC.
15618 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15619
15620 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15621 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15622 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15623 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15624 e_* cousins.
15625 (alloca) [_MSC_VER]: Define to _alloca.
15626
15627 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15628
15629 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15630
15631 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15632
15633 * xdisp.c (note_mouse_highlight): If either of
15634 previous/next-single-property-change returns nil, treat that as
15635 the beginning or the end of the buffer. (Bug#9955)
15636
15637 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15638
15639 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
15640 label is not null (Bug#9951).
15641 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15642 may be NULL.
15643
15644 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15645
15646 * window.c (Fwindow_body_size): Mention in the doc string that the
15647 return value is in frame's canonical units. (Bug#9949)
15648
15649 2011-11-03 Eli Zaretskii <eliz@gnu.org>
15650
15651 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15652
15653 * w32fns.c (unwind_create_frame): If needed, free the glyph
15654 matrices of the partially constructed frame. (Bug#9943)
15655 * xfns.c (unwind_create_frame): Likewise.
15656
15657 2011-11-01 Eli Zaretskii <eliz@gnu.org>
15658
15659 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15660 Don't stop backward scan on the continuation glyph, even though
15661 its CHARPOS is positive.
15662 (mouse_face_from_buffer_pos, note_mouse_highlight):
15663 Rename cover_string to disp_string.
15664
15665 2011-11-01 Martin Rudalics <rudalics@gmx.at>
15666
15667 * window.c (temp_output_buffer_show): Don't use
15668 Vtemp_buffer_show_specifiers.
15669 (Vtemp_buffer_show_specifiers): Remove unused variable.
15670
15671 2011-10-30 Eli Zaretskii <eliz@gnu.org>
15672
15673 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15674 past the beginning of the current glyph matrix.
15675
15676 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
15677
15678 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15679 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15680 HAVE_GTK3 (Bug#9869).
15681
15682 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15683 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15684
15685 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15686
15687 * xterm.c: Declare x_handle_net_wm_state to return int.
15688 (handle_one_xevent): Check if we are iconified but don't have
15689 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15690 (get_current_wm_state): Return non-zero if not hidden,
15691 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15692 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15693 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15694 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15695
15696 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15697
15698 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15699 so that this new function doesn't get optimized away by a
15700 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15701
15702 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15703
15704 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15705
15706 2011-10-29 Eli Zaretskii <eliz@gnu.org>
15707
15708 Fix the `xbytecode' command.
15709 * .gdbinit (xprintbytestr): New command.
15710 (xwhichsymbols): Rename from `which'; all callers changed.
15711 (xbytecode): Print the byte-code string as well.
15712
15713 2011-10-29 Kim Storm <storm@cua.dk>
15714
15715 * alloc.c (which_symbols): New function.
15716
15717 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15718
15719 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15720 line. (Bug#9903)
15721
15722 2011-10-29 Glenn Morris <rgm@gnu.org>
15723
15724 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15725 Not clear what it was for, and it causes various bugs. (Bug#9839)
15726
15727 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15728
15729 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15730 possible random value that matches one of those tested as
15731 condition to clear the mouse face.
15732
15733 2011-10-28 Chong Yidong <cyd@gnu.org>
15734
15735 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15736
15737 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15738
15739 * window.c (make_window): Initialize phys_cursor_on_p.
15740
15741 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15742
15743 * lisp.h (struct Lisp_Symbol): Update comments.
15744
15745 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
15746
15747 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15748
15749 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15750
15751 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15752 <oslsachem@gmail.com> for helping to debug this.
15753
15754 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15755 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15756 (g_b_init_get_glyph_outline_w): New static variables.
15757 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15758 (GetGlyphOutlineW_Proc): New typedefs.
15759 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
15760 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15761 New functions.
15762 (w32font_open_internal, compute_metrics):
15763 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
15764 instead of calling the "wide" APIs directly.
15765
15766 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15767
15768 * w32.h (syms_of_w32font): Add prototype.
15769
15770 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15771
15772 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15773 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15774 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15775 (Fmove_to_window_line): Doc fix.
15776
15777 2011-10-27 Chong Yidong <cyd@gnu.org>
15778
15779 * process.c (make_process): Set gnutls_state to NULL.
15780
15781 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15782 non-NULL, regardless of GNUTLS_INITSTAGE.
15783 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15784 an error. Set process slots as soon as we allocate them.
15785
15786 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15787
15788 2011-10-27 Chong Yidong <cyd@gnu.org>
15789
15790 * gnutls.c (emacs_gnutls_deinit): New function.
15791 Deallocate credentials structures as well as calling gnutls_deinit.
15792 (Fgnutls_deinit, Fgnutls_boot): Use it.
15793
15794 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15795 (deactivate_process): Call emacs_gnutls_deinit.
15796
15797 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15798
15799 * image.c (x_create_x_image_and_pixmap):
15800 * w32.c (sys_rename, w32_delayed_load):
15801 * w32font.c (fill_in_logfont):
15802 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15803
15804 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
15805
15806 * w32fns.c (w32_default_color_map): New function,
15807 extracted from Fw32_default_color_map.
15808 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
15809
15810 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15811
15812 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15813
15814 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15815
15816 * keyboard.c (test_undefined): New function (bug#9751).
15817 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15818
15819 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15820
15821 * sysdep.c (init_sys_modes): Fix the check for the controlling
15822 terminal (Bug#6649).
15823
15824 2011-10-20 Eli Zaretskii <eliz@gnu.org>
15825
15826 * dispextern.h (struct bidi_it): New member next_en_type.
15827
15828 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15829 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15830 current character, check also for next_en_type being WEAK_EN.
15831 (bidi_resolve_weak): Don't enter the expensive loop if the current
15832 position is before next_en_pos. Record the bidi type of the first
15833 non-ET, non-BN character we find, in addition to its position.
15834 (bidi_level_of_next_char): Invalidate next_en_type when
15835 next_en_pos is over-stepped.
15836
15837 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15838
15839 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15840 * editfns.c: Rewrite current-time-zone so that it invokes
15841 the equivalent of (format-time-string "%Z") to get the time zone name.
15842 This fixes a bug when the time zone name contains characters that
15843 need converting from the system time locale to Emacs internal format.
15844 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15845 that patch fixed format-time-string to do the conversion, but
15846 I forgot to fix current-time-zone.
15847 (format_time_string): New function, containing most of
15848 what Fformat_time_string used to contain.
15849 (Fformat_time_string): Rewrite in terms of format_time_string.
15850 This doesn't change this function's behavior.
15851 (current-time-zone): Rewrite to use format_time_string.
15852 This fixes the bug reported by Michael Schierl in
15853 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15854 Jason Rumney's 2007-06-07 change worked around this bug, but
15855 didn't fix it.
15856 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15857
15858 2011-10-19 Eli Zaretskii <eliz@gnu.org>
15859
15860 * xdisp.c (start_display): If the character at POS is displayed
15861 via a display vector, reset IT->current.dpvec_index to zero.
15862 (try_window_reusing_current_matrix): If a line ends in a display
15863 vector or the next line starts in a display vector, continue
15864 redrawing the window even though the character position of
15865 start_row was reached.
15866 (Bug#9771, part 2)
15867
15868 2011-10-18 Chong Yidong <cyd@gnu.org>
15869
15870 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15871 with nobreak-char-display too.
15872
15873 2011-10-18 Eli Zaretskii <eliz@gnu.org>
15874
15875 Fix part 3 of bug#9771.
15876 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15877 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15878 non-neutral characters if the current character is a paragraph
15879 separator (a.k.a. Newline). This avoids running the same
15880 expensive loop twice, once when we consume the preceding newline
15881 and the other time when the line actually needs to be displayed.
15882 Avoid the loop when we see neutrals on the base embedding level
15883 following a character whose directionality is the same as the
15884 paragraph's. This avoids running the expensive loop when a line
15885 ends in a long sequence of neutrals, like control characters.
15886 Add assertion against STRONG_AL type. Slightly rearrange code
15887 that determines the type of a neutral given the first non-neutral
15888 that follows it.
15889 (bidi_level_of_next_char): Set next_en_pos to zero when
15890 invalidating its info.
15891
15892 2011-10-17 Eli Zaretskii <eliz@gnu.org>
15893
15894 * xdisp.c (push_display_prop): Determine whether to record string
15895 or buffer position by IT->string, not by IT->method. Allow
15896 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
15897 (move_it_vertically_backward): Don't look for character position
15898 immediately after the newline when in a continuation line.
15899 (Bug#9771, part 1)
15900
15901 2011-10-15 Martin Rudalics <rudalics@gmx.at>
15902
15903 * window.c (coordinates_in_window): Rewrite and delabelize
15904 vertical border check. (Bug#5357) (Bug#9618)
15905
15906 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15907
15908 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15909 errors in XSetWindowBorder (bug#9310).
15910
15911 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15912
15913 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15914 avoid crash when xmalloc overrun checking is enabled.
15915
15916 2011-10-13 Eli Zaretskii <eliz@gnu.org>
15917
15918 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15919 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15920 cursor motion with <left> and <right> arrow keys.
15921
15922 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15923 some callers set that themselves.
15924
15925 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15926
15927 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15928 display string and the previous row comes from the same string and
15929 is empty. (Bug#9739) (Bug#9738)
15930
15931 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15932
15933 * doc.c (get_doc_string): Encode file name (bug#9735).
15934
15935 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15936
15937 * bidi.c (bidi_level_of_next_char):
15938 * xdisp.c (get_visually_first_element): Remove old incorrect
15939 comments regarding the Unicode Line Separator character.
15940
15941 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15942
15943 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15944
15945 * alloc.c (Fgc_status): Do not access beyond zombies array
15946 boundary if nzombies > MAX_ZOMBIES.
15947 * alloc.c (dump_zombies): Add missing format specifier.
15948
15949 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15950
15951 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15952 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15953
15954 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15955 Some packages use them to denote characters with modifiers.
15956
15957 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15958
15959 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15960 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15961 matching a pp-number. Rename parameter var to var1.
15962
15963 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15964
15965 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15966
15967 2011-10-08 Glenn Morris <rgm@gnu.org>
15968
15969 * callint.c (Fcall_interactively): Give a more explicit error for the
15970 'c' case with a non-character input. (Bug#8479)
15971
15972 2011-10-08 Eli Zaretskii <eliz@gnu.org>
15973
15974 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15975 lines.
15976 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15977 lines that are hscrolled on the left.
15978
15979 * dispnew.c (buffer_posn_from_coords): Account for a possible
15980 presence of header-line. (Bug#4426)
15981
15982 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15983
15984 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15985 Don't advertise functionality which we discourage or doesn't work.
15986
15987 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15988
15989 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15990 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15991 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15992 this makes Emacs dump core during garbage collection on rare
15993 occasions. sizeof is obviously inferior to offsetof here, so
15994 stick with offsetof.
15995 (GC_POINTER_ALIGNMENT): New macro.
15996 (mark_memory): Omit 3rd (offset) arg; caller changed.
15997 Don't assume EMACS_INT alignment is the same as pointer alignment.
15998
15999 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16000
16001 * keyboard.c (read_key_sequence_remapped): New var.
16002 (read_key_sequence): Compute remapping in the right buffer.
16003 (command_loop_1): Use read_key_sequence's remapping directly.
16004
16005 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16006
16007 * dired.c (file_name_completion): Don't expand file name.
16008 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16009 before checking file name handler.
16010
16011 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16012 they've been requested explicitly (bug#9591).
16013
16014 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16015
16016 * keymap.c (Fsingle_key_description): Use make_specified_string
16017 instead of build_string to build string from push_key_description.
16018 (Bug#5193)
16019
16020 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16021
16022 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16023 This fixes a Y2038 bug on 64-bit hosts.
16024 * buffer.c (reset_buffer):
16025 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16026 (Fclear_buffer_auto_save_failure):
16027 Use 0, not -1, to represent an unset failure time, since time_t
16028 might not be signed.
16029
16030 Remove dependency on glibc malloc internals.
16031 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16032 Move back here from lisp.h, but with their new implementations.
16033 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16034 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16035 * charset.c (charset_table_init): New static var.
16036 (syms_of_charset): Use it instead of xmalloc. This removes a
16037 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16038 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16039 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16040 Move back to alloc.c.
16041 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16042 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16043
16044 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16045
16046 * nsterm.m (windowDidResize): Call x_set_window_size only when
16047 ns_in_resize is true. Otherwise set pixelwidth/height and
16048 call change_frame_size (Bug#9628).
16049
16050 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16051
16052 Port --enable-checking=all to Fedora 14 x86-64.
16053 * charset.c (syms_of_charset): Also account for glibc malloc's
16054 internal overhead when calculating the initial malloc maximum.
16055
16056 Port --enable-checking=all to Fedora 14 x86.
16057 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16058 Move to lisp.h.
16059 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16060 (overrun_check_realloc, overrun_check_free):
16061 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16062 That way, xmalloc returns a properly-aligned pointer even if
16063 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16064 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16065 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16066 into account when calculating the initial malloc maximum.
16067 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16068 Move here from alloc.c, so that charset.c can use it too.
16069 Properly align; the old code wasn't right for common 32-bit hosts
16070 when configured with --enable-checking=all.
16071 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16072 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16073
16074 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16075
16076 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16077 use EDOM.
16078
16079 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16080
16081 * xdisp.c (compute_display_string_end): If there's no display
16082 string at CHARPOS, return -1.
16083
16084 * bidi.c (bidi_fetch_char): When compute_display_string_end
16085 returns a negative value, treat the character as a normal
16086 character not covered by a display string. (Bug#9624)
16087
16088 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16089
16090 * lread.c (Fread_from_string): Fix typo in docstring.
16091
16092 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16093
16094 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16095 newline, reseat the iterator instead of bidi-iterating there one
16096 character at a time. (Bug#9610)
16097 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16098 TO_CHARPOS if the bidi iterator is at base embedding level.
16099
16100 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16101
16102 * lread.c (readevalloop): Use correct code for NBSP.
16103 (read1): Likewise. (Bug#9608)
16104
16105 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16106
16107 * dbusbind.c (Fdbus_register_signal): When service is not
16108 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16109
16110 2011-09-25 Glenn Morris <rgm@gnu.org>
16111
16112 * buffer.c (truncate-lines): Doc fix.
16113
16114 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16115
16116 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16117 (Fset_window_next_buffers): Doc fix.
16118
16119 2011-09-24 Glenn Morris <rgm@gnu.org>
16120
16121 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16122
16123 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16124
16125 Fix minor problems found by static checking.
16126 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16127 * indent.c (Fvertical_motion): Fix == vs = typo.
16128
16129 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16130
16131 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16132 Default value is now t. Doc fix.
16133
16134 * indent.c (Fvertical_motion): Compute and apply the overshoot
16135 logic when moving up, not only when moving down. Fix the
16136 confusing name and values of the it_overshoot_expected variable;
16137 logic changes accordingly. (Bug#9254) (Bug#9549)
16138
16139 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16140 CHARPOS is covered by a display string which includes newlines.
16141 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16142 is covered by a display string with embedded newlines.
16143
16144 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16145
16146 * dbusbind.c (Fdbus_register_signal): Add match rule to
16147 Vdbus_registered_objects_table. (Bug#9581)
16148 (Fdbus_register_method, Vdbus_registered_objects_table):
16149 Fix docstring.
16150
16151 2011-09-24 Jim Meyering <meyering@redhat.com>
16152
16153 do not ignore write error for any output size
16154 The previous change was incomplete.
16155 While it makes emacs --batch detect the vast majority of stdout
16156 write failures, errors were still ignored whenever the output size is
16157 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16158 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16159 && echo FAIL: ignored write error
16160 FAIL: ignored write error
16161 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16162 && echo FAIL: ignored write error
16163 FAIL: ignored write error
16164 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16165
16166 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16167
16168 * emacs.c (Fkill_emacs): In noninteractive mode exit
16169 non-successfully if a write error occurred on stdout. (Bug#9574)
16170
16171 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16172
16173 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16174 the xassert test.
16175
16176 * dispextern.h (struct it): Update the comment documenting what
16177 can it->OBJECT be.
16178
16179 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16180
16181 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16182 a display string, extend search for cursor position to end of row.
16183 (find_row_edges): If the row ends in a newline from a display
16184 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16185 Handle the case of a display string with multiple newlines.
16186 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16187 non-empty line. Fixes confusing cursor motion with arrow keys at
16188 the beginning of a line that starts with whitespace.
16189
16190 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16191
16192 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16193 (bug#9493).
16194
16195 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16196
16197 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16198 boolean (Bug#9154).
16199
16200 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16201
16202 * xdisp.c (display_line): Record maximum and minimum buffer
16203 positions even if no glyphs were produced (e.g., by a zero-width
16204 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16205 buffer positions that will be removed from the glyph row because
16206 they don't fit.
16207 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16208 column is beyond frame width: don't subtract 1 "pixel" when
16209 computing width of the stretch.
16210 (reseat_at_next_visible_line_start): Undo the change made on
16211 2011-09-17 that saved paragraph information and restored it after
16212 the call to `reseat'. (Bug#9545)
16213
16214 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16215
16216 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16217 and turn window cursor on if cleared (Bug#9415).
16218
16219 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16220
16221 * search.c (boyer_moore): Take unibyte characters from pattern
16222 literally. (Bug#9458)
16223
16224 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16225
16226 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16227
16228 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16229
16230 Fix minor problem found by static checking.
16231 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16232 initialized, to pacify gcc -Wuninitialized.
16233
16234 * fileio.c: Report proper errno when syscall falls.
16235 (Finsert_file_contents): Save and restore errno,
16236 so that report_file_error outputs the correct diagnostic.
16237 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16238
16239 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16240
16241 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16242
16243 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16244
16245 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16246 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16247
16248 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16249
16250 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16251 about the current paragraph and restore it after the call to reseat.
16252
16253 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16254 (bidi_find_paragraph_start): Search back for paragraph beginning
16255 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16256 (bidi_move_to_visually_next): Only trigger paragraph-related
16257 computations when the last character is a newline or at EOB, not
16258 just any NEUTRAL_B. (Bug#9470)
16259
16260 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16261 truncated lines if point is covered by a display string. (Bug#9524)
16262
16263 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16264
16265 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16266 (cons_to_x_long): New function.
16267 (lisp_data_to_selection_data): Use it. Correct the test for
16268 short-versus-long data; it was negated. Break out of vector
16269 loop, for efficiency, when a long datum is discovered.
16270
16271 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16272
16273 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16274
16275 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16276
16277 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16278 GCC PR/17406) by declaring this function with external scope.
16279
16280 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16281
16282 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16283 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16284
16285 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16286
16287 * editfns.c (Fformat): Correctly handle text properties on "%%".
16288
16289 2011-09-15 Eli Zaretskii <eliz@gnu.org>
16290
16291 * xterm.c (x_draw_composite_glyph_string_foreground):
16292 * w32term.c (x_draw_composite_glyph_string_foreground):
16293 * term.c (encode_terminal_code):
16294 * composite.c (composition_update_it, get_composition_id):
16295 * xdisp.c (get_next_display_element)
16296 (fill_composite_glyph_string): Add comments about special meaning
16297 of TAB characters in a composition.
16298
16299 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16300
16301 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
16302 This occurs when processing a multibyte format.
16303 Problem reported by Wolfgang Jenker.
16304
16305 2011-09-15 Johan Bockgård <bojohan@gnu.org>
16306
16307 * xdisp.c (try_cursor_movement): Only check for exact match if
16308 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16309
16310 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16311
16312 Remove unused external symbols.
16313 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16314 * xdisp.c (calc_pixel_width_or_height): Now static.
16315 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16316 * indent.c (check_display_width):
16317 * w32term.c: Fix comment to match code.
16318 * xterm.c, xterm.h (x_catching_errors): Remove.
16319
16320 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16321
16322 * xselect.c: Use signed conversions more consistently (Bug#9498).
16323 (selection_data_to_lisp_data): Assume incoming selection data are
16324 signed integers, not unsigned. This is to be consistent with
16325 outgoing selection data, which was modified to use signed integers
16326 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16327 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16328 expects long, not unsigned long.
16329
16330 2011-09-14 Eli Zaretskii <eliz@gnu.org>
16331
16332 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16333 computation of loop end. Reported by Johan Bockgård
16334 <bojohan@gnu.org>.
16335
16336 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
16337
16338 * frame.c (Fother_visible_frames_p): Function deleted.
16339
16340 2011-09-12 Eli Zaretskii <eliz@gnu.org>
16341
16342 * indent.c (compute_motion): Process display vector front to back
16343 rather than the other way around. (Bug#2496)
16344
16345 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16346
16347 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16348
16349 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
16350
16351 * minibuf.c (Fread_from_minibuffer): Doc fix.
16352
16353 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16354
16355 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16356 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16357
16358 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16359
16360 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16361 value for non-existent files.
16362
16363 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16364
16365 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16366 set its "size" to -1. This will set the modtime_size field of
16367 the corresponding buffer to -1, which is what
16368 verify-visited-file-modtime expects for files that do not exist.
16369 (Bug#9139)
16370
16371 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16372
16373 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16374 here ...
16375 * lisp.h: ... from here. push_key_description is no longer
16376 defined in keyboard.c, so its declaration should not be in
16377 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16378 logically belongs with push_key_description.
16379
16380 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16381
16382 * buffer.h: Include <sys/types.h> instead of <time.h>.
16383 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16384 Problem reported by Herbert J. Skuhra.
16385
16386 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16387
16388 * xml.c (parse_region): Make the parsing work for
16389 non-comment-starting XML files again (bug#9144).
16390
16391 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16392
16393 * image.c (gif_load): Fix calculation of bottom and right corner.
16394 (Bug#9468)
16395
16396 2011-09-10 Eli Zaretskii <eliz@gnu.org>
16397
16398 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16399 redisplay in small windows.
16400
16401 2011-09-09 Eli Zaretskii <eliz@gnu.org>
16402
16403 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16404
16405 2011-09-08 Martin Rudalics <rudalics@gmx.at>
16406
16407 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16408 Operate on live windows only.
16409
16410 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
16411
16412 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16413
16414 2011-09-07 Eli Zaretskii <eliz@gnu.org>
16415
16416 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16417 only under bidi iteration.
16418
16419 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16420
16421 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16422
16423 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16424
16425 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16426 Without this fix, the command to link temacs failed due to an
16427 undefined symbol __builtin_isnan. This is because
16428 /usr/include/iso/math_c99.h #defines isnan(x) to
16429 __builtin_isnan(x), but the bundled gcc, which identifies itself
16430 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16431 a __builtin_isnan.
16432 * floatfns.c (isnan): #undef, and then #define to a clone of
16433 what's in data.c.
16434 (Fisnan): Always define, since it's always available now.
16435 (syms_of_floatfns): Always define isnan at the Lisp level.
16436
16437 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16438
16439 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16440
16441 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16442
16443 * fileio.c: Fix bugs with large file offsets (Bug#9428).
16444 The previous code assumed that file offsets (off_t values) fit in
16445 EMACS_INT variables, which is not true on typical 32-bit hosts.
16446 The code messed up by falsely reporting buffer overflow in cases
16447 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16448 when "big" contains more than 2**29 bytes, even though this
16449 inserts just one byte and does not overflow the buffer.
16450 (Finsert_file_contents): Store file offsets as off_t
16451 values, not as EMACS_INT values. Check for overflow when
16452 converting between EMACS_INT and off_t. When checking for
16453 buffer overflow or for overlap, take the offsets into account.
16454 Don't use EMACS_INT for small values where int suffices.
16455 When checking for overlap, fix a typo: ZV was used where
16456 ZV_BYTE was intended.
16457 (Fwrite_region): Don't assume off_t fits into 'long'.
16458 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16459
16460 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
16461
16462 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16463
16464 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16465
16466 sprintf-related integer and memory overflow issues (Bug#9412).
16467
16468 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
16469 (esprintf, exprintf, evxprintf): New functions.
16470 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
16471 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
16472 (modify_event_symbol): Do not assume that the length of
16473 name_alist_or_stem is safe to alloca and fits in int.
16474 (Fexecute_extended_command): Likewise for function name and binding.
16475 (Frecursion_depth): Wrap around reliably on integer overflow.
16476 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16477 since some callers pass EMACS_INT values.
16478 (Fsingle_key_description): Don't crash if symbol name contains more
16479 than MAX_ALLOCA bytes.
16480 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16481 (get_minibuffer): Arg is now EMACS_INT, not int.
16482 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
16483 (esprintf, exprintf, evxprintf): New decls.
16484 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16485
16486 * dbusbind.c (signature_cat): New function.
16487 (xd_signature, Fdbus_register_signal):
16488 Do not overrun buffer; instead, report string overflow.
16489
16490 * dispnew.c (add_window_display_history): Don't overrun buffer.
16491 Truncate instead; this is OK since it's just a log.
16492
16493 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16494 even if the time zone offset is outlandishly large.
16495 Don't mishandle offset == INT_MIN.
16496
16497 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16498 when creating daemon; the previous buffer-overflow check was incorrect.
16499
16500 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16501 which has the guts of the old verror function.
16502
16503 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16504 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16505
16506 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16507 (font_unparse_xlfd): Don't blindly alloca long strings.
16508 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
16509 fits in int, when using sprintf. Use single snprintf to count
16510 length of string rather than counting it via multiple sprintfs;
16511 that's simpler and more reliable.
16512 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16513 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16514 sprintf, in case result does not fit in int.
16515
16516 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16517 (fontset_from_font): Print it.
16518
16519 * frame.c (tty_frame_count): Now printmax_t, not int.
16520 (make_terminal_frame, set_term_frame_name): Print it.
16521 (x_report_frame_params): In X, window IDs are unsigned long,
16522 not signed long, so print them as unsigned.
16523 (validate_x_resource_name): Check for implausibly long names,
16524 and don't assume name length fits in 'int'.
16525 (x_get_resource_string): Don't blindly alloca invocation name;
16526 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16527 not fit in int.
16528
16529 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16530 (xg_check_special_colors, xg_set_geometry):
16531 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16532
16533 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16534 Use esprintf, not sprintf, in case result does not fit in int.
16535
16536 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16537 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16538 it as a large positive number.
16539 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16540 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16541
16542 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16543 in case result does not fit in int.
16544
16545 * print.c (float_to_string): Detect width overflow more reliably.
16546 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16547 buffer overrun. Don't assume list length fits in 'int'. Treat
16548 print length of 0 as 0, not as infinity; to be consistent with other
16549 uses of print length in this function. Don't overflow print length
16550 index. Don't assume hash table size fits in 'long', or that
16551 vectorlike size fits in 'unsigned long'.
16552
16553 * process.c (make_process): Use printmax_t, not int, to format
16554 process-name gensyms.
16555
16556 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16557
16558 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16559 to avoid potential buffer overrun.
16560
16561 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16562 if X resource line is longer than 512 bytes.
16563
16564 * xfns.c (x_window): Make sprintf buffer a bit bigger
16565 to avoid potential buffer overrun.
16566
16567 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16568
16569 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16570
16571 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16572
16573 Integer overflow fixes for scrolling, etc.
16574 Without these, Emacs silently mishandles large integers sometimes.
16575 For example, "C-u 4294967297 M-x recenter" was treated as if
16576 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16577
16578 * xdisp.c (try_window_id): Check Emacs fixnum range before
16579 converting to 'int'.
16580
16581 * window.c (window_scroll_line_based, Frecenter):
16582 Check that an Emacs fixnum is in range before assigning it to 'int'.
16583 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16584 values converted from Emacs fixnums.
16585 (Frecenter): Don't wrap around a line count if it is out of 'int'
16586 range; instead, treat it as an extreme value.
16587 (Fset_window_configuration, compare_window_configurations):
16588 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16589
16590 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16591 that can exceed INT_MAX. Check that EMACS_INT value is in range
16592 before assigning it to the (possibly-narrower) index.
16593 (match_limit): Don't assume that a fixnum can fit in 'int'.
16594
16595 * print.c (print_object): Use ptrdiff_t, not int, for index that can
16596 exceed INT_MAX.
16597
16598 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
16599 (Fvertical_motion): Don't wrap around LINES values that don't fit
16600 in 'int'. Instead, treat them as extreme values. This is good
16601 enough for windows, which can't have more than INT_MAX lines anyway.
16602
16603 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16604
16605 * Require libxml/parser.h to avoid compilation warning.
16606
16607 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16608
16609 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16610 since this reportedly can destroy thread storage.
16611
16612 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
16613
16614 * syntax.c (find_defun_start): Update all cache variables if
16615 exiting early (Bug#9401).
16616
16617 2011-08-30 Eli Zaretskii <eliz@gnu.org>
16618
16619 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16620
16621 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16622 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16623 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16624
16625 * term.c (tty_append_glyph): New function.
16626 (produce_stretch_glyph): Static function and its prototype deleted.
16627
16628 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16629 Add prototypes.
16630
16631 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16632
16633 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16634 when checking :margin (Bug#9390).
16635 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
16636 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
16637 so that the name doesn't mislead. All uses changed.
16638
16639 2011-08-28 Johan Bockgård <bojohan@gnu.org>
16640
16641 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16642 set_tty_hooks.
16643
16644 2011-08-27 Eli Zaretskii <eliz@gnu.org>
16645
16646 * xdisp.c (move_it_to): Don't bail out early when reaching
16647 position beyond to_charpos, if we are scanning backwards.
16648 (move_it_vertically_backward): When DY == 0, make sure we get to
16649 the first character in the line after the newline.
16650
16651 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16652
16653 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16654 (ccl_driver): Do not generate an out-of-range pointer.
16655 (Fccl_execute_on_string): Remove unnecessary check for
16656 integer overflow, noted by Stefan Monnier in
16657 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16658 Remove a FIXME that didn't need fixing.
16659 Simplify the newly-introduced buffer reallocation code.
16660
16661 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
16662
16663 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16664
16665 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
16666
16667 Integer and memory overflow issues (Bug#9196).
16668
16669 * doc.c (get_doc_string): Rework so that
16670 get_doc_string_buffer_size is the actual buffer size, rather than
16671 being 1 less than the actual buffer size; this makes xpalloc more
16672 convenient.
16673
16674 * image.c (x_allocate_bitmap_record, cache_image):
16675 * xselect.c (Fx_register_dnd_atom):
16676 Simplify previous changes by using xpalloc.
16677
16678 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16679 since either will do and ptrdiff_t is convenient with xpalloc.
16680
16681 * charset.c (charset_table_size)
16682 (struct charset_sort_data.priority): Now ptrdiff_t.
16683 (charset_compare): Don't overflow if priorities differ greatly.
16684 (Fsort_charsets): Don't assume list length fits in int.
16685 Check for size-calculation overflow when allocating sort data.
16686 (syms_of_charset): Allocate an initial charset table that is
16687 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16688
16689 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16690
16691 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16692 The actual value is always <= INT_MAX, and leaving it unsigned made
16693 overflow checking harder.
16694
16695 * dispextern.h (struct glyph_matrix.rows_allocated)
16696 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16697 with xpalloc. The values are still always <= INT_MAX.
16698
16699 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16700
16701 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16702 (SAFE_NALLOCA): New macro.
16703
16704 * region-cache.c (struct boundary.pos, find_cache_boundary)
16705 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16706 (set_cache_region, invalidate_region_cache)
16707 (revalidate_region_cache, know_region_cache, region_cache_forward)
16708 (region_cache_backward, pp_cache):
16709 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16710 so that ptrdiff_t * can be passed to xpalloc.
16711 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16712 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16713 (pp_cache): Don't assume cache_len fits in int.
16714 * region-cache.h: Adjust extern decls to match.
16715
16716 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16717 EMACS_INT, since either will do, for xpalloc.
16718
16719 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16720 (xnmalloc, xnrealloc, xpalloc): New functions.
16721
16722 * bidi.c (bidi_shelve_header_size): New constant.
16723 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16724 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16725
16726 * bidi.c (bidi_cache_shrink):
16727 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16728 (overlay_strings):
16729 Don't update size of array until after memory allocation succeeds,
16730 because xmalloc/xrealloc may not return.
16731 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16732 now that we have proper integer overflow checking.
16733 (record_overlay_string, overlay_strings): Catch overflows when
16734 calculating size of overlay_str_buf.
16735
16736 * callproc.c (Fcall_process): Check for size overflow when
16737 calculating size of args2.
16738 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16739 Normally we prefer signed values, but sticking with ptrdiff_t would
16740 require adding more-complicated checks.
16741
16742 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16743 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16744 Redo buffer-overflow calculations to avoid integer overflow.
16745 Add a FIXME comment where memory seems to be over-allocated.
16746
16747 * character.c (Fstring): Check for size-calculation overflow.
16748
16749 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16750 unnecessary integer overflow. Check for size overflow.
16751 (encode_coding_object): Don't update size until xmalloc succeeds.
16752
16753 * composite.c (get_composition_id): Check for overflow in glyph
16754 length calculations.
16755
16756 Integer and memory overflow fixes for display code.
16757 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16758 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16759 (scrolling_window): Check for overflow in size calculations.
16760 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16761 Don't assume glyph table len fits in int.
16762 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16763 (row_table_size): Now ptrdiff_t, not int.
16764 (scrolling_window): Avoid overflow in size calculations.
16765 Don't update size until allocation succeeds.
16766 * fns.c (concat): Check for overflow in size calculations.
16767 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16768 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16769 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16770
16771 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16772 (get_doc_string): Check for size calculation overflow.
16773 Don't update size until allocation succeeds.
16774 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16775 EMACS_INT, where ptrdiff_t will do.
16776 (Fsubstitute_command_keys): Check for string overflow.
16777
16778 * editfns.c (set_time_zone_rule): Don't assume environment length
16779 fits in int.
16780 (message_length): Now ptrdiff_t, not int.
16781 (Fmessage_box): Don't update size until allocation succeeds.
16782 Don't assume message length fits in int.
16783 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16784
16785 * emacs.c (main): Do not reallocate argv, since there is a null at
16786 the end that can be overwritten, and this way there's no need to
16787 worry about size-calculation overflow.
16788 (sort_args): Check for size-calculation overflow.
16789
16790 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16791 alloc succeeds.
16792 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16793
16794 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16795 (x_set_scroll_bar_width, x_figure_window_size):
16796 Check for integer overflow.
16797 (x_set_alpha): Do not assume XINT fits in int.
16798
16799 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16800 This is for the members text_lines, text_cols, total_lines, total_cols,
16801 where the system imposes an 'int' limit.
16802
16803 * fringe.c (Fdefine_fringe_bitmap):
16804 Don't update size until alloc works.
16805
16806 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16807 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16808
16809 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16810 Check for size-calculation overflow.
16811 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16812 do, as we prefer signed integers.
16813 (id_to_widget.max_size, id_to_widget.used)
16814 (xg_store_widget_in_map, xg_remove_widget_from_map)
16815 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16816 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16817 Use and return ptrdiff_t, not int.
16818 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16819 * gtkutil.h: Change prototypes to match the above.
16820
16821 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16822 are duplicate now that they've been promoted to lisp.h.
16823 (x_allocate_bitmap_record, x_alloc_image_color)
16824 (make_image_cache, cache_image, xpm_load):
16825 Don't update size until alloc is done.
16826 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16827 (x_detect_edges):
16828 Check for size calculation overflow.
16829 (ct_colors_allocated_max): New constant.
16830 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16831 overflow.
16832
16833 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16834 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16835 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16836 Use ptrdiff_t, not int, to count maps.
16837 (read_char_minibuf_menu_prompt): Check for overflow in size
16838 calculations. Don't update size until allocation succeeds.
16839 Redo calculations to avoid overflow.
16840 * keyboard.h: Change prototypes to match the above.
16841
16842 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16843 to count maps.
16844 (current_minor_maps): Check for size calculation overflow.
16845 * keymap.h: Change prototypes to match the above.
16846
16847 * lread.c (read1, init_obarray): Don't update size until alloc done.
16848
16849 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16850 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16851
16852 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16853 Now ptrdiff_t, not int.
16854 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16855 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16856
16857 * process.c (Fnetwork_interface_list): Check for overflow
16858 in size calculation.
16859
16860 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16861
16862 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16863 overflow. Don't bother calling xmalloc when xrealloc will do.
16864
16865 * search.c (Freplace_match): Check for size calculation overflow.
16866 (Fset_match_data): Don't assume list lengths fit in 'int'.
16867
16868 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16869 for command line length. Do not attempt to address one before the
16870 beginning of an array, as that's not portable.
16871
16872 * term.c (max_frame_lines): Remove; unused.
16873 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16874 not int.
16875 (encode_terminal_code, calculate_costs): Check for size
16876 calculation overflow.
16877 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16878 table lengths and related sizes. Don't update size until alloc
16879 done. Redo calculations to avoid overflow.
16880 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16881
16882 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16883 subtracting pointers.
16884 (gobble_line): Check for overflow more carefully. Don't update size
16885 until alloc done.
16886
16887 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16888 Don't update size until alloc done.
16889 Redo size calculations to avoid overflow.
16890 Check for size calculation overflow.
16891 (main) [DEBUG]: Fix typo in invoking tparam1.
16892
16893 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16894 Use ptrdiff_t, not int, for sizes.
16895 (store_mode_line_noprop_char): Don't update size until alloc done.
16896
16897 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16898 Use ptrdiff_t, not int, for sizes.
16899 (Finternal_make_lisp_face, cache_face):
16900 Check for size calculation overflow.
16901 (cache_face): Treat size calculation overflows as if they were
16902 memory exhaustion (the usual treatment), rather than aborting.
16903
16904 * xfns.c (x_encode_text, x_set_name_internal)
16905 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16906 sizes, since they can exceed INT_MAX in size. Check for size
16907 calculation overflow.
16908
16909 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16910 (xg_select): Check for size calculation overflow.
16911 Don't update size until alloc done.
16912
16913 * xrdb.c (get_environ_db): Don't assume path length fits in int,
16914 as sprintf is limited to int lengths.
16915
16916 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16917 (X_LONG_MIN): New macros.
16918 Use them to make the following changes clearer.
16919 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16920 This change doesn't affect the value now, but it may help remind
16921 future maintainers not to raise the value too much later.
16922 (SELECTION_QUANTUM): Remove, replacing with ...
16923 (selection_quantum): ... new function, which avoids overflow.
16924 All uses changed.
16925 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16926 assumption that selection length fits in 'int'.
16927 (x_reply_selection_request, x_handle_selection_request)
16928 (x_get_window_property, receive_incremental_selection)
16929 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16930 (lisp_data_to_selection_data, clean_local_selection_data):
16931 Use ptrdiff_t, not int, to record length of selection.
16932 (x_reply_selection_request, x_get_window_property)
16933 (receive_incremental_selection, x_property_data_to_lisp):
16934 Redo calculations to avoid overflow.
16935 (x_reply_selection_request): When sending hint, ceiling it at
16936 X_LONG_MAX rather than relying on wraparound overflow to send
16937 something.
16938 (x_get_window_property, receive_incremental_selection)
16939 (lisp_data_to_selection_data, x_property_data_to_lisp):
16940 Check for size-calculation overflow.
16941 (x_get_window_property, receive_incremental_selection)
16942 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16943 Don't store size until memory allocation succeeds.
16944 (x_get_window_property): Plug memory leak on memory exhaustion.
16945 Don't double-block input; malloc is safe here. Don't assume 2**34
16946 - 4 fits in unsigned long. Add an xassert to check
16947 XGetWindowProperty overflow. Be more careful about overflow
16948 calculations, and distinguish size from memory overflow better.
16949 (receive_incremental_selection): When tracing, don't assume
16950 unsigned int is less than INT_MAX.
16951 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16952 harmful) conversions of unsigned short to int.
16953 (lisp_data_to_selection_data): Don't assume that integers
16954 in the range -65535 through -1 fit in an X unsigned short.
16955 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16956 result parameters unless successful. Rely on cons_to_unsigned
16957 to report problems with elements; the old code wasn't right anyway.
16958 (x_check_property_data): Check for int overflow; we cannot use
16959 a wider type due to X limits.
16960 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16961
16962 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
16963
16964 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16965 (x_term_init): Check for size calculation overflow.
16966 (x_color_cells): Don't store size until memory allocation succeeds.
16967 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
16968 Don't assume alloca size is less than MAX_ALLOCA.
16969 (x_term_init): Don't assume length fits in int (sprintf is limited
16970 to int size).
16971
16972 Use ptrdiff_t for composition IDs.
16973 * character.c (lisp_string_width):
16974 * composite.c (composition_table_size, n_compositions)
16975 (get_composition_id, composition_gstring_from_id):
16976 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16977 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16978 * window.c (Frecenter):
16979 Use ptrdiff_t, not int, for composition IDs.
16980 * composite.c (get_composition_id): Check for integer overflow.
16981 * composite.h: Adjust prototypes to match the above changes.
16982
16983 Use ptrdiff_t for hash table indexes.
16984 * category.c (hash_get_category_set):
16985 * ccl.c (ccl_driver):
16986 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16987 * coding.c (coding_system_charset_list, detect_coding_system):
16988 * coding.h (struct coding_system.id):
16989 * composite.c (get_composition_id, gstring_lookup_cache):
16990 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16991 * image.c (xpm_get_color_table_h):
16992 * lisp.h (hash_lookup, hash_put):
16993 * minibuf.c (Ftest_completion):
16994 Use ptrdiff_t for hash table indexes, not int (which is too
16995 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16996 32-bit --with-wide-int hosts).
16997
16998 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16999 Add a FIXME comment about memory leaks.
17000 (syms_of_charset): Don't assume xmalloc returns.
17001
17002 Don't assume that stated character widths fit in int.
17003 * character.c (Fchar_width, c_string_width, lisp_string_width):
17004 * character.h (CHAR_WIDTH):
17005 * indent.c (MULTIBYTE_BYTES_WIDTH):
17006 Use sanitize_char_width to avoid undefined and/or bad behavior
17007 with outlandish widths.
17008 * character.h (sanitize_tab_width): Rename from sanitize_width,
17009 now that we have two such functions. All uses changed.
17010 (sanitize_char_width): New inline function.
17011
17012 Don't assume that tab-width fits in int.
17013 * character.h (sanitize_width): New inline function.
17014 (SANE_TAB_WIDTH): New macro.
17015 (ASCII_CHAR_WIDTH): Use it.
17016 * indent.c (sane_tab_width): Remove. All uses replaced by
17017 SANE_TAB_WIDTH (current_buffer).
17018 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17019
17020 * fileio.c: Integer overflow issues with file modes.
17021 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17022
17023 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17024 Remove unreachable code.
17025 (read_hex, load_charset_map_from_file): Check for integer overflow.
17026
17027 * xterm.c: Don't go over XClientMessageEvent limit.
17028 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17029 (x_send_scroll_bar_event): Likewise. Check that the size does not
17030 exceed limits imposed by XClientMessageEvent, as well as the usual
17031 ptrdiff_t and size_t limits.
17032
17033 * keyboard.c: Overflow, signedness and related fixes.
17034 (make_lispy_movement): Use same integer type in forward decl
17035 that is used in the definition.
17036 (read_key_sequence, keyremap_step):
17037 Change bufsize argument back to int, undoing my 2011-03-30 change.
17038 We prefer signed types, and int is wide enough here.
17039 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17040 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17041 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17042 length, not size_t. Use ptrdiff_t for index, not int.
17043 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17044 possibility of integer overflow.
17045
17046 Overflow, signedness and related fixes for images.
17047
17048 * dispextern.h (struct it.stack[0].u.image.image_id)
17049 (struct_it.image_id, struct image.id, struct image_cache.size)
17050 (struct image_cache.used, struct image_cache.ref_count):
17051 * gtkutil.c (update_frame_tool_bar):
17052 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17053 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17054 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17055 * nsmenu.m (update_frame_tool_bar):
17056 * xdisp.c (calc_pixel_width_or_height):
17057 * xfns.c (image_cache_refcount):
17058 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17059 on typical 64-bit hosts.
17060
17061 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17062 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17063 Omit unnecessary casts to int.
17064 (parse_image_spec): Check that integers fall into 'int' range
17065 when the callers expect that.
17066 (image_ascent): Redo ascent calculation to avoid int overflow.
17067 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17068 (lookup_image): Remove unnecessary tests.
17069 (xbm_image_p): Locals are now of int, not EMACS_INT,
17070 since parse_image_check makes sure they fit into int.
17071 (png_load, gif_load, svg_load_image):
17072 Prefer int to unsigned where either will do.
17073 (tiff_handler): New function, combining the cores of the
17074 old tiff_error_handler and tiff_warning_handler.
17075 This function is rewritten to use vsnprintf and thereby avoid
17076 stack buffer overflows. It uses only the features of vsnprintf
17077 that are common to both POSIX and native Microsoft.
17078 (tiff_error_handler, tiff_warning_handler): Use it.
17079 (tiff_load, gif_load, imagemagick_load_image):
17080 Don't assume :index value fits in 'int'.
17081 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17082 (imagemagick_load_image): Check that crop parameters fit into
17083 the integer types that MagickCropImage accepts. Don't assume
17084 Vimagemagick_render_type has a nonnegative value. Don't assume
17085 size_t fits in 'long'.
17086 (gs_load): Use printmax_t to print the widest integers possible.
17087 Check for integer overflow when computing image height and width.
17088
17089 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17090
17091 * xdisp.c (redisplay_window): Don't force window start if point
17092 will be invisible in the resulting window. (Bug#9324)
17093
17094 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17095
17096 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17097 the display spec is of the form `(space ...)'.
17098 (handle_display_spec): Return the value returned by
17099 handle_single_display_spec, not just 1 or zero.
17100 (handle_single_display_spec): If the display spec is of the form
17101 `(space ...)', and specifies display in the text area, return 2
17102 rather than 1.
17103 (try_cursor_movement): Check for the need to scroll more
17104 accurately, and prefer exact match for point under bidi.
17105 Don't advance `row' beyond the last row of the window.
17106
17107 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17108 into disp_prop; all users changed.
17109
17110 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17111 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17112 for the text covered by the display property.
17113
17114 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17115
17116 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17117 Change return value to nil.
17118 (Frecord_buffer): Delete unused function.
17119
17120 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17121
17122 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17123 buffers, return left-to-right.
17124 (set_cursor_from_row): Consider candidate row a win if its glyph
17125 represents a newline and point is on that newline. Fixes cursor
17126 positioning on the newline at EOL of R2L text within L2R
17127 paragraph, and vice versa.
17128 (try_cursor_movement): Check continued rows, in addition to
17129 continuation rows. Fixes unwarranted scroll when point enters a
17130 continued line of R2L text within an L2R paragraph, or vice versa.
17131 (cursor_row_p): Consider the case of point being equal to
17132 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17133 from the end of a short line to the beginning of a continued line
17134 of R2L text within L2R paragraph.
17135 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17136 composed characters.
17137
17138 * bidi.c (bidi_check_type): Use xassert.
17139 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17140 members.
17141
17142 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17143
17144 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17145 a character.
17146
17147 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17148
17149 * nsfont.m (ns_otf_to_script): Fix typo.
17150
17151 2011-08-22 Kenichi Handa <handa@m17n.org>
17152
17153 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17154 extra slot even if the purpose is char-code-property-table.
17155
17156 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17157
17158 * xdisp.c (redisplay_window): When computing centering_position,
17159 account for the height of the header line. (Bug#8874)
17160
17161 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17162 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17163 candidate is selected by the mouse, and that candidate has a
17164 composed character under the mouse.
17165
17166 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17167 coordinates reported by pos-visible-in-window-p for a composed
17168 character in column zero.
17169
17170 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17171
17172 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17173
17174 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17175
17176 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17177 consider it a hit if to_charpos is anywhere in the range of the
17178 composed buffer positions.
17179
17180 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17181
17182 * image.c (gif_load): Don't assume that each subimage has the same
17183 dimensions as the base image. Handle disposal method that is
17184 "undefined" by the gif spec (Bug#9335).
17185
17186 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17187
17188 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17189 (Fcondition_case): Document `debug' symbol in error handler.
17190
17191 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17192
17193 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17194 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17195 from an Org mode buffer to a Speedbar frame.
17196
17197 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17198 a composition, take its buffer position from IT->cmp_it.charpos.
17199 Fixes cursor positioning at the beginning of a line that begins
17200 with a composed character.
17201
17202 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17203
17204 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17205 character bidirectional type, use STRONG_L instead. Fixes crashes
17206 in a buffer produced by `describe-categories'.
17207
17208 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17209 members before the level stack, so they would be saved and
17210 restored when copying iterator state. Fixes incorrect reordering
17211 around TABs covered by display properties.
17212
17213 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17214
17215 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17216
17217 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17218
17219 * eval.c (internal_condition_case, internal_condition_case_1)
17220 (internal_condition_case_2, internal_condition_case_n):
17221 Remove unnecessary aborts (Bug#9081).
17222
17223 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17224
17225 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17226 has no `load' handler, try opening the file locally. (Bug#9311)
17227
17228 2011-08-16 Ken Brown <kbrown@cornell.edu>
17229
17230 * gmalloc.c: Expand comment.
17231
17232 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17233
17234 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17235 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17236
17237 2011-08-16 Ken Brown <kbrown@cornell.edu>
17238
17239 Fix memory allocation problems in Cygwin build (Bug#9273).
17240
17241 * unexcw.c ( __malloc_initialized): Declare external variable.
17242 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17243
17244 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17245 New variables.
17246 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17247 dumped emacs.
17248 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17249 in the static heap.
17250 [CYGWIN] (special_realloc): New function.
17251 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17252 requests to realloc storage in the static heap.
17253
17254 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17255
17256 * bidi.c (bidi_initialize): Remove unused local.
17257
17258 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17259
17260 * bidimirror.h:
17261 * biditype.h: Remove file.
17262 * makefile.w32-in ($(BLD)/bidi.$(O)):
17263 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17264
17265 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17266
17267 * chartab.c: Improve commentary for the uniprop_table API.
17268
17269 * bidi.c (bidi_paragraph_init): Support zero value of
17270 bidi_ignore_explicit_marks_for_paragraph_level.
17271 (bidi_initialize): Use uniprop_table instead of including
17272 biditype.h and bidimirror.h.
17273
17274 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17275 coordinates of the iterator when restoring from ppos_it.
17276 (Bug#9296)
17277
17278 2011-08-14 Kenichi Handa <handa@m17n.org>
17279
17280 * process.c (create_process): Call setup_process_coding_systems
17281 after the pid of the process is set to -1 (Bug#8162).
17282
17283 2011-08-14 Eli Zaretskii <eliz@gnu.org>
17284
17285 * xdisp.c (move_it_in_display_line_to): Don't invoke
17286 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17287 ppos_it. Fixes vertical cursor motion when line beginning is
17288 covered by an image. (Bug#9296)
17289
17290 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17291
17292 * nsterm.h (ns_run_ascript): Declare.
17293 (NSAPP_DATA2_RUNASSCRIPT): Define.
17294
17295 * nsfns.m (as_script, as_result, as_status): New static variables.
17296 (ns_run_ascript): New function.
17297 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
17298 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17299 the event loop. Get status from as_status (Bug#7276).
17300
17301 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17302 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17303 the event loop (Bug#7276).
17304
17305 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17306
17307 * gnutls.c (QCgnutls_bootprop_priority)
17308 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17309 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17310 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17311 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17312 (QCgnutls_bootprop_verify_hostname_error)
17313 (QCgnutls_bootprop_callbacks_verify): Rename from
17314 Qgnutls_bootprop_..., all uses changed.
17315
17316 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17317 uses changed.
17318
17319 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17320
17321 * xfaces.c (Qframe_set_background_mode): Now static.
17322 * dispextern.h (Qframe_set_background_mode): Remove decl.
17323
17324 * process.c (Fnetwork_interface_info): Declare local only if needed.
17325
17326 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17327
17328 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17329 (Fnetwork_interface_list): Allocate in increments of bytes instead
17330 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17331 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17332 sockaddr.
17333 (struct ifflag_def): notrailers is smart on OSX.
17334 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17335 Get hardware address with getifaddrs if available.
17336
17337 2011-08-12 Eli Zaretskii <eliz@gnu.org>
17338
17339 * xdisp.c (iterate_out_of_display_property): xassert that
17340 IT->position is set to within IT->object's boundaries. Break from
17341 the loop as soon as EOB is reached; avoids infloops in redisplay
17342 when IT->position is set up wrongly due to some bug.
17343 Set IT->current to match the bidi iterator unconditionally.
17344 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17345 entry. Force push_it to save on the stack the current
17346 buffer/string position, to be restored by pop_it. Fix flags in
17347 the iterator structure wrt the object coming from a display
17348 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17349 properties. (Bug#9284)
17350
17351 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
17352
17353 * fontset.c (fontset_get_font_group): Add proper type checks.
17354 (Bug#9172)
17355
17356 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17357
17358 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17359 and LC_VERSION_MIN_MACOSX.
17360 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17361 (dump_it) [LC_FUNCTION_STARTS]: Use it.
17362
17363 2011-08-08 Eli Zaretskii <eliz@gnu.org>
17364
17365 * xdisp.c (forward_to_next_line_start): Allow to use the
17366 no-display-properties-and-no-overlays under bidi display.
17367 Set disp_pos in the bidi iterator to avoid searches for display
17368 properties and overlays.
17369
17370 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
17371
17372 * editfns.c (Fset_time_zone_rule): Document relationship with the
17373 setenv function.
17374
17375 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17376 the font entity extracted from the cache (Bug#8109).
17377
17378 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
17379
17380 * composite.c (autocmp_chars): Don't reset point. That is done by
17381 restore_point_unwind (Bug#5984).
17382
17383 2011-08-07 Juri Linkov <juri@jurta.org>
17384
17385 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17386 to show the arg `TIME' instead of `TIMEVAL'.
17387
17388 2011-08-06 Eli Zaretskii <eliz@gnu.org>
17389
17390 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17391 display property strides EOL and includes a newline, as in
17392 longlines-mode. (Bug#9254)
17393 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17394 word-wrap under bidirectional display. (Bug#9224)
17395
17396 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17397 is non-zero, even if the data buffer is NULL. Fixes a crash in
17398 vertical-motion with longlines-mode. (Bug#9254)
17399
17400 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17401
17402 * bidi.c <bidi_cache_total_alloc>: Now static.
17403 (bidi_initialize): Initialize bidi_cache_total_alloc.
17404
17405 * xdisp.c (display_line): Release buffer allocated for shelved bidi
17406 cache. (Bug#9221)
17407
17408 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17409 amount allocated this far in `bidi_cache_total_alloc'.
17410 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17411 non-zero, only free the data buffer without restoring the cache
17412 contents. All callers changed.
17413
17414 * dispextern.h (bidi_unshelve_cache): Update prototype.
17415
17416 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17417 (move_it_in_display_line, move_it_to)
17418 (move_it_vertically_backward, move_it_by_lines): Replace the call
17419 to xfree to an equivalent call to bidi_unshelve_cache.
17420 (move_it_in_display_line_to): Fix logic of returning
17421 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
17422
17423 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17424
17425 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17426 came from a string character with a `cursor' property. (Bug#9229)
17427
17428 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17429
17430 * Makefile.in (LIB_PTHREAD): New variable.
17431 (LIBES): Add LIB_PTHREAD (Bug#9216).
17432
17433 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17434 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17435
17436 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17437
17438 * regex.c (re_iswctype): Remove some redundant boolean conversions.
17439
17440 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17441
17442 * xterm.c (x_find_topmost_parent): New function.
17443 (x_set_frame_alpha): Find topmost parent window with
17444 x_find_topmost_parent and set the property there also (bug#9181).
17445 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17446
17447 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17448
17449 * callproc.c (Fcall_process): Avoid vfork clobbering
17450 the local vars buffer, coding_systems, current_dir.
17451
17452 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17453
17454 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17455
17456 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17457
17458 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17459 so that it is not optimized away.
17460
17461 * xdisp.c (compute_display_string_pos): Remove unused local.
17462
17463 2011-08-02 Eli Zaretskii <eliz@gnu.org>
17464
17465 Fix slow cursor motion and scrolling in large buffers with
17466 selective display, like Org Mode buffers. (Bug#9218)
17467
17468 * dispextern.h (struct bidi_it): New member disp_prop_p.
17469
17470 * xdisp.c: Remove one-slot cache of display string positions.
17471 (compute_display_string_pos): Accept an additional argument
17472 DISP_PROP_P; callers changed. Scan at most 5K characters forward
17473 for a display string or property. If found, set DISP_PROP_P
17474 non-zero.
17475
17476 * bidi.c (bidi_fetch_char): Accept an additional argument
17477 DISP_PROP_P, and pass it to compute_display_string_pos.
17478 Only handle text covered by a display string if DISP_PROP_P is returned
17479 non-zero. All callers of bidi_fetch_char changed.
17480
17481 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17482
17483 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17484
17485 2010-12-03 Don March <don@ohspite.net>
17486
17487 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17488 last character M-[char] is translated to ESC [char] (bug#7541).
17489
17490 2011-08-02 Kenichi Handa <handa@m17n.org>
17491
17492 * lisp.h (uniprop_table): Extern it.
17493
17494 * chartab.c (uniprop_table): Make it non-static.
17495
17496 2011-08-01 Eli Zaretskii <eliz@gnu.org>
17497
17498 * xdisp.c (forward_to_next_line_start): Accept additional argument
17499 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17500 on the newline.
17501 (reseat_at_next_visible_line_start): Use the bidi iterator state
17502 returned by forward_to_next_line_start to restore the state of
17503 it->bidi_it after backing up to previous newline. (Bug#9212)
17504
17505 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17506
17507 * regex.c (re_comp): Protoize.
17508 (re_exec): Fix return type.
17509 (regexec): Fix type of `ret'. (Bug#9203)
17510
17511 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17512
17513 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17514 This is needed if max-image-size is a floating-point number.
17515
17516 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17517
17518 * print.c (print_object): Print empty symbol as ##.
17519
17520 * lread.c (read1): Read ## as empty symbol.
17521
17522 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17523
17524 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17525 setting frame foreground color (Bug#9175).
17526 (x_set_background_color): Likewise.
17527
17528 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17529 contents (Bug#9176).
17530 (EmacsTooltip -init): Remove bezels and add shadows to
17531 tooltip windows.
17532
17533 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17534 or scroll bar (Bug#8470).
17535
17536 * nsfont.m (nsfont_open): Remove assignment to voffset and
17537 unnecessary vars hshink, expand, hd, full_height, min_height.
17538 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17539
17540 * nsterm.h (nsfont_info): Remove voffset field.
17541
17542 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17543
17544 Implement strike-through and overline on NextStep (Bug#8863).
17545
17546 * nsfont.m (nsfont_open): Use underline position provided by font,
17547 instead of hard-coded value of 2.
17548 (nsfont_draw): Call ns_draw_text_decoration instead.
17549
17550 * nsterm.h: Add declaration for ns_draw_text_decoration.
17551
17552 * nsterm.m (ns_draw_text_decoration): New function for drawing
17553 underline, overline, and strike-through.
17554 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17555 ns_draw_text_decoration. Change treatment of cursor drawing to
17556 accommodate underlining, etc.
17557
17558 2011-07-28 Eli Zaretskii <eliz@gnu.org>
17559
17560 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17561 default.
17562
17563 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17564
17565 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17566 Without this fix, if a signal arrives just after memory fills up,
17567 'malloc' might be invoked reentrantly.
17568
17569 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17570 In other words, assume that every image size is allowed, on non-X
17571 hosts. This assumption is probably wrong, but it lets Emacs compile.
17572
17573 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17574
17575 * regex.c (re_iswctype): Convert return values to boolean.
17576
17577 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17578
17579 * xdisp.c (compute_display_string_pos): Don't use cached display
17580 string position if the buffer had its restriction changed.
17581 (Bug#9184)
17582
17583 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17584
17585 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17586
17587 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17588
17589 Integer signedness and overflow and related fixes. (Bug#9079)
17590
17591 * bidi.c: Integer size and overflow fixes.
17592 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17593 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17594 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17595 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17596 (bidi_find_other_level_edge):
17597 Use ptrdiff_t instead of EMACS_INT where either will do.
17598 This works better on 32-bit hosts configured --with-wide-int.
17599 (bidi_cache_ensure_space): Check for size-calculation overflow.
17600 Use % rather than repeated addition, for better worst-case speed.
17601 Don't set bidi_cache_size until after xrealloc returns, because it
17602 might not return.
17603 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
17604 (bidi_cache_ensure_space): Also check that the bidi cache size
17605 does not exceed that of the largest Lisp string or buffer. See Eli
17606 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
17607
17608 * alloc.c (__malloc_size_t): Remove.
17609 All uses replaced by size_t. See Andreas Schwab's note
17610 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17611
17612 * image.c: Improve checking for integer overflow.
17613 (check_image_size): Assume that f is nonnull, since
17614 it is always nonnull in practice. This is one less thing to
17615 worry about when checking for integer overflow later.
17616 (x_check_image_size): New function, which checks for integer
17617 overflow issues inside X.
17618 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17619 This removes the need for a memory_full check.
17620 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17621 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17622 (xbm_read_bitmap_data): Change locals back to 'int', since
17623 their values must fit in 'int'.
17624 (xpm_load_image, png_load, tiff_load):
17625 Invoke x_create_x_image_and_pixmap earlier,
17626 to avoid much needless work if the image is too large.
17627 (tiff_load): Treat overly large images as if
17628 x_create_x_image_and_pixmap failed, not as malloc failures.
17629 (gs_load): Use x_check_image_size.
17630
17631 * gtkutil.c: Omit integer casts.
17632 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17633 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17634
17635 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17636
17637 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17638 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17639 would wrongly return t on a 64-bit host.
17640
17641 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17642 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17643 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17644 and therefore cause GCC to emit a bogus diagnostic in some cases.
17645
17646 * image.c: Integer signedness and overflow and related fixes.
17647 This is not an exhaustive set of fixes, but it's time to
17648 record what I've got.
17649 (lookup_pixel_color, check_image_size): Remove redundant decls.
17650 (check_image_size): Don't assume that arbitrary EMACS_INT values
17651 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17652 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17653 (tiff_load, imagemagick_load_image):
17654 Check for overflow in size calculations.
17655 (x_create_x_image_and_pixmap): Remove unnecessary test for
17656 xmalloc returning NULL; that can't happen.
17657 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17658 (xpm_color_bucket): Use better integer hashing function.
17659 (xpm_cache_color): Don't possibly over-allocate memory.
17660 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17661 (gif_memory_source):
17662 Use ptrdiff_t, not int or size_t, to record sizes.
17663 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17664 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17665 either works, as we prefer signed integers.
17666 (tiff_read_from_memory, tiff_write_from_memory):
17667 Return tsize_t, not size_t, since that's what the TIFF API wants.
17668 (tiff_read_from_memory): Don't fail simply because the read would
17669 go past EOF; instead, return a short read.
17670 (tiff_load): Omit no-longer-needed casts.
17671 (Fimagemagick_types): Don't assume size fits into 'int'.
17672
17673 Improve hashing quality when configured --with-wide-int.
17674 * fns.c (hash_string): New function, taken from sxhash_string.
17675 Do not discard information about ASCII character case; this
17676 discarding is no longer needed.
17677 (sxhash-string): Use it. Change sig to match it. Caller changed.
17678 * lisp.h: Declare it.
17679 * lread.c (hash_string): Remove, since we now use fns.c's version.
17680 The fns.c version returns a wider integer if --with-wide-int is
17681 specified, so this should help the quality of the hashing a bit.
17682
17683 * emacs.c: Integer overflow minor fix.
17684 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17685 Define only if GNU_LINUX.
17686 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17687
17688 * dispnew.c: Integer signedness and overflow fixes.
17689 Remove unnecessary forward decls, that were a maintenance hassle.
17690 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17691 All uses changed.
17692 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17693 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17694 (prepare_desired_row, line_draw_cost):
17695 Use int, not unsigned, where either works.
17696 (save_current_matrix, restore_current_matrix):
17697 Use ptrdiff_t, not size_t, where either works.
17698 (init_display): Check for overflow more accurately, and without
17699 relying on undefined behavior.
17700
17701 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17702 Remove, replacing with the new symbols in lisp.h. All uses changed.
17703 * fileio.c (make_temp_name):
17704 * filelock.c (lock_file_1, lock_file):
17705 * xdisp.c (message_dolog):
17706 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17707 Use pMd etc. instead.
17708 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17709 replacing the pWIDE etc. symbols removed from editfns.c.
17710
17711 * keyboard.h (num_input_events): Now uintmax_t.
17712 This is (very slightly) less likely to mess up due to wraparound.
17713 All uses changed.
17714
17715 * buffer.c: Integer signedness fixes.
17716 (alloc_buffer_text, enlarge_buffer_text):
17717 Use ptrdiff_t rather than size_t when either will do, as we prefer
17718 signed integers.
17719
17720 * alloc.c: Integer signedness and overflow fixes.
17721 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17722 (__malloc_size_t): Default to size_t, not to int.
17723 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17724 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17725 Prefer ptrdiff_t to size_t when either would do, as we prefer
17726 signed integers.
17727 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17728 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17729 Now const. Initialize with values that are in range even if char
17730 is signed.
17731 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17732 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17733 These functions do the right thing with sizes > 2**32.
17734 (check_depth): Now ptrdiff_t, not int.
17735 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17736 Adjust to new way of storing sizes. Check for size overflow bugs
17737 in rest of code.
17738 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17739 slightly wrong anyway, as it missed one instance of
17740 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17741 (refill_memory_reserve): Omit needless cast to size_t.
17742 (mark_object_loop_halt): Mark as externally visible.
17743
17744 * xselect.c: Integer signedness and overflow fixes.
17745 (Fx_register_dnd_atom, x_handle_dnd_message):
17746 Use ptrdiff_t, not size_t, since we prefer signed.
17747 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17748 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17749 x_dnd_atoms_size and x_dnd_atoms_length.
17750
17751 * doprnt.c: Prefer signed to unsigned when either works.
17752 * eval.c (verror):
17753 * doprnt.c (doprnt):
17754 * lisp.h (doprnt):
17755 * xdisp.c (vmessage):
17756 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17757 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17758 prefer signed arithmetic to avoid comparison confusion.
17759 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17760 but is a bit tricky.
17761
17762 Assume freestanding C89 headers, string.h, stdlib.h.
17763 * data.c, doprnt.c, floatfns.c, print.c:
17764 Include float.h unconditionally.
17765 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17766 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17767 * regex.c: Likewise for stddef.h, string.h.
17768 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17769 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17770 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17771 (STDC_HEADERS): Remove obsolete defines.
17772 * sysdep.c: Include limits.h unconditionally.
17773
17774 Assume support for memcmp, memcpy, memmove, memset.
17775 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17776 * regex.c (memcmp, memcpy):
17777 Remove; we assume C89 now.
17778
17779 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17780 (__malloc_safe_bcopy): Remove; no longer needed.
17781
17782 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
17783 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17784 well either way, and we prefer signed to unsigned.
17785
17786 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17787
17788 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17789 closes the connection while we're reading (bug#9182).
17790
17791 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
17792
17793 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17794 are specified (Bug#9168).
17795
17796 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17797
17798 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17799 Found by GCC static checking and --with-wide-int on a 32-bit host.
17800
17801 2011-07-25 Eli Zaretskii <eliz@gnu.org>
17802
17803 * xdisp.c (compute_display_string_pos): Fix logic of caching
17804 previous display string position. Initialize cached_prev_pos to
17805 -1. Fixes slow-down at the beginning of a buffer.
17806
17807 2011-07-24 Eli Zaretskii <eliz@gnu.org>
17808
17809 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17810 for attrs[LFACE_FONTSET_INDEX].
17811
17812 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17813
17814 * xml.c (parse_region): Remove unused local
17815 that was recently introduced.
17816
17817 2011-07-23 Eli Zaretskii <eliz@gnu.org>
17818
17819 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17820 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17821
17822 * xdisp.c (move_it_in_display_line_to): Record the best matching
17823 position for TO_CHARPOS while scanning the line, and restore it on
17824 exit if none of the characters scanned was an exact match.
17825 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
17826 when exact match is impossible due to invisible text, and the
17827 lines are truncated.
17828
17829 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17830
17831 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17832 for OSX >= 10.7.
17833
17834 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17835
17836 Fix a significant slow-down of cursor motion with C-n, C-p,
17837 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17838 auto-repeat under bidi redisplay in fontified buffers.
17839 * xdisp.c (compute_stop_pos_backwards): New function.
17840 (next_element_from_buffer): Call compute_stop_pos_backwards to
17841 find a suitable prev_stop when we find ourselves before
17842 base_level_stop.
17843 (reseat): Don't look for prev_stop, as that could mean a very long
17844 run.
17845 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17846 <cached_disp_overlay_modiff>: Cache for last found display string
17847 position.
17848 (compute_display_string_pos): Return the cached position if asked
17849 about the same buffer in the same area of character positions, and
17850 the buffer wasn't changed since the time the display string
17851 position was cached.
17852
17853 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17854
17855 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17856 is an integer, which is important for empty lines. (Bug#9149)
17857
17858 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
17859
17860 * frame.c (Fmodify_frame_parameters): In tty case, update the
17861 default face if necessary (Bug#4238).
17862
17863 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
17864
17865 * editfns.c (Fstring_to_char): No need to explain what a character
17866 is in the docstring (Bug#6576).
17867
17868 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17869
17870 * xml.c (parse_region): Make sure we always return a tree.
17871
17872 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17873
17874 * xml.c (parse_region): If a document contains only comments,
17875 return that, too.
17876
17877 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17878
17879 * xml.c (make_dom): Return comments, too.
17880
17881 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17882
17883 Port to OpenBSD.
17884 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17885 and the surrounding thread.
17886 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17887 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17888 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17889 timer goes off.
17890 * s/openbsd.h (BROKEN_SIGIO): Define.
17891 * unexelf.c (unexec) [__OpenBSD__]:
17892 Don't update the .mdebug section of the Alpha COFF symbol table.
17893
17894 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17895
17896 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17897 (bug#8460).
17898
17899 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17900
17901 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17902 This fixes some race conditions on the permissions of any newly
17903 created file.
17904
17905 * alloc.c (valid_pointer_p): Use pipe, not open.
17906 This fixes some permissions issues when debugging.
17907
17908 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17909 If fchown fails to set both uid and gid, try to set just gid,
17910 as that is sometimes allowed. Adjust the file's mode to eliminate
17911 setuid or setgid bits that are inappropriate if fchown fails.
17912
17913 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17914
17915 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17916 to compare Lisp_Objects.
17917 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17918 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17919 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17920
17921 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17922
17923 * lread.c (read_integer): Unread even EOF character.
17924 (read1): Likewise. Properly record start position of symbol.
17925
17926 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17927 symbol character follows.
17928
17929 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17930
17931 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17932 This works around a problem with the previous change to Fcopy_file.
17933 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17934 and without this change, GCC might complain about discarding
17935 fchown's return value.
17936
17937 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
17938
17939 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17940
17941 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17942
17943 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17944
17945 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17946
17947 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17948 it's used from the C level.
17949
17950 * process.c: Use the same condition for POLL_FOR_INPUT in both
17951 keyboard.c and process.c (bug#1858).
17952
17953 2011-07-09 Lawrence Mitchell <wence@gmx.li>
17954
17955 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17956 (Fgnutls_boot): Use it.
17957
17958 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17959
17960 * doc.c (Fsubstitute_command_keys): Revert last change.
17961
17962 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17963
17964 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17965 quotes the next character, and doesn't affect other longer
17966 sequences (bug#8935).
17967
17968 * lread.c (syms_of_lread): Clarify that is isn't only
17969 `eval-buffer' and `eval-defun' that's affected by
17970 `lexical-binding' (bug#8460).
17971
17972 2011-07-15 Eli Zaretskii <eliz@gnu.org>
17973
17974 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
17975 bidi redisplay when a line includes both an image and is truncated.
17976
17977 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17978
17979 Fix minor problems found by static checking.
17980 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17981 (elsz): Now a signed constant, not a size_t var. We prefer signed
17982 types to unsigned, to avoid integer comparison confusion. Without
17983 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17984 "cannot optimize loop, the loop counter may overflow", a symptom
17985 of the confusion.
17986 * indent.c (Fvertical_motion): Mark locals as initialized.
17987 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17988
17989 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17990
17991 * search.c (Fre_search_backward): Mention `case-fold-search' in
17992 all the re_search_* functions (bug#8138).
17993
17994 * keyboard.c (Fopen_dribble_file): Document when the file is
17995 closed (bug#8056).
17996
17997 2011-07-14 Eli Zaretskii <eliz@gnu.org>
17998
17999 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18000 bidi_cache_idx.
18001
18002 Support bidi reordering of display and overlay strings.
18003 * xdisp.c (compute_display_string_pos)
18004 (compute_display_string_end): Accept additional argument STRING.
18005 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18006 (reseat_to_string): Initialize bidi_it->string.s and
18007 bidi_it->string.schars.
18008 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18009 NULL (avoids a crash in bidi_paragraph_init).
18010 Initialize itb.string.lstring.
18011 (init_iterator): Call bidi_init_it only of a valid
18012 buffer position was specified. Initialize paragraph_embedding to
18013 L2R.
18014 (reseat_to_string): Initialize the bidi iterator.
18015 (display_string): If we need to ignore text properties of
18016 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18017 original value of -1 will not work with bidi.)
18018 (compute_display_string_pos): First arg is now struct
18019 `text_pos *'; all callers changed. Support display properties on
18020 Lisp strings.
18021 (compute_display_string_end): Support display properties on Lisp
18022 strings.
18023 (init_iterator, reseat_1, reseat_to_string): Initialize the
18024 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18025 when iterating on a string not from display properties).
18026 (compute_display_string_pos, compute_display_string_end):
18027 Fix calculation of the object to scan. Fixes an error when using
18028 arrow keys.
18029 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18030 base_level_stop; instead, set base_level_stop to BEGV.
18031 Fixes crashes in vertical-motion.
18032 (next_element_from_buffer): Improve commentary for when
18033 the iterator is before prev_stop.
18034 (init_iterator): Initialize bidi_p from the default value of
18035 bidi-display-reordering, not from buffer-local value. Use the
18036 buffer-local value only if initializing for buffer iteration.
18037 (handle_invisible_prop): Support invisible properties on strings
18038 that are being bidi-reordered.
18039 (set_iterator_to_next): Support bidi reordering of C strings and
18040 Lisp strings.
18041 (next_element_from_string): Support bidi reordering of Lisp
18042 strings.
18043 (handle_stop_backwards): Support Lisp strings as well.
18044 (display_string): Support display of R2L glyph rows.
18045 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18046 (init_iterator): Don't initialize it->bidi_p for strings
18047 here.
18048 (reseat_to_string): Initialize it->bidi_p for strings here.
18049 (next_element_from_string, next_element_from_c_string)
18050 (next_element_from_buffer): Add xassert's for correspondence
18051 between IT's object being iterated and it->bidi_it.string
18052 structure.
18053 (face_before_or_after_it_pos): Support bidi iteration.
18054 (next_element_from_c_string): Handle the case of the first string
18055 character that is not the first one in the visual order.
18056 (get_visually_first_element): New function, refactored from common
18057 parts of next_element_from_buffer, next_element_from_string, and
18058 next_element_from_c_string.
18059 (tool_bar_lines_needed, redisplay_tool_bar)
18060 (display_menu_bar): Force left-to-right direction. Add a FIXME
18061 comment for making that be controlled by a user option.
18062 (push_it, pop_it): Save and restore the state of the
18063 bidi iterator. Save and restore the bidi_p flag.
18064 (pop_it): Iterate out of display property for string iteration as
18065 well.
18066 (iterate_out_of_display_property): Support iteration over strings.
18067 (handle_single_display_spec): Set up it->bidi_it for iteration
18068 over a display string, and call bidi_init_it.
18069 (handle_single_display_spec, next_overlay_string)
18070 (get_overlay_strings_1, push_display_prop): Set up the bidi
18071 iterator for displaying display or overlay strings.
18072 (forward_to_next_line_start): Don't use the shortcut if
18073 bidi-iterating.
18074 (back_to_previous_visible_line_start): If handle_display_prop
18075 pushed the iterator stack, restore the internal state of the bidi
18076 iterator by calling bidi_pop_it same number of times.
18077 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18078 and we are bidi-iterating, don't decrement the iterator position;
18079 instead, set the first_elt flag in the bidi iterator, to produce
18080 the same effect.
18081 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18082 (push_display_prop): xassert that we are iterating a buffer.
18083 (push_it, pop_it): Save and restore paragraph_embedding member.
18084 (handle_single_display_spec, next_overlay_string)
18085 (get_overlay_strings_1, reseat_1, reseat_to_string)
18086 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18087 correctly. Don't assume unibyte strings are not bidi-reordered.
18088 (compute_display_string_pos)
18089 (compute_display_string_end): Fix handling the case of C string.
18090 (push_it, pop_it): Save and restore from_disp_prop_p.
18091 (handle_single_display_spec, push_display_prop): Set the
18092 from_disp_prop_p flag.
18093 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18094 (pop_it): Call iterate_out_of_display_property only if we are
18095 popping after iteration over a string that came from a display
18096 property. Fix a typo in popping stretch info. Add an assertion
18097 for verifying that the iterator position is in sync with the bidi
18098 iterator.
18099 (handle_single_display_spec, get_overlay_strings_1)
18100 (push_display_prop): Fix initialization of paragraph direction for
18101 string when that of the parent object is not yet determined.
18102 (reseat_1): Call bidi_init_it to resync the bidi
18103 iterator with IT's position. (Bug#7616)
18104 (find_row_edges): If ROW->start.pos gives position
18105 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18106 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18107 Reset the from_disp_prop_p flag.
18108 (SAVE_IT, RESTORE_IT): New macros.
18109 (pos_visible_p, face_before_or_after_it_pos)
18110 (back_to_previous_visible_line_start)
18111 (move_it_in_display_line_to, move_it_in_display_line)
18112 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18113 (try_scrolling, redisplay_window, display_line): Use them when
18114 saving a temporary copy of the iterator and restoring it back.
18115 (back_to_previous_visible_line_start, reseat_1)
18116 (init_iterator): Empty the bidi cache "stack".
18117 (move_it_in_display_line_to): If iterator ended up at
18118 EOL, but we never saw any buffer positions smaller than
18119 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18120 motion in bidi-reordered lines.
18121 (move_it_in_display_line_to): Record prev_method and prev_pos
18122 immediately before the call to set_iterator_to_next. Fixes cursor
18123 motion in bidi-reordered lines with stretch glyphs and strings
18124 displayed in margins. (Bug#8133) (Bug#8867)
18125 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18126 TO_CHARPOS.
18127 (pos_visible_p): Support positions in bidi-reordered lines.
18128 Save and restore bidi cache.
18129
18130 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18131 (bidi_paragraph_info): Delete unused struct.
18132 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18133 (bidi_cache_start): New variable.
18134 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18135 to zero.
18136 (bidi_cache_fetch_state, bidi_cache_search)
18137 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18138 (bidi_cache_find, bidi_peek_at_next_level)
18139 (bidi_level_of_next_char, bidi_find_other_level_edge)
18140 (bidi_move_to_visually_next): Compare cache index with
18141 bidi_cache_start rather than with zero.
18142 (bidi_fetch_char): Accept new argument STRING; all callers
18143 changed. Support iteration over a string. Support strings with
18144 display properties. Support unibyte strings. Fix the type of
18145 `len' according to what STRING_CHAR_AND_LENGTH expects.
18146 (bidi_paragraph_init, bidi_resolve_explicit_1)
18147 (bidi_resolve_explicit, bidi_resolve_weak)
18148 (bidi_level_of_next_char, bidi_move_to_visually_next):
18149 Support iteration over a string.
18150 (bidi_set_sor_type, bidi_resolve_explicit_1)
18151 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18152 can now be zero (for strings); special values 0 and -1 were
18153 changed to -1 and -2, respectively.
18154 (bidi_char_at_pos): New function.
18155 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18156 Call it instead of FETCH_MULTIBYTE_CHAR.
18157 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18158 initialized to valid values.
18159 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18160 values.
18161 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18162 the test for valid cached positions. Fix the logic for looking up
18163 the sentinel state in the cache. GCPRO the Lisp string we are
18164 iterating.
18165 (bidi_push_it, bidi_pop_it): New functions.
18166 (bidi_initialize): Initialize the bidi cache start stack pointer.
18167 (bidi_cache_ensure_space): New function, refactored from part of
18168 bidi_cache_iterator_state. Don't assume the required size is just
18169 one BIDI_CACHE_CHUNK away.
18170 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18171 (bidi_count_bytes, bidi_char_at_pos): New functions.
18172 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18173 always valid if bidi_cache_idx is valid.
18174 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18175 is valid if it's going to be used.
18176 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18177 (bidi_cache_fetch_state, bidi_cache_search)
18178 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18179 (bidi_cache_iterator_state, bidi_cache_find)
18180 (bidi_find_other_level_edge, bidi_cache_start_stack):
18181 All variables related to cache indices are now EMACS_INT.
18182
18183 * dispextern.h (struct bidi_string_data): New structure.
18184 (struct bidi_it): New member `string'. Make flag members be 1-bit
18185 fields, and put them last in the struct.
18186 (compute_display_string_pos, compute_display_string_end):
18187 Update prototypes.
18188 (bidi_push_it, bidi_pop_it): Add prototypes.
18189 (struct iterator_stack_entry): New members bidi_p,
18190 paragraph_embedding, and from_disp_prop_p.
18191 (struct it): Member bidi_p is now a bit field 1 bit wide.
18192 (bidi_shelve_cache, bidi_unshelve_cache):
18193 Declare prototypes.
18194
18195 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18196 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18197 and vector-like objects.
18198
18199 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18200 cache around display iteration.
18201
18202 * window.c (Fwindow_end, window_scroll_pixel_based)
18203 (displayed_window_lines, Frecenter): Save and restore the bidi
18204 cache around display iteration.
18205
18206 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18207
18208 * editfns.c (Fdelete_region): Clarify the use of the named
18209 parameters (bug#6788).
18210
18211 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18212
18213 * indent.c (Fvertical_motion): Set and restore w->pointm when
18214 saving and restoring the window's buffer (Bug#9006).
18215
18216 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18217
18218 * editfns.c (Fstring_to_char): Clarify just what is returned
18219 (bug#6576). Text by Eli Zaretskii.
18220
18221 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18222
18223 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18224
18225 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18226
18227 * buffer.c (mmap_find): Fix a typo.
18228
18229 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18230
18231 Fix execution of x selection hooks.
18232 * xselect.c (Qx_lost_selection_functions)
18233 (Qx_sent_selection_functions): New vars.
18234 (syms_of_xselect): DEFSYM them.
18235 (x_handle_selection_request): Pass Qx_sent_selection_functions
18236 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18237 (x_handle_selection_clear,x_clear_frame_selections):
18238 Pass Qx_lost_selection_functions rather than
18239 Vx_lost_selection_functions to Frun_hook_with_args.
18240
18241 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18242
18243 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18244 The old code sometimes used this field without initializing it.
18245
18246 * alloc.c (gc_sweep): Don't read past end of array.
18247 In theory, the old code could also have corrupted Emacs internals,
18248 though it'd be very unlikely.
18249
18250 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18251
18252 * character.c (Fcharacterp): Don't advertise optional ignored
18253 argument. (Bug#4026)
18254
18255 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18256
18257 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18258 key" (bug#4257).
18259
18260 * window.c (Fset_window_start): Doc fix (bug#4199).
18261 (Fset_window_hscroll): Ditto.
18262
18263 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18264
18265 Fix minor new problems caught by GCC 4.6.1.
18266 * term.c (init_tty): Remove unused local.
18267 * xsettings.c (store_monospaced_changed): Define this function only
18268 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18269 not used otherwise.
18270
18271 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18272
18273 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18274
18275 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18276
18277 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18278 are the mini-buffer and the echo area (bug#3320).
18279
18280 * term.c (init_tty): Remove support for supdup, c10 and perq
18281 terminals, which are no longer supported (bug#1482).
18282
18283 2011-07-10 Johan Bockgård <bojohan@gnu.org>
18284
18285 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18286
18287 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18288
18289 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18290 for non-popups (Bug#3642).
18291
18292 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18293
18294 * alloc.c (reset_malloc_hooks): Protoize.
18295 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
18296 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18297 * cm.c (losecursor): Likewise.
18298 * data.c (fmod): Likewise.
18299 * dispnew.c (swap_glyphs_in_rows): Likewise.
18300 * emacs.c (memory_warning_signal): Likewise.
18301 * floatfns.c (float_error): Likewise.
18302 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18303 (otf_open, font_otf_capability, generate_otf_features)
18304 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18305 Likewise.
18306 * image.c (pbm_read_file): Likewise.
18307 * indent.c (string_display_width): Likewise.
18308 * intervals.c (check_for_interval, search_for_interval)
18309 (inc_interval_count, count_intervals, root_interval)
18310 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18311 * lread.c (defalias): Likewise.
18312 * ralloc.c (r_alloc_check): Likewise.
18313 * regex.c (set_image_of_range_1, set_image_of_range)
18314 (regex_grow_registers): Likewise.
18315 * sysdep.c (strerror): Likewise.
18316 * termcap.c (valid_filename_p, tprint, main): Likewise.
18317 * tparam.c (main): Likewise.
18318 * unexhp9k800.c (run_time_remap, save_data_space)
18319 (update_file_ptrs, read_header, write_header, calculate_checksum)
18320 (copy_file, copy_rest, display_header): Likewise.
18321 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18322 Likewise.
18323 * xdisp.c (check_it): Likewise.
18324 * xfaces.c (register_color, unregister_color, unregister_colors):
18325 Likewise.
18326 * xfns.c (print_fontset_result): Likewise.
18327 * xrdb.c (member, fatal, main): Likewise.
18328
18329 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18330
18331 Fix minor problems found by static checking (Bug#9031).
18332 * chartab.c (char_table_set_range, map_sub_char_table):
18333 Remove unused locals.
18334 (uniprop_table): Now static.
18335 * composite.c (_work_char): Remove unused static var.
18336
18337 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
18338
18339 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18340
18341 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18342
18343 * gtkutil.c (qttip_cb): Remove code without function.
18344
18345 2011-07-09 Eli Zaretskii <eliz@gnu.org>
18346
18347 * w32.c (pthread_sigmask): New stub.
18348
18349 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
18350
18351 Use pthread_sigmask, not sigprocmask (Bug#9010).
18352 sigprocmask is portable only for single-threaded applications, and
18353 Emacs can be multi-threaded when it uses GTK.
18354 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18355 (LIBES): Use it.
18356 * callproc.c (Fcall_process):
18357 * process.c (create_process):
18358 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18359 Use pthread_sigmask, not sigprocmask.
18360
18361 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18362
18363 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18364 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18365 wrong (Bug#8591).
18366
18367 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18368
18369 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18370 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18371 (xg_hide_tooltip): Fix comment.
18372
18373 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18374 in registerServicesMenuSendTypes.
18375 (validRequestorForSendType): Don't check ns_return_types.
18376
18377 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18378 ns_return_type.
18379
18380 2011-07-08 Jason Rumney <jasonr@gnu.org>
18381
18382 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18383 SH_SHOW for hidden windows (Bug#5482).
18384
18385 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18386 frame struct members of non-existent frames (Bug#6284).
18387
18388 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18389
18390 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18391 variable firstTime not needed on OSX >= 10.6.
18392 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18393 >= 10.5. Use setKnobProportion, setDoubleValue.
18394
18395 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18396 (MAC_OS_X_VERSION_10_5): Define if not defined.
18397 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18398 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18399 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18400
18401 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
18402 cString and lossyCString on OSX >= 10.4.
18403
18404 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
18405 sizeToFit on OSX >= 10.2.
18406
18407 * nsimage.m (allocInitFromFile): Don't use deprecated method
18408 bestRepresentationForDevice on OSX >= 10.6.
18409
18410 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18411 to avoid warning.
18412
18413 * emacs.c: Declare unexec_init_emacs_zone.
18414
18415 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18416
18417 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18418
18419 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18420 on svcsMenu (Bug#8842).
18421
18422 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18423 ns_return_types.
18424 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18425
18426 * nsterm.m (QUTF8_STRING): Declare.
18427 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18428 (validRequestorForSendType): Return type is (id).
18429 Change indexOfObjectIdenticalTo to indexOfObject.
18430 Check if we have local selection before returning self (Bug#8842).
18431 (writeSelectionToPasteboard): Put local selection into paste board
18432 if we have a local selection (Bug#8842).
18433 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18434
18435 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18436 (ns_get_local_selection): Declare.
18437
18438 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18439
18440 * keymap.c (describe_map_tree): Don't insert a double newline at
18441 the end of the buffer (bug#1169) and return whether we inserted
18442 something.
18443
18444 * callint.c (Fcall_interactively): Change "reading args" to
18445 "providing args" to try to clarify what it does (bug#1010).
18446
18447 2011-07-07 Kenichi Handa <handa@m17n.org>
18448
18449 * composite.c (composition_compute_stop_pos): Ignore a static
18450 composition starting before CHARPOS (Bug#8915).
18451
18452 * xdisp.c (handle_composition_prop): Likewise.
18453
18454 2011-07-07 Eli Zaretskii <eliz@gnu.org>
18455
18456 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18457 (Bug#9015)
18458
18459 2011-07-07 Kenichi Handa <handa@m17n.org>
18460
18461 * character.h (unicode_category_t): New enum type.
18462
18463 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18464 (Qchar_code_property_table): New variable.
18465 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18466 (UNIPROP_COMPRESSED_FORM_P): New macros.
18467 (char_table_ascii): Uncompress the compressed values.
18468 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18469 Uncompress the compressed values.
18470 (sub_char_table_ref_and_range): Likewise.
18471 (char_table_ref_and_range): Uncompress the compressed values.
18472 (sub_char_table_set): New arg is_uniprop. Callers changed.
18473 Uncompress the compressed values.
18474 (sub_char_table_set_range): Args changed. Callers changed.
18475 (char_table_set_range): Adjuted for the above change.
18476 (map_sub_char_table): Delete args default_val and parent. Add arg
18477 top. Give decoded values to a Lisp function.
18478 (map_char_table): Adjust for the above change. Give decoded
18479 values to a Lisp function. Gcpro more variables.
18480 (uniprop_table_uncompress)
18481 (uniprop_decode_value_run_length): New functions.
18482 (uniprop_decoder, uniprop_decoder_count): New variables.
18483 (uniprop_get_decoder, uniprop_encode_value_character)
18484 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18485 New functions.
18486 (uniprop_encoder, uniprop_encoder_count): New variables.
18487 (uniprop_get_encoder, uniprop_table)
18488 (Funicode_property_table_internal, Fget_unicode_property_internal)
18489 (Fput_unicode_property_internal): New functions.
18490 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18491 Sunicode_property_table_internal, Sget_unicode_property_internal,
18492 and Sput_unicode_property_internal. Defvar_lisp
18493 char-code-property-alist.
18494
18495 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
18496 Vunicode_category_table.
18497
18498 * font.c (font_range): Adjust for the change of
18499 Vunicode_category_table.
18500
18501 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18502
18503 * m/iris4d.h: Remove file, move contents ...
18504 * s/irix6-5.h: ... here.
18505
18506 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18507
18508 Remove unportable assumption about struct layout (Bug#8884).
18509 * alloc.c (mark_buffer):
18510 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18511 (clone_per_buffer_values): Don't assume that
18512 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18513 This isn't true in general, and it's particularly not true
18514 if Emacs is configured with --with-wide-int.
18515 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18516 New macros, used in the buffer.c change.
18517
18518 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18519
18520 * xsettings.c: Use both GConf and GSettings if both are available.
18521 (store_config_changed_event): Add comment.
18522 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18523 (store_tool_bar_style_changed): New functions.
18524 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
18525 (struct xsettings): Move font inside HAVE_XFT.
18526 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
18527 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
18528 Move inside HAVE_XFT.
18529 (something_changed_gsettingsCB): Rename from something_changedCB.
18530 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18531 also.
18532 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
18533 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
18534 (something_changed_gconfCB): Rename from something_changedCB.
18535 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18536 (parse_settings): Move check for font inside HAVE_XFT.
18537 (read_settings, apply_xft_settings): Add comment.
18538 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18539 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18540 call store_font_name_changed.
18541 (xft_settings_event): Add comment.
18542 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18543 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18544 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18545 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18546 (xsettings_initialize): Call init_gsettings last.
18547 (xsettings_get_system_font, xsettings_get_system_normal_font):
18548 Add comment.
18549
18550 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18551
18552 Random fixes. E.g., (random) never returned negative values.
18553 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18554 subseconds part to the entropy, as that's a bit more random.
18555 Prefer signed to unsigned, since the signedness doesn't matter and
18556 in general we prefer signed. When given a limit, use a
18557 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18558 latter isn't right if USE_2_TAGS_FOR_INTS.
18559 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18560 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18561
18562 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18563
18564 * textprop.c (text_property_stickiness):
18565 Obey Vtext_property_default_nonsticky.
18566 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18567 * w32fns.c (syms_of_w32fns):
18568 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18569
18570 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18571
18572 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18573 This is more efficient than Ffile_directory_p and avoids a minor race.
18574
18575 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18576
18577 * buffer.c (Foverlay_put): Say what the return value is
18578 (bug#7835).
18579
18580 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18581 is a directory before asking whether to use the file name
18582 (bug#7564).
18583 (barf_or_query_if_file_exists): Make the "File is a directory"
18584 error be more correct.
18585
18586 * fns.c (Frequire): Remove the mention of the .gz files, since
18587 that's installation-specific, but keep the mention of
18588 `get-load-suffixes'.
18589
18590 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18591
18592 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18593 Report string overflow if the output is too long.
18594
18595 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
18596
18597 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18598 (syms_of_gnutls): Remove duplicate DEFSYM for
18599 Qgnutls_bootprop_verify_hostname_error, an error for
18600 Qgnutls_bootprop_verify_error (which is no longer used).
18601
18602 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18603 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18604 Also (re)move comments that are misplaced or no longer relevant.
18605
18606 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18607
18608 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18609
18610 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
18611
18612 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18613 and background color parameters if they have been changed.
18614
18615 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18616
18617 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18618
18619 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18620
18621 * xsettings.c (SYSTEM_FONT): Define only when used.
18622 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18623
18624 * keymap.c (access_keymap_1): Now static.
18625
18626 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
18627
18628 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18629 leave any prefix arg for the up event (Bug#1586).
18630
18631 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18632
18633 * lread.c (syms_of_lread): Mention single symbols defined by
18634 `defvar' or `defconst' (bug#7154).
18635
18636 * fns.c (Frequire): Mention .el.gz files (bug#7314).
18637 (Frequire): Mention get-load-suffixes.
18638
18639 2011-07-02 Martin Rudalics <rudalics@gmx.at>
18640
18641 * window.h (window): Remove clone_number slot.
18642 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18643 Remove.
18644 (make_parent_window, make_window, saved_window)
18645 (Fset_window_configuration, save_window_save): Don't deal with
18646 clone numbers.
18647 * buffer.c (Qclone_number): Remove declaration.
18648 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18649
18650 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18651
18652 Add multiple inheritance to keymaps.
18653 * keymap.c (Fmake_composed_keymap): New function.
18654 (Fset_keymap_parent): Simplify.
18655 (fix_submap_inheritance): Remove.
18656 (access_keymap_1): New function extracted from access_keymap to handle
18657 embedded parents and handle lists of maps.
18658 (access_keymap): Use it.
18659 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18660 (Fcopy_keymap): Handle embedded parents.
18661 (Fcommand_remapping, define_as_prefix): Simplify.
18662 (Fkey_binding): Simplify.
18663 (syms_of_keymap): Move minibuffer-local-completion-map,
18664 minibuffer-local-filename-completion-map,
18665 minibuffer-local-must-match-map, and
18666 minibuffer-local-filename-must-match-map to Elisp.
18667 (syms_of_keymap): Defsubr make-composed-keymap.
18668 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18669 (parse_menu_item): Trivial simplification.
18670
18671 2011-07-01 Glenn Morris <rgm@gnu.org>
18672
18673 * Makefile.in (SETTINGS_LIBS): Fix typo.
18674
18675 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
18676
18677 * coding.c (Fencode_coding_string): Record the last coding system
18678 used, as the function doc string says (bug#8738).
18679
18680 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18681
18682 * xsettings.c (store_monospaced_changed): Take new font as arg and
18683 check for change against current_mono_font.
18684 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18685 (emacs_settings_constructor, emacs_settings_get_property)
18686 (emacs_settings_set_property, emacs_settings_class_init)
18687 (emacs_settings_init, gsettings_obj): Remove.
18688 (something_changedCB): New function for HAVE_GSETTINGS.
18689 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18690 with value as argument.
18691 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18692 g_settings_new (Bug#8967). Do not create gsettings_obj.
18693 Remove calls to g_settings_bind. Connect something_changedCB to
18694 "changed".
18695
18696 * xgselect.c: Add defined (HAVE_GSETTINGS).
18697 (xgselect_initialize): Ditto.
18698
18699 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18700 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18701 xg_select.
18702
18703 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18704
18705 * eval.c (struct backtrace): Simplify and port the data structure.
18706 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18707 signed bit field, as this assumption is not portable and it makes
18708 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18709 "char debug_on_exit : 1" as this is not portable either; instead,
18710 use the portable "unsigned int debug_on_exit : 1". Remove unused
18711 member evalargs. Remove obsolete comments about cc bombing out.
18712
18713 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18714
18715 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
18716 Let HAVE_GSETTINGS override HAVE_GCONF.
18717 (store_monospaced_changed): New function.
18718 (EMACS_SETTINGS): A new type derived from GObject to handle
18719 GSettings notifications.
18720 (emacs_settings_constructor, emacs_settings_get_property)
18721 (emacs_settings_set_property, emacs_settings_class_init):
18722 New functions.
18723 (gsettings_client, gsettings_obj): New variables.
18724 (GSETTINGS_SCHEMA): New define.
18725 (something_changedCB): Call store_monospaced_changed.
18726 (init_gsettings): New function.
18727 (xsettings_initialize): Call init_gsettings.
18728 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18729 to NULL.
18730
18731 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
18732 GCONF_CFLAGS/LIBS.
18733
18734 2011-06-29 Martin Rudalics <rudalics@gmx.at>
18735
18736 * window.c (resize_root_window, grow_mini_window)
18737 (shrink_mini_window): Rename Qresize_root_window to
18738 Qwindow_resize_root_window and Qresize_root_window_vertically to
18739 Qwindow_resize_root_window_vertically.
18740
18741 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18742
18743 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18744
18745 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
18746
18747 * makefile.w32-in: Redesign dependencies so they reflect more
18748 clearly which files are directly included by each source file,
18749 and not through other includes.
18750
18751 2011-06-27 Martin Rudalics <rudalics@gmx.at>
18752
18753 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18754 (sort_overlays, overlay_strings): When an overlay's clone number
18755 matches the window's clone number process the overlay even if
18756 the overlay's window property doesn't match the current window.
18757
18758 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18759 (Fwindow_hchild): Rename to Fwindow_left_child.
18760 (Fwindow_next): Rename to Fwindow_next_sibling.
18761 (Fwindow_prev): Rename to Fwindow_prev_sibling.
18762 (resize_window_check): Rename to window_resize_check.
18763 (resize_window_apply): Rename to window_resize_apply.
18764 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18765 (Fdelete_other_windows_internal, resize_frame_windows)
18766 (Fsplit_window_internal, Fdelete_window_internal)
18767 (grow_mini_window, shrink_mini_window)
18768 (Fresize_mini_window_internal): Fix callers accordingly.
18769
18770 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18771
18772 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18773 (emacs_fixed_set_min_size): Remove.
18774 (emacs_fixed_new): Take frame as argument.
18775
18776 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18777 (_EmacsFixedPrivate): Remove minwidth/height.
18778 Add struct frame *f.
18779 (emacs_fixed_init): Initialize priv->f.
18780 (get_parent_class, emacs_fixed_set_min_size): Remove.
18781 (emacs_fixed_new): Set priv->f to argument.
18782 (emacs_fixed_get_preferred_width)
18783 (emacs_fixed_get_preferred_height): Use min_width/height from
18784 frames size_hint to set minimum and natural (Bug#8919).
18785 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18786 and use min_width/height from frames size_hint to set
18787 min_width/height (Bug#8919).
18788
18789 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
18790 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18791 Fix indentation.
18792
18793 2011-06-26 Eli Zaretskii <eliz@gnu.org>
18794
18795 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18796 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18797 called at ZV.
18798
18799 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
18800
18801 * process.c (wait_reading_process_output): Bypass select if
18802 waiting for a cell while ignoring keyboard input, and input is
18803 pending. Suggested by Jan Djärv (Bug#8869).
18804
18805 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18806
18807 Use gnulib's dup2 module instead of rolling our own.
18808 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18809
18810 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18811
18812 * dispnew.c (scrolling_window): Before scrolling, turn off a
18813 mouse-highlight in the window being scrolled.
18814
18815 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
18816
18817 Move DEFSYM to lisp.h and use everywhere.
18818
18819 * character.h (DEFSYM): Move declaration...
18820 * lisp.h (DEFSYM): ...here.
18821
18822 * gnutls.c:
18823 * minibuf.c:
18824 * w32menu.c:
18825 * w32proc.c:
18826 * w32select.c: Don't include character.h.
18827
18828 * alloc.c (syms_of_alloc):
18829 * buffer.c (syms_of_buffer):
18830 * bytecode.c (syms_of_bytecode):
18831 * callint.c (syms_of_callint):
18832 * casefiddle.c (syms_of_casefiddle):
18833 * casetab.c (init_casetab_once):
18834 * category.c (init_category_once, syms_of_category):
18835 * ccl.c (syms_of_ccl):
18836 * cmds.c (syms_of_cmds):
18837 * composite.c (syms_of_composite):
18838 * dbusbind.c (syms_of_dbusbind):
18839 * dired.c (syms_of_dired):
18840 * dispnew.c (syms_of_display):
18841 * doc.c (syms_of_doc):
18842 * editfns.c (syms_of_editfns):
18843 * emacs.c (syms_of_emacs):
18844 * eval.c (syms_of_eval):
18845 * fileio.c (syms_of_fileio):
18846 * fns.c (syms_of_fns):
18847 * frame.c (syms_of_frame):
18848 * fringe.c (syms_of_fringe):
18849 * insdel.c (syms_of_insdel):
18850 * keymap.c (syms_of_keymap):
18851 * lread.c (init_obarray, syms_of_lread):
18852 * macros.c (syms_of_macros):
18853 * msdos.c (syms_of_msdos):
18854 * print.c (syms_of_print):
18855 * process.c (syms_of_process):
18856 * search.c (syms_of_search):
18857 * sound.c (syms_of_sound):
18858 * syntax.c (init_syntax_once, syms_of_syntax):
18859 * terminal.c (syms_of_terminal):
18860 * textprop.c (syms_of_textprop):
18861 * undo.c (syms_of_undo):
18862 * w32.c (globals_of_w32):
18863 * window.c (syms_of_window):
18864 * xdisp.c (syms_of_xdisp):
18865 * xfaces.c (syms_of_xfaces):
18866 * xfns.c (syms_of_xfns):
18867 * xmenu.c (syms_of_xmenu):
18868 * xsettings.c (syms_of_xsettings):
18869 * xterm.c (syms_of_xterm): Use DEFSYM.
18870
18871 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18872
18873 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
18874
18875 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18876
18877 Integer and buffer overflow fixes (Bug#8873).
18878
18879 * print.c (printchar, strout): Check for string overflow.
18880 (PRINTPREPARE, printchar, strout):
18881 Don't set size unless allocation succeeds.
18882
18883 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18884 for sizes. Check for string overflow more accurately.
18885 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18886
18887 * macros.c: Integer and buffer overflow fixes.
18888 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18889 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18890 Use ptrdiff_t, not int, for sizes.
18891 Don't increment bufsize until after realloc succeeds.
18892 Check for size-calculation overflow.
18893 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18894
18895 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18896
18897 * lread.c: Integer overflow fixes.
18898 (read_integer): Radix is now EMACS_INT, not int,
18899 to improve quality of diagnostics for out-of-range radices.
18900 Calculate buffer size correctly for out-of-range radices.
18901 (read1): Check for integer overflow in radices, and in
18902 read-circle numbers.
18903 (read_escape): Avoid int overflow.
18904 (Fload, openp, read_buffer_size, read1)
18905 (substitute_object_recurse, read_vector, read_list, map_obarray):
18906 Use ptrdiff_t, not int, for sizes.
18907 (read1): Use EMACS_INT, not int, for sizes.
18908 Check for size overflow.
18909
18910 * image.c (cache_image): Check for size arithmetic overflow.
18911
18912 * lread.c: Integer overflow issues.
18913 (saved_doc_string_size, saved_doc_string_length)
18914 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18915 Now ptrdiff_t, not int.
18916 (read1): Don't assume doc string length fits in int. Check for
18917 out-of-range doc string lengths.
18918 (read_list): Don't assume file position fits in int.
18919 (read_escape): Check for hex character overflow.
18920
18921 2011-06-22 Leo Liu <sdl.web@gmail.com>
18922
18923 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18924 Move to minibuffer.el.
18925
18926 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18927
18928 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
18929 The following patches are for when GLYPH_DEBUG && !XASSERT.
18930 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18931 * dispnew.c (flush_stdout):
18932 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18933 Mark as externally visible.
18934 * dispnew.c (check_window_matrix_pointers): Now static.
18935 * dispnew.c (window_to_frame_vpos):
18936 * xfns.c (unwind_create_frame):
18937 * xterm.c (x_check_font): Remove unused local.
18938 * scroll.c (CHECK_BOUNDS):
18939 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18940 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18941 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18942 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18943 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18944 Now static.
18945 (debug_method_add): Use va_list and vsprintf rather than relying
18946 on undefined behavior with wrong number of arguments.
18947 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18948 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18949 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18950 since we're not interested in debugging glyphs with old libraries.
18951 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18952 GCC 4.6.0's static checking.
18953
18954 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18955
18956 Integer overflow and signedness fixes (Bug#8873).
18957 A few related buffer overrun fixes, too.
18958
18959 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18960
18961 * dispextern.h (struct face.stipple):
18962 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18963 (x_bitmap_mask, x_allocate_bitmap_record)
18964 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18965 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18966 (x_create_bitmap_from_xpm_data):
18967 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18968 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18969 (.bitmaps_last):
18970 * xfaces.c (load_pixmap):
18971 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18972 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18973 (.bitmaps_last, struct x_output.icon_bitmap):
18974 Use ptrdiff_t, not int, for bitmap indexes.
18975 (x_allocate_bitmap_record): Check for size overflow.
18976 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18977
18978 Use ptrdiff_t, not int, for overlay counts.
18979 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18980 * editfns.c (overlays_around, get_pos_property):
18981 * textprop.c (get_char_property_and_overlay):
18982 * xdisp.c (next_overlay_change, note_mouse_highlight):
18983 * xfaces.c (face_at_buffer_position):
18984 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18985 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18986 (Fnext_overlay_change, Fprevious_overlay_change)
18987 (mouse_face_overlay_overlaps, Foverlays_in):
18988 Use ptrdiff_t, not int, for sizes.
18989 (overlays_at, overlays_in): Check for size-calculation overflow.
18990
18991 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18992
18993 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18994 (x_session_initialize): Do not assume string length fits in int.
18995
18996 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18997 This is unlikely, but can occur if DPI is outlandish.
18998
18999 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19000 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19001
19002 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19003 * xrdb.c (magic_file_p, search_magic_path):
19004 Omit last arg SUFFIX; it was always 0. All callers changed.
19005 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19006
19007 * xfont.c (xfont_match): Avoid need for strlen.
19008
19009 * xfns.c: Don't assume strlen fits in int.
19010 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19011
19012 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19013 not unsigned long, as we prefer signed integers. All callers changed.
19014 Detect integer overflow in repeat count.
19015 (message_dolog): Don't assume print length fits in 39 bytes.
19016 (display_mode_element): Don't assume strlen fits in int.
19017
19018 * termcap.c: Don't assume sizes fit in int and never overflow.
19019 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19020 (gobble_line): Check for size-calculation overflow.
19021
19022 * minibuf.c (Fread_buffer):
19023 * lread.c (intern, intern_c_string):
19024 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19025 Don't assume string length fits in int.
19026
19027 * keyboard.c (parse_tool_bar_item):
19028 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19029
19030 * font.c: Don't assume string length fits in int.
19031 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19032 Use ptrdiff_t, not int.
19033 (font_intern_prop): Don't assume string length fits in int.
19034 Don't assume integer property fits in fixnum.
19035 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19036
19037 * filelock.c: Fix some buffer overrun and integer overflow issues.
19038 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19039 Reformulate so as not to need the command string.
19040 Invoke gzip -cd rather than gunzip, as it's more portable.
19041 (lock_info_type, lock_file_1, lock_file):
19042 Don't assume pid_t and time_t fit in unsigned long.
19043 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19044 (current_lock_owner): Prefer signed type for sizes.
19045 Use memcpy, not strncpy, where memcpy is what is really wanted.
19046 Don't assume (via atoi) that time_t and pid_t fit in int.
19047 Check for time_t and/or pid_t out of range, e.g., via a network share.
19048 Don't alloca where an auto var works fine.
19049
19050 * fileio.c: Fix some integer overflow issues.
19051 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19052 Don't assume string length fits in int.
19053 (directory_file_name): Don't assume string length fits in long.
19054 (make_temp_name): Don't assume pid fits in int, or that its print
19055 length is less than 20.
19056
19057 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19058
19059 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19060
19061 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19062
19063 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19064 We prefer signed integers, even for size calculations.
19065
19066 * emacs.c: Don't assume string length fits in 'int'.
19067 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19068 (main): Don't invoke strlen when not needed.
19069
19070 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19071 (XD_DEBUG_MESSAGE): Don't waste a byte.
19072
19073 * callproc.c (getenv_internal_1, getenv_internal)
19074 (Fgetenv_internal):
19075 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19076
19077 * lread.c (invalid_syntax): Omit length argument.
19078 All uses changed. This doesn't fix a bug, but it simplifies the
19079 code away from its former Hollerith-constant appearance, and it's
19080 one less 'int' to worry about when looking at integer-overflow issues.
19081 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19082
19083 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19084 This didn't break anything, but it didn't help either.
19085 It's confusing to put a bogus integer in a place where the actual
19086 value does not matter.
19087 (LIST_END_P): Remove unused macro and its bogus comment.
19088 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19089
19090 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19091 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19092 implementation.
19093 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19094 We prefer signed types, and the value cannot exceed the EMACS_INT
19095 range anyway (because otherwise the length would not be representable).
19096 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19097 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19098 This avoids a GCC warning when WIDE_EMACS_INT.
19099
19100 * indent.c (sane_tab_width): New function.
19101 (current_column, scan_for_column, Findent_to, position_indentation)
19102 (compute_motion): Use it. This is just for clarity.
19103 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19104
19105 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19106
19107 * lisp.h (lint_assume): New macro.
19108 * composite.c (composition_gstring_put_cache):
19109 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19110
19111 * editfns.c, insdel.c:
19112 Omit unnecessary forward decls, to simplify future changes.
19113
19114 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19115
19116 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19117
19118 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19119 Use much-faster test for byte-length change.
19120 Don't assume string byte-length fits in 'int'.
19121 Check that character arg fits in 'int'.
19122 (mapcar1): Declare byte as byte, for clarity.
19123
19124 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19125
19126 * fns.c (concat): Catch string overflow earlier.
19127 Do not rely on integer wraparound.
19128
19129 * dispextern.h (struct it.overlay_strings_charpos)
19130 (struct it.selective): Now EMACS_INT, not int.
19131 * xdisp.c (forward_to_next_line_start)
19132 (back_to_previous_visible_line_start)
19133 (reseat_at_next_visible_line_start, next_element_from_buffer):
19134 Don't arbitrarily truncate the value of 'selective' to int.
19135
19136 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19137
19138 * composite.c: Don't truncate sizes to 'int'.
19139 (composition_gstring_p, composition_reseat_it)
19140 (composition_adjust_point): Use EMACS_INT, not int.
19141 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19142 not EMACS_UINT, for indexes.
19143
19144 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19145
19146 * buffer.c: Include <verify.h>.
19147 (struct sortvec.priority, struct sortstr.priority):
19148 Now EMACS_INT, not int.
19149 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19150 (struct sortstr.size, record_overlay_string)
19151 (struct sortstrlist.size, struct sortlist.used):
19152 Don't truncate size to int.
19153 (record_overlay_string): Check for size-calculation overflow.
19154 (init_buffer_once): Check at compile-time, not run-time.
19155
19156 2011-06-22 Jim Meyering <meyering@redhat.com>
19157
19158 Don't leak an XBM-image-sized buffer
19159 * image.c (xbm_load): Free the image buffer after using it.
19160
19161 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19162
19163 Port to Sun C.
19164 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19165 that Sun C diagnosed.
19166 * fns.c (secure_hash): Fix pointer signedness issue.
19167 * intervals.c (static_offset_intervals): New function.
19168 (offset_intervals): Use it.
19169
19170 2011-06-21 Leo Liu <sdl.web@gmail.com>
19171
19172 * deps.mk (fns.o):
19173 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19174 sha512.h.
19175
19176 * fns.c (secure_hash): Rename from crypto_hash_function and change
19177 the first arg to accept symbols.
19178 (Fsecure_hash): New primitive.
19179 (syms_of_fns): New symbols.
19180
19181 2011-06-20 Deniz Dogan <deniz@dogan.se>
19182
19183 * process.c (Fset_process_buffer): Clarify return value in
19184 docstring.
19185
19186 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19187
19188 * dispnew.c (add_window_display_history): Use BVAR.
19189
19190 * xdisp.c (debug_method_add): Use BVAR.
19191 (check_window_end, dump_glyph_matrix, dump_glyph)
19192 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19193
19194 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19195 Likewise.
19196
19197 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19198 check till after the cache is created in init_frame_faces.
19199
19200 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19201
19202 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19203
19204 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19205
19206 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19207 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19208 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19209
19210 Improve buffer-overflow checking (Bug#8873).
19211 * fileio.c (Finsert_file_contents):
19212 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19213 Remove the old (too-loose) buffer overflow checks.
19214 They weren't needed, since make_gap checks for buffer overflow.
19215 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19216 The old code merely checked for Emacs fixnum overflow, and relied
19217 on undefined (wraparound) behavior. The new code avoids undefined
19218 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19219
19220 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19221 Tune. Don't use wider integers than needed. Don't use alloca.
19222 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19223
19224 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19225
19226 * insdel.c, lisp.h (buffer_overflow): New function.
19227 (insert_from_buffer_1, replace_range, replace_range_2):
19228 * insdel.c (make_gap_larger):
19229 * editfns.c (Finsert_char):
19230 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19231
19232 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19233
19234 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19235
19236 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19237
19238 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19239 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19240
19241 * fileio.c: Don't assume EMACS_INT fits in off_t.
19242 (emacs_lseek): New static function.
19243 (Finsert_file_contents, Fwrite_region): Use it.
19244 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19245
19246 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19247
19248 * fns.c: Don't overflow int when computing a list length.
19249 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19250 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19251 truncation on 64-bit hosts. Check for QUIT every
19252 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19253 faster and is responsive enough.
19254 (Flength): Report an error instead of overflowing an integer.
19255 (Fsafe_length): Return a float if the value is not representable
19256 as a fixnum. This shouldn't happen except in contrived situations.
19257 (Fnthcdr, Fsort): Don't assume list length fits in int.
19258 (Fcopy_sequence): Don't assume vector length fits in int.
19259
19260 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19261 (header_size, word_size): New constants.
19262 (allocate_vectorlike): Don't check size overflow here.
19263 (allocate_vector): Check it here instead, since this is the only
19264 caller of allocate_vectorlike that could cause overflow.
19265 Check that the new vector's length is representable as a fixnum.
19266
19267 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19268 The previous code was bogus. For example, next_almost_prime (32)
19269 returned 39, which is undesirable as it is a multiple of 3; and
19270 next_almost_prime (24) returned 25, which is a multiple of 5 so
19271 why was the code bothering to check for multiples of 7?
19272
19273 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19274
19275 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19276
19277 Variadic C functions now count arguments with ptrdiff_t.
19278 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19279 Back then I didn't know that the Emacs coding style prefers signed int.
19280 Also, in the meantime I found a few more instances where arguments
19281 were being counted with int, which may truncate counts on 64-bit
19282 machines, or EMACS_INT, which may be unnecessarily wide.
19283 * lisp.h (struct Lisp_Subr.function.aMANY)
19284 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19285 Arg counts are now ptrdiff_t, not size_t.
19286 All variadic functions and their callers changed accordingly.
19287 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19288 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19289 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19290 * callint.c (Fcall_interactively): Check arg count for overflow,
19291 to avoid potential buffer overrun. Use signed char, not 'int',
19292 for 'varies' array, so that we needn't bother to check its size
19293 calculation for overflow.
19294 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19295 * eval.c (apply_lambda):
19296 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19297 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19298 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19299
19300 * callint.c (Fcall_interactively): Don't use index var as event count.
19301
19302 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19303 * mem-limits.h (SIZE): Remove; no longer used.
19304
19305 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
19306
19307 Remove unnecessary casts.
19308 * xterm.c (x_term_init):
19309 * xfns.c (x_set_border_pixel):
19310 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19311 These aren't needed now that we assume ANSI C.
19312
19313 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19314 It's more likely to cause problems (due to unsigned overflow)
19315 than to cure them.
19316
19317 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19318
19319 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19320
19321 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19322
19323 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19324
19325 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19326
19327 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19328
19329 GLYPH_CODE_FACE returns EMACS_INT, not int.
19330 * dispextern.h (merge_faces):
19331 * xfaces.c (merge_faces):
19332 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19333 Don't assume EMACS_INT fits in int.
19334
19335 * character.h (CHAR_VALID_P): Remove unused parameter.
19336 * fontset.c, lisp.h, xdisp.c: All uses changed.
19337
19338 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19339
19340 * fns.c (concat): Minor tuning based on overflow analysis.
19341 This doesn't fix any bugs. Use int to hold character, instead
19342 of constantly refetching from Emacs object. Use XFASTINT, not
19343 XINT, for value known to be a character. Don't bother comparing
19344 a single byte to 0400, as it's always less.
19345
19346 * floatfns.c (Fexpt):
19347 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19348
19349 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19350 for characters.
19351
19352 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19353
19354 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19355 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19356 incorrectly succeed when S was a string, because 4294967386 was
19357 truncated before it was used.
19358
19359 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19360 Otherwise, an out-of-range integer could cause undefined behavior
19361 on a 64-bit host.
19362
19363 * composite.c: Use int, not EMACS_INT, for characters.
19364 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19365 EMACS_INT, for values that are known to be in character range.
19366 This doesn't fix any bugs but is the usual style inside Emacs and
19367 may generate better code on 32-bit machines.
19368
19369 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19370 This is for reasons similar to the recent CHAR_STRING fix.
19371 * charset.c (Fencode_char): Check that character arg is actually
19372 a character. Pass an int to ENCODE_CHAR.
19373 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19374 wider than 'int', as a compile-time check to prevent future regressions
19375 in this area.
19376
19377 * character.c (char_string): Remove unnecessary casts.
19378
19379 Make sure a 64-bit char is never passed to CHAR_STRING.
19380 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19381 by silently ignoring the top 32 bits, allowing some values
19382 that were far too large to be valid characters.
19383 * character.h: Include <verify.h>.
19384 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19385 arguments are no wider than unsigned, as a compile-time check
19386 to prevent future regressions in this area.
19387 * data.c (Faset):
19388 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
19389 (Fsubst_char_in_region):
19390 * fns.c (concat):
19391 * xdisp.c (decode_mode_spec_coding):
19392 Adjust to CHAR_STRING's new requirement.
19393 * editfns.c (Finsert_char, Fsubst_char_in_region):
19394 * fns.c (concat): Check that character args are actually
19395 characters. Without this test, these functions did the wrong
19396 thing with wildly out-of-range values on 64-bit hosts.
19397
19398 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19399 These casts should not be needed on 32-bit hosts, either.
19400 * keyboard.c (read_char):
19401 * lread.c (Fload): Remove casts to unsigned.
19402
19403 * lisp.h (UNSIGNED_CMP): New macro.
19404 This fixes comparison bugs on 64-bit hosts.
19405 (ASCII_CHAR_P): Use it.
19406 * casefiddle.c (casify_object):
19407 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
19408 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19409 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19410 * dispextern.h (FACE_FROM_ID):
19411 * keyboard.c (read_char): Use UNSIGNED_CMP.
19412
19413 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19414 not to EMACS_INT, to avoid GCC warning.
19415
19416 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19417
19418 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19419 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19420 isn't needed on 32-bit machines.
19421
19422 * buffer.c (Fgenerate_new_buffer_name):
19423 Use EMACS_INT for count, not int.
19424 (advance_to_char_boundary): Return EMACS_INT, not int.
19425
19426 * data.c (Qcompiled_function): Now static.
19427
19428 * window.c (window_body_lines): Now static.
19429
19430 * image.c (gif_load): Rename local to avoid shadowing.
19431
19432 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19433 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19434 * alloc.c (make_save_value): Integer argument is now of type
19435 ptrdiff_t, not int.
19436 (mark_object): Use ptrdiff_t, not int.
19437 * lisp.h (pD): New macro.
19438 * print.c (print_object): Use it.
19439
19440 * alloc.c: Use EMACS_INT, not int, to count objects.
19441 (total_conses, total_markers, total_symbols, total_vector_size)
19442 (total_free_conses, total_free_markers, total_free_symbols)
19443 (total_free_floats, total_floats, total_free_intervals)
19444 (total_intervals, total_strings, total_free_strings):
19445 Now EMACS_INT, not int. All uses changed.
19446 (Fgarbage_collect): Compute overall total using a double, so that
19447 integer overflow is less likely to be a problem. Check for overflow
19448 when converting back to an integer.
19449 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19450 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19451 These were 'int' variables that could overflow on 64-bit hosts;
19452 they were never used, so remove them instead of repairing them.
19453 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
19454 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19455 Previously, this ceilinged at INT_MAX, but that doesn't work on
19456 64-bit machines.
19457 (allocate_pseudovector): Don't use EMACS_INT when int would do.
19458
19459 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
19460 (allocate_vectorlike): Check for ptrdiff_t overflow.
19461 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19462 when a (possibly-narrower) signed value would do just as well.
19463 We prefer using signed arithmetic, to avoid comparison confusion.
19464
19465 * alloc.c: Catch some string size overflows that we were missing.
19466 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19467 for convenience in STRING_BYTES_MAX.
19468 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19469 The definition here is exact; the one in lisp.h was approximate.
19470 (allocate_string_data): Check for string overflow. This catches
19471 some instances we weren't catching before. Also, it catches
19472 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19473 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19474 and ptrdiff_t and EMACS_INT are both 64 bits.
19475
19476 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19477 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
19478 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
19479
19480 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19481
19482 * alloc.c (Fmake_string): Check for out-of-range init.
19483
19484 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19485
19486 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19487
19488 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19489
19490 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19491 xg_get_default_scrollbar_width.
19492
19493 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19494 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19495 (style_changed_cb): Call update_theme_scrollbar_width and call
19496 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19497 all frames (Bug#8505).
19498 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19499 Call gtk_window_set_resizable if HAVE_GTK3.
19500 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19501 and height if HAVE_GTK3 (Bug#8505).
19502 (scroll_bar_width_for_theme): New variable.
19503 (update_theme_scrollbar_width): New function.
19504 (xg_get_default_scrollbar_width): Move code to
19505 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19506 (xg_initialize): Call update_theme_scrollbar_width.
19507
19508 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19509
19510 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19511
19512 2011-06-12 Martin Rudalics <rudalics@gmx.at>
19513
19514 * frame.c (make_frame): Call other_buffer_safely instead of
19515 other_buffer.
19516
19517 * window.c (temp_output_buffer_show): Call display_buffer with
19518 second argument Vtemp_buffer_show_specifiers and reset latter
19519 immediately after the call.
19520 (Vtemp_buffer_show_specifiers): New variable.
19521 (auto_window_vscroll_p, next_screen_context_lines)
19522 (Vscroll_preserve_screen_position): Remove leading asterisks from
19523 doc-strings.
19524
19525 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
19526
19527 Fix minor problems found by GCC 4.6.0 static checking.
19528 * buffer.c (Qclone_number): Remove for now, as it's unused.
19529 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19530 (record_buffer): Remove unused local.
19531 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19532 (set_frame_buffer_list): Remove; unused.
19533 * frame.h (other_visible_frames): Remove decl.
19534 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19535 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19536 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19537 if HAVE_GPM.
19538 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19539 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19540 Define only if HAVE_GPM.
19541 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19542 (update_hints_inhibit): Remove; never set. All uses removed.
19543 * widgetprv.h (emacsFrameClassRec): Remove decl.
19544 * window.c (delete_deletable_window): Now returns void, since it
19545 wasn't returning anything.
19546 (compare_window_configurations): Remove unused locals.
19547 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19548 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
19549 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19550 the same widths as pointers. This follows up on the 2011-05-06 patch.
19551 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19552 * xterm.h: Likewise.
19553 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19554
19555 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
19556
19557 * makefile.w32-in: Update dependencies.
19558 (LISP_H): Add lib/intprops.h.
19559
19560 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19561
19562 * image.c (gif_load): Add animation frame delay to the metadata.
19563 (syms_of_image): Use DEFSYM. New symbol `delay'.
19564
19565 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19566
19567 * window.c (delete_deletable_window): Re-add.
19568 (Fset_window_configuration): Rewrite to handle dead buffers and
19569 consequently deletable windows.
19570 (window_tree, Fwindow_tree): Remove. Supply functionality in
19571 window.el.
19572 (compare_window_configurations): Simplify code.
19573
19574 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19575
19576 * image.c (imagemagick_load_image): Fix type mismatch.
19577 (Fimagemagick_types): Likewise.
19578
19579 * window.h (replace_buffer_in_windows): Declare.
19580
19581 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19582
19583 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19584 Qclone_number. Remove external declaration of Qdelete_window.
19585 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19586 code.
19587 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19588 Run Qbuffer_list_update_hook if allowed.
19589 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19590 buffer list implementation.
19591 (other_buffer_safely): New function.
19592 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19593 calls to replace_buffer_in_windows and
19594 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19595 if allowed.
19596 (record_buffer): Inhibit quitting and rewrite using quittable
19597 functions. Run Qbuffer_list_update_hook if allowed.
19598 (Frecord_buffer, Funrecord_buffer): New functions.
19599 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19600 Move switch-to-buffer to window.el.
19601 (bury-buffer): Move to window.el.
19602 (Vbuffer_list_update_hook): New variable.
19603
19604 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19605 section.
19606
19607 * window.h (resize_frame_windows): Move up in code.
19608 (Fwindow_frame): Remove EXFUN.
19609 (replace_buffer_in_all_windows): Remove prototype.
19610 (replace_buffer_in_windows_safely): Add prototype.
19611
19612 * window.c: Declare Qdelete_window static again. Move down
19613 declaration of select_count.
19614 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19615 (Fother_window): Move to window.el.
19616 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19617 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19618 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19619 window.el.
19620 (replace_buffer_in_windows): Implement by calling
19621 Qreplace_buffer_in_windows.
19622 (replace_buffer_in_all_windows): Remove with some functionality
19623 moved into replace_buffer_in_windows_safely.
19624 (replace_buffer_in_windows_safely): New function.
19625 (select_window_norecord, select_frame_norecord): Move in front
19626 of run_window_configuration_change_hook. Remove now obsolete
19627 declarations.
19628 (Fset_window_buffer): Rewrite doc-string.
19629 Call Qrecord_window_buffer.
19630 (keys_of_window): Move binding for other-window to window.el.
19631
19632 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19633
19634 * dispextern.h (struct image): Replace data member, whose int_val
19635 and ptr_val fields were not used by anything, with a single
19636 lisp_val object.
19637
19638 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19639 (gif_clear_image, gif_load, imagemagick_load_image)
19640 (gs_clear_image, gs_load): Callers changed.
19641
19642 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19643
19644 * buffer.h: Include <time.h>, for time_t.
19645 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19646
19647 Fix minor problems found by static checking.
19648
19649 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19650
19651 Make identifiers static if they are not used in other modules.
19652 * data.c (Qcompiled_function, Qframe, Qvector):
19653 * image.c (QimageMagick, Qsvg):
19654 * minibuf.c (Qmetadata):
19655 * window.c (resize_window_check, resize_root_window): Now static.
19656 * window.h (resize_window_check, resize_root_window): Remove decls.
19657
19658 * window.c (window_deletion_count, delete_deletable_window):
19659 Remove; unused.
19660 (window_body_lines): Now static.
19661 (Fdelete_other_windows_internal): Mark vars as initialized.
19662 Make sure 'resize_failed' is initialized.
19663 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19664 (resize_window_apply): Remove unused local.
19665 * window.h (delete_deletable_window): Remove decl.
19666
19667 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
19668 (imagemagick_load_image): Fix pointer signedness problem by changing
19669 last arg from unsigned char * to char *. All uses changed.
19670 Also, fix a local for similar reasons.
19671 Remove unused locals. Remove locals to avoid shadowing.
19672 (fn_rsvg_handle_free): Remove; unused.
19673 (svg_load, svg_load_image): Fix pointer signedness problem.
19674 (imagemagick_load_image): Don't use garbage pointer image_wand.
19675
19676 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19677
19678 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
19679
19680 * image.c (gif_load): Fix omitted cast error introduced by
19681 2011-06-06 change.
19682
19683 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19684
19685 * window.h (resize_proportionally, orig_total_lines)
19686 (orig_top_line): Remove from window structure.
19687 (set_window_height, set_window_width, change_window_heights)
19688 (Fdelete_window): Remove prototypes.
19689 (resize_frame_windows): Remove duplicate declaration.
19690
19691 2011-06-10 Eli Zaretskii <eliz@gnu.org>
19692
19693 * window.h (resize_frame_windows, resize_window_check)
19694 (delete_deletable_window, resize_root_window)
19695 (resize_frame_windows): Declare prototypes.
19696
19697 * window.c (resize_window_apply): Make definition be "static" to
19698 match the prototype.
19699
19700 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19701
19702 * window.c: Remove declarations of Qwindow_size_fixed,
19703 window_min_size_1, window_min_size_2, window_min_size,
19704 size_window, window_fixed_size_p, enlarge_window, delete_window.
19705 Remove static from declaration of Qdelete_window, it's
19706 temporarily needed by Fbury_buffer.
19707 (replace_window): Don't assign orig_top_line and
19708 orig_total_lines.
19709 (Fdelete_window, delete_window): Remove. Window deletion is
19710 handled by window.el.
19711 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19712 Replace Fdelete_window calls with calls to Qdelete_window.
19713 (Fdelete_other_windows): Remove. Deleting other windows is
19714 handled by window.el.
19715 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19716 handled in window.el.
19717 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19718 Window minimum sizes are handled in window.el.
19719 (shrink_windows, size_window, set_window_height)
19720 (set_window_width, change_window_heights, window_height)
19721 (window_width, CURBEG, CURSIZE, enlarge_window)
19722 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19723 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19724 handled in window.el.
19725 (make_dummy_parent): Rename to make_parent_window and give it a
19726 second argument horflag.
19727 (make_window): Don't set resize_proportionally any more.
19728 (Fsplit_window): Remove. Windows are split in window.el.
19729 (save_restore_action, save_restore_orig_size)
19730 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19731 Resize mini windows in window.el.
19732 (grow_mini_window, shrink_mini_window): Implement by calling
19733 Qresize_root_window_vertically, resize_window_check and
19734 resize_window_apply.
19735 (saved_window, Fset_window_configuration, save_window_save):
19736 Do not handle orig_top_line, orig_total_lines, and
19737 resize_proportionally.
19738 (window_min_height, window_min_width): Move to window.el.
19739 (keys_of_window): Move bindings for delete-other-windows,
19740 split-window, delete-window and enlarge-window to window.el.
19741
19742 * buffer.c: Temporarily extern Qdelete_window.
19743 (Fbury_buffer): Temporarily call Qdelete_window instead of
19744 Fdelete_window (Fbury_buffer will move to window.el soon).
19745
19746 * frame.c (set_menu_bar_lines_1): Remove code handling
19747 orig_top_line and orig_total_lines.
19748
19749 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19750 set_window_height but set heights directly.
19751 (change_frame_size_1): Use resize_frame_windows.
19752
19753 * xdisp.c (init_xdisp): Don't use set_window_height but set
19754 heights directly.
19755
19756 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19757 Use resize_frame_windows instead of change_window_heights and run
19758 run_window_configuration_change_hook.
19759
19760 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19761 instead of change_window_heights and run
19762 run_window_configuration_change_hook.
19763
19764 2011-06-09 Martin Rudalics <rudalics@gmx.at>
19765
19766 * window.c (replace_window): Rename second argument REPLACEMENT to
19767 NEW. New third argument SETFLAG. Rewrite.
19768 (delete_window, make_dummy_parent): Call replace_window with
19769 third argument 1.
19770 (window_list_1): Move down in code.
19771 (run_window_configuration_change_hook): Move set_buffer part
19772 before select_frame_norecord part in order to unwind correctly.
19773 Rename count1 to count.
19774 (recombine_windows, delete_deletable_window, resize_root_window)
19775 (Fdelete_other_windows_internal)
19776 (Frun_window_configuration_change_hook, make_parent_window)
19777 (resize_window_check, resize_window_apply, Fresize_window_apply)
19778 (resize_frame_windows, Fsplit_window_internal)
19779 (Fdelete_window_internal, Fresize_mini_window_internal):
19780 New functions.
19781 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19782
19783 2011-06-08 Martin Rudalics <rudalics@gmx.at>
19784
19785 * window.h (window): Add some new members to window structure -
19786 normal_lines, normal_cols, new_total, new_normal, clone_number,
19787 splits, nest, prev_buffers, next_buffers.
19788 (WINDOW_TOTAL_SIZE): Move here from window.c.
19789 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
19790
19791 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19792 Remove.
19793 (make_dummy_parent): Set new members of windows structure.
19794 (make_window): Move down in code. Handle new members of window
19795 structure.
19796 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19797 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19798 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19799 (Fset_window_prev_buffers, Fwindow_next_buffers)
19800 (Fset_window_next_buffers, Fset_window_clone_number):
19801 New functions.
19802 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19803 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19804 Doc-string fixes.
19805 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19806 Argument WINDOW can be now internal window too.
19807 (Fwindow_use_time): Move up in code.
19808 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19809 Rewrite doc-string.
19810 (Fset_window_configuration, saved_window)
19811 (Fcurrent_window_configuration, save_window_save): Handle new
19812 members of window structure.
19813 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19814 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19815 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19816 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19817 Qget_mru_window, Qresize_root_window,
19818 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19819 Qauto_buffer_name; staticpro them.
19820
19821 2011-06-07 Martin Rudalics <rudalics@gmx.at>
19822
19823 * window.c (Fwindow_total_size, Fwindow_left_column)
19824 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19825 (Fwindow_list_1): New functions.
19826 (window_box_text_cols): Replace with window_body_cols.
19827 (Fwindow_width, Fscroll_left, Fscroll_right):
19828 Use window_body_cols instead of window_box_text_cols.
19829 (delete_window, Fset_window_configuration):
19830 Call delete_all_subwindows with window as argument.
19831 (delete_all_subwindows): Take a window as argument and not a
19832 structure. Rewrite.
19833 (window_loop): Remove handling of GET_LRU_WINDOW and
19834 GET_LARGEST_WINDOW.
19835 (Fget_lru_window, Fget_largest_window): Move to window.el.
19836
19837 * window.h: Extern window_body_cols instead of
19838 window_box_text_cols. delete_all_subwindows now takes a
19839 Lisp_Object as argument.
19840
19841 * indent.c (compute_motion, Fcompute_motion):
19842 Use window_body_cols instead of window_box_text_cols.
19843
19844 * frame.c (delete_frame): Call delete_all_subwindows with root
19845 window as argument.
19846
19847 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19848
19849 * fns.c (Fputhash): Document return value.
19850
19851 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
19852
19853 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19854
19855 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19856
19857 Cons<->int and similar integer overflow fixes (Bug#8794).
19858
19859 Check for overflow when converting integer to cons and back.
19860 * charset.c (Fdefine_charset_internal, Fdecode_char):
19861 Use cons_to_unsigned to catch overflow.
19862 (Fencode_char): Use INTEGER_TO_CONS.
19863 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19864 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19865 * data.c (long_to_cons, cons_to_long): Remove.
19866 (cons_to_unsigned, cons_to_signed): New functions.
19867 These signal an error for invalid or out-of-range values.
19868 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19869 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19870 * font.c (Ffont_variation_glyphs):
19871 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19872 * lisp.h: Include <intprops.h>.
19873 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19874 (cons_to_signed, cons_to_unsigned): New decls.
19875 (long_to_cons, cons_to_long): Remove decls.
19876 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19877 (Fprimitive_undo): Use CONS_TO_INTEGER.
19878 * xfns.c (Fx_window_property): Likewise.
19879 * xselect.c: Include <limits.h>.
19880 (x_own_selection, selection_data_to_lisp_data):
19881 Use INTEGER_TO_CONS.
19882 (x_handle_selection_request, x_handle_selection_clear)
19883 (x_get_foreign_selection, Fx_disown_selection_internal)
19884 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19885 (lisp_data_to_selection_data): Use cons_to_unsigned.
19886 (x_fill_property_data): Use cons_to_signed.
19887 Report values out of range.
19888
19889 Check for buffer and string overflow more precisely.
19890 * buffer.h (BUF_BYTES_MAX): New macro.
19891 * lisp.h (STRING_BYTES_MAX): New macro.
19892 * alloc.c (Fmake_string):
19893 * character.c (string_escape_byte8):
19894 * coding.c (coding_alloc_by_realloc):
19895 * doprnt.c (doprnt):
19896 * editfns.c (Fformat):
19897 * eval.c (verror):
19898 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19899 since they may not be the same number.
19900 * editfns.c (Finsert_char):
19901 * fileio.c (Finsert_file_contents):
19902 Likewise for BUF_BYTES_MAX.
19903
19904 * image.c: Use ptrdiff_t, not int, for sizes.
19905 (slurp_file): Switch from int to ptrdiff_t.
19906 All uses changed.
19907 (slurp_file): Check that file size fits in both size_t (for
19908 malloc) and ptrdiff_t (for sanity and safety).
19909
19910 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19911 if b->modtime has its maximal value.
19912
19913 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19914
19915 Don't assume time_t can fit into int.
19916 * buffer.h (struct buffer.modtime): Now time_t, not int.
19917 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19918 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19919
19920 Minor fixes for signed vs unsigned integers.
19921 * character.h (MAYBE_UNIFY_CHAR):
19922 * charset.c (maybe_unify_char):
19923 * keyboard.c (read_char, reorder_modifiers):
19924 XINT -> XFASTINT, since the integer must be nonnegative.
19925 * ftfont.c (ftfont_spec_pattern):
19926 * keymap.c (access_keymap, silly_event_symbol_error):
19927 XUINT -> XFASTINT, since the integer must be nonnegative.
19928 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19929 since it makes no difference and we prefer signed.
19930 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19931 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19932 nonnegative.
19933
19934 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19935
19936 * window.h (Fwindow_frame): Declare.
19937
19938 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19939
19940 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19941 (SPARE_MEMORY): Always define.
19942 (LARGE_REQUEST): Remove.
19943 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19944
19945 2011-06-06 Martin Rudalics <rudalics@gmx.at>
19946
19947 * lisp.h: Move EXFUNS for Fframe_root_window,
19948 Fframe_first_window and Fset_frame_selected_window to window.h.
19949
19950 * window.h: Move EXFUNS for Fframe_root_window,
19951 Fframe_first_window and Fset_frame_selected_window here from
19952 lisp.h.
19953
19954 * frame.c (Fwindow_frame, Fframe_first_window)
19955 (Fframe_root_window, Fframe_selected_window)
19956 (Fset_frame_selected_window): Move to window.c.
19957 (Factive_minibuffer_window): Move to minibuf.c.
19958 (Fother_visible_frames_p): New function.
19959
19960 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19961
19962 * window.c (decode_window, decode_any_window): Move up in code.
19963 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19964 (inhibit_frame_unsplittable): Remove unused variable.
19965 (Fwindow_buffer): Move up and rewrite doc-string.
19966 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19967 (Fwindow_prev): New functions.
19968 (Fwindow_frame): Move here from frame.c. Accept any window as
19969 argument.
19970 (Fframe_root_window, Fframe_first_window)
19971 (Fframe_selected_window): Move here from frame.c. Accept frame
19972 or arbitrary window as argument. Update doc-strings.
19973 (Fminibuffer_window): Move up in code.
19974 (Fwindow_minibuffer_p): Move up in code and simplify.
19975 (Fset_frame_selected_window): Move here from frame.c.
19976 Marginal rewrite.
19977 (Fselected_window, select_window, Fselect_window): Move up in
19978 code. Minor doc-string fixes.
19979
19980 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19981
19982 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19983 Do not assume that spare memory exists; that assumption is valid
19984 only if SYSTEM_MALLOC.
19985 (LARGE_REQUEST): New macro, so that the issue of large requests
19986 is separated from the issue of spare memory.
19987
19988 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19989
19990 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19991 format. (Bug#8806)
19992
19993 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19994
19995 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19996 before statements.
19997
19998 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19999
20000 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20001
20002 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20003
20004 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20005 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20006
20007 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20008
20009 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20010
20011 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20012
20013 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20014 (x_clipboard_manager_save): Add return value.
20015 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20016 New error handlers.
20017 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20018 Obey Vx_select_enable_clipboard_manager. Catch errors in
20019 x_clipboard_manager_save (Bug#8779).
20020 (Vx_select_enable_clipboard_manager): New variable.
20021 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20022
20023 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20024
20025 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20026
20027 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20028
20029 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20030 in the current matrix if keep_current_p is non-zero.
20031
20032 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20033
20034 * bidi.c (bidi_level_of_next_char): Fix last change.
20035
20036 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20037
20038 Support bidi reordering of text covered by display properties.
20039
20040 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20041 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20042 (bidi_cache_search, bidi_cache_iterator_state)
20043 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20044 (bidi_level_of_next_char, bidi_move_to_visually_next):
20045 Support character positions inside a run of characters covered by a
20046 display string.
20047 (bidi_paragraph_init, bidi_resolve_explicit_1)
20048 (bidi_level_of_next_char): Call bidi_fetch_char and
20049 bidi_fetch_char_advance instead of FETCH_CHAR and
20050 FETCH_CHAR_ADVANCE.
20051 (bidi_init_it): Initialize new members.
20052 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20053 definitions.
20054 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20055 instead of using explicit *_CHAR codes.
20056 (bidi_resolve_explicit, bidi_resolve_weak):
20057 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20058 bidirectional text is supported only in multibyte buffers.
20059 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20060 it to initialize the frame_window_p member of struct bidi_it.
20061 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20062 (bidi_resolve_explicit, bidi_resolve_weak)
20063 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20064 bidi_it->nchars is non-positive.
20065 (bidi_level_of_next_char): Don't try to lookup the cache for the
20066 next/previous character if nothing is cached there yet, or if we
20067 were just reseat()'ed to a new position.
20068
20069 * xdisp.c (set_cursor_from_row): Set start and stop points
20070 according to the row's direction when priming the loop that looks
20071 for the glyph on which to display cursor.
20072 (single_display_spec_intangible_p): Function deleted.
20073 (display_prop_intangible_p): Reimplement to call
20074 handle_display_spec instead of single_display_spec_intangible_p.
20075 Accept 3 additional arguments needed by handle_display_spec.
20076 This fixes incorrect cursor motion across display property with complex
20077 values: lists, `(when COND...)' forms, etc.
20078 (single_display_spec_string_p): Support property values that are
20079 lists with the argument STRING its top-level element.
20080 (display_prop_string_p): Fix the condition for processing a
20081 property that is a list to be consistent with handle_display_spec.
20082 (handle_display_spec): New function, refactored from the
20083 last portion of handle_display_prop.
20084 (compute_display_string_pos): Accept additional argument
20085 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20086 value of a `display' property is a "replacing spec".
20087 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20088 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20089 the display property, but just return a value indicating whether
20090 the display property will replace the characters it covers.
20091 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20092 frame_window_p members of struct bidi_it.
20093 (compute_display_string_pos, compute_display_string_end):
20094 New functions.
20095 (push_it): Accept second argument POSITION, where pop_it should
20096 jump to continue iteration.
20097 (reseat_1): Initialize bidi_it.disp_pos.
20098
20099 * keyboard.c (adjust_point_for_property): Adjust the call to
20100 display_prop_intangible_p to its new signature.
20101
20102 * dispextern.h (struct bidi_it): New member frame_window_p.
20103 (bidi_init_it): Update prototypes.
20104 (display_prop_intangible_p): Update prototype.
20105 (compute_display_string_pos, compute_display_string_end):
20106 Declare prototypes.
20107 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20108 EMACS_INT.
20109
20110 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20111
20112 Malloc failure behavior now depends on size of allocation.
20113 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20114 * lisp.h: Change signatures accordingly.
20115 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20116 All callers changed. (Bug#8762)
20117
20118 * gnutls.c: Use Emacs's memory allocators.
20119 Without this change, the gnutls library would invoke malloc etc.
20120 directly, which causes problems on non-SYNC_INPUT hosts, and which
20121 runs afoul of improving memory_full behavior. (Bug#8761)
20122 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20123 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20124 xfree instead of the default malloc, realloc, free.
20125 (Fgnutls_boot): No need to check for memory allocation failure,
20126 since xmalloc does that for us.
20127
20128 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20129 * category.c (hash_get_category_set):
20130 * ccl.c (ccl_driver):
20131 * charset.c (Fdefine_charset_internal):
20132 * charset.h (struct charset.hash_index):
20133 * composite.c (get_composition_id, gstring_lookup_cache)
20134 (composition_gstring_put_cache):
20135 * composite.h (struct composition.hash_index):
20136 * dispextern.h (struct image.hash):
20137 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20138 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20139 (hashfn_equal, hashfn_user_defined, make_hash_table)
20140 (maybe_resize_hash_table, hash_lookup, hash_put)
20141 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20142 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20143 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20144 * image.c (make_image, search_image_cache, lookup_image)
20145 (xpm_put_color_table_h):
20146 * lisp.h (struct Lisp_Hash_Table):
20147 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20148 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20149 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20150 * alloc.c (allocate_vectorlike):
20151 Check for overflow in vector size calculations.
20152 * ccl.c (ccl_driver):
20153 Check for overflow when converting EMACS_INT to int.
20154 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20155 need to be updated by these changes.
20156 * fns.c (make_hash_table, maybe_resize_hash_table):
20157 Check for integer overflow with large hash tables.
20158 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20159 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20160 (SXHASH_REDUCE): New macro.
20161 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20162 Use it instead of discarding useful hash info with large hash values.
20163 (sxhash_float): New function.
20164 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20165 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20166 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20167 Rewrite to use FIXNUM_BITS, as this simplifies things.
20168 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20169 Adjust signatures to match updated version of code.
20170 (consing_since_gc): Now EMACS_INT, since a single hash table can
20171 use more than INT_MAX bytes.
20172
20173 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20174
20175 Make it possible to build with GCC-4.6+ -O2 -flto.
20176
20177 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20178
20179 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20180
20181 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20182 Call minibuffer-inactive-mode.
20183
20184 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20185
20186 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20187 Update dependencies.
20188
20189 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20190
20191 * data.c (init_data): Remove code for UTS, this system is not
20192 supported anymore.
20193
20194 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20195
20196 Don't force ./temacs to start in terminal mode.
20197
20198 * frame.c (make_initial_frame): Initialize faces in all cases, not
20199 only when CANNOT_DUMP is defined.
20200 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20201
20202 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20203
20204 * dispnew.c (add_window_display_history): Use const for the string
20205 pointer. Remove declaration, not needed.
20206
20207 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20208
20209 Use 'inline', not 'INLINE'.
20210 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20211 * alloc.c, fontset.c (INLINE): Remove.
20212 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20213 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20214 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20215 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20216 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20217
20218 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20219
20220 Make it possible to run ./temacs.
20221
20222 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20223 syms_of_callproc does the same thing. Remove test for
20224 "initialized", do it in the caller.
20225 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20226
20227 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20228
20229 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20230 (read_minibuf): Use get_minibuffer.
20231 (syms_of_minibuf): Use DEFSYM.
20232 (Qmetadata): New var.
20233 * data.c (Qbuffer): Don't make it static.
20234 (syms_of_data): Use DEFSYM.
20235
20236 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20237
20238 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20239 (CCL_CODE_MIN): New macro.
20240
20241 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20242
20243 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20244
20245 * eval.c (Qdebug): Now static.
20246 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20247 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20248 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20249
20250 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20251
20252 * image.c: Various fixes to ImageMagick code comments.
20253 (Fimagemagick_types): Doc fix.
20254
20255 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20256
20257 Minor fixes prompted by GCC 4.6.0 warnings.
20258
20259 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20260
20261 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20262 (x_clipboard_manager_save_all): Move extern decl to ...
20263 * xterm.h: ... here, so that it can be checked for consistency.
20264
20265 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20266
20267 * xselect.c (x_clipboard_manager_save_frame)
20268 (x_clipboard_manager_save_all): New functions.
20269 (Fx_clipboard_manager_save): Lisp function deleted.
20270
20271 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20272 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20273
20274 * xterm.h: Update prototype.
20275
20276 2011-05-28 William Xu <william.xwl@gmail.com>
20277
20278 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20279 exiting (Bug#8239).
20280
20281 2011-05-28 Jim Meyering <meyering@redhat.com>
20282
20283 Avoid a sign-extension bug in crypto_hash_function.
20284 * fns.c (to_uchar): Define.
20285 (crypto_hash_function): Use it to convert some newly-signed
20286 variables to unsigned, to avoid sign-extension bugs. For example,
20287 without this change, (md5 "truc") would evaluate to
20288 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20289 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
20290 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
20291
20292 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20293
20294 Integer overflow fixes.
20295
20296 * dbusbind.c: Serial number integer overflow fixes.
20297 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
20298 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20299 to hold a serial number that is too large for a fixnum.
20300 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20301 Check for serial numbers out of range. Decode any serial number
20302 that was so large that it became a float. (Bug#8722)
20303
20304 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20305 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20306 Use XFASTINT rather than XUINT when numbers are nonnegative.
20307 (xd_append_arg, Fdbus_method_return_internal):
20308 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20309 arguments, check that Lisp number is nonnegative, rather than
20310 silently wrapping negative numbers around. (Bug#8722)
20311 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
20312 (Bug#8722)
20313
20314 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20315
20316 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20317
20318 ccl: Add integer overflow checks.
20319 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20320 (IN_INT_RANGE): New macros.
20321 (ccl_driver): Use them to check for integer overflow when
20322 decoding a CCL program. Many of the new checks are whether XINT (x)
20323 fits in int; it doesn't always, on 64-bit hosts. The new version
20324 doesn't catch all possible integer overflows, but it's an
20325 improvement. (Bug#8719)
20326
20327 * alloc.c (make_event_array): Use XINT, not XUINT.
20328 There's no need for unsigned here.
20329
20330 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20331 This follows up to the 2011-05-06 change that substituted uintptr_t
20332 for EMACS_INT. This case wasn't caught back then.
20333
20334 Rework Fformat to avoid integer overflow issues.
20335 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20336 now (part of C89). Include <verify.h>.
20337 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20338 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20339 (Fformat): Avoid the prepass trying to compute sizes; it was only
20340 approximate and thus did not catch overflow reliably. Instead, walk
20341 through the format just once, formatting and computing sizes as we go,
20342 checking for integer overflow at every step, and allocating a larger
20343 buffer as needed. Keep track separately whether the format is
20344 multibyte. Keep only the most-recently calculated precision, rather
20345 than them all. Record whether each argument has been converted to
20346 string. Use EMACS_INT, not int, for byte and char and arg counts.
20347 Support field widths and precisions larger than INT_MAX. Avoid
20348 sprintf's undefined behavior with conversion specifications such as %#d
20349 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20350 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20351 formatting out-of-range floating point numbers with int
20352 formats. (Bug#8668)
20353
20354 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20355
20356 * data.c: Avoid integer truncation in expressions involving floats.
20357 * data.c: Include <intprops.h>.
20358 (arith_driver): When there's an integer overflow in an expression
20359 involving floating point, convert the integers to floating point
20360 so that the resulting value does not suffer from catastrophic
20361 integer truncation. For example, on a 64-bit host (* 4
20362 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20363 Do not rely on undefined behavior after integer overflow.
20364
20365 merge count_size_as_multibyte, parse_str_to_multibyte
20366 * character.c, character.h (count_size_as_multibyte):
20367 Rename from parse_str_to_multibyte; all uses changed.
20368 Check for integer overflow.
20369 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20370 since it's now a duplicate of the other. This is more of
20371 a character than a buffer op, so better that it's in character.c.
20372 * fns.c, print.c: Adjust to above changes.
20373
20374 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20375
20376 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20377
20378 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20379
20380 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20381 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20382 (x_clipboard_manager_save): Now static.
20383 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20384
20385 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20386 (crypto_hash_function): Now static.
20387 Fix pointer signedness problems. Avoid unnecessary initializations.
20388
20389 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
20390
20391 * termhooks.h (Vselection_alist): Make it terminal-local.
20392
20393 * terminal.c (create_terminal): Initialize it.
20394
20395 * xselect.c: Support for clipboard managers.
20396 (Vselection_alist): Move to termhooks.h as terminal-local var.
20397 (LOCAL_SELECTION): New macro.
20398 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20399 (symbol_to_x_atom): Remove gratuitous arg.
20400 (x_handle_selection_request, lisp_data_to_selection_data)
20401 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
20402 (x_own_selection, x_get_local_selection, x_convert_selection):
20403 New arg, specifying work frame. Use terminal-local Vselection_alist.
20404 (some_frame_on_display): Delete unused function.
20405 (Fx_own_selection_internal, Fx_get_selection_internal)
20406 (Fx_disown_selection_internal, Fx_selection_owner_p)
20407 (Fx_selection_exists_p): New optional frame arg.
20408 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20409 (x_handle_selection_clear): Don't treat other terminals with the
20410 same keyboard specially. Use the terminal-local Vselection_alist.
20411 (x_clear_frame_selections): Use Frun_hook_with_args.
20412
20413 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20414
20415 * xterm.h: Add support for those atoms.
20416
20417 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
20418
20419 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20420 (converted_selections, conversion_fail_tag): New global variables.
20421 (x_selection_request_lisp_error): Free the above.
20422 (x_get_local_selection): Remove unnecessary code.
20423 (x_reply_selection_request): Args changed; handle arbitrary array
20424 of converted selections stored in converted_selections.
20425 Separate the XChangeProperty and SelectionNotify steps.
20426 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20427 (x_convert_selection): New function.
20428 (x_handle_selection_event): Simplify.
20429 (x_get_foreign_selection): Don't ignore incoming requests while
20430 waiting for an answer; this will fail when we implement
20431 SAVE_TARGETS, and seems unnecessary anyway.
20432 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20433 (Vx_sent_selection_functions): Doc fix.
20434
20435 2011-05-26 Leo Liu <sdl.web@gmail.com>
20436
20437 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20438
20439 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20440
20441 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20442
20443 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20444 for fringe update if it has periodic bitmap.
20445 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
20446 and fringe_bitmap_periodic_p.
20447
20448 * fringe.c (get_fringe_bitmap_data): New function.
20449 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20450 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20451 row. Mark glyph row for fringe update if periodicity changed.
20452
20453 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20454 for fringe update unless it has periodic bitmap.
20455
20456 2011-05-25 Kenichi Handa <handa@m17n.org>
20457
20458 * xdisp.c (get_next_display_element): Set correct it->face_id for
20459 a static composition.
20460
20461 2011-05-24 Leo Liu <sdl.web@gmail.com>
20462
20463 * deps.mk (fns.o):
20464 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20465
20466 * fns.c (crypto_hash_function, Fsha1): New function.
20467 (Fmd5): Use crypto_hash_function.
20468 (syms_of_fns): Add Ssha1.
20469
20470 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20471
20472 * gnutls.c: Remove unused macros.
20473 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20474 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20475 Remove macros that are defined and never used.
20476 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20477
20478 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20479
20480 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20481 (Fx_get_selection_internal): Minor cleanup.
20482 (Fx_own_selection_internal): Rename arguments for consistency with
20483 select.el.
20484
20485 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20486
20487 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20488
20489 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20490
20491 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20492
20493 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20494
20495 * dispnew.c (scrolling_window): Don't exclude the case that the
20496 last enabled row in the desired matrix touches the bottom boundary.
20497
20498 2011-05-21 Glenn Morris <rgm@gnu.org>
20499
20500 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
20501 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20502 and add some more files.
20503
20504 2011-05-20 Eli Zaretskii <eliz@gnu.org>
20505
20506 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20507 report_file_error introduced by the change from 2011-05-07.
20508
20509 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20510
20511 * systime.h (Time): Define only if emacs is defined.
20512 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20513 where the include path doesn't have X11/X.h by default. See
20514 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20515
20516 2011-05-20 Kenichi Handa <handa@m17n.org>
20517
20518 * composite.c (find_automatic_composition): Fix previous change.
20519
20520 2011-05-20 Glenn Morris <rgm@gnu.org>
20521
20522 * lisp.mk: New file, split from Makefile.in.
20523 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20524 (shortlisp): Remove.
20525 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20526
20527 2011-05-19 Glenn Morris <rgm@gnu.org>
20528
20529 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20530 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20531 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20532 (lisp): Set the order to that of loadup.el.
20533 (shortlisp): Make it a copy of $lisp.
20534 (SOME_MACHINE_LISP): Remove.
20535 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20536 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20537
20538 2011-05-18 Kenichi Handa <handa@m17n.org>
20539
20540 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20541 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20542 (find_automatic_composition): Mostly rewrite for efficiency.
20543
20544 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
20545
20546 * makefile.w32-in: Update dependencies.
20547
20548 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20549
20550 * menu.c: Include limits.h (fixes the MS-Windows build broken by
20551 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
20552
20553 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
20554
20555 Fix some integer overflow issues, such as string length overflow.
20556
20557 * insdel.c (count_size_as_multibyte): Check for string overflow.
20558
20559 * character.c (lisp_string_width): Check for string overflow.
20560 Use EMACS_INT, not int, for string indexes and lengths; in
20561 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20562 the resulting string length overflows an EMACS_INT; instead,
20563 report a string overflow if no precision given. When checking for
20564 precision exhaustion, use a check that cannot possibly have
20565 integer overflow. (Bug#8675)
20566 * character.h (lisp_string_width): Adjust to new signature.
20567
20568 * alloc.c (string_overflow): New function.
20569 (Fmake_string): Use it. This doesn't change behavior, but saves
20570 a few bytes and will simplify future changes.
20571 * character.c (string_escape_byte8): Likewise.
20572 * lisp.h (string_overflow): New decl.
20573
20574 Fixups, following up to the user-interface timestamp change.
20575 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20576 for UI timestamps, instead of unsigned long.
20577 * msdos.c (mouse_get_pos): Likewise.
20578 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
20579 * w32gui.h (Time): Define by including "systime.h" rather than by
20580 declaring it ourselves. (Bug#8664)
20581
20582 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20583 * image.c (clear_image_cache): Likewise.
20584
20585 * term.c (term_mouse_position): Don't assume time_t wraparound.
20586
20587 Be more systematic about user-interface timestamps.
20588 Before, the code sometimes used 'Time', sometimes 'unsigned long',
20589 and sometimes 'EMACS_UINT', to represent these timestamps.
20590 This change causes it to use 'Time' uniformly, as that's what X uses.
20591 This makes the code easier to follow, and makes it easier to catch
20592 integer overflow bugs such as Bug#8664.
20593 * frame.c (Fmouse_position, Fmouse_pixel_position):
20594 Use Time, not unsigned long, for user-interface timestamps.
20595 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20596 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20597 * keyboard.h (last_event_timestamp): Likewise.
20598 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20599 * menu.h (xmenu_show): Likewise.
20600 * term.c (term_mouse_position): Likewise.
20601 * termhooks.h (struct input_event.timestamp): Likewise.
20602 (struct terminal.mouse_position_hook): Likewise.
20603 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20604 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20605 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20606 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20607 what it was before.
20608 * menu.h, termhooks.h: Include "systime.h", for Time.
20609
20610 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20611 Don't assume that the difference between two unsigned long values
20612 can fit into an integer. At this point, we know button_down_time
20613 <= event->timestamp, so the difference must be nonnegative, so
20614 there's no need to cast the result if double-click-time is
20615 nonnegative, as it should be; check that it's nonnegative, just in
20616 case. This bug is triggered when events are more than 2**31 ms
20617 apart (about 25 days). (Bug#8664)
20618
20619 * xselect.c (last_event_timestamp): Remove duplicate decl.
20620 (x_own_selection): Remove needless cast to unsigned long.
20621
20622 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20623 that always fit in int. Use a sentinel instead of a counter, to
20624 avoid a temp and to allay GCC's concerns about possible int overflow.
20625 * frame.h (struct frame): Use int for menu_bar_items_used
20626 instead of EMACS_INT, since it always fits in int.
20627
20628 * menu.c (grow_menu_items): Check for int overflow.
20629
20630 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20631
20632 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20633 Before, the code was not consistent. These values cannot exceed
20634 2**31 - 1 so there's no need to make them unsigned.
20635 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20636 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20637 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20638 as modifiers.
20639 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20640
20641 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20642 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20643 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20644 presumably because the widths might not match.
20645
20646 * window.c (size_window): Avoid needless test at loop start.
20647
20648 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20649
20650 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20651
20652 2011-05-12 Drew Adams <drew.adams@oracle.com>
20653
20654 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20655
20656 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20657
20658 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20659 `width' to `bar_area_x' and `bar_area_width', respectively.
20660 (x_scroll_run): Take account of fringe background extension.
20661
20662 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20663 Rename local vars `left' and `width' to `bar_area_x' and
20664 `bar_area_width', respectively.
20665 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20666 background extension.
20667
20668 2011-05-10 Jim Meyering <meyering@redhat.com>
20669
20670 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20671
20672 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
20673
20674 * image.c (Finit_image_library): Return t for built-in image types,
20675 like pbm and xbm. (Bug#8640)
20676
20677 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20678
20679 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20680
20681 2011-05-07 Eli Zaretskii <eliz@gnu.org>
20682
20683 * w32console.c (Fset_screen_color): Doc fix.
20684 (Fget_screen_color): New function.
20685 (syms_of_ntterm): Defsubr it.
20686
20687 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20688 unlink the temporary file if Fcall_process didn't create it in the
20689 first place.
20690 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20691 child process will be redirected to a file specified with `:file'.
20692 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20693 cue to call_process_cleanup not to close that handle.
20694
20695 2011-05-07 Ben Key <bkey76@gmail.com>
20696
20697 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20698 one of two shell specific rules, either bootstrap-temacs-CMD or
20699 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20700 to the previous implementation of the bootstrap-temacs rule.
20701 The bootstrap-temacs-CMD rule is similar to the previous
20702 implementation of the bootstrap-temacs rule except that it
20703 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20704 variable.
20705
20706 These changes, along with some changes to nt/configure.bat,
20707 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20708 earlier fix to add support for --cflags and --ldflags options
20709 that include quotes so that it works whether make uses cmd or
20710 sh as the shell.
20711
20712 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
20713
20714 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20715 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20716 is a constant.
20717 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20718 a string. Handle both cases.
20719 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20720 (Fdbus_register_method): Use Qinvalid_function.
20721
20722 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20723
20724 * makefile.w32-in: Update dependencies.
20725 (LISP_H): Add inttypes.h and stdin.h.
20726 (PROCESS_H): Add unistd.h.
20727
20728 2011-05-06 Eli Zaretskii <eliz@gnu.org>
20729
20730 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20731 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20732
20733 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
20734
20735 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20736
20737 * term.c (vfatal): Remove stray call to va_end.
20738 It's not needed and the C Standard doesn't allow it here anyway.
20739
20740 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20741 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20742
20743 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20744 bytes.
20745
20746 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20747
20748 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20749
20750 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20751
20752 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20753
20754 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20755
20756 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20757 * charset.c (Fdefine_charset_internal): Don't initialize
20758 charset.code_space[15]. The value was garbage, on hosts with
20759 32-bit int (Bug#8600).
20760
20761 * lread.c (read_integer): Be more consistent with string-to-number.
20762 Use string_to_number to do the actual conversion; this avoids
20763 rounding errors and fixes some other screwups. Without this fix,
20764 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20765 (digit_to_number): Move earlier, for benefit of read_integer.
20766 Return -1 if the digit is out of range for the base, -2 if it is
20767 not a digit in any supported base. (Bug#8602)
20768
20769 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20770
20771 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20772 to match comment at start of function. This also removes a
20773 GCC warning about overflow in a 32+64-bit port.
20774
20775 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20776
20777 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20778 Reported by Stefan Monnier in
20779 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
20780 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20781 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
20782
20783 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20784 (EMACS_UINTPTR): Likewise, with uintptr_t.
20785
20786 * lisp.h: Prefer 64-bit EMACS_INT if available.
20787 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20788 on 32-bit hosts that have 64-bit int, so that they can access
20789 large files.
20790 However, temporarily disable this change unless the temporary
20791 symbol WIDE_EMACS_INT is defined.
20792
20793 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20794
20795 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20796 This removes an assumption that EMACS_INT and long are the same
20797 width as pointers. The assumption is true for Emacs porting targets
20798 now, but we want to make other targets possible.
20799 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20800 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20801 In the rest of the code, change types of integers that hold casted
20802 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20803 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20804 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20805 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20806 No need to cast type when ORing.
20807 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20808 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20809 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20810 assume EMACS_INT is the same width as char *.
20811 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20812 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20813 Remove no-longer-needed casts.
20814 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20815 (xg_tool_bar_help_callback, xg_make_tool_item):
20816 Use EMACS_INTPTR to hold an integer
20817 that will be cast to void *; this can avoid a GCC warning
20818 if EMACS_INT is not the same width as void *.
20819 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20820 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20821 (current_message_1, set_message_1):
20822 Use a local to convert to proper width without a cast.
20823 * xmenu.c (dialog_selection_callback): Likewise.
20824
20825 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20826 Also, don't assume VALBITS / RAND_BITS is less than 5,
20827 and don't rely on undefined behavior when shifting a 1 left into
20828 the sign bit.
20829 * lisp.h (get_random): Change signature to match.
20830
20831 * lread.c (hash_string): Use size_t, not int, for hash computation.
20832 Normally we prefer signed values; but hashing is special, because
20833 it's better to use unsigned division on hash table sizes so that
20834 the remainder is nonnegative. Also, size_t is the natural width
20835 for hashing into memory. The previous code used 'int', which doesn't
20836 retain enough info to hash well into very large tables.
20837 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20838
20839 * dbusbind.c: Don't possibly lose pointer info when converting.
20840 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20841 Use XPNTR rather than XHASH, so that the high-order bits of
20842 the pointer aren't lost when converting through void *.
20843
20844 * eval.c (Fautoload): Don't double-shift a pointer.
20845
20846 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20847
20848 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20849
20850 * gnutls.c (DEF_GNUTLS_FN):
20851 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20852
20853 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20854
20855 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20856 marker. (Bug#8610)
20857
20858 2011-05-05 Eli Zaretskii <eliz@gnu.org>
20859
20860 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20861 New version that can reserve upto 2GB of heap space.
20862
20863 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
20864
20865 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20866
20867 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20868
20869 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20870 `gnutls_certificate_set_x509_key_file'.
20871
20872 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
20873
20874 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20875 Update dependencies.
20876
20877 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20878
20879 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20880 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20881 Remove unused parameter `fildes'.
20882 * process.c (read_process_output, send_process): Don't pass it.
20883
20884 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20885
20886 Fix previous change: the library cache is defined in w32.c.
20887 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20888 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20889
20890 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20891
20892 Implement dynamic loading of GnuTLS on Windows.
20893
20894 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20895 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20896 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20897 Declare.
20898
20899 * gnutls.c (Qgnutls_dll): Define.
20900 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20901 (gnutls_*): Declare function pointers.
20902 (init_gnutls_functions): New function to initialize function pointers.
20903 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20904 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20905 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20906 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20907 (emacs_gnutls_write, emacs_gnutls_read)
20908 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20909 (Fgnutls_available_p): New function.
20910 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20911 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20912 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20913
20914 * image.c: Include w32.h.
20915 (Vimage_type_cache): Delete.
20916 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20917 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20918 (w32_delayed_load): Move to w32.c.
20919
20920 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20921
20922 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20923 (w32_delayed_load): Move from image.c. When loading a library, record
20924 its filename in the :loaded-from property of the library id.
20925 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20926 Initialize and staticpro them.
20927 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20928
20929 * process.c: Include lisp.h before w32.h, not after.
20930 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20931 instead of gnutls_record_check_pending.
20932
20933 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20934
20935 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20936
20937 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20938 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20939 as passed in.
20940
20941 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20942
20943 * xterm.c (x_set_frame_alpha): Do not set property on anything
20944 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20945
20946 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20947
20948 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20949
20950 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20951
20952 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20953 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20954 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20955 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20956 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20957 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20958 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20959 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20960 (Qgnutls_bootprop_callbacks_verify): Make static.
20961
20962 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20963
20964 * callproc.c: Indentation fixup.
20965
20966 * sysdep.c (wait_for_termination_1): Make static.
20967 (wait_for_termination, interruptible_wait_for_termination):
20968 Move after wait_for_termination_1.
20969
20970 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20971
20972 * sysdep.c (interruptible_wait_for_termination): New function
20973 which is like wait_for_termination, but allows keyboard
20974 interruptions.
20975
20976 * callproc.c (Fcall_process): Add (:file "file") as an option for
20977 the STDOUT buffer.
20978 (Fcall_process_region): Ditto.
20979
20980 2011-04-30 Eli Zaretskii <eliz@gnu.org>
20981
20982 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20983 rather than `XVECTOR (FOO)->size'.
20984
20985 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20986 inttypes.h, as a gnulib replacement is used if it not available in
20987 system headers.
20988
20989 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20990
20991 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20992 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20993 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20994
20995 * coding.c (coding_alloc_by_realloc): Error out if destination
20996 will grow beyond MOST_POSITIVE_FIXNUM.
20997 (decode_coding_emacs_mule): Abort if there isn't enough place in
20998 charbuf for the composition carryover bytes. Reserve an extra
20999 space for up to 2 characters produced in a loop.
21000 (decode_coding_iso_2022): Abort if there isn't enough place in
21001 charbuf for the composition carryover bytes.
21002
21003 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21004
21005 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21006 aborting when %lld or %lll format is passed.
21007 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21008 %llo or %llx format is passed. (Bug#8545)
21009
21010 * window.c (window_scroll_line_based): Use a marker instead of
21011 simple variables to record original value of point. (Bug#7952)
21012
21013 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21014 produced by %s or %c overflows available buffer space. (Bug#8545)
21015
21016 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21017
21018 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21019 (SIZE_MAX): Move defn after all includes, as they might #define it.
21020
21021 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21022
21023 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21024
21025 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21026
21027 * keyboard.c (Qdelayed_warnings_hook): Define.
21028 (command_loop_1): Run `delayed-warnings-hook'
21029 if Vdelayed_warnings_list is non-nil.
21030 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21031 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21032
21033 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21034
21035 * doprnt.c (doprnt): Don't return value smaller than the buffer
21036 size if the message was truncated. (Bug#8545).
21037
21038 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21039
21040 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21041 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21042
21043 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21044
21045 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21046
21047 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21048
21049 * makefile.w32-in: Update dependencies.
21050
21051 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21052
21053 Improve `doprnt' and its usage. (Bug#8545)
21054 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21055 `format_end'. Remove support for %l as a conversion specifier.
21056 Don't use xrealloc. Improve diagnostics when the %l size modifier
21057 is used. Update the commentary.
21058
21059 * eval.c (verror): Simplify calculation of size_t.
21060
21061 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21062 messages.
21063
21064 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21065
21066 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21067 change.
21068
21069 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21070
21071 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21072 This makes this file independent of the recent pseudovector change.
21073
21074 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21075
21076 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21077
21078 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21079 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21080 Remove unused local.
21081 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21082
21083 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21084 GCC 4.6.0 optimizes based on type-based alias analysis.
21085 For example, if b is of type struct buffer * and v of type struct
21086 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21087 != &v->size, and therefore "v->size = 1; b->size = 2; return
21088 v->size;" must therefore return 1. This assumption is incorrect
21089 for Emacs, since it type-puns struct Lisp_Vector * with many other
21090 types. To fix this problem, this patch adds a new type struct
21091 vectorlike_header that documents the constraints on layout of vectors
21092 and pseudovectors, and helps optimizing compilers not get fooled
21093 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21094 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21095 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21096 the size member.
21097 (XSETPVECTYPE): Rewrite in terms of new macro.
21098 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21099 This is a bit clearer, and further avoids the possibility of
21100 undesirable aliasing.
21101 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21102 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21103 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21104 since Lisp_Subr is a special case (no "next" field).
21105 (ASIZE): Now uses header.size rather than size.
21106 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21107 to avoid the hassle of writing XVECTOR (foo)->header.size.
21108 (struct vectorlike_header): New type.
21109 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21110 object, to help avoid aliasing.
21111 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21112 (SUBRP): Likewise, since Lisp_Subr is a special case.
21113 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21114 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21115 (struct Lisp_Hash_Table): Combine first two members into a single
21116 struct vectorlike_header member. All uses of "size" and "next" members
21117 changed to be "header.size" and "header.next".
21118 * buffer.h (struct buffer): Likewise.
21119 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21120 * frame.h (struct frame): Likewise.
21121 * process.h (struct Lisp_Process): Likewise.
21122 * termhooks.h (struct terminal): Likewise.
21123 * window.c (struct save_window_data, struct saved_window): Likewise.
21124 * window.h (struct window): Likewise.
21125 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21126 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21127 * buffer.c (init_buffer_once): Likewise.
21128 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21129 special case.
21130 * process.c (Fformat_network_address): Use local var for size,
21131 for brevity.
21132
21133 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21134
21135 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21136 * data.c (atof): Remove decl; no longer used or needed.
21137 (digit_to_number): Move to lread.c.
21138 (Fstring_to_number): Use new string_to_number function, to be
21139 consistent with how the Lisp reader treats infinities and NaNs.
21140 Do not assume that floating-point numbers represent EMACS_INT
21141 without losing information; this is not true on most 64-bit hosts.
21142 Avoid double-rounding errors, by insisting on integers when
21143 parsing non-base-10 numbers, as the documentation specifies.
21144 * lisp.h (string_to_number): New decl, replacing ...
21145 (isfloat_string): Remove.
21146 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21147 (read1): Do not accept +. and -. as integers; this
21148 appears to have been a coding error. Similarly, do not accept
21149 strings like +-1e0 as floating point numbers. Do not report
21150 overflow for integer overflows unless the base is not 10 which
21151 means we have no simple and reliable way to continue.
21152 Break out the floating-point parsing into a new
21153 function string_to_number, so that Fstring_to_number parses
21154 floating point numbers consistently with the Lisp reader.
21155 (digit_to_number): Move here from data.c. Make it static inline.
21156 (E_CHAR, EXP_INT): Remove, replacing with ...
21157 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21158 (string_to_number): New function, replacing isfloat_string.
21159 This function checks for valid syntax and produces the resulting
21160 Lisp float number too. Rework it so that string-to-number
21161 no longer mishandles examples like "1.0e+". Use strtoumax,
21162 so that overflow for non-base-10 numbers is reported only when
21163 there's no portable and simple way to convert to floating point.
21164
21165 * textprop.c (set_text_properties_1): Rewrite for clarity,
21166 and to avoid GCC warning about integer overflow.
21167
21168 * intervals.h (struct interval): Use EMACS_INT for members
21169 where EMACS_UINT might cause problems. See
21170 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21171 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21172 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21173 All uses changed.
21174 (offset_intervals): Tell GCC not to worry about length overflow
21175 when negating a negative length.
21176
21177 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21178 (overrun_check_free): Likewise.
21179
21180 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21181 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21182 word size.
21183
21184 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21185 (gnutls_make_error): Rename local to avoid shadowing.
21186 (gnutls_emacs_global_deinit): ifdef out; not used.
21187 (Fgnutls_boot): Use const for pointer to readonly storage.
21188 Comment out unused local. Fix pointer signedness problems.
21189
21190 * lread.c (openp): Don't stuff size_t into an 'int'.
21191 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21192 about possible signed overflow.
21193
21194 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21195 (GDK_KEY_g): Don't define if already defined.
21196 (xg_prepare_tooltip): Avoid pointer signedness problem.
21197 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21198
21199 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21200 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21201
21202 * xfns.c (Fx_window_property): Simplify a bit,
21203 to make a bit faster and to avoid GCC 4.6.0 warning.
21204 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21205
21206 * fns.c (internal_equal): Don't assume size_t fits in int.
21207
21208 * alloc.c (compact_small_strings): Tighten assertion a little.
21209
21210 Replace pEd with more-general pI, and fix some printf arg casts.
21211 * lisp.h (pI): New macro, generalizing old pEd macro to other
21212 conversion specifiers. For example, use "...%"pI"d..." rather
21213 than "...%"pEd"...".
21214 (pEd): Remove. All uses replaced with similar uses of pI.
21215 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21216 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21217 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21218 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21219 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21220 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21221 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21222 64-bit hosts.
21223 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21224 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21225 * print.c (safe_debug_print, print_object): Likewise.
21226 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21227 to int.
21228 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21229 avoiding the 0 flag, which is not portable.
21230 * process.c (Fmake_network_process): Use pI to avoid cast.
21231 * region-cache.c (pp_cache): Likewise.
21232 * xdisp.c (decode_mode_spec): Likewise.
21233 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21234 behavior on 64-bit hosts with printf arg.
21235 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21236 (x_stop_queuing_selection_requests): Likewise.
21237 (x_get_window_property): Don't truncate byte count to an 'int'
21238 when tracing.
21239
21240 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21241 here, since it parses constructs like leading '-' and spaces,
21242 which are not wanted; and it overflows with large numbers.
21243 Instead, simply match F[0-9]+, which is what is wanted anyway.
21244
21245 * alloc.c: Remove unportable assumptions about struct layout.
21246 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21247 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21248 (allocate_vectorlike, make_pure_vector): Use the new macros,
21249 plus offsetof, to remove unportable assumptions about struct layout.
21250 These assumptions hold on all porting targets that I know of, but
21251 they are not guaranteed, they're easy to remove, and removing them
21252 makes further changes easier.
21253
21254 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21255 This doesn't fix a bug but makes the code clearer.
21256 (string_overrun_cookie): Now const. Use initializers that
21257 don't formally overflow signed char, to avoid warnings.
21258 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21259 can cause Emacs to crash when string overrun checking is enabled.
21260 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21261 multiple of sizeof (EMACS_INT); it need not be, if
21262 alignof(EMACS_INT) < sizeof (EMACS_INT).
21263 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21264
21265 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21266
21267 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21268
21269 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21270
21271 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21272 supposed to be handshaking. (Bug#8556)
21273 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21274
21275 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21276
21277 * lisp.h (Qdebug): List symbol.
21278 * eval.c (Qdebug): Restore global linkage.
21279 * keyboard.c (debug-on-event): New variable.
21280 (handle_user_signal): Break into debugger when debug-on-event
21281 matches the current signal symbol.
21282
21283 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21284
21285 * alloc.c (check_sblock, check_string_bytes)
21286 (check_string_free_list): Convert to standard C.
21287
21288 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21289
21290 * w32.c (emacs_gnutls_push): Fix typo.
21291
21292 2011-04-25 Eli Zaretskii <eliz@gnu.org>
21293
21294 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21295 "cast to pointer from integer of different size".
21296
21297 Improve doprnt and its use in verror. (Bug#8545)
21298 * doprnt.c (doprnt): Document the set of format control sequences
21299 supported by the function. Use SAFE_ALLOCA instead of always
21300 using `alloca'.
21301
21302 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21303 is one byte too soon. Don't use xrealloc; instead xfree and
21304 xmalloc anew.
21305
21306 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21307
21308 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21309 callbacks stage.
21310
21311 * gnutls.c: Renamed global_initialized to
21312 gnutls_global_initialized. Added internals for the
21313 :verify-hostname-error, :verify-error, and :verify-flags
21314 parameters of `gnutls-boot' and documented those parameters in the
21315 docstring. Start callback support.
21316 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21317 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21318 on error. Return error code.
21319 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21320 (emacs_gnutls_read): Likewise.
21321 (Fgnutls_boot): Return handshake error code.
21322 (emacs_gnutls_handle_error): New function.
21323 (wsaerror_to_errno): Likewise.
21324
21325 * w32.h (emacs_gnutls_pull): Add prototype.
21326 (emacs_gnutls_push): Likewise.
21327
21328 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21329 (emacs_gnutls_push): Likewise.
21330
21331 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21332
21333 * process.c (wait_reading_process_output): Check if GnuTLS
21334 buffered some data internally if no FDs are set for TLS
21335 connections.
21336
21337 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21338 (LIBS): Link to USER_LIBS.
21339 ($(BLD)/gnutls.$(0)): New target.
21340
21341 2011-04-24 Eli Zaretskii <eliz@gnu.org>
21342
21343 * xdisp.c (handle_single_display_spec): Rename the
21344 display_replaced_before_p argument into display_replaced_p, to
21345 make it consistent with the commentary. Fix typos in the
21346 commentary.
21347
21348 * textprop.c (syms_of_textprop): Remove dead code.
21349 (copy_text_properties): Delete obsolete commentary about an
21350 interface that was deleted long ago. Fix typos in the description
21351 of arguments.
21352
21353 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21354 to changes in oldXMenu/XMenu.h from 2011-04-16.
21355 <menu_help_message, prev_menu_help_message>: Constify.
21356 (IT_menu_make_room): menu->help_text is now `const char **';
21357 adjust.
21358
21359 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21360 to changes in oldXMenu/XMenu.h from 2011-04-16.
21361 (struct XMenu): Declare `help_text' `const char **'.
21362
21363 * xfaces.c <Qunspecified>: Make extern again.
21364
21365 * syntax.c: Include sys/types.h before including regex.h, as
21366 required by POSIX.
21367
21368 * doc.c (get_doc_string): Improve the format passed to `error'.
21369
21370 * doprnt.c (doprnt): Improve commentary.
21371
21372 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21373
21374 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21375 them with etags.
21376
21377 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21378 changes in globals.h immediately force recompilation.
21379 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21380 $(CURDIR)/s/ms-w32.h.
21381 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
21382
21383 * character.c (Fchar_direction): Function deleted.
21384 (syms_of_character): Don't defsubr it.
21385 <char-direction-table>: Deleted.
21386
21387 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21388
21389 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21390 * doprnt.c: Include limits.h.
21391 (SIZE_MAX): New macro.
21392 (doprnt): Return a size_t value. 2nd arg is now size_t.
21393 Many local variables are now size_t instead of int or unsigned.
21394 Improve overflow protection. Support `l' modifier for integer
21395 conversions. Support %l conversion. Don't assume an EMACS_INT
21396 argument for integer conversions and for %c.
21397
21398 * lisp.h (doprnt): Restore prototype.
21399
21400 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21401 $(SRC)/character.h.
21402
21403 * Makefile.in (base_obj): Add back doprnt.o.
21404
21405 * deps.mk (doprnt.o): Add back prerequisites.
21406 (callint.o): Depend on character.h.
21407
21408 * eval.c (internal_lisp_condition_case): Include the handler
21409 representation in the error message.
21410 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21411 when breaking from the loop.
21412
21413 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21414
21415 * callint.c (Fcall_interactively): When displaying error message
21416 about invalid control letter, pass the character's codepoint, not
21417 a pointer to its multibyte form. Improve display of the character
21418 in octal and display also its hex code.
21419
21420 * character.c (char_string): Use %x to display the (unsigned)
21421 codepoint of an invalid character, to avoid displaying a bogus
21422 negative value.
21423
21424 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21425 `error', not SYMBOL_NAME itself.
21426
21427 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21428 character arguments to `error'.
21429
21430 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21431 to `error' in error message about FINAL_CHAR argument. Make sure
21432 FINAL_CHAR is a character, and use %c when it is passed as
21433 argument to `error'.
21434
21435 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21436
21437 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21438
21439 * w32.c: Include <time.h>.
21440 (sys_localtime): New function.
21441
21442 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
21443
21444 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21445
21446 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
21447
21448 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
21449
21450 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21451 zombies (Bug#8467).
21452
21453 2011-04-19 Eli Zaretskii <eliz@gnu.org>
21454
21455 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21456 gl_state.e_property when gl_state.object is Qt.
21457
21458 * insdel.c (make_gap_larger): Remove limitation of buffer size
21459 to <= INT_MAX.
21460
21461 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
21462
21463 * xdisp.c (lookup_glyphless_char_display)
21464 (produce_glyphless_glyph): Handle cons cell entry in
21465 glyphless-char-display.
21466 (Vglyphless_char_display): Document it.
21467
21468 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21469 glyphless-char-display.
21470
21471 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
21472
21473 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21474
21475 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21476
21477 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21478 definition for no-X builds.
21479
21480 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
21481
21482 Static checks with GCC 4.6.0 and non-default toolkits.
21483
21484 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21485
21486 * process.c (keyboard_bit_set): Define only if SIGIO.
21487 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21488 (send_process): Repair possible setjmp clobbering.
21489
21490 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21491
21492 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21493
21494 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21495
21496 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21497 Define only if needed.
21498
21499 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21500 by pacifying GCC about it. Maybe it's time to retire it?
21501 * xfaces.c (USG, __TIMEVAL__): Likewise.
21502
21503 * dispextern.h (struct redisplay_interface): Rename param
21504 to avoid shadowing.
21505 * termhooks.h (struct terminal): Likewise.
21506 * xterm.c (xembed_send_message): Likewise.
21507
21508 * insdel.c (make_gap_smaller): Define only if
21509 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21510
21511 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21512 it.
21513
21514 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21515 so that we aren't warned about unused symbols.
21516
21517 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21518
21519 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
21520
21521 * xfns.c (x_real_positions): Mark locals as initialized.
21522
21523 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21524
21525 * xterm.c: Fix problems found by static analysis with other toolkits.
21526 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
21527 (x_dispatch_event): Declare static if USE_GTK, and
21528 define if USE_GTK || USE_X_TOOLKIT.
21529 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
21530 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
21531 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21532 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
21533
21534 * xmenu.c (menu_help_callback): Pointer type fixes.
21535 Use const pointers when pointing at readonly data. Avoid pointer
21536 signedness clashes.
21537 (FALSE): Remove unused macro.
21538 (update_frame_menubar): Remove unused decl.
21539
21540 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21541
21542 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21543 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21544 (single_menu_item): Rename local to avoid shadowing.
21545
21546 * keyboard.c (make_lispy_event): Remove unused local var.
21547
21548 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21549 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21550
21551 * bitmaps: Change bitmaps from unsigned char back to the X11
21552 compatible char. Avoid the old compiler warnings about
21553 out-of-range initializers by using, for example, '\xab' rather
21554 than 0xab.
21555
21556 * xgselect.c (xgselect_initialize): Check vs interface
21557 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21558
21559 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21560
21561 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21562 to read-only memory.
21563
21564 * fns.c (vector): Remove; this old hack is no longer needed.
21565
21566 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
21567 Remove unused var.
21568 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
21569
21570 * xrdb.c (x_load_resources): Omit unused local.
21571
21572 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
21573 (x_window): Rename locals to avoid shadowing.
21574 (USG): Use the kludged USG macro, to pacify gcc.
21575
21576 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
21577 (x_term_init): Remove local to avoid shadowing.
21578
21579 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
21580
21581 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21582 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21583
21584 2011-04-16 Eli Zaretskii <eliz@gnu.org>
21585
21586 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21587
21588 Fix regex.c, syntax.c and friends for buffers > 2GB.
21589 * syntax.h (struct gl_state_s): Declare character position members
21590 EMACS_INT.
21591
21592 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21593
21594 * textprop.c (verify_interval_modification, interval_of):
21595 Declare arguments EMACS_INT.
21596
21597 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21598 EMACS_INT.
21599
21600 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21601
21602 * indent.c (Fvertical_motion): Local variable it_start is now
21603 EMACS_INT.
21604
21605 * regex.c (re_match, re_match_2, re_match_2_internal)
21606 (bcmp_translate, regcomp, regexec, print_double_string)
21607 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21608 (re_compile_pattern, re_exec): Declare arguments and local
21609 variables `size_t' and `ssize_t' and return values `regoff_t', as
21610 appropriate.
21611 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21612 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21613 <compile_stack_type>: `size' and `avail' are now `size_t'.
21614
21615 * regex.h <regoff_t>: Use ssize_t, not int.
21616 (re_search, re_search_2, re_match, re_match_2): Arguments that
21617 specify buffer/string position and length are now ssize_t and
21618 size_t. Return type is regoff_t.
21619
21620 2011-04-16 Ben Key <bkey76@gmail.com>
21621
21622 * nsfont.m: Fixed bugs in ns_get_family and
21623 ns_descriptor_to_entity that were caused by using free to
21624 deallocate memory blocks that were allocated by xmalloc (via
21625 xstrdup). This caused Emacs to crash when compiled with
21626 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21627 --enable-checking=xmallocoverrun). xfree is now used to
21628 deallocate these memory blocks.
21629
21630 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
21631
21632 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21633
21634 emacs_write: Accept and return EMACS_INT for sizes.
21635 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21636 et seq.
21637 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21638 Accept and return EMACS_INT.
21639 (emacs_gnutls_write): Return the number of bytes written on
21640 partial writes.
21641 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
21642 (emacs_read, emacs_write): Remove check for negative size, as the
21643 Emacs source code has been audited now.
21644 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21645 (emacs_read, emacs_write): Use it.
21646 * process.c (send_process): Adjust to the new signatures of
21647 emacs_write and emacs_gnutls_write. Do not attempt to store
21648 a byte offset into an 'int'; it might overflow.
21649 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
21650
21651 * sound.c: Don't assume sizes fit in 'int'.
21652 (struct sound_device.period_size, alsa_period_size):
21653 Return EMACS_INT, not int.
21654 (struct sound_device.write, vox_write, alsa_write):
21655 Accept EMACS_INT, not int.
21656 (wav_play, au_play): Use EMACS_INT to store sizes and to
21657 record read return values.
21658
21659 2011-04-15 Ben Key <bkey76@gmail.com>
21660
21661 * keyboard.c (Qundefined): Don't declare static since it is used
21662 in nsfns.m.
21663 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21664 static since they are used in nsfont.m.
21665
21666 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21667
21668 * process.c (Qprocessp): Don't declare static.
21669 * lisp.h (Qprocessp): Declare again.
21670
21671 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
21672
21673 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21674
21675 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21676
21677 Improve C-level modularity by making more things 'static'.
21678
21679 Don't publish debugger-only interfaces to other modules.
21680 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21681 (verify_bytepos, count_markers): Move decls to the only modules
21682 that need them.
21683 * region-cache.h (pp_cache): Likewise.
21684 * window.h (check_all_windows): Likewise.
21685 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21686
21687 * sysdep.c (croak): Now static, if
21688 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21689 * syssignal.h (croak): Declare only if not static.
21690
21691 * alloc.c (refill_memory_reserve): Now static if
21692 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21693 * lisp.h (refill_memory_reserve): Declare only if not static.
21694
21695 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21696 Define only if USE_LUCID.
21697
21698 * xrdb.c (x_customization_string, x_rm_string): Now static.
21699
21700 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21701 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21702
21703 * xdisp.c (draw_row_with_mouse_face): Now static.
21704 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21705
21706 * window.h (check_all_windows): Mark externally visible.
21707
21708 * window.c (window_deletion_count): Now static.
21709
21710 * undo.c: Make symbols static if they're not exported.
21711 (last_undo_buffer, last_boundary_position, pending_boundary):
21712 Now static.
21713
21714 * textprop.c (interval_insert_behind_hooks): Now static.
21715 (interval_insert_in_front_hooks): Likewise.
21716
21717 * term.c: Make symbols static if they're not exported.
21718 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21719 (max_frame_lines, tty_set_terminal_modes):
21720 (tty_reset_terminal_modes, tty_turn_off_highlight):
21721 (get_tty_terminal): Now static.
21722 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21723 * termhooks.h (term_mouse_moveto): Do not declare if
21724 HAVE_WINDOW_SYSTEM.
21725 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21726 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21727
21728 * sysdep.c: Make symbols static if they're not exported.
21729 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21730 Now static.
21731 (sigprocmask_set, full_mask): Remove; unused.
21732 (wait_debugging): Mark as visible.
21733 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21734 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21735
21736 * syntax.c (syntax_temp): Define only if !__GNUC__.
21737
21738 * sound.c (current_sound_device, current_sound): Now static.
21739
21740 * search.c (searchbufs, searchbuf_head): Now static.
21741
21742 * scroll.c (scroll_cost): Remove; unused.
21743 * dispextern.h (scroll_cost): Remove decl.
21744
21745 * region-cache.h (pp_cache): Mark as externally visible.
21746
21747 * process.c: Make symbols static if they're not exported.
21748 (process_tick, update_tick, create_process, chan_process):
21749 (Vprocess_alist, proc_buffered_char, datagram_access):
21750 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21751 (deactivate_process): Mark defn as static, as well as decl.
21752 * lisp.h (create_process): Remove decl.
21753 * process.h (chan_process, Vprocess_alist): Remove decls.
21754
21755 * print.c: Make symbols static if they're not exported.
21756 (print_depth, new_backquote_output, being_printed, print_buffer):
21757 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21758 (print_interval, print_number_index, initial_stderr_stream):
21759 Now static.
21760 * lisp.h (Fprinc): Remove decl.
21761 (debug_output_compilation_hack): Mark as externally visible.
21762
21763 * sysdep.c (croak): Move decl from here to syssignal.h.
21764 * syssignal.h (croak): Put it here, so the API can be checked when
21765 'croak' is called from dissociate_if_controlling_tty.
21766
21767 * minibuf.c: Make symbols static if they're not exported.
21768 (minibuf_save_list, choose_minibuf_frame): Now static.
21769 * lisp.h (choose_minibuf_frame): Remove decl.
21770
21771 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21772
21773 * lread.c: Make symbols static if they're not exported.
21774 (read_objects, initial_obarray, oblookup_last_bucket_number):
21775 Now static.
21776 (make_symbol): Remove; unused.
21777 * lisp.h (initial_obarray, make_symbol): Remove decls.
21778
21779 * keyboard.c: Make symbols static if they're not exported.
21780 (single_kboard, recent_keys_index, total_keys, recent_keys):
21781 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21782 (this_single_command_key_start, echoing, last_auto_save):
21783 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21784 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21785 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21786 (Vlispy_mouse_stem, double_click_count):
21787 Now static.
21788 (force_auto_save_soon): Define only if SIGDANGER.
21789 (ignore_mouse_drag_p): Now static if
21790 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21791 (print_help): Remove; unused.
21792 (stop_character, last_timer_event): Mark as externally visible.
21793 * keyboard.h (ignore_mouse_drag_p): Declare only if
21794 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21795 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21796 * lisp.h (echoing): Remove decl.
21797 (force_auto_save_soon): Declare only if SIGDANGER.
21798 * xdisp.c (redisplay_window): Simplify code, to make it more
21799 obvious that ignore_mouse_drag_p is not accessed if !defined
21800 USE_GTK && !defined HAVE_NS.
21801
21802 * intervals.c: Make symbols static if they're not exported.
21803 (merge_properties_sticky, merge_interval_right, delete_interval):
21804 Now static.
21805 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21806
21807 * insdel.c: Make symbols static if they're not exported.
21808 However, leave prepare_to_modify_buffer alone. It's never
21809 called from outside this function, but that appears to be a bug.
21810 (combine_after_change_list, combine_after_change_buffer):
21811 (adjust_after_replace, signal_before_change): Now static.
21812 (adjust_after_replace_noundo): Remove; unused.
21813 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
21814 (signal_before_change): Remove decls.
21815
21816 * indent.c (val_compute_motion, val_vmotion): Now static.
21817
21818 * image.c: Make symbols static if they're not exported.
21819 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21820 if USE_GTK.
21821 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21822 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21823
21824 * fringe.c (standard_bitmaps): Now static.
21825 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21826
21827 * frame.c: Make symbols static if they're not exported.
21828 (x_report_frame_params, make_terminal_frame): Now static.
21829 (get_frame_param): Now static, unless HAVE_NS.
21830 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21831 (x_get_resource_string): Remove; not used.
21832 * frame.h (make_terminal_frame, x_report_frame_params):
21833 (x_get_resource_string); Remove decls.
21834 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21835 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21836
21837 * font.c, fontset.c: Make symbols static if they're not exported.
21838 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21839 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21840 * font.c (font_close_object): Now static.
21841 * font.h (font_close_object): Remove.
21842 * fontset.c (FONTSET_OBJLIST): Remove.
21843 (free_realized_fontset) #if-0 the body, which does nothing.
21844 (face_suitable_for_char_p): #if-0, as it's never called.
21845 * fontset.h (face_suitable_for_char_p): Remove decl.
21846 * xfaces.c (face_at_string_position):
21847 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
21848 since 0 is always ASCII.
21849
21850 * fns.c (weak_hash_tables): Now static.
21851
21852 * fileio.c: Make symbols static if they're not exported.
21853 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21854 (Vwrite_region_annotation_buffers): Now static.
21855
21856 * eval.c: Make symbols static if they're not exported.
21857 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21858 * lisp.h (backtrace_list): Remove decl.
21859
21860 * emacs.c: Make symbols static if they're not exported.
21861 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21862 (fatal_error_code, fatal_error_signal_hook, standard_args):
21863 Now static.
21864 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21865 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21866 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21867 * lisp.h (fatal_error_signal_hook): Remove decl.
21868 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21869
21870 * editfns.c: Move a (normally-unused) function to its only use.
21871 * editfns.c, lisp.h (get_operating_system_release): Remove.
21872 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21873 worth the hassle of breaking this out.
21874
21875 * xterm.c: Make symbols static if they're not exported.
21876 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21877 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21878 (x_destroy_window, x_delete_display):
21879 Now static.
21880 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21881 (x_mouse_leave): Remove; unused.
21882 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21883 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21884 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21885 Remove decls.
21886 (x_mouse_leave): Declare only if WINDOWSNT.
21887 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21888 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21889 USE_X_TOOLKIT.
21890
21891 * ftxfont.c: Make symbols static if they're not exported.
21892 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21893 HAVE_FREETYPE.
21894 * font.h (ftxfont_driver): Likewise.
21895
21896 * xfns.c: Make symbols static if they're not exported.
21897 (x_last_font_name, x_display_info_for_name):
21898 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21899 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21900 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21901 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21902 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21903 (last_show_tip_args): Now static.
21904 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21905 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21906 (x_screen_planes): Remove; unused.
21907 * dispextern.h (x_screen_planes): Remove decl.
21908
21909 * dispnew.c: Make symbols static if they're not exported.
21910 * dispextern.h (redraw_garbaged_frames, scrolling):
21911 (increment_row_positions): Remove.
21912 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21913 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21914 Now static.
21915 (redraw_garbaged_frames): Remove; unused.
21916
21917 * xfaces.c: Make symbols static if they're not exported.
21918 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21919 Remove decls.
21920 * xterm.h (defined_color): Remove decls.
21921 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21922 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21923 (menu_face_changed_default, defined_color, free_realized_face):
21924 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21925 (ascii_face_of_lisp_face): Remove; unused.
21926
21927 * xdisp.c: Make symbols static if they're not exported.
21928 * dispextern.h (scratch_glyph_row, window_box_edges):
21929 (glyph_to_pixel_coords, set_cursor_from_row):
21930 (get_next_display_element, set_iterator_to_next):
21931 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21932 (show_mouse_face): Remove decls
21933 * frame.h (message_buf_print): Likewise.
21934 * lisp.h (pop_message, set_message, check_point_in_composition):
21935 Likewise.
21936 * xterm.h (set_vertical_scroll_bar): Likewise.
21937 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21938 (message_buf_print, scratch_glyph_row, displayed_buffer):
21939 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21940 (get_next_display_element, show_mouse_face, window_box_edges):
21941 (frame_to_window_pixel_xy, check_point_in_composition):
21942 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21943 (glyph_to_pixel_coords): Remove; unused.
21944
21945 * dired.c (file_name_completion): Now static.
21946
21947 * dbusbind.c (xd_in_read_queued_messages): Now static.
21948
21949 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21950 * data.c (circular_list_error): Remove.
21951
21952 * commands.h (last_point_position, last_point_position_buffer):
21953 (last_point_position_window): Remove decls.
21954 * keyboard.c: Make these variables static.
21955
21956 * coding.h (coding, code_convert_region, encode_coding_gap):
21957 Remove decls.
21958 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21959 (iso_code_class, detect_coding, code_convert_region): Now static.
21960 (encode_coding_gap): Remove; unused.
21961
21962 * chartab.c (chartab_chars, chartab_bits): Now static.
21963
21964 * charset.h (charset_iso_8859_1): Remove decl.
21965 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21966 Now static.
21967
21968 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21969 * ccl.c (Vccl_program_table): Now static.
21970 (check_ccl_update): Remove; unused.
21971
21972 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21973 * category.h: ... from here.
21974 * category.c (check_category_table, set_category_set): Now static.
21975
21976 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21977 * lisp.h: Remove these decls.
21978
21979 * buffer.c (buffer_count): Remove unused var.
21980
21981 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21982 so that it's not optimized away.
21983 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21984 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21985 exported only to the debugger.
21986
21987 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
21988 * atimer.h (run_all_atimers): Remove; not exported.
21989
21990 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21991 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21992 was inaccessible from Lisp.
21993 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21994 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21995
21996 alloc.c: Import and export fewer symbols, and remove unused items.
21997 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21998 is defined.
21999 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22000 it's not optimized away by whole-program optimization.
22001 (message_enable_multibyte, free_misc): Remove.
22002 (catchlist, handlerlist, mark_backtrace):
22003 Declare only if BYTE_MARK_STACK.
22004 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22005 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22006 (message_enable_multibyte): Remove decl.
22007 (free_misc, interval_free_list, float_block, float_block_index):
22008 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22009 (cons_free_list, last_marked_index):
22010 Now static.
22011 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22012 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22013 (mark_backtrace): Define only if BYTE_MARK_STACK.
22014 * xdisp.c (message_enable_multibyte): Now static.
22015
22016 Declare Lisp_Object Q* variables to be 'static' if not exported.
22017 This makes it easier for human readers (and static analyzers)
22018 to see whether these variables are used from other modules.
22019 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22020 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22021 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22022 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22023 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22024 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22025 * xmenu.c, xselect.c:
22026 Declare Q* vars static if they are not used in other modules.
22027 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22028 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22029 Remove decls of unexported vars.
22030 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22031
22032 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22033
22034 Make Emacs functions such as Fatom 'static' by default.
22035 This makes it easier for human readers (and static analyzers)
22036 to see whether these functions can be called from other modules.
22037 DEFUN now defines a static function. To make the function external
22038 so that it can be used in other C modules, use the new macro DEFUE.
22039 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22040 (Finit_image_library):
22041 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22042 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22043 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22044 Remove decls, since these functions are now static.
22045 (Funintern, Fget_internal_run_time): New decls, since these functions
22046 were already external.
22047
22048 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22049 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22050 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22051 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22052 * keyboard.c, keymap.c, lread.c:
22053 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22054 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22055 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22056 Mark functions with DEFUE instead of DEFUN,
22057 if they are used in other modules.
22058 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22059 decls for now-static functions.
22060 * buffer.h (Fdelete_overlay): Remove decl.
22061 * callproc.c (Fgetenv_internal): Mark as internal.
22062 * composite.c (Fremove_list_of_text_properties): Remove decl.
22063 (Fcomposition_get_gstring): New forward static decl.
22064 * composite.h (Fcomposite_get_gstring): Remove decl.
22065 * dired.c (Ffile_attributes): New forward static decl.
22066 * doc.c (Fdocumntation_property): New forward static decl.
22067 * eval.c (Ffetch_bytecode): New forward static decl.
22068 (Funintern): Remove extern decl; now in .h file where it belongs.
22069 * fileio.c (Fmake_symbolic_link): New forward static decl.
22070 * image.c (Finit_image_library): New forward static decl.
22071 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22072 * intervals.h (Fprevious_property_change):
22073 (Fremove_list_of_text_properties): Remove decls.
22074 * keyboard.c (Fthis_command_keys): Remove decl.
22075 (Fcommand_execute): New forward static decl.
22076 * keymap.c (Flookup_key): New forward static decl.
22077 (Fcopy_keymap): Now static.
22078 * keymap.h (Flookup_key): Remove decl.
22079 * process.c (Fget_process): New forward static decl.
22080 (Fprocess_datagram_address): Mark as internal.
22081 * syntax.c (Fsyntax_table_p): New forward static decl.
22082 (skip_chars): Remove duplicate decl.
22083 * textprop.c (Fprevious_property_change): New forward static decl.
22084 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22085 Now internal.
22086 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22087 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22088
22089 * editfns.c (Fformat): Remove unreachable code.
22090
22091 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22092
22093 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22094 change. (Bug#8496)
22095
22096 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22097
22098 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22099 when at ZV. (Bug#8487)
22100
22101 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22102
22103 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22104 (Bug#8437)
22105 * keyboard.c (parse_tool_bar_item): Likewise.
22106 * sound.c (sound_cleanup, alsa_close): Likewise.
22107 * termcap.c (tgetent): Likewise.
22108 * xfns.c (x_default_font_parameter): Likewise.
22109 * xsettings.c (read_and_apply_settings): Likewise.
22110
22111 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22112 (overrun_check_free): Protoize.
22113
22114 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22115
22116 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22117 since callers should never pass a negative size.
22118 Change the signature to match that of plain 'read' and 'write'; see
22119 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22120 * lisp.h: Update prototypes of emacs_write and emacs_read.
22121
22122 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22123
22124 * xdisp.c (redisplay_window): Don't try to determine the character
22125 position of the scroll margin if the window start point w->startp
22126 is outside the buffer's accessible region. (Bug#8468)
22127
22128 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22129
22130 Fix write-region and its subroutines for buffers > 2GB.
22131 * fileio.c (a_write, e_write): Modify declaration of arguments and
22132 local variables to support buffers larger than 2GB.
22133 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22134
22135 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22136 argument, local variables, and return value.
22137
22138 * lisp.h: Update prototypes of emacs_write and emacs_read.
22139
22140 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22141
22142 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22143
22144 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22145
22146 Fix more problems found by GCC 4.6.0's static checks.
22147
22148 * xdisp.c (vmessage): Use a better test for character truncation.
22149
22150 * charset.c (load_charset_map): <, not <=, for optimization,
22151 and to avoid potential problems with integer overflow.
22152 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22153 * casetab.c (set_identity, shuffle): Likewise.
22154 * editfns.c (Fformat): Likewise.
22155 * syntax.c (skip_chars): Likewise.
22156
22157 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22158 This also lets GCC 4.6.0 generate slightly better loop code.
22159
22160 * callint.c (Fcall_interactively): <, not <=, for optimization.
22161 (Fcall_interactively): Count the number of arguments produced,
22162 not the number of arguments given. This is simpler and lets GCC
22163 4.6.0 generate slightly better code.
22164
22165 * ftfont.c: Distingish more carefully between FcChar8 and char.
22166 The previous code passed unsigned char * to a functions like
22167 strlen and xstrcasecmp that expect char *, which does not
22168 conform to the C standard.
22169 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22170 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22171 char * when the C standard requires it.
22172
22173 * keyboard.c (read_char): Remove unused var.
22174
22175 * eval.c: Port to Windows vsnprintf (Bug#8435).
22176 Include <limits.h>.
22177 (SIZE_MAX): Define if the headers do not.
22178 (verror): Do not give up if vsnprintf returns a negative count.
22179 Instead, grow the buffer. This ports to Windows vsnprintf, which
22180 does not conform to C99. Problem reported by Eli Zaretskii.
22181 Also, simplify the allocation scheme, by avoiding the need for
22182 calling realloc, and removing the ALLOCATED variable.
22183
22184 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22185
22186 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22187 But keep the doprint source code for now, as we might revamp it
22188 and use it again (Bug#8435).
22189 * lisp.h (doprnt): Remove.
22190 * Makefile.in (base_obj): Remove doprnt.o.
22191 * deps.mk (doprnt.o): Remove.
22192
22193 error: Print 32- and 64-bit integers portably (Bug#8435).
22194 Without this change, on typical 64-bit hosts error ("...%d...", N)
22195 was used to print both 32- and 64-bit integers N, which relied on
22196 undefined behavior.
22197 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22198 * lisp.h (error, verror): Mark as printf-like functions.
22199 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22200 Report overflow in size calculations when allocating printf buffer.
22201 Do not truncate output string at its first null byte.
22202 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22203 Truncate the output at a character boundary, since vsnprintf does not
22204 do that.
22205 * charset.c (check_iso_charset_parameter): Convert internal
22206 character to string before calling 'error', since %c now has the
22207 printf meaning.
22208 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22209 overflow when computing char to be passed to 'error'. Do not
22210 pass Lisp_Object to 'error'; pass the integer instead.
22211 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22212 formatted with plain %d.
22213
22214 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22215
22216 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22217
22218 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22219
22220 * xterm.c (x_catch_errors): Remove duplicate declaration.
22221
22222 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22223
22224 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22225
22226 2011-04-10 Jim Meyering <meyering@redhat.com>
22227
22228 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22229 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22230 return ssize_t not "int", and use size_t as the buffer length.
22231 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22232 * gnutls.h: Update declarations.
22233 * process.c (read_process_output): Use ssize_t, to match.
22234 (send_process): Likewise.
22235
22236 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22237
22238 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22239
22240 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22241
22242 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22243 Use unsigned char, to match FcChar8 type definition.
22244
22245 * xterm.c (handle_one_xevent):
22246 * xmenu.c (create_and_show_popup_menu):
22247 * xselect.c (x_decline_selection_request)
22248 (x_reply_selection_request): Avoid type-punned deref of X events.
22249
22250 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22251
22252 Fix some uses of `int' instead of EMACS_INT.
22253 * search.c (string_match_1, fast_string_match)
22254 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22255 (scan_buffer, find_next_newline_no_quit)
22256 (find_before_next_newline, search_command, Freplace_match)
22257 (Fmatch_data): Make some `int' variables be EMACS_INT.
22258
22259 * xdisp.c (display_count_lines): 3rd argument and return value now
22260 EMACS_INT. All callers changed.
22261 (pint2hrstr): Last argument is now EMACS_INT.
22262
22263 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22264 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22265 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22266 (decode_coding_utf_16, decode_coding_emacs_mule)
22267 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22268 (decode_coding_ccl, decode_coding_charset)
22269 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22270 (decode_coding_iso_2022, decode_coding_emacs_mule)
22271 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22272 <char_offset, last_offset>: Declare EMACS_INT.
22273 (encode_coding_utf_8, encode_coding_utf_16)
22274 (encode_coding_emacs_mule, encode_invocation_designation)
22275 (encode_designation_at_bol, encode_coding_iso_2022)
22276 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22277 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22278 Declare EMACS_INT.
22279 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22280 (encode_invocation_designation): Last argument P_NCHARS is now
22281 EMACS_INT.
22282 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22283 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22284
22285 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22286 All users changed.
22287
22288 * ccl.c (Fccl_execute_on_string): Declare some variables
22289 EMACS_INT.
22290
22291 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
22292
22293 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22294
22295 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22296
22297 * process.c (Fformat_network_address): Doc fix.
22298
22299 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22300
22301 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
22302
22303 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
22304
22305 * keyboard.c (read_char): Call Lisp function help-form-show,
22306 instead of using internal_with_output_to_temp_buffer.
22307 (Qhelp_form_show): New var.
22308 (syms_of_keyboard): Use DEFSYM macro.
22309
22310 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22311
22312 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22313
22314 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
22315
22316 * process.c (Flist_processes): Remove to Lisp.
22317 (list_processes_1): Delete.
22318
22319 2011-04-06 Eli Zaretskii <eliz@gnu.org>
22320
22321 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22322
22323 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22324
22325 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
22326
22327 Fix more problems found by GCC 4.6.0's static checks.
22328
22329 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22330
22331 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22332
22333 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
22334
22335 * xdisp.c (vmessage): Mark as a printf-like function.
22336
22337 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22338
22339 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22340
22341 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22342 printf-like functions.
22343 (tiff_load): Add casts to remove these marks before passing them
22344 to system-supplied API.
22345
22346 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22347
22348 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22349 This avoids several warnings with gcc -Wstrict-overflow.
22350 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22351 directly, rather than having caller test rule sign. This avoids
22352 some unnecessary tests.
22353 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22354 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22355 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
22356
22357 * xfont.c (xfont_text_extents): Remove var that was set but not used.
22358 (xfont_open): Avoid unnecessary tests.
22359
22360 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22361
22362 * composite.h, composite.c (composition_gstring_put_cache):
22363 Use EMACS_INT, not int, for length.
22364
22365 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22366 breaking out part of COMPOSITION_DECODE_RULE.
22367 (COMPOSITION_DECODE_RULE): Use it.
22368 * composite.c (get_composition_id): Remove unused local vars,
22369 by using the new macro.
22370
22371 * textprop.c (set_text_properties_1): Change while to do-while,
22372 since the condition is always true at first.
22373
22374 * intervals.c (graft_intervals_into_buffer): Mark var as used.
22375 (interval_deletion_adjustment): Return unsigned value.
22376 All uses changed.
22377
22378 * process.c (list_processes_1, create_pty, read_process_output):
22379 (exec_sentinel): Remove vars that were set but not used.
22380 (create_pty): Remove unnecessary "volatile"s.
22381 (Fnetwork_interface_info): Avoid possibility of int overflow.
22382 (read_process_output): Do adaptive read buffering even if carryover.
22383 (read_process_output): Simplify nbytes computation if buffered.
22384
22385 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22386
22387 * syntax.c (scan_words): Remove var that was set but not used.
22388 (update_syntax_table): Use unsigned instead of int.
22389
22390 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
22391 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
22392 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
22393
22394 * print.c (print_error_message): Avoid int overflow.
22395
22396 * font.c (font_list_entities): Redo for clarity,
22397 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22398
22399 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
22400 (font_score): Avoid potential overflow in diff calculation.
22401
22402 * fns.c (substring_both): Remove var that is set but not used.
22403 (sxhash): Redo loop for clarity and to avoid wraparound warning.
22404
22405 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22406
22407 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22408 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22409 can always succeed if overflow has undefined behavior.
22410
22411 * search.c (boyer_moore, wordify): Remove vars set but not used.
22412 (wordify): Omit three unnecessary tests.
22413
22414 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22415 All callers changed. This avoids the need for an unused var.
22416
22417 * casefiddle.c (casify_region): Remove var that is set but not used.
22418
22419 * dired.c (file_name_completion): Remove var that is set but not used.
22420
22421 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22422
22423 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
22424 (Finsert_file_contents): Remove unnecessary code checking fd.
22425
22426 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22427 Check for integer overflow on size calculations.
22428
22429 * buffer.c (Fprevious_overlay_change): Remove var that is set
22430 but not used.
22431
22432 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22433 Remove vars that are set but not used.
22434 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
22435 (timer_check_2): Mark vars as initialized.
22436
22437 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22438
22439 * image.c (lookup_image): Remove var that is set but not used.
22440 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
22441
22442 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22443 that are set but not used.
22444
22445 * xfns.c (make_invisible_cursor): Don't return garbage
22446 if XCreateBitmapFromData fails (Bug#8410).
22447
22448 * xselect.c (x_get_local_selection, x_handle_property_notify):
22449 Remove vars that are set but not used.
22450
22451 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
22452 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
22453
22454 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22455 Remove var that is set but not used.
22456 (scroll_bar_windows_size): Now size_t, not int.
22457 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22458 Check for overflow.
22459
22460 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22461 (map_tty_color) [!defined MSDOS]: Likewise.
22462
22463 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22464
22465 * coding.c: Remove vars that are set but not used.
22466 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22467 All callers changed.
22468 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22469 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22470 (decode_coding_charset): Remove vars that are set but not used.
22471
22472 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22473 that is set but not used.
22474
22475 * print.c (print_object): Remove var that is set but not used.
22476
22477 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
22478 The gnulib version avoids calling malloc in the usual case,
22479 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22480 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22481 * filelock.c (current_lock_owner): Likewise.
22482 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22483 * sysdep.c: Include allocator.h, careadlinkat.h.
22484 (emacs_no_realloc_allocator): New static constant.
22485 (emacs_readlink): New function.
22486 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22487 ../lib/careadlinkat.h.
22488
22489 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22490
22491 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22492 first non-nil return value).
22493
22494 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22495
22496 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22497 if not defined (Bug#8403).
22498
22499 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22500
22501 * xdisp.c (display_count_lines): Remove parameter `start',
22502 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22503 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22504 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22505 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22506 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22507 and thereabouts. All callers changed.
22508 (get_per_char_metric): Remove parameter `f', unused since
22509 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22510
22511 2011-04-02 Jim Meyering <meyering@redhat.com>
22512
22513 do not dereference NULL upon failed strdup
22514 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22515 (ns_get_family): Likewise.
22516
22517 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22518
22519 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22520
22521 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22522
22523 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22524 later (Bug#8403).
22525
22526 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22527
22528 Add lexical binding.
22529
22530 * window.c (Ftemp_output_buffer_show): New fun.
22531 (Fsave_window_excursion):
22532 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22533
22534 * lread.c (lisp_file_lexically_bound_p): New function.
22535 (Fload): Bind Qlexical_binding.
22536 (readevalloop): Remove `evalfun' arg.
22537 Bind Qinternal_interpreter_environment.
22538 (Feval_buffer): Bind Qlexical_binding.
22539 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22540 Mark as dynamic.
22541 (syms_of_lread): Declare `lexical-binding'.
22542
22543 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22544
22545 * keyboard.c (eval_dyn): New fun.
22546 (menu_item_eval_property): Use it.
22547
22548 * image.c (parse_image_spec): Use Ffunctionp.
22549
22550 * fns.c (concat, mapcar1): Accept byte-code-functions.
22551
22552 * eval.c (Fsetq): Handle lexical vars.
22553 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22554 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22555 (FletX, Flet): Obey lexical binding.
22556 (Fcommandp): Handle closures.
22557 (Feval): New `lexical' arg.
22558 (eval_sub): New function extracted from Feval. Use it almost
22559 everywhere where Feval was used. Look up vars in lexical env.
22560 Handle closures.
22561 (Ffunctionp): Move from subr.el.
22562 (Ffuncall): Handle closures.
22563 (apply_lambda): Remove `eval_flags'.
22564 (funcall_lambda): Handle closures and new byte-code-functions.
22565 (Fspecial_variable_p): New function.
22566 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22567 but without exporting it to Lisp.
22568
22569 * doc.c (Fdocumentation, store_function_docstring):
22570 * data.c (Finteractive_form): Handle closures.
22571
22572 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22573 interactive spec.
22574
22575 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22576 New byte-codes.
22577 (exec_byte_code): New function extracted from Fbyte_code to handle new
22578 calling convention for byte-code-functions. Add new byte-codes.
22579
22580 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
22581
22582 * alloc.c (Fmake_symbol): Init new `declared_special' field.
22583
22584 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22585
22586 * xdisp.c (redisplay_internal): Fix prototype.
22587
22588 2011-03-31 Eli Zaretskii <eliz@gnu.org>
22589
22590 * xdisp.c (SCROLL_LIMIT): New macro.
22591 (try_scrolling): Use it when setting scroll_limit.
22592 Limit scrolling to 100 screen lines.
22593 (redisplay_window): Even when falling back on "recentering",
22594 position point in the window according to scroll-conservatively,
22595 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22596
22597 (try_scrolling): When point is above the window, allow searching
22598 as far as scroll_max, or one screenful, to compute vertical
22599 distance from PT to the scroll margin position. This prevents
22600 try_scrolling from unnecessarily failing when
22601 scroll-conservatively is set to a value slightly larger than the
22602 window height. Clean up the case of PT below the margin at bottom
22603 of window: scroll_max can no longer be INT_MAX. When aggressive
22604 scrolling is in use, don't let point enter the opposite scroll
22605 margin as result of the scroll.
22606 (syms_of_xdisp) <scroll-conservatively>: Document the
22607 threshold of 100 lines for never-recentering scrolling.
22608
22609 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22610
22611 * dispextern.h (move_it_by_lines):
22612 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22613 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22614 (message_log_check_duplicate): Remove parameters `prev_bol' and
22615 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22616 (redisplay_internal): Remove parameter `preserve_echo_area',
22617 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22618
22619 * indent.c (Fvertical_motion):
22620 * window.c (window_scroll_pixel_based, Frecenter):
22621 Don't pass `need_y_p' to `move_it_by_lines'.
22622
22623 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22624
22625 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22626 steal a few bits to be more compact.
22627 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22628 Remove unneeded casts.
22629
22630 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22631
22632 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22633
22634 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22635 binding" message (bug#7967).
22636
22637 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22638
22639 Fix more problems found by GCC 4.6.0's static checks.
22640
22641 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22642 Remove unused local var.
22643
22644 * editfns.c (Fmessage_box): Remove unused local var.
22645
22646 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22647 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22648 Omit unused local vars.
22649 * window.c (shrink_windows): Omit unused local var.
22650 * menu.c (digest_single_submenu): Omit unused local var.
22651 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22652 Omit unused local var.
22653
22654 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22655 Don't assume string length fits in int.
22656 (keyremap_step, read_key_sequence): Use size_t for sizes.
22657 (read_key_sequence): Don't check last_real_key_start redundantly.
22658
22659 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22660 instead of alloca (Bug#8344).
22661
22662 * eval.c (Fbacktrace): Don't assume nargs fits in int.
22663 (Fbacktrace_frame): Don't assume nframes fits in int.
22664
22665 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22666
22667 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22668 concerns.
22669
22670 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22671
22672 * cm.c (calccost): Turn while-do into do-while, for clarity.
22673
22674 * keyboard.c (syms_of_keyboard): Use the same style as later
22675 in this function when indexing through an array. This also
22676 works around GCC bug 48267.
22677
22678 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22679
22680 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22681
22682 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22683 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22684
22685 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22686 This avoids undefined behavior on integer overflow, and is a bit
22687 more convenient anyway since it is compared to a size_t variable.
22688
22689 Variadic C functions now count arguments with size_t, not int.
22690 This avoids an unnecessary limitation on 64-bit machines, which
22691 caused (substring ...) to crash on large vectors (Bug#8344).
22692 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22693 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
22694 All variadic functions and their callers changed accordingly.
22695 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22696 * data.c (arith_driver, float_arith_driver): Likewise.
22697 * editfns.c (general_insert_function): Likewise.
22698 * eval.c (struct backtrace.nargs, interactive_p)
22699 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22700 (funcall_lambda, mark_backtrace): Likewise.
22701 * fns.c (concat): Likewise.
22702 * frame.c (x_set_frame_parameters): Likewise.
22703 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22704 0 if not found, not -1. All callers changed.
22705
22706 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22707 (stack_copy_size): Now size_t, not int.
22708 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22709
22710 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22711
22712 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22713 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22714 All callers changed.
22715
22716 * lisp.h (multibyte_char_to_unibyte):
22717 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22718 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22719 * character.h (CHAR_TO_BYTE8):
22720 * cmds.c (internal_self_insert):
22721 * editfns.c (general_insert_function):
22722 * keymap.c (push_key_description):
22723 * search.c (Freplace_match):
22724 * xdisp.c (message_dolog, set_message_1): All callers changed.
22725
22726 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22727
22728 * keyboard.c (safe_run_hook_funcall): New function.
22729 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22730 don't set the hook to nil, but remove the offending function instead.
22731 (Qcommand_hook_internal): Remove, unused.
22732 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22733 Vcommand_hook_internal.
22734
22735 * eval.c (enum run_hooks_condition): Remove.
22736 (funcall_nil, funcall_not): New functions.
22737 (run_hook_with_args): Call each function through a `funcall' argument.
22738 Remove `cond' argument, now redundant.
22739 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22740 (Frun_hook_with_args_until_failure): Adjust accordingly.
22741 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22742
22743 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22744
22745 * dispextern.h (string_buffer_position): Remove declaration.
22746
22747 * print.c (strout): Remove parameter `multibyte', unused since
22748 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22749
22750 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22751 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22752 All callers changed.
22753
22754 * w32.c (_wsa_errlist): Use braces for struct initializers.
22755
22756 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22757 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22758 All callers changed.
22759 (string_buffer_position): Likewise. Also, make static (it's never
22760 used outside xdisp.c).
22761 (cursor_row_p): Remove parameter `w', unused since
22762 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22763 (decode_mode_spec): Remove parameter `precision', introduced during
22764 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22765 All callers changed.
22766
22767 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22768
22769 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22770
22771 2011-03-27 Anders Lindgren <andlind@gmail.com>
22772
22773 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22774 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22775 (ns_update_auto_hide_menu_bar): New functions.
22776 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22777 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22778 ns_constrain_all_frames.
22779 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22780 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22781
22782 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22783
22784 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22785
22786 2011-03-27 Glenn Morris <rgm@gnu.org>
22787
22788 * syssignal.h: Replace RETSIGTYPE with void.
22789 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22790 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22791 Replace SIGTYPE with void everywhere.
22792 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22793 * s/template.h (SIGTYPE): Remove commented out definition.
22794
22795 2011-03-26 Eli Zaretskii <eliz@gnu.org>
22796
22797 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22798 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22799
22800 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
22801
22802 * w32.c (read_unc_volume): Use parameter `henum', instead of
22803 global variable `wget_enum_handle'.
22804
22805 * keymap.c (describe_vector): Remove parameters `indices' and
22806 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22807 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22808
22809 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22810
22811 * keyboard.c (timer_check): Remove parameter `do_it_now',
22812 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22813 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22814 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22815
22816 * keyboard.c (read_char):
22817 * w32menu.c (w32_menu_display_help):
22818 * xmenu.c (show_help_event, menu_help_callback):
22819 Adjust calls to `show_help_echo'.
22820
22821 * gtkutil.c (xg_maybe_add_timer):
22822 * keyboard.c (readable_events):
22823 * process.c (wait_reading_process_output):
22824 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22825
22826 * insdel.c (adjust_markers_gap_motion):
22827 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22828 (gap_left, gap_right): Don't call it.
22829
22830 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
22831
22832 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22833 incurred during fontification.
22834
22835 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22836
22837 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22838 (DEFVAR_PER_BUFFER): Don't pass it.
22839
22840 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22841 (scrolling_window): Don't pass it.
22842
22843 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22844
22845 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22846
22847 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22848 and `suffix'.
22849 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22850 of variables specific to SELinux and computation of `encoded_absname'.
22851
22852 * image.c (XPutPixel): Remove unused variable `height'.
22853
22854 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22855
22856 * unexw32.c (get_section_info): Remove unused variable `section'.
22857
22858 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22859 (system_process_attributes): Remove unused variable `sess'.
22860 (sys_read): Remove unused variable `err'.
22861
22862 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22863 (w32_wnd_proc): Remove unused variable `isdead'.
22864 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22865 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22866 (x_create_tip_frame): Remove unused variable `tem'.
22867
22868 * w32inevt.c (w32_console_read_socket):
22869 Remove unused variable `no_events'.
22870
22871 * w32term.c (x_draw_composite_glyph_string_foreground):
22872 Remove unused variable `width'.
22873
22874 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
22875
22876 * w32term.c (x_set_glyph_string_clipping):
22877 Don't pass uninitialized region to CombineRgn.
22878
22879 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
22880
22881 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22882 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22883 (Fx_close_connection): Remove unused variable `i'.
22884
22885 * w32font.c (w32font_draw): Return number of glyphs.
22886 (w32font_open_internal): Remove unused variable `i'.
22887 (w32font_driver): Add missing initializer.
22888
22889 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22890 (fill_in_menu): Remove unused variable `items_added'.
22891
22892 * w32term.c (last_mouse_press_frame): Remove static global variable.
22893 (w32_clip_to_row): Remove unused variable `f'.
22894 (x_delete_terminal): Remove unused variable `i'.
22895
22896 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22897 (NOTHING): Remove unused static global variable.
22898 (uniscribe_check_otf): Remove unused variable `table'.
22899 (uniscribe_font_driver): Add missing initializers.
22900
22901 2011-03-23 Julien Danjou <julien@danjou.info>
22902
22903 * term.c (Fsuspend_tty, Fresume_tty):
22904 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22905 * window.c (temp_output_buffer_show):
22906 * insdel.c (signal_before_change):
22907 * frame.c (Fhandle_switch_frame):
22908 * fileio.c (Fdo_auto_save):
22909 * emacs.c (Fkill_emacs):
22910 * editfns.c (save_excursion_restore):
22911 * cmds.c (internal_self_insert):
22912 * callint.c (Fcall_interactively):
22913 * buffer.c (Fkill_all_local_variables):
22914 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22915 Use Frun_hooks.
22916 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
22917 unconditionally since it does the check itself.
22918
22919 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
22920
22921 Fix more problems found by GCC 4.5.2's static checks.
22922
22923 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22924 the first time through the loop, since we know p0 < p1 then.
22925 This also avoids a gcc -Wstrict-overflow warning.
22926
22927 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22928 leading to a memory leak, possible in functions like
22929 load_charset_map_from_file that can allocate an unbounded number
22930 of objects (Bug#8318).
22931
22932 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22933 that could (at least in theory) be that large.
22934
22935 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22936 This is less likely to overflow, and avoids undefined behavior if
22937 overflow does occur. All callers changed. Use strtoul to scan
22938 for the unsigned long integer.
22939 (pint2hrstr): Simplify and tune code slightly.
22940 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
22941
22942 * scroll.c (do_scrolling): Work around GCC bug 48228.
22943 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22944
22945 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22946 This also avoids a warning with gcc -Wstrict-overflow.
22947 (validate_x_resource_name): Simplify count usage.
22948 This also avoids a warning with gcc -Wstrict-overflow.
22949
22950 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22951 fail (Bug#8306).
22952
22953 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
22954
22955 * process.c (Fmake_network_process): Use socklen_t, not int,
22956 where POSIX says socklen_t is required in portable programs.
22957 This fixes a porting bug on hosts like 64-bit HP-UX, where
22958 socklen_t is wider than int (Bug#8277).
22959 (Fmake_network_process, server_accept_connection):
22960 (wait_reading_process_output, read_process_output):
22961 Likewise.
22962
22963 * process.c: Rename or move locals to avoid shadowing.
22964 (list_processes_1, Fmake_network_process):
22965 (read_process_output_error_handler, exec_sentinel_error_handler):
22966 Rename or move locals.
22967 (Fmake_network_process): Define label "retry_connect" only if needed.
22968 (Fnetwork_interface_info): Fix pointer signedness.
22969 (process_send_signal): Add cast to avoid pointer signedness problem.
22970 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
22971 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
22972
22973 Make tparam.h and terminfo.c consistent.
22974 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22975 Include tparam.h instead, since it declares them.
22976 * cm.h (PC): Remove extern decl; tparam.h now does this.
22977 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22978 * terminfo.c: Include tparam.h, to check interfaces.
22979 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22980 (tparam): Adjust signature to match interface in tparam.h;
22981 this removes some undefined behavior. Check that outstring and len
22982 are zero, which they always are with Emacs.
22983 * tparam.h (PC, BC, UP): New extern decls.
22984
22985 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
22986 (xftfont_open): Rename locals to avoid shadowing.
22987
22988 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
22989 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22990 (OTF_TAG_SYM): Omit macro if not needed.
22991 (ftfont_list): Remove unused local.
22992 (get_adstyle_property, ftfont_pattern_entity):
22993 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22994 Rename locals to avoid shadowing.
22995
22996 * xfont.c (xfont_list_family): Mark var as initialized.
22997
22998 * xml.c (make_dom): Now static.
22999
23000 * composite.c (composition_compute_stop_pos): Rename local to
23001 avoid shadowing.
23002 (composition_reseat_it): Remove unused locals.
23003 (find_automatic_composition, composition_adjust_point): Likewise.
23004 (composition_update_it): Mark var as initialized.
23005 (find_automatic_composition): Mark vars as initialized,
23006 with a FIXME (Bug#8290).
23007
23008 character.h: Rename locals to avoid shadowing.
23009 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23010 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23011 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23012 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23013 to avoid shadowing.
23014
23015 * textprop.c (property_change_between_p): Remove; unused.
23016
23017 * intervals.c (interval_start_pos): Now static.
23018
23019 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23020
23021 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23022 Rename locals to avoid shadowing.
23023
23024 * sound.c (wav_play, au_play, Fplay_sound_internal):
23025 Fix pointer signedness.
23026 (alsa_choose_format): Remove unused local var.
23027 (wav_play): Initialize a variable to 0, to prevent undefined
23028 behavior (Bug#8278).
23029
23030 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23031
23032 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23033
23034 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23035 clobbering (Bug#8298).
23036 * sysdep.c (sys_subshell): Likewise.
23037 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23038
23039 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23040 This should get cleaned up, so that child_setup has the
23041 same signature on all platforms.
23042
23043 * callproc.c (call_process_cleanup): Now static.
23044 (relocate_fd): Rename locals to avoid shadowing.
23045
23046 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23047
23048 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23049 not to be necessary, and produces flickering.
23050
23051 2011-03-20 Glenn Morris <rgm@gnu.org>
23052
23053 * config.in: Remove file.
23054
23055 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23056
23057 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23058 are now in src/globals.h.
23059 (syms_of_minibuf): Remove spurious & from previous change.
23060
23061 2011-03-20 Leo Liu <sdl.web@gmail.com>
23062
23063 * minibuf.c (completing-read-function): New variable.
23064 (completing-read-default): Rename from completing-read.
23065 (completing-read): Call completing-read-function.
23066
23067 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23068
23069 * xfaces.c (Fx_load_color_file):
23070 Read color file from absolute filename (bug#8250).
23071
23072 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23073
23074 * makefile.w32-in: Update dependencies.
23075
23076 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23077
23078 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23079
23080 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23081
23082 Fix more problems found by GCC 4.5.2's static checks.
23083
23084 * process.c (make_serial_process_unwind, send_process_trap):
23085 (sigchld_handler): Now static.
23086
23087 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23088 That way, the code declares only the vars that it needs.
23089 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23090 * s/cygwin.h (PTY_ITERATION): Likewise.
23091 * s/darwin.h (PTY_ITERATION): Likewise.
23092 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23093
23094 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23095 * process.c (allocate_pty): Don't declare stb unless it's needed.
23096
23097 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23098 (CONSTANTLIM): Remove; unused.
23099 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23100 Define only if needed.
23101
23102 * unexelf.c (unexec): Name an expression,
23103 to avoid gcc -Wbad-function-cast warning.
23104 Use a different way to cause a compilation error if anyone uses
23105 n rather than nn, a way that does not involve shadowing.
23106 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23107
23108 * deps.mk (unexalpha.o): Remove; unused.
23109
23110 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23111 * unexec.h: New file.
23112 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23113 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23114 Depend on unexec.h.
23115 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23116 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23117 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23118 Change as necessary to match prototype in unexec.h.
23119
23120 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23121 shadowing.
23122 (back_comment, skip_chars): Mark vars as initialized.
23123
23124 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23125 Rename locals to avoid shadowing.
23126
23127 * lread.c (read1): Rewrite so as not to use empty "else".
23128 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23129
23130 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23131
23132 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23133 warning when compiling print.c.
23134
23135 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23136 instead of using an uninitialized var.
23137 (font_sort_entities): Mark var as initialized.
23138
23139 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23140
23141 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23142 pointers to constants.
23143 (font_parse_fcname): Remove unused vars.
23144 (font_delete_unmatched): Now static.
23145 (font_get_spec): Remove; unused.
23146 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23147 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23148 Rename or move locals to avoid shadowing.
23149
23150 * fns.c (require_nesting_list, require_unwind): Now static.
23151 (Ffillarray): Rename locals to avoid shadowing.
23152
23153 * floatfns.c (domain_error2): Define only if needed.
23154 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23155
23156 * alloc.c (mark_backtrace): Move decl from here ...
23157 * lisp.h: ... to here, so that it can be checked.
23158
23159 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23160 (Fdefvar): Rewrite so as not to use empty "else".
23161 (lisp_indirect_variable): Name an expression,
23162 to avoid gcc -Wbad-function-cast warning.
23163 (Fdefvar): Rename locals to avoid shadowing.
23164
23165 * callint.c (quotify_arg, quotify_args): Now static.
23166 (Fcall_interactively): Rename locals to avoid shadowing.
23167 Use const pointer when appropriate.
23168
23169 * lisp.h (get_system_name, get_operating_system_release):
23170 Move decls here, to check interfaces.
23171 * process.c (get_operating_system_release): Move decl to lisp.h.
23172 * xrdb.c (get_system_name): Likewise.
23173 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23174 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23175 some of which prompt warnings from gcc -Wbad-function-cast.
23176 (Fformat_time_string, Fencode_time, Finsert_char):
23177 (Ftranslate_region_internal, Fformat):
23178 Rename or remove local vars to avoid shadowing.
23179 (Ftranslate_region_internal): Mark var as initialized.
23180
23181 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23182 avoid shadowing.
23183
23184 * lisp.h (eassert): Check that the argument compiles, even if
23185 ENABLE_CHECKING is not defined.
23186
23187 * data.c (Findirect_variable): Name an expression, to avoid
23188 gcc -Wbad-function-cast warning.
23189 (default_value, arithcompare, arith_driver, arith_error): Now static.
23190 (store_symval_forwarding): Rename local to avoid shadowing.
23191 (Fmake_variable_buffer_local, Fmake_local_variable):
23192 Mark variables as initialized.
23193 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23194
23195 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23196 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23197 Rename locals to avoid shadowing.
23198 (mark_stack): Move local variables into the #ifdef region where
23199 they're used.
23200 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23201 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23202 needed otherwise.
23203 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23204 (GC_STRING_CHARS): Remove; not used.
23205 (Fmemory_limit): Cast sbrk's returned value to char *.
23206
23207 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23208 avoids undefined behavior in theory.
23209
23210 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23211
23212 Use functions, not macros, for up- and down-casing (Bug#8254).
23213 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23214 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23215 to use the following functions instead of these macros.
23216 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23217 EMACS_INT, since callers assume the returned value fits in int.
23218 (upcase1): Likewise, for UPCASE_TABLE.
23219 (uppercasep, lowercasep, upcase): New static inline functions.
23220 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23221 the race-condition problem in the old DOWNCASE.
23222
23223 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23224 Rename locals to avoid shadowing.
23225 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23226 (regex_compile, re_search_2, re_match_2_internal):
23227 Remove unused local vars.
23228 (FREE_VAR): Rewrite so as not to use empty "else",
23229 which gcc can warn about.
23230 (regex_compile, re_match_2_internal): Mark locals as initialized.
23231 (RETALLOC_IF): Define only if needed.
23232 (WORDCHAR_P): Likewise. This one is never needed, but is used
23233 only in a comment talking about a compiler bug, so put inside
23234 the #if 0 of that comment.
23235 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23236 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23237 Remove; unused.
23238
23239 * search.c (boyer_moore): Rename locals to avoid shadowing.
23240 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23241 (PREV_CHAR_BOUNDARY): Likewise.
23242
23243 * search.c (simple_search): Remove unused var.
23244
23245 * dired.c (compile_pattern): Move decl from here ...
23246 * lisp.h: ... to here, so that it can be checked.
23247 (struct re_registers): New forward decl.
23248
23249 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23250
23251 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23252 All uses changed.
23253 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23254 Rename locals to avoid shadowing.
23255 (Fvertical_motion): Mark locals as initialized.
23256
23257 * casefiddle.c (casify_object, casify_region): Now static.
23258 (casify_region): Mark local as initialized.
23259
23260 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23261
23262 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23263 New macros, so that the caller can use some names other than
23264 gcpro1, gcpro2, etc.
23265 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23266 of the new macros.
23267 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23268 argument, for consistency with GCPRO2_VAR, etc: it is now the
23269 prefix of the variable, not the variable itself. All uses
23270 changed.
23271 * dired.c (directory_files_internal, file_name_completion):
23272 Rename locals to avoid shadowing.
23273
23274 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23275 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23276 dired.c's scmp function, had undefined behavior.
23277 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23278 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23279 * buffer.h: ... to here, because these macros use current_buffer,
23280 and the new implementation with inline functions needs to have
23281 current_buffer in scope now, rather than later when the macros
23282 are used.
23283 (downcase, upcase1): New static inline functions.
23284 (DOWNCASE, UPCASE1): Reimplement using these functions.
23285 This avoids undefined behavior in expressions like
23286 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23287 from race conditions in accessing the global variables
23288 case_temp1 and case_temp2.
23289 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23290 * lisp.h (case_temp1, case_temp2): Remove their decls.
23291 * character.h (ASCII_CHAR_P): Move from here ...
23292 * lisp.h: ... to here, so that the inline functions mentioned
23293 above can use them.
23294
23295 * dired.c (directory_files_internal_unwind): Now static.
23296
23297 * fileio.c (file_name_as_directory, directory_file_name):
23298 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23299 Now static.
23300 (file_name_as_directory): Use const pointers when appropriate.
23301 (Fexpand_file_name): Likewise. In particular, newdir might
23302 point at constant storage, so make it a const pointer.
23303 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
23304 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23305 signedness issues.
23306 (Fset_file_times, Finsert_file_contents, auto_save_error):
23307 Rename locals to avoid shadowing.
23308
23309 * minibuf.c (choose_minibuf_frame_1): Now static.
23310 (Ftry_completion, Fall_completions): Rename or remove locals
23311 to avoid shadowing.
23312
23313 * marker.c (bytepos_to_charpos): Remove; unused.
23314
23315 * lisp.h (verify_bytepos, count_markers): New decls,
23316 so that gcc does not warn that these functions aren't declared.
23317
23318 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23319 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
23320 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
23321 (copy_text): Remove unused local var.
23322
23323 * filelock.c (within_one_second): Now static.
23324 (lock_file_1): Rename local to avoid shadowing.
23325
23326 * buffer.c (fix_overlays_before): Mark locals as initialized.
23327 (fix_start_end_in_overlays): Likewise. This function should be
23328 simplified by using pointers-to-pointers, but that's a different
23329 matter.
23330 (switch_to_buffer_1): Now static.
23331 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23332 (report_overlay_modification): Rename locals to avoid shadowing.
23333
23334 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
23335 Fix pointer signedness issue.
23336 (sys_subshell): Mark local as volatile if checking for lint,
23337 to suppress a gcc -Wclobbered warning that does not seem to be right.
23338 (MAXPATHLEN): Define only if needed.
23339
23340 * process.c (serial_open, serial_configure): Move decls from here ...
23341 * systty.h: ... to here, so that they can be checked.
23342
23343 * fns.c (get_random, seed_random): Move extern decls from here ...
23344 * lisp.h: ... to here, so that they can be checked.
23345
23346 * sysdep.c (reset_io): Now static.
23347 (wait_for_termination_signal): Remove; unused.
23348
23349 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23350 (copy_keymap_item, append_key, push_text_char_description):
23351 Now static.
23352 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
23353 (DENSE_TABLE_SIZE): Remove; unused.
23354 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23355 (describe_map_tree):
23356 Rename locals to avoid shadowing.
23357
23358 * keyboard.c: Declare functions static if they are not used elsewhere.
23359 (echo_char, echo_dash, cmd_error, top_level_2):
23360 (poll_for_input, handle_async_input): Now static.
23361 (read_char, kbd_buffer_get_event, make_lispy_position):
23362 (make_lispy_event, make_lispy_movement, apply_modifiers):
23363 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23364 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23365 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
23366 (read_key_sequence, read_char): Mark locals as initialized.
23367 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
23368
23369 * keyboard.h (make_ctrl_char): New decl.
23370 (mark_kboards): Move decl here ...
23371 * alloc.c (mark_kboards): ... from here.
23372
23373 * lisp.h (force_auto_save_soon): New decl.
23374
23375 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
23376 (DEFINE_DUMMY_FUNCTION): New macro.
23377 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23378 Use it.
23379 (main): Add casts to avoid warnings
23380 if GCC considers string literals to be constants.
23381
23382 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23383
23384 * dbusbind.c: Pointer signedness fixes.
23385 (xd_signature, xd_append_arg, xd_initialize):
23386 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23387 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23388 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23389 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23390
23391 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23392 if GCC considers string literals to be constants.
23393 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
23394
23395 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23396
23397 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23398 (print_preprocess, print_object): New macro to fix last change.
23399
23400 * print.c (print_preprocess): Don't forget font objects.
23401
23402 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
23403
23404 * emacs.c (USAGE3): Doc fixes.
23405
23406 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23407
23408 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23409 structure.
23410
23411 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
23412
23413 * lisp.h (VWindow_system, Qfile_name_history):
23414 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23415 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23416 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23417
23418 * w32select.c: Don't #include "keyboard.h".
23419 (run_protected): Add extern declaration for waiting_for_input.
23420
23421 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23422 * w32console.c (detect_input_pending, read_input_pending)
23423 (encode_terminal_code):
23424 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23425 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23426 (w32_system_caret_y, Qfile_name_history):
23427 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23428 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23429 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23430 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23431 * w32proc.c (Qlocal, report_file_error):
23432 * w32term.c (Vwindow_system, updating_frame):
23433 * w32uniscribe.c (initialized, uniscribe_font_driver):
23434 Remove unneeded extern declarations.
23435
23436 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
23437
23438 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
23439
23440 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
23441
23442 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23443 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23444 These macros can no longer be used for assignment.
23445
23446 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23447 Assign struct members directly, instead of using BUF_BEGV etc.
23448 (record_buffer_markers, fetch_buffer_markers): New functions for
23449 recording and fetching special buffer markers.
23450 (set_buffer_internal_1, set_buffer_temp): Use them.
23451
23452 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23453
23454 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23455
23456 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23457 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23458
23459 * xdisp.c (hscroll_window_tree):
23460 (reconsider_clip_changes): Use PT instead of BUF_PT.
23461
23462 2011-03-13 Eli Zaretskii <eliz@gnu.org>
23463
23464 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23465 $(EMACS_ROOT)/lib/intprops.h.
23466
23467 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23468
23469 Fix more problems found by GCC 4.5.2's static checks.
23470
23471 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23472 to unsigned char * to avoid compiler diagnostic.
23473 (xg_free_frame_widgets): Make it clear that a local variable is
23474 needed only if USE_GTK_TOOLTIP.
23475 (gdk_window_get_screen): Make it clear that this macro is needed
23476 only if USE_GTK_TOOLTIP.
23477 (int_gtk_range_get_value): New function, which avoids a diagnostic
23478 from gcc -Wbad-function-cast.
23479 (xg_set_toolkit_scroll_bar_thumb): Use it.
23480 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23481 diagnostic from gcc -Wbad-function-cast.
23482 (get_utf8_string, xg_get_file_with_chooser):
23483 Rename locals to avoid shadowing.
23484 (create_dialog): Move locals to avoid shadowing.
23485
23486 * xgselect.c (xg_select): Remove unused var.
23487
23488 * image.c (four_corners_best): Mark locals as initialized.
23489 (gif_load): Initialize transparent_p to zero (Bug#8238).
23490 Mark another local as initialized.
23491 (my_png_error, my_error_exit): Mark with NO_RETURN.
23492
23493 * image.c (clear_image_cache): Now static.
23494 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
23495 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
23496 (x_edge_detection): Remove unnecessary cast that
23497 gcc -Wbad-function-cast diagnoses.
23498 (gif_load): Fix pointer signedness.
23499 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23500 (jpeg_load, gif_load): Rename locals to avoid shadowing.
23501
23502 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
23503
23504 Improve quality of tests for time stamp overflow.
23505 For example, without this patch (encode-time 0 0 0 1 1
23506 1152921504606846976) returns the obviously-bogus value (-948597
23507 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23508 reports time overflow. See
23509 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
23510 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23511 * editfns.c: Include limits.h and intprops.h.
23512 (TIME_T_MIN, TIME_T_MAX): New macros.
23513 (time_overflow): Move earlier, to before first use.
23514 (hi_time, lo_time): New functions, for an accurate test for
23515 out-of-range times.
23516 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23517 (Fget_internal_run_time): Don't assume time_t fits in int.
23518 (make_time): Use list2 instead of Fcons twice.
23519 (Fdecode_time): More accurate test for out-of-range times.
23520 (check_tm_member): New function.
23521 (Fencode_time): Use it, to test for out-of-range times.
23522 (lisp_time_argument): Don't rely on undefined left-shift and
23523 right-shift behavior when checking for time stamp overflow.
23524
23525 * editfns.c (time_overflow): New function, refactoring common code.
23526 (Fformat_time_string, Fdecode_time, Fencode_time):
23527 (Fcurrent_time_string): Use it.
23528
23529 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23530 * dired.c (make_time): Move to ...
23531 * editfns.c (make_time): ... here.
23532 * systime.h: Note the move.
23533
23534 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23535
23536 * fringe.c (update_window_fringes): Remove unused variables.
23537
23538 * unexmacosx.c (copy_data_segment): Also copy __got section.
23539 (Bug#8223)
23540
23541 2011-03-12 Eli Zaretskii <eliz@gnu.org>
23542
23543 * termcap.c [MSDOS]: Include "msdos.h".
23544 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23545 Constify `char *' arguments and their references according to
23546 prototypes in tparam.h.
23547
23548 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
23549
23550 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23551 Adapt all references accordingly.
23552
23553 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23554
23555 2011-03-11 Tom Tromey <tromey@redhat.com>
23556
23557 * buffer.c (syms_of_buffer): Remove obsolete comment.
23558
23559 2011-03-11 Eli Zaretskii <eliz@gnu.org>
23560
23561 * termhooks.h (encode_terminal_code): Declare prototype.
23562
23563 * msdos.c (encode_terminal_code): Don't declare prototype.
23564
23565 * term.c (encode_terminal_code): Now external again, used by
23566 w32console.c and msdos.c.
23567
23568 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23569 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
23570
23571 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
23572
23573 Fix some minor problems found by GCC 4.5.2's static checks.
23574
23575 * fringe.c (update_window_fringes): Mark locals as initialized
23576 (Bug#8227).
23577 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
23578
23579 * alloc.c (mark_fringe_data): Move decl from here ...
23580 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23581 to check its interface.
23582 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23583
23584 * fontset.c (free_realized_fontset): Now static.
23585 (Fset_fontset_font): Rename local to avoid shadowing.
23586 (fontset_font): Mark local as initialized.
23587 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
23588
23589 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23590
23591 * xselect.c (x_disown_buffer_selections): Remove; not used.
23592 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
23593 (x_own_selection, Fx_disown_selection_internal): Rename locals
23594 to avoid shadowing.
23595 (x_handle_dnd_message): Remove local to avoid shadowing.
23596
23597 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23598 so that the caller can use some name other than gcpro1.
23599 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
23600 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23601 (Fx_backspace_delete_keys_p):
23602 Use them to avoid shadowing, and rename vars to avoid shadowing.
23603 (x_decode_color, x_set_name, x_window): Now static.
23604 (Fx_create_frame): Add braces to silence GCC warning.
23605 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
23606 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23607 Remove unused locals.
23608 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23609 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23610 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23611 macros.
23612
23613 * xterm.h (x_mouse_leave): New decl.
23614
23615 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23616 Remove unused functions.
23617 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23618 (x_calc_absolute_position): Now static.
23619 (XTread_socket): Don't define label "out" unless it's used.
23620 Don't declare local "event" unless it's used.
23621 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23622 unless they are used.
23623 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23624 (x_fatal_error_signal): Remove; not used.
23625 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23626 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23627 (x_error_catcher, x_connection_closed, x_error_handler):
23628 (x_error_quitter, xembed_send_message, x_iconify_frame):
23629 (my_log_handler): Rename locals to avoid shadowing.
23630 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
23631 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
23632
23633 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23634 Rename or move locals to avoid shadowing.
23635 (tty_defined_color, merge_face_heights): Now static.
23636 (free_realized_faces_for_fontset): Remove; not used.
23637 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23638 does not deduce is never used uninitialized.
23639 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23640 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
23641
23642 * terminal.c (store_terminal_param): Now static.
23643
23644 * xmenu.c (menu_highlight_callback): Now static.
23645 (set_frame_menubar): Remove unused local.
23646 (xmenu_show): Rename parameter to avoid shadowing.
23647 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23648 since they might point to immutable storage.
23649 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23650 since it's unused otherwise.
23651
23652 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
23653 Add a FIXME, since the code still doesn't look right. (Bug#8215)
23654 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23655 avoids a gcc -Wuninitialized diagnostic.
23656 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
23657 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23658 does not deduce are never used uninitialized.
23659
23660 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23661
23662 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
23663 * window.c (window_loop, size_window):
23664 (run_window_configuration_change_hook, enlarge_window): Likewise.
23665
23666 * window.c (display_buffer): Now static.
23667 (size_window): Mark variables that gcc -Wuninitialized
23668 does not deduce are never used uninitialized.
23669 * window.h (check_all_windows): New decl, to forestall
23670 gcc -Wmissing-prototypes diagnostic.
23671 * dispextern.h (bidi_dump_cached_states): Likewise.
23672
23673 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23674 shadowing.
23675 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
23676 Include <limits.h>.
23677 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23678 and to avoid gcc -Wuninitialized warning.
23679 (load_charset_map): Mark variables that gcc -Wuninitialized
23680 does not deduce are never used uninitialized.
23681 (load_charset): Abort instead of using uninitialized var (Bug#8229).
23682
23683 * coding.c (coding_set_source, coding_set_destination):
23684 Use "else { /* comment */ }" rather than "else /* comment */;"
23685 for clarity, and to avoid gcc -Wempty-body warning.
23686 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23687 a block, when the outer 'i' will do.
23688 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23689 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23690 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23691 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23692 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23693 Rename locals to avoid shadowing.
23694 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
23695 * coding.c (emacs_mule_char, encode_invocation_designation):
23696 Now static, since they're not used elsewhere.
23697 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
23698 (decode_coding_object, encode_coding_object, detect_coding_system):
23699 (decode_coding_emacs_mule): Mark variables that gcc
23700 -Wuninitialized does not deduce are never used uninitialized.
23701 (detect_coding_iso_2022): Initialize a local variable that might
23702 be used uninitialized. Leave a FIXME because it's not clear that
23703 this initialization is needed. (Bug#8211)
23704 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23705 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23706 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23707 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23708 Remove unused macros.
23709
23710 * category.c (hash_get_category_set): Remove unused local var.
23711 (copy_category_table): Now static, since it's not used elsewhere.
23712 * character.c (string_count_byte8): Likewise.
23713
23714 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23715 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23716
23717 * chartab.c (copy_sub_char_table): Now static, since it's not used
23718 elsewhere.
23719 (sub_char_table_ref_and_range, char_table_ref_and_range):
23720 Rename locals to avoid shadowing.
23721 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
23722
23723 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
23724 (BIDI_BOB): Remove unused macro.
23725
23726 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23727 deduce are never used uninitialized.
23728 * term.c (encode_terminal_code): Likewise.
23729
23730 * term.c (encode_terminal_code): Now static. Remove unused local.
23731
23732 * tparam.h: New file.
23733 * term.c, tparam.h: Include it.
23734 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23735 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23736 Move these decls to tparam.h, and make them agree with what
23737 is actually in tparam.c. The previous trick of using incompatible
23738 decls in different modules does not conform to the C standard.
23739 All callers of tparam changed to use tparam's actual API.
23740 * tparam.c (tparam1, tparam, tgoto):
23741 Use const pointers where appropriate.
23742
23743 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23744 * cm.h (struct cm): Likewise.
23745 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23746 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23747 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23748 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23749 (turn_on_face, init_tty): Likewise.
23750 * termchar.h (struct tty_display_info): Likewise.
23751
23752 * term.c (term_mouse_position): Rename local to avoid shadowing.
23753
23754 * alloc.c (mark_ttys): Move decl from here ...
23755 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23756
23757 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23758
23759 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23760
23761 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
23762
23763 * search.c (compile_pattern_1): Remove argument regp, unused since
23764 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23765 (compile_pattern): Don't pass it.
23766
23767 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23768
23769 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23770 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23771 for ! HAVE_GTK3.
23772 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23773
23774 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23775
23776 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23777 gdk_window_get_screen, gdk_window_get_geometry,
23778 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23779 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23780 (xg_get_pixbuf_from_pixmap): New function.
23781 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23782 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23783 Call xg_get_pixbuf_from_pixmap instead of
23784 gdk_pixbuf_get_from_drawable.
23785 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23786 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23787 (xg_check_special_colors): Use GtkStyleContext and its functions
23788 for HAVE_GTK3.
23789 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23790 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23791 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
23792 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23793 Call gtk_widget_get_preferred_size.
23794 (xg_frame_resized): gdk_window_get_geometry only takes 5
23795 parameters.
23796 (xg_win_to_widget, xg_event_is_for_menubar):
23797 Call gdk_x11_window_lookup_for_display.
23798 (xg_set_widget_bg): New function.
23799 (delete_cb): New function.
23800 (xg_create_frame_widgets): Connect delete-event to delete_cb.
23801 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
23802 (xg_set_background_color): Call xg_set_widget_bg.
23803 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23804 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23805 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23806 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23807 if ! HAVE_GTK3.
23808 (update_frame_tool_bar): Call gtk_widget_hide.
23809 (xg_initialize): Use GDK_KEY_g.
23810
23811 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23812 if ! HAVE_GTK3
23813 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23814
23815 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23816 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23817 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23818
23819 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
23820
23821 * w32xfns.c (select_palette): Check success of RealizePalette against
23822 GDI_ERROR, not zero.
23823
23824 See ChangeLog.11 for earlier changes.
23825
23826 ;; Local Variables:
23827 ;; coding: utf-8
23828 ;; End:
23829
23830 Copyright (C) 2011-2013 Free Software Foundation, Inc.
23831
23832 This file is part of GNU Emacs.
23833
23834 GNU Emacs is free software: you can redistribute it and/or modify
23835 it under the terms of the GNU General Public License as published by
23836 the Free Software Foundation, either version 3 of the License, or
23837 (at your option) any later version.
23838
23839 GNU Emacs is distributed in the hope that it will be useful,
23840 but WITHOUT ANY WARRANTY; without even the implied warranty of
23841 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23842 GNU General Public License for more details.
23843
23844 You should have received a copy of the GNU General Public License
23845 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.