* xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
[bpt/emacs.git] / src / ChangeLog
1 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
4
5 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
6
7 Static checking by GCC 4.8.0.
8 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
9 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
10 (x_get_monitor_attributes_fallback)
11 (x_get_monitor_attributes_xinerama)
12 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
13 Define only if USE_GTK.
14 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
15 (x_get_monitor_attributes_fallback): Omit unused locals.
16 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
17 Use double, not float, to avoid mixed-mode floating point arithmetic.
18
19 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20 Jan Djärv <jan.h.d@swipnet.se>
21
22 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
23 (XINERAMA_CFLAGS): New macros.
24 (ALL_CFLAGS, LIBES): Use them.
25
26 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
27 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
28 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
29 (syms_of_xfns): DEFSYM them.
30 (struct MonitorInfo): New struct.
31 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
32 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
33 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
34 (x_get_monitor_attributes_xinerama): New functions.
35 (Fx_display_monitor_attributes_list): New primitive.
36 (syms_of_xfns): Defsubr it.
37
38 * xterm.h (x_display_info): Add Xatom_net_workarea and
39 Xatom_net_current_desktop.
40
41 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
42 and dpyinfo->Xatom_net_current_desktop.
43
44 2013-05-06 Eli Zaretskii <eliz@gnu.org>
45
46 * xdisp.c (pos_visible_p): Use the special code for finding the
47 beginning of a display property or overlay for any "replacing"
48 display property, not just for display strings. This solves
49 incorrect reporting of position by posn-at-point. (Bug#14241)
50
51 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
52
53 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
54 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
55 Verify that ElfW (Half) fits in int.
56 (fatal): Use same signature as lisp.h.
57 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
58 configure and build with -DUNEXELF_DEBUG without worrying about
59 other modules that use DEBUG.
60 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
61 possibly-wide integers now uses it instead of plain fprintf.
62 (entry_address): New function, which avoids problems with 32-bit
63 overflow on 64-bit hosts.
64 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
65 (round_up): Don't assume the remainder fits in int.
66 (find_section): Use bool for boolean. Simplify debug code.
67 (unexec): Don't assume file sizes fit in int or size_t.
68 Omit unnecessary trailing newline in 'fatal' format.
69 Use strerror rather than outputting decimal error number.
70 Remove unused code when emacs is not defined;
71 this file relies on Emacs now.
72 Don't assume e_phnum and e_shnum are positive.
73
74 * regex.c: Fix problems when DEBUG is defined.
75 (extract_number, extract_number_and_incr): Define regardless of
76 whether DEBUG is defined; that's simpler and makes the code less
77 likely to go stale in the normal case when DEBUG is not defined.
78 Return int rather than taking an int * arg. All callers changed.
79 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
80 Remove, replacing with ...
81 (DEBUG_PRINT): New macro. All callers changed.
82 (DEBUG_COMPILES_ARGUMENTS): New macro.
83 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
84 (print_compiled_pattern, print_double_string) [DEBUG]:
85 Use prototype rather than old-style definition.
86 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
87 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
88 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
89 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
90 Don't assume ptrdiff_t, size_t, and long are the same width as int.
91 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
92 This matters only when DEBUG is defined.
93
94 2013-05-05 Eli Zaretskii <eliz@gnu.org>
95
96 * xdisp.c (set_iterator_to_next): Set the
97 ignore_overlay_strings_at_pos_p flag only if we are _really_
98 iterating over an overlay string, as indicated by the
99 current.overlay_string_index member. (Bug#14306)
100
101 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
102
103 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
104 to where it is used, to avoid autorelease issues (Bug#14050).
105
106 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
107
108 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
109 * fileio.c (syms_of_fileio): Implement this.
110 * filelock.c (create_lock_file): If symbolic links don't work, so
111 we use a regular file as a lock file, do not fsync the lock file;
112 it's not needed.
113
114 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
115
116 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
117 (syms_of_minibuf): Adjust accodingly.
118 * lread.c (Fread):
119 * callint.c (Fcall_interactively): Adjust calls accordingly.
120
121 2013-05-04 Eli Zaretskii <eliz@gnu.org>
122
123 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
124 w->contents is a buffer before computing everything else.
125 Use parentheses to disambiguate last part of the condition.
126
127 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
128 assertion violations. (Bug#14062)
129
130 2013-05-01 David Reitter <david.reitter@gmail.com>
131
132 * nsfns.m (ns_tooltip): Initialize.
133
134 2013-04-28 Eli Zaretskii <eliz@gnu.org>
135
136 * coding.c (decode_coding_gap): Don't remove the character before
137 a newline unless it's a CR character. (Bug#14287)
138
139 2013-04-28 Dan Nicolaescu <dann@gnu.org>
140
141 * dispextern.h (struct face): Move enum face_underline_type
142 earlier so that bitfields can be in the same word.
143
144 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
145
146 * nsfns.m (handlePanelKeys): New function.
147 (EmacsOpenPanel:performKeyEquivalent:)
148 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
149 arrows/function/control and copy/paste keys (Bug#14296).
150
151 2013-04-27 Juri Linkov <juri@jurta.org>
152
153 * callint.c (Fcall_interactively): Call `Qread_number' for
154 interactive code letter `n' instead of using duplicate code.
155 (Bug#14254)
156
157 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
158
159 * systime.h (make_timeval): Declare as 'const'.
160
161 2013-04-27 Kenichi Handa <handa@gnu.org>
162
163 * font.c (font_open_entity): Always open a font of manageable
164 size.
165
166 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
167
168 Port better to AIX (Bug#14258).
169 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
170 to pacify AIX xlc.
171
172 2013-04-24 Kenichi Handa <handa@gnu.org>
173
174 * coding.c (decode_coding_iso_2022): When an invalid escape
175 sequence is encountered, reset the invocation and designation
176 status to the safest one.
177
178 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
179
180 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
181 Without this fix, "make distclean" leaves stamp-h1 behind.
182
183 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
184
185 * w32fns.c (w32_fullscreen_rect): New function to compute the
186 window rectangle for the given fullscreen mode.
187 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
188 longer tunes the window size. This keeps the window's edges flush
189 with the screen and allows the taskbar to hide itself in fullboth.
190
191 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
192 window decorations and uses the entire screen.
193
194 * w32term.h (w32_fullscreen_rect) Add prototype.
195 (struct w32_output): Replace normal_width, normal_height,
196 normal_top, and normal_left members with a single normal_placement
197 struct.
198 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
199 Remove macros.
200 (FRAME_NORMAL_PLACEMENT): New macro.
201
202 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
203
204 * minibuf.c (Ftest_completion): Silence compiler warning.
205
206 2013-04-15 Eli Zaretskii <eliz@gnu.org>
207
208 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
209 bug#14062.
210
211 * frame.h (WINDOW_FRAME): Protect macro and its argument with
212 parentheses.
213
214 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
215 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
216 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
217 parentheses where appropriate.
218
219 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
220
221 * keyboard.c (timer_start_idle): Remove no-longer-used local.
222
223 2013-04-14 Eli Zaretskii <eliz@gnu.org>
224
225 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
226 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
227 Mention in the doc string that setting these variables takes
228 effect only after a call to set-window-buffer. (Bug#14200)
229
230 2013-04-13 Eli Zaretskii <eliz@gnu.org>
231
232 * indent.c (Fvertical_motion): Don't consider display strings on
233 overlay strings as display strings on the buffer position we
234 started from. This prevents vertical cursor motion from jumping
235 more than one line when there's an overlay string with a display
236 property at end of line.
237 Reported by Karl Chen <Karl.Chen@quarl.org> in
238 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
239
240 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
241
242 * window.c (select_window): `record_buffer' even if window is
243 already selected (bug#14191).
244
245 2013-04-11 Eli Zaretskii <eliz@gnu.org>
246
247 * window.c (Fwindow_end): Test more flags, including the buffer's
248 last_overlay_modified flag, to determine whether the window's
249 display is really up-to-date. Prevents the function from
250 returning a stale value. (Bug#14170)
251 (Fwindow_line_height): Fix the test for up-to-date-ness of the
252 current matrix.
253
254 2013-04-10 Eli Zaretskii <eliz@gnu.org>
255
256 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
257 garbaged only if it is not already the top frame on its TTY.
258 This prevents flickering due to constant redrawing of TTY frames when
259 there are GUI frames open in the same session. (Bug#13864)
260
261 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
262
263 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
264 of marking the idle timers directly.
265
266 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
267
268 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
269 tables (bug#14054).
270
271 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
272
273 * window.c (select_window): Don't record_buffer while the invariant is
274 temporarily broken (bug#14161).
275
276 * fns.c (Fdelq): Don't assume !NILP => CONSP.
277
278 2013-04-07 Eli Zaretskii <eliz@gnu.org>
279
280 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
281
282 2013-04-07 Romain Francoise <romain@orebokech.com>
283
284 Ignore additional platform-specific ACL errors (Bug#13702).
285 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
286 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
287
288 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
289
290 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
291 f->output_data.ns.
292
293 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
294
295 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
296 This bug was introduced by my 2013-02-25 change that simplified
297 data_start configuration. Without this change, on GNU/Linux
298 an Emacs configured with --enable-profiling fails immediately
299 due to a profiler signal.
300 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
301 with these flags. On platforms where special flags are needed
302 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
303 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
304 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
305
306 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
307
308 Get rid of some platform-specific functions examining window
309 system and its capabilities. This is a partial rework of the
310 2013-04-05 change.
311 * lisp.h (have_menus_p): Remove prototype. This function is
312 replaced with platform-independent window_system_available.
313 (check_window_system): Move to...
314 * frame.h (decode_window_system_frame, window_system_available):
315 ...here, add new prototypes.
316 * frame.c (window_system_available, decode_window_system_frame):
317 New functions.
318 (check_window_system): Platform-independent now.
319 * xterm.h (x_in_use): Remove declaration.
320 (check_x_frame):
321 * w32term.h (check_x_frame):
322 * nsterm.h (check_x_frame): Remove prototypes. This function
323 is replaced with platform-independent decode_window_system_frame.
324 * msdos.c (have_menus_p): Remove.
325 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
326 Remove platform-specific functions. Use check_window_system,
327 decode_window_system_frame and check_ns_display_info where
328 appropriate. Minor style and comment tweaks.
329 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
330 (check_x_frame): Likewise.
331 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
332 Likewise.
333 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
334 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
335 * xmenu.c, xselect.c: All related users changed.
336
337 2013-04-03 Kenichi Handa <handa@gnu.org>
338
339 The following changes is to optimize the code for reading UTF-8
340 files.
341
342 * coding.c (check_ascii): Rename from detect_ascii. Return value
343 changed. Check EOL format. Do not call adjust_coding_eol_type
344 here.
345 (check_utf_8): New function.
346 (adjust_coding_eol_type): Do nothing if already adjusted.
347 (detect_coding): Compare the return value of check_ascii with
348 coding->src_bytes. Call adjust_coding_eol_type if necessary.
349 (decode_coding_gap): Optimize for valid UTF-8.
350
351 2013-03-21 Kenichi Handa <handa@gnu.org>
352
353 * coding.c (syms_of_coding): Cancel previous change.
354
355 * insdel.c (insert_from_gap): Fix previous change.
356
357 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
358
359 Consistently use platform-specific function to detect window system.
360 * lisp.h (check_window_system): New prototype. This function is
361 going to replace check_x, check_w32 and check_ns.
362 (have_menus_p): Mention msdos.c in comment.
363 * fontset.c (check_window_system_func): Remove. Adjust all users.
364 * fontset.h (check_window_system_func): Remove prototype.
365 * nsterm.h (check_ns):
366 * xterm.h (check_x):
367 * w32term.h (check_w32): Likewise.
368 * menu.c (Fx_popup_menu): Use check_window_system.
369 * msdos.c (check_window_system): Define for MS-DOS.
370 * nsfns.m (check_window_system): Define for NS. Adjust all users.
371 * w32fns.c (check_window_system): Likewise for MS-Windows.
372 * xfns.c (check_window_system): Likewise for X.
373 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
374 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
375
376 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
377
378 Prefer < to > in range checks such as 0 <= i && i < N.
379 This makes it easier to visualize quantities on a number line.
380 This patch doesn't apply to all such range checks,
381 only to the range checks affected by the 2013-03-24 change.
382 This patch reverts most of the 2013-03-24 change.
383 * alloc.c (xpalloc, Fgarbage_collect):
384 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
385 * character.c (string_escape_byte8):
386 * charset.c (read_hex):
387 * data.c (cons_to_unsigned):
388 * dispnew.c (update_frame_1):
389 * doc.c (Fsubstitute_command_keys):
390 * doprnt.c (doprnt):
391 * editfns.c (hi_time, decode_time_components):
392 * fileio.c (file_offset):
393 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
394 * font.c (font_intern_prop):
395 * frame.c (x_set_alpha):
396 * gtkutil.c (get_utf8_string):
397 * indent.c (check_display_width):
398 * keymap.c (Fkey_description):
399 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
400 * lread.c (read1):
401 * minibuf.c (read_minibuf_noninteractive):
402 * process.c (wait_reading_process_output):
403 * search.c (Freplace_match):
404 * window.c (get_phys_cursor_glyph):
405 * xdisp.c (redisplay_internal):
406 * xsmfns.c (smc_save_yourself_CB):
407 Prefer < to > for range checks.
408 * dispnew.c (sit_for): Don't mishandle NaNs.
409 This fixes a bug introduced in the 2013-03-24 change.
410 * editfns.c (decode_time_components): Don't hoist comparison.
411 This fixes another bug introduced in the 2013-03-24 change.
412
413 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
414
415 * frame.h (struct frame): Drop scroll_bottom_vpos
416 member becaue all real users are dead long ago.
417 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
418 * xdisp.c (redisplay_internal): Adjust user.
419
420 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
421
422 * nsmenu.m (showAtX:Y:for:): setLevel to
423 NSPopUpMenuWindowLevel (Bug#13998).
424
425 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
426
427 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
428 (ns_check_pending_open_menu): Declare.
429
430 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
431 (x_activate_menubar): Update the menu with title that matches
432 ns_get_pending_menu_title, and call
433 ns_check_pending_openmenu (Bug#12698).
434 (menuWillOpen:): New method.
435 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
436
437 * nsterm.m (menu_will_open_state, menu_mouse_point)
438 (menu_pending_title): New varaibles.
439 (ns_get_pending_menu_title, ns_check_menu_open)
440 (ns_check_pending_open_menu): New functions.
441
442 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
443
444 * indent.c (current_column_bol_cache): Remove leftover which is not
445 used in Fmove_to_column any more.
446 (current_column, scan_for_column): Adjust users.
447 * keyboard.c (last_point_position_buffer, last_point_position_window):
448 Remove leftovers which are not used for recording undo any more.
449 (command_loop_1, syms_of_keyboard): Adjust users.
450 * xdisp.c (last_max_ascent): Remove leftover which is not used in
451 redisplay_window any more.
452 (move_it_to): Adjust user.
453
454 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
455
456 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
457 Update dependencies.
458
459 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
460
461 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
462 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
463 forward references.
464
465 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
466
467 * window.h (struct window): Replace hchild, vchild and buffer slots
468 with the only contents slot. This is possible because each valid
469 window may have either the child window (in vertical or horizontal
470 combination) or buffer to display (for the leaf window). Using that,
471 a lof of operations to traverse and/or change window hierarchies may
472 be simplified. New member horizontal is used to distinguish between
473 horizontal and vertical combinations of internal windows.
474 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
475 (WINDOW_VERTICAL_COMBINATION_P): New macros.
476 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
477 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
478 Use contents slot, not buffer, where appropriate.
479 (wset_combination): New function.
480 (wset_buffer): Add eassert.
481 (Fframe_first_window): Simplify the loop reaching first window.
482 (Fwindow_buffer): Use WINDOW_LEAF_P.
483 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
484 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
485 (unshow_buffer): Convert initial debugging check to eassert.
486 (replace_window, recombine_windows, Fdelete_other_windows_internal)
487 (make_parent_window, window_resize_check, window_resize_apply)
488 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
489 (Fset_window_configuration, delete_all_child_windows, save_window_save):
490 Adjust to match struct window changes.
491 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
492 (mark_window_cursors_off, count_windows, get_leaf_windows)
493 (foreach_window_1): Simplify the loop.
494 * alloc.c (mark_object): Do not check for the leaf window because
495 internal windows has no glyph matrices anyway.
496 * dispnew.c (clear_window_matrices, showing_window_margins_p)
497 (allocate_matrices_for_window_redisplay, fake_current_matrices)
498 (allocate_matrices_for_frame_redisplay, free_window_matrices)
499 (build_frame_matrix_from_window_tree, mirror_make_current)
500 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
501 (update_window_tree, set_window_update_flags): Simplify the loop.
502 (sync_window_with_frame_matrix_rows): Enforce live window.
503 Use contents slot, not buffer, where appropriate.
504 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
505 and WINDOW_HORIZONTAL_COMBINATION_P.
506 (make_frame_visible_1): Simplify the loop.
507 Use contents slot, not buffer, where appropriate.
508 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
509 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
510 (expose_window_tree): Likewise.
511 Use contents slot, not buffer, where appropriate.
512 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
513 to avoid deleted windows. Use contents slot instead of buffer.
514 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
515 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
516 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
517 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
518
519 2013-03-28 Eli Zaretskii <eliz@gnu.org>
520
521 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
522 identify the reasons for assertion violations in bug#14062 and
523 similar ones.
524 (Fx_show_tip): Fix compilation error under
525 "--enable-check-lisp-object-type". (Bug#14073)
526
527 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
528 Reported by <rzl24ozi@gmail.com>.
529
530 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
531
532 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
533 start marker...
534 (unwind_with_echo_area_buffer): ...to restore it here.
535 This is needed to ensure that...
536 (redisplay_window): ...both window markers are valid here,
537 which is verified by eassert.
538 * editfns.c (save_excursion_save): Do not assume that
539 selected_window always displays the buffer.
540 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
541 Fix comment.
542
543 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
544
545 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
546 the upcase table.
547
548 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
549
550 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
551
552 2013-03-27 Eli Zaretskii <eliz@gnu.org>
553
554 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
555 since MinGW's w32api headers do. This avoids compiler warnings.
556
557 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
558 if already defined.
559
560 2013-03-26 Eli Zaretskii <eliz@gnu.org>
561
562 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
563
564 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
565
566 * gtkutil.c (style_changed_cb): Check if frame is live and an
567 X frame (Bug#14038).
568
569 2013-03-26 Eli Zaretskii <eliz@gnu.org>
570
571 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
572 Define only for _WIN32_WINNT less than 0x0500.
573 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
574 MinGW64.
575 Move inclusion of time.h before sys/time.h, so that MinGW64 could
576 see its own definitions of 'struct timeval' and 'struct timezone'.
577
578 Fix incompatibilities between MinGW.org and MinGW64 headers.
579 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
580
581 * w32.c (REPARSE_DATA_BUFFER): Guard with
582 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
583
584 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
585
586 * xterm.c: Include X11/XKBlib.h
587 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
588
589 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
590
591 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
592 written backwards.
593 * blockinput.h (input_blocked_p): Likewise.
594 * bytecode.c (exec_byte_code): Likewise.
595 * callproc.c (call_process_kill, call_process_cleanup)
596 (Fcall_process): Likewise.
597 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
598 (Fccl_execute_on_string): Likewise.
599 * character.c (string_escape_byte8): Likewise.
600 * charset.c (read_hex): Likewise.
601 * cm.c (calccost): Likewise.
602 * data.c (cons_to_unsigned): Likewise.
603 * dired.c (directory_files_internal, file_name_completion):
604 Likewise.
605 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
606 (sit_for): Likewise.
607 * doc.c (Fsubstitute_command_keys): Likewise.
608 * doprnt.c (doprnt): Likewise.
609 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
610 * emacsgtkfixed.c: Likewise.
611 * fileio.c (file_offset, Fwrite_region): Likewise.
612 * floatfns.c (Fexpt, fmod_float): Likewise.
613 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
614 Likewise.
615 * font.c (font_intern_prop): Likewise.
616 * frame.c (x_set_alpha): Likewise.
617 * gtkutil.c (get_utf8_string): Likewise.
618 * indent.c (check_display_width): Likewise.
619 * intervals.c (create_root_interval, rotate_right, rotate_left)
620 (split_interval_right, split_interval_left)
621 (adjust_intervals_for_insertion, delete_node)
622 (interval_deletion_adjustment, adjust_intervals_for_deletion)
623 (merge_interval_right, merge_interval_left, copy_intervals)
624 (set_intervals_multibyte_1): Likewise.
625 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
626 * keymap.c (Fkey_description): Likewise.
627 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
628 * lread.c (openp, read_integer, read1, string_to_number):
629 Likewise.
630 * menu.c (ensure_menu_items): Likewise.
631 * minibuf.c (read_minibuf_noninteractive): Likewise.
632 * print.c (printchar, strout): Likewise.
633 * process.c (create_process, Faccept_process_output)
634 (wait_reading_process_output, read_process_output, send_process)
635 (wait_reading_process_output): Likewise.
636 * profiler.c (make_log, handle_profiler_signal): Likewise.
637 * regex.c (re_exec): Likewise.
638 * regex.h: Likewise.
639 * search.c (looking_at_1, Freplace_match): Likewise.
640 * sysdep.c (get_child_status, procfs_ttyname)
641 (procfs_get_total_memory): Likewise.
642 * systime.h (EMACS_TIME_VALID_P): Likewise.
643 * term.c (dissociate_if_controlling_tty): Likewise.
644 * window.c (get_phys_cursor_glyph): Likewise.
645 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
646 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
647 Likewise.
648 * xfns.c (Fx_window_property): Likewise.
649 * xmenu.c (set_frame_menubar): Likewise.
650 * xselect.c (x_get_window_property, x_handle_dnd_message):
651 Likewise.
652 * xsmfns.c (smc_save_yourself_CB): Likewise.
653 * xterm.c (x_scroll_bar_set_handle): Likewise.
654
655 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
656
657 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
658 to be optional or nil. Adjust comment and convert it to docstring.
659 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
660 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
661
662 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
663
664 Static checking by GCC 4.8-20130319.
665 * image.c (gif_load): Assume pass < 3 to pacify GCC.
666 * process.c (Fset_process_datagram_address)
667 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
668 * xdisp.c (get_char_face_and_encoding):
669 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
670 (get_glyph_face_and_encoding): Prepare face before possibly using it.
671 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
672
673 2013-03-24 Ken Brown <kbrown@cornell.edu>
674
675 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
676 fix compilation on 64-bit Cygwin, where underscores are not
677 automatically prepended.
678
679 * w32term.c (w32_initialize): Silence compiler warning.
680
681 2013-03-23 Eli Zaretskii <eliz@gnu.org>
682
683 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
684 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
685 variables, to save and restore frame dimensions.
686 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
687 after returning from a 'fullscreen' configuration.
688 use SendMessage instead of PostMessage to send the SC_RESTORE message,
689 to avoid races between the main thread and the input thread.
690
691 * w32term.h (struct w32_output): New members normal_width,
692 normal_height, normal_top, normal_left, and prev_fsmode.
693 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
694 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
695 members of a frame.
696
697 * w32term.c (w32fullscreen_hook): Record last value of the frame's
698 'fullscreen' parameter. Always record previous width and height
699 of the frame, except when switching out of maximized modes, so
700 that they could be restored correctly, instead of resetting to the
701 default frame dimensions. Send SC_RESTORE command to the frame,
702 unless we are going to send SC_MAXIMIZE, to restore the frame
703 resize hints in the mouse pointer shown by the window manager.
704 (Bug#14032)
705
706 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
707
708 * lisp.h (get_frame_param): Adjust conditions for prototype
709 declaration.
710
711 2013-03-22 Ken Brown <kbrown@cornell.edu>
712
713 * unexcw.c: Drop unneeded inclusion of w32common.h.
714 (report_sheap_usage): Declare.
715 (read_exe_header): Add magic numbers for x86_64.
716 (fixup_executable): Fix printf format specifier for unsigned long
717 argument.
718
719 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
720
721 * frame.h (struct frame): Put menu_bar_window under #ifdef
722 because this member is not needed when X toolkit is in use.
723 (fset_menu_bar_window):
724 * dispnew.c (clear_current_matrices, clear_desired_matrices)
725 (free_glyphs, update_frame):
726 * xdisp.c (expose_frame): Likewise.
727 (display_menu_bar): Likewise. Remove redundant eassert.
728 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
729 toolkit is in use.
730
731 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
732
733 Use functions and constants to manipulate Lisp_Save_Value objects.
734 This replaces code that used macros and strings and token-pasting.
735 The change makes the C source a bit easier to follow,
736 and shrinks the Emacs executable a bit.
737 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
738 (make_save_value): Change 1st arg from string to enum. All callers
739 changed.
740 (INTX): Remove.
741 (mark_object): Use if, not #if, for GC_MARK_STACK.
742 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
743 (XSAVE_OBJECT): Now functions, not macros.
744 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
745 the constant was never used.
746 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
747 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
748 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
749 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
750 New constants.
751 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
752 type3 with a single member save_type. All uses changed.
753 (save_type, set_save_pointer, set_save_integer): New functions.
754 * print.c (PRINTX): Remove.
755
756 * alloc.c: Remove redundant static declarations.
757
758 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
759
760 * window.h (struct window): Convert left_col, top_line, total_lines
761 and total_cols from Lisp_Objects to integers. Adjust comments.
762 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
763 Remove.
764 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
765 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
766 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
767 Adjust users where appropriate.
768
769 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
770
771 * frame.h (struct frame): Drop resx and resy because the same data is
772 available from window system-specific output context. Adjust users.
773 (default_pixels_per_inch_x, default_pixels_per_inch_y):
774 New functions to provide defaults when no window system available.
775 (FRAME_RES_X, FRAME_RES_Y): New macros.
776 (NUMVAL): Move from xdisp.c.
777 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
778 (Ffont_face_attributes, Fopen_font):
779 * image.c (gs_load):
780 * w32font.c (fill_in_logfont):
781 * xdisp.c (calc_pixel_width_or_height):
782 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
783 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
784
785 2013-03-20 Kenichi Handa <handa@gnu.org>
786
787 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
788 to 1 (temporary workaround until a bug related to ASCII
789 optimization is fixed).
790
791 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
792
793 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
794 Signal error if window is not internal. Adjust docstring.
795 (delete_all_child_windows): Use combination_limit to save the buffer.
796 (Fset_window_configuration): Adjust accordingly.
797 * print.c (syms_of_print): Initialize debugging output not here...
798 (init_print_once): ...but in a new function here.
799 * lisp.h (init_print_once): Add prototype.
800 * emacs.c (main): Add call to init_print_once. Adjust comments.
801
802 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
803
804 * window.c (window_resize_check, window_resize_apply)
805 (window_from_coordinates, recombine_windows, set_window_buffer)
806 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
807 (Fsplit_window_internal, Fdelete_window_internal)
808 (freeze_window_starts): Use bool for booleans.
809 * window.h (window_frame_coordinates, resize_frame_windows)
810 (freeze_window_starts, set_window_buffer): Adjust prototypes.
811
812 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
813
814 * dispnew.c (bitch_at_user): Use `user-error'.
815
816 2013-03-17 Ken Brown <kbrown@cornell.edu>
817
818 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
819 as return type of image_background. (Bug#13981)
820 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
821
822 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
823
824 * nsterm.m (updateFrameSize:): Change resize increments if needed.
825 (ns_select): Don't return with result uninitialized.
826
827 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
828 and getDirectory.
829
830 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
831 New functions.
832 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
833 directories. If filename is nil, get directory name (Bug#13932).
834 Use getFilename and getDirectory.
835 (getFilename, getDirectory): New methods for EmacsSavePanel and
836 EmacsOpenPanel.
837 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
838
839 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
840
841 * coding.c (decode_coding_gap): Fix typo caught by static checking.
842
843 2013-03-15 Kenichi Handa <handa@gnu.org>
844
845 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
846 (adjust_after_replace): Make it back to static. Delete the third
847 arg text_at_gap_tail. Cancel the code for handling it.
848
849 * coding.h (struct coding_system): New member eol_seen.
850
851 * coding.c (detect_ascii): New function.
852 (detect_coding): Set coding->head_ascii and coding->eol_seen only
853 when the source bytes are actually scanned. On detecting for
854 coding_category_utf_8_auto, call detect_ascii instead of scanning
855 source bytes directly.
856 (produce_chars): Call insert_from_gap with the new arg 0.
857 (encode_coding): Likewise.
858 (decode_coding_gap): Control ASCII optimization by the variable
859 disable_ascii_optimization instead of #ifndef .. #endif.
860 Deccode EOL format according to coding->eol_seen.
861 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
862 variable.
863
864 * lisp.h (adjust_after_replace): Cancel externing it.
865 (insert_from_gap): Adjust prototype.
866
867 2013-03-15 Eli Zaretskii <eliz@gnu.org>
868
869 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
870 FULLSCREEN_MAXIMIZED. (Bug#13935)
871
872 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
873
874 * region-cache.c (find_cache_boundary, move_cache_gap)
875 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
876 Simplify debugging check and convert to eassert. Adjust comment.
877 (pp_cache): Put under ENABLE_CHECKING.
878
879 2013-03-14 Eli Zaretskii <eliz@gnu.org>
880
881 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
882 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
883 and WM_ACTIVATEAPP.
884 (w32fullscreen_hook): If the frame is visible, reset
885 f->want_fullscreen flag after changing the frame size. If the
886 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
887 (Bug#13953)
888
889 2013-03-13 Daniel Colascione <dancol@dancol.org>
890
891 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
892 too so that these builds can use Cygwin's file conversion
893 functions. (We've been building and linking cygw32.o all along
894 and just not using it.)
895
896 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
897
898 File synchronization fixes (Bug#13944).
899 * Makefile.in (LIB_FDATASYNC): New macro.
900 (LIBES): Use it.
901 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
902 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
903 Don't worry about HAVE_FSYNC, since a substitute fsync is
904 available if the system lacks one.
905 (Fwrite_regin): Retry fsync if interrupted.
906
907 2013-03-13 Eli Zaretskii <eliz@gnu.org>
908
909 * w32term.c (w32_read_socket): If the Emacs frame is being
910 activated, call w32fullscreen_hook, to make sure the new frame
911 dimensions are in effect. (Bug#13937)
912
913 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
914
915 * xdisp.c (init_iterator): Simplify because both character and byte
916 positions are either specified or -1. Add eassert. Adjust comment.
917 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
918 character and byte positions can be obtained from marker.
919
920 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
921
922 Static checking by Sun C 5.12.
923 * alloc.c (buffer_memory_full) [REL_ALLOC]:
924 * bytecode.c (exec_byte_code):
925 * dispnew.c (init_display):
926 * eval.c (error):
927 * fileio.c (Fsubstitute_in_file_name):
928 * keyboard.c (Fevent_convert_list):
929 * keymap.c (Fsingle_key_description):
930 * term.c (maybe_fatal, fatal):
931 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
932 * xsmfns.c (Fhandle_save_session):
933 Omit unreachable code.
934 * keymap.c (map_keymap_char_table_item): Cast void * to
935 a function pointer type; the C Standard requires this.
936
937 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
938 Include <sys/param.h> unconditionally, as that works elsewhere and
939 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
940 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
941 and FreeBSD now.
942
943 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
944
945 * insdel.c (adjust_after_replace): Use bool for boolean.
946
947 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
948
949 * keyboard.c: Move keyboard decoding to read_key_sequence.
950 (decode_keyboard_code): Remove.
951 (tty_read_avail_input): Don't try to decode input.
952 (read_decoded_char): New function.
953 (read_key_sequence): Use it.
954
955 2013-03-10 Daniel Colascione <dancol@dancol.org>
956
957 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
958 (GUI_SDATA, guichar_t): Macros to abstract out differences between
959 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
960 w32fns.c.
961
962 * w32term.c (construct_drag_n_drop): Use the above macros to make
963 drag-and-drop work for non-ASCII filenames in cygw32 builds.
964
965 * w32fns.c (x_set_name, x_set_title): Use the above macros to
966 properly display non-ASCII frame titles in cygw32 builds.
967
968 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
969 call ShellExecute in cygw32 builds.
970
971 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
972 common file dialog code.
973
974 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
975 can just use du like other systems.
976
977 * coding.c (from_unicode_buffer): Declare.
978 * coding.c (from_unicode_buffer): Implement.
979
980 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
981
982 * lread.c: Minor cleanup.
983 (FROM_FILE_P): New macro.
984 (skip_dyn_bytes, unreadchar, read1): Use it.
985 (read_list): Consolidate duplicated code.
986
987 * bytecode.c (struct byte_stack): Remove `constants' when unused.
988
989 2013-03-10 Eli Zaretskii <eliz@gnu.org>
990
991 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
992 (redisplay_internal, set_cursor_from_row, try_window)
993 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
994 (display_line, notice_overwritten_cursor)
995 (mouse_face_from_buffer_pos, note_mouse_highlight):
996 Use MATRIX_ROW_DISPLAYS_TEXT_P.
997 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
998 (mouse_face_from_string_pos, fast_find_string_pos):
999 Use MATRIX_ROW_VPOS.
1000
1001 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1002
1003 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1004
1005 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1006 MATRIX_MODE_LINE_ROW.
1007
1008 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1009
1010 2013-03-10 handa <handa@gnu.org>
1011
1012 * lisp.h (adjust_after_replace): Extern it.
1013
1014 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1015 case of detection for coding_category_utf_8_auto.
1016 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1017 Skip decoding if all bytes are ASCII.
1018
1019 * insdel.c (adjust_after_replace): Make it public. New arg
1020 text_at_gap_tail.
1021 (adjust_after_insert): Call adjust_after_replace with the new arg
1022 value 0.
1023
1024 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1025
1026 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1027 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1028 from Elisp via unread-command-events.
1029
1030 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1031 functions to mean "no change".
1032
1033 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1034
1035 region-cache.c, scroll.c, search.c: Use bool for booleans.
1036 * lisp.h (compile_pattern):
1037 * scroll.c (do_scrolling, do_direct_scrolling):
1038 * search.c (struct regexp_cache, compile_pattern_1)
1039 (compile_pattern, string_match_1, search_command)
1040 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1041 (search_regs_saved, Fregexp_quote):
1042 Use bool for boolean.
1043 * region-cache.c (region_cache_forward, region_cache_backward):
1044 Fix comments to match code: these functions return int, not boolean.
1045
1046 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1047
1048 * search.c (find_newline): Accept start and end byte positions
1049 as arguments and allow -1 if not known.
1050 (find_newline_no_quit): Likewise for start position.
1051 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1052 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1053 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1054 * editfns.c (Fconstrain_to_field): Break long line.
1055 Adjust call to find_newline.
1056 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1057 Use DEC_BOTH to start next search from the previous buffer
1058 position, where appropriate.
1059 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1060 (get_visually_first_element, move_it_vertically_backward): Likewise.
1061 Obtain byte position from the display iterator, where appropriate.
1062
1063 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1064
1065 print.c, process.c: Use bool for booleans.
1066 * lisp.h (wait_reading_process_output):
1067 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1068 (strout, debug_output_compilation_hack, float_to_string, print)
1069 (print_object):
1070 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1071 (decode_status, status_message, create_process, create_pty)
1072 (Fmake_network_process, Fnetwork_interface_info)
1073 (wait_reading_process_output, read_process_output)
1074 (write_queue_push, write_queue_pop, process_send_signal)
1075 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1076 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1077 Use bool for booleans.
1078 * process.c (Fnetwork_interface_list): Remove unused local.
1079 (connect_counter): Now EMACS_INT, not int.
1080
1081 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1082
1083 * bidi.c (bidi_fetch_char): Swap first and second arguments
1084 to match other functions accepting character and byte positions.
1085 Adjust comment.
1086 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1087 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1088 when you need just to move to the previous buffer position.
1089 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1090
1091 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1092
1093 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1094
1095 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1096
1097 Avoid character to byte conversions in motion subroutines.
1098 * indent.h (compute_motion, vmotion): Add byte position argument.
1099 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1100 Add eassert.
1101 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1102 Use list5 for return value.
1103 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1104 Adjust comments, style and calls to compute_motion.
1105 (Fvertical_motion): Adjust call to vmotion.
1106 * window.c (Fdelete_other_windows_internal): Record window start
1107 byte position and adjust call to vmotion.
1108 (window_scroll_line_based): Likewise with call to compute_motion.
1109 Use SET_PT_BOTH.
1110 (Frecenter): Adjust calls to vmotion.
1111
1112 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1113
1114 * lisp.h (list2i, list3i): New functions.
1115 (list4i): Move from window.c and make LISP_INLINE.
1116 * editfns.c (make_lisp_time):
1117 * fns.c (Flocale_info):
1118 * keyboard.c (parse_modifiers):
1119 * xterm.c (x_ewmh_activate_frame): Use list2i.
1120 * instel.c (signal_after_change):
1121 * nsfns.m (Fx_server_version, Fxw_color_values):
1122 * w32fns.c (Fxw_color_values, Fx_server_version):
1123 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1124 * fileio.c (Fvisited_file_modtime):
1125 * nsfns.m (Fns_display_usable_bounds):
1126 * w32.c (ltime): Use list4i.
1127
1128 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1129
1130 * search.c (find_newline_no_quit): Rename from find_next_newline.
1131 Add commentary.
1132
1133 * lisp.h (find_newline_no_quit): Rename prototype.
1134
1135 * xdisp.c (back_to_previous_line_start)
1136 (forward_to_next_line_start, get_visually_first_element)
1137 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1138 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1139 * bidi.c (bidi_find_paragraph_start): Callers of
1140 find_newline_no_quit changed.
1141
1142 * msdos.c: Change encoding to cp850. (Bug#13879)
1143 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1144
1145 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1146
1147 Coding system support cleanup and minor refactoring.
1148 * coding.h (enum coding_result_code): Remove
1149 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1150 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1151 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1152 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1153 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1154 (decode_coding_region, encode_coding_region, decode_coding_string):
1155 Remove unused compatibility macros.
1156 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1157 (record_conversion_result): Adjust user.
1158 (syms_of_coding): Likewise.
1159 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1160 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1161 (decode_coding_object): Simplify since xrealloc never returns NULL.
1162 Add eassert.
1163
1164 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1165
1166 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1167 * sysdep.c (list_system_processes)
1168 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1169 Make it a stub in this case; otherwise the build might fail,
1170 and this code hasn't been tested on such hosts anyway.
1171 Problem reported by Nelson H. F. Beebe in
1172 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1173 and analyzed by Jérémie Courrèges-Anglas in
1174 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1175
1176 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1177
1178 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1179 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1180 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1181 * bidi.c (bidi_find_paragraph_start): Likewise.
1182 * indent.c (vmotion): Likewise.
1183
1184 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1185
1186 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1187 * filelock.c: Include <c-ctype.h>.
1188 (MAX_LFINFO): New top-level constant.
1189 (lock_info_type): Remove members pid, boot_time. Add members at,
1190 dot, colon. Change user member to be the entire buffer, not a
1191 pointer. This allows us to handle the case where a foreign
1192 pid or boot time exceeds the local range. All uses changed.
1193 (LINKS_MIGHT_NOT_WORK): New constant.
1194 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1195 (defined_WINDOWSNT): Remove.
1196 (MAKE_LOCK_NAME, file_in_lock_file_name):
1197 Always use .#FILE (not .#-FILE) for the file lock,
1198 even if it is a regular file.
1199 (rename_lock_file): New function.
1200 (create_lock_file): Use it.
1201 (create_lock_file, read_lock_data):
1202 Prefer a symbolic link for the lock file, falling back on a
1203 regular file if symlinks don't work. Do not try to create
1204 symlinks on MS-Windows, due to security hassles. Stick with
1205 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1206 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1207 host may be using a Windowsish file system, and cannot use
1208 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1209 doesn't work. Don't fail merely because of a symlink-contents
1210 length limit in the current file system; fall back on regular
1211 files. Increase the symlink contents length limit to 8 KiB, this
1212 should be big enough for any real use and doesn't crunch the
1213 stack.
1214 (create_lock_file, lock_file_1, read_lock_data):
1215 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1216 (lock_file_1): Return error number, not bool. All callers changed.
1217 (ELOOP): New macro, if not already defined.
1218 (read_lock_data): Return size of lock file contents, not Lisp object.
1219 All callers changed. Handle a race condition if some other process
1220 replaces a regular-file lock with a symlink lock or vice versa,
1221 while we're trying to read the lock.
1222 (current_lock_owner): Parse contents more carefully, to help avoid
1223 confusing a regular-file lock with some other application's use
1224 of the file. Check for lock file contents being too long, or
1225 not parsing correctly.
1226 (current_lock_owner, lock_file):
1227 Allow foreign pid and boot times that exceed the local range.
1228 (current_lock_owner, lock_if_free, lock_file):
1229 Simplify allocation of lock file contents.
1230 * w32.c (sys_rename_replace): New function, containing most of
1231 the contents of the old sys_rename.
1232 (sys_rename): Use it.
1233 (fchmod): New dummy function.
1234 * w32.h (sys_rename_replace, fchmod): New decls.
1235
1236 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1237
1238 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1239 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1240 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1241 <dmantipov@yandex.ru>.
1242
1243 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1244
1245 * composite.c (get_composition_id, fill_gstring_header):
1246 Use make_uninit_vector where appropriate.
1247 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1248 * xselect.c (clean_local_selection_data): Likewise.
1249
1250 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1251
1252 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1253 * image.c (imagemagick_load_image): Calculate height and width
1254 after flattening the image, not before.
1255
1256 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1257
1258 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1259 * ftfont.c (ftfont_shape_by_flt): Likewise.
1260 * w32uniscribe.c (uniscribe_shape): Likewise.
1261
1262 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1263
1264 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1265 The old approach, which fell back on DIR/.#FILE.0 through
1266 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1267 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1268 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1269 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1270 because the locking mechanism was never reliable in that case).
1271 This patch fixes this and other bugs discovered by a code
1272 inspection that was prompted by
1273 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1274 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1275 to avoid interoperability problems between the MS-Windows and
1276 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1277 instances of Emacs now ignore each others' locks.
1278 * filelock.c (defined_WINDOWSNT): New constant.
1279 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1280 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1281 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1282 regular files on MS-Windows hosts.
1283 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1284 Use SAFE_ALLOCA to avoid problems with long file names.
1285 (MAX_LFINFO): Now a local constant, not a global macro.
1286 (IS_LOCK_FILE): Remove.
1287 (lock_file_1): Don't inspect errno if symlink call succeeds;
1288 that's not portable.
1289 (lock_file): Document that this function can return if lock
1290 creation fails.
1291 (lock_file): Don't access freed storage.
1292
1293 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1294
1295 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1296
1297 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1298
1299 * textprop.c: Use bool for booleans.
1300 (validate_interval_range, Fadd_text_properties)
1301 (Fremove_text_properties): Prefer bool to int when either works.
1302
1303 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1304
1305 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1306 If the interval tree changes as a side effect of calling
1307 modify_region, re-do processing starting from the call to
1308 validate_interval_range. (Bug#13743)
1309
1310 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1311
1312 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1313 (Bug#13546).
1314
1315 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1316
1317 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1318 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1319 access to the lock file until it is written and closed.
1320 (Bug#13807)
1321
1322 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1323
1324 * callint.c (Qcall_interactively):
1325 * macros.c (Qexecute_kbd_macro):
1326 Now static.
1327
1328 2013-02-26 Bastien Guerry <bzg@gnu.org>
1329
1330 * window.c (Frecenter): Tiny docstring enhancement.
1331
1332 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1333
1334 Minor textprop integer cleanup.
1335 * intervals.h, textprop.c (add_text_properties_from_list):
1336 Return void, not int, since nobody uses the return value.
1337 * textprop.c (validate_plist, add_properties, remove_properties)
1338 (Fadd_text_properties):
1339 Don't assume list length fits in int.
1340 (interval_has_all_properties, interval_has_some_properties)
1341 (interval_has_some_properties_list, add_properties, remove_properties)
1342 (Fadd_text_properties, Fremove_text_properties)
1343 (Fremove_list_of_text_properties, text_property_stickiness):
1344 Use bool for booleans.
1345 (Fadd_text_properties, Fremove_text_properties):
1346 (Fremove_list_of_text_properties):
1347 Reindent do-while as per GNU style.
1348
1349 2013-02-25 Eli Zaretskii <eliz@gnu.org>
1350
1351 Implement CLASH_DETECTION for MS-Windows.
1352
1353 * filelock.c [WINDOWSNT]: Include w32.h.
1354 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1355 function of that name. Up-case the macro arguments.
1356 (IS_LOCK_FILE): New macro.
1357 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1358 (create_lock_file): New function, with body extracted from
1359 lock_file_1.
1360 [WINDOWSNT]: Implement lock files by writing a regular file with
1361 the lock information as its contents.
1362 (read_lock_data): New function, on Posix platforms just calls
1363 emacs_readlinkat.
1364 [WINDOWSNT]: Read the lock info from the file.
1365 (current_lock_owner): Call read_lock_data instead of calling
1366 emacs_readlinkat directly.
1367 (lock_file) [WINDOWSNT]: Run the file name through
1368 dostounix_filename.
1369
1370 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1371 just check if the process by that PID exists.
1372
1373 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1374 also present, as doing so will fail to error out if the file
1375 already exists.
1376
1377 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1378
1379 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1380 (Fremove_list_of_text_properties): Skip all of the intervals in
1381 the region between START and END that already have resp. don't
1382 have the requested properties, not just the first one.
1383 Add assertions that the loop afterwards always modifies the
1384 properties. (Bug#13743)
1385
1386 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1387
1388 * callint.c (Fcall_interactively): Use the right lexical environment
1389 for `interactive' specs (bug#13811).
1390 * eval.c (Feval): Accept a lexical environment.
1391
1392 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1393
1394 Simplify data_start configuration (Bug#13783).
1395 This is a followon simplification to the fix for Bug#13650.
1396 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1397 (START_FILES): Remove. All uses removed.
1398 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1399 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1400 (buildobj.h): Use it.
1401 ($(ALLOBJS)): Depend on globals.h.
1402 (temacs$(EXEEXT)): Use $(ALLOBJS).
1403 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1404 * deps.mk (vm-limit.o):
1405 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1406 Do not depend on mem-limits.h.
1407 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1408 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1409 [__GNUC__ && !ORDINARY_LINK]: Remove.
1410 * mem-limits.h, pre-crt0.c: Remove.
1411 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1412 * unexcoff.c (etext): New decl.
1413 (make_hdr): Use DATA_START instead of start_of_data.
1414 * vm-limit.c: Move most of mem-limits.h's contents here.
1415 (data_start): New decl. It's OK if this is approximate,
1416 so simplify-away some unnecessary exactness.
1417 (POINTER): Remove; all uses removed.
1418 (data_space_start): Now char *, to avoid casts.
1419 (exceeds_lisp_ptr): New function, replacing the old
1420 EXCEEDS_LISP_PTR macro. All uses changed.
1421 (check_memory_limits): Simplify and remove casts.
1422 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1423 (memory_warnings): Use data_start instead of start_of_data.
1424
1425 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1426
1427 * xdisp.c (set_message): Only check for debug-on-message if STRING
1428 is a string. (Bug#13797)
1429
1430 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1431
1432 Fix regression introduced by July 10 filelock.c patch.
1433 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1434 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1435 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1436 and diagnosed by Andreas Schwab in
1437 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1438
1439 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1440
1441 Assume C89 or better.
1442 * ralloc.c (SIZE, POINTER, NIL):
1443 * vm-limit.c (POINTER):
1444 Remove, replacing all uses with C89 equivalents. These old
1445 symbols were present only for porting to pre-C89 platforms.
1446
1447 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
1448
1449 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1450 This avoids warning messages reported as part of Bug#13546.
1451
1452 2013-02-21 Ken Brown <kbrown@cornell.edu>
1453
1454 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1455
1456 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1457
1458 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1459
1460 * keyboard.c (Qcommand_execute): New var.
1461 (command_loop_1, read_char): Use it.
1462 (Fcommand_execute): Remove, replace by an Elisp implementation.
1463 (syms_of_keyboard): Adjust accordingly.
1464
1465 2013-02-19 Daniel Colascione <dancol@dancol.org>
1466
1467 * sheap.c (report_sheap_usage): Use message, not message1, so
1468 that we don't try to create a buffer while we're in the middle
1469 of dumping Emacs. Explain why.
1470
1471 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
1472
1473 * search.c (find_newline): Return byte position in bytepos.
1474 Adjust comment.
1475 (find_next_newline_no_quit, find_before_next_newline):
1476 Add bytepos argument.
1477 * lisp.h (find_newline, find_next_newline_no_quit)
1478 (find_before_next_newline): Adjust prototypes.
1479 * bidi.c (bidi_find_paragraph_start):
1480 * editfns.c (Fconstrain_to_field, Fline_end_position):
1481 * indent.c (compute_motion, vmotion):
1482 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1483 (get_visually_first_element, move_it_vertically_backward):
1484 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1485
1486 2013-02-19 Eli Zaretskii <eliz@gnu.org>
1487
1488 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1489 resources were not orderly released.
1490
1491 2013-02-17 Eli Zaretskii <eliz@gnu.org>
1492
1493 * xdisp.c (x_draw_vertical_border): For a window that is neither
1494 the leftmost nor the rightmost, redraw both the left and the right
1495 vertical borders. (Bug#13723)
1496
1497 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1498
1499 * xml.c (init_libxml2_functions):
1500 * sound.c (sound_warning):
1501 * sheap.c (report_sheap_usage):
1502 * process.c (wait_reading_process_output):
1503 * msdos.c (XMenuActivate):
1504 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1505 * keyboard.c (top_level_1):
1506 * editfns.c (Fmessage, Fmessage_box):
1507 * callint.c (Fcall_interactively):
1508 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1509
1510 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1511
1512 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
1513 * frame.c (syms_of_frame): ... to here.
1514
1515 2013-02-16 Eli Zaretskii <eliz@gnu.org>
1516
1517 * w32.c (sys_chown): Remove unused function.
1518
1519 * w32term.c <input_signal_count>: Declare 'volatile'
1520 unconditionally. (Bug#9066)
1521
1522 * w32.c (set_errno): Reset h_errno and don't set it to any other
1523 value. Set errno instead.
1524 (check_errno): Reset h_errno.
1525 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1526 (sys_gethostname, sys_getservbyname, sys_getpeername)
1527 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1528 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1529 h_errno.
1530 (sys_gethostbyname): Set h_errno only errors detected.
1531
1532 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1533
1534 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1535
1536 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1537
1538 * keyboard.c (read_char): Fix calculation of auto-save time out
1539 when auto-save-timeout is less than 4. (Bug#13720)
1540
1541 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
1542 time. Improve diagnostics in DebPrint. (Bug#13546)
1543
1544 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1545 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1546 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1547 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1548 make sure errno is set to an appropriate value. (Bug#13546)
1549 (socket_to_fd): Add assertion against indexing fd_info[] with a
1550 value that is out of bounds.
1551 (sys_accept): If fd is negative, do not set up the child_process
1552 structure for reading.
1553
1554 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1555
1556 * composite.c (fill_gstring_header): Remove useless prototype.
1557 Break long line.
1558 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1559 * print.c (PRINTDECLARE, print_object):
1560 * search.c (compile_pattern, fast_looking_at, search_buffer):
1561 (simple_search, boyer_moore, Freplace_match):
1562 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1563 (get_overlay_arrow_glyph_row, display_mode_element):
1564 (decode_mode_spec_coding, message3):
1565 * xfaces.c (face_at_string_position): Use bool for booleans.
1566 Adjust comments.
1567
1568 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1569
1570 Fix AIX port (Bug#13650).
1571 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1572 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1573 was #undeffed earlier, so it cannot be used as a macro here.
1574 Use the constant and not the macro.
1575
1576 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1577
1578 * w32proc.c (new_child): If no vacant slots are found in
1579 child_procs[], make another pass looking for slots whose process
1580 has exited or died. (Bug#13546)
1581
1582 * w32.c (sys_pipe): When failing due to file descriptors above
1583 MAXDESC, set errno to EMFILE.
1584 (_sys_read_ahead): Update cp->status when failing to read serial
1585 communications input, so that the status doesn't stay at
1586 STATUS_READ_IN_PROGRESS. (Bug#13546)
1587
1588 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1589
1590 * gtkutil.c (tb_size_cb): New function.
1591 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1592
1593 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1594
1595 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1596 an event.
1597
1598 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1599
1600 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1601
1602 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1603
1604 * font.c (font_range): Add pos_byte argument. Adjust comment
1605 and break long line.
1606 * font.h (font_range): Adjust prototype.
1607 * composite.c (autocmp_chars): Pass byte position to font_range.
1608 Break long line. Remove useless prototype and format comment.
1609
1610 2013-02-13 Glenn Morris <rgm@gnu.org>
1611
1612 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1613
1614 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1615
1616 Improve AIX port some more (Bug#13650).
1617 With this, it should be as good as it was in 23.3, though it's
1618 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1619 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1620 * unexaix.c (start_of_text): Remove.
1621 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1622 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1623 (orig_load_scnptr, orig_data_scnptr):
1624 Now off_t, not long, since they are file offsets.
1625 (make_hdr): Use _data, not start_of_data ().
1626 This is the key part of the fix.
1627 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1628 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1629
1630 * pre-crt0.c (data_start): Initialize to 1.
1631 This ports to compilers that optimize the external declaration
1632 'int x = 0;' as if it were 'int x;' to shrink the executable.
1633
1634 Improve AIX port (Bug#13650).
1635 This doesn't fix the bug, but it makes progress: Emacs builds now.
1636 * unexaix.c: Include inttypes.h, stdarg.h.
1637 (report_error, report_error_1): Mark as _Noreturn.
1638 (report_error): Don't report the wrong errno.
1639 (report_error_1): Now varargs. All callers changed.
1640 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1641 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1642 (write_ptr): Use %p to print address rather than %lx and a cast
1643 to unsigned long. Grow buffer a bit, to be safer.
1644
1645 2013-02-13 Eli Zaretskii <eliz@gnu.org>
1646
1647 * bidi.c (bidi_resolve_neutral): After finding the next
1648 non-neutral character, accept NEUTRAL_ON type as well, because
1649 directional control characters, such as LRE and RLE, have their
1650 type converted to that by bidi_resolve_weak. This avoids aborts
1651 when LRE/RLE follows a run of neutrals.
1652 (bidi_move_to_visually_next): Assert that return value of
1653 bidi_peek_at_next_level is non-negative. Negative values will
1654 cause an infloop.
1655
1656 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1657
1658 Minor getenv-related fixes.
1659 * callproc.c (Fcall_process_region) [!DOS_NT]:
1660 Avoid unnecessary duplicate call to getenv.
1661 * callproc.c (init_callproc):
1662 * dispnew.c (init_display):
1663 * sysdep.c (sys_subshell):
1664 Omit unnecessary cast of getenv or egetenv.
1665
1666 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
1667
1668 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1669 Update dependencies.
1670
1671 2013-02-12 Eli Zaretskii <eliz@gnu.org>
1672
1673 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1674 marker's position.
1675 (display_line): Set w->region_showing to the value of
1676 it->region_beg_charpos, not to -1. This fixes redisplay
1677 optimization when cursor is moved up after M->. (Bug#13623)
1678 (Bug#13626)
1679 (try_scrolling): Scroll text up more if point is too close to ZV
1680 and inside the scroll margin. This makes sure point is moved
1681 outside the scroll margin in these cases.
1682
1683 * window.h (struct window): region_showing can no longer be
1684 negative.
1685
1686 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1687
1688 Tune by using memchr and memrchr.
1689 * doc.c (Fsnarf_documentation):
1690 * fileio.c (Fsubstitute_in_file_name):
1691 * search.c (find_newline, scan_newline):
1692 * xdisp.c (pos_visible_p, display_count_lines):
1693 Use memchr and memrchr rather than scanning byte-by-byte.
1694 * search.c (find_newline): Rename from scan_buffer.
1695 Omit first arg TARGET, as it's always '\n'. All callers changed.
1696
1697 Clean up read_key_sequence a tiny bit more.
1698 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1699 (read_key_sequence): Remove unused locals.
1700
1701 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1702
1703 Clean up read_key_sequence a bit; reread active keymaps after first event.
1704 * keyboard.c (read_char, read_char_x_menu_prompt)
1705 (read_char_minibuf_menu_prompt):
1706 Replace nmaps+maps with a single `map' arg.
1707 (follow_key): Operate on a single map.
1708 (active_maps): New function.
1709 (test_undefined): Also return true for nil bindings.
1710 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1711 a single (composed) keymap. Remember `first_event' to choose the right
1712 set of active keymaps. Recompute the set of keymaps after receiving
1713 the first event. Remove GOBBLE_FIRST_EVENT.
1714 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1715 * keyboard.h (read_char): Update declaration.
1716 * lread.c (read_filtered_event): Adjust call to read_char.
1717
1718 2013-02-11 Eli Zaretskii <eliz@gnu.org>
1719
1720 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1721 Don't use the limitation on backwards movement when lines are truncated
1722 in the window. (Bug#13675)
1723
1724 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1725
1726 * marker.c (set_marker_internal): If desired position is passed
1727 as a marker, avoid call to buf_charpos_to_bytepos.
1728 * window.c (Fset_window_point): Omit redundant type checking.
1729 (Fset_window_start): Likewise. Format comment.
1730 (window_scroll_pixel_based): Use set_marker_restricted_both
1731 with character and byte positions obtained from an iterator.
1732 (Fset_window_configuration): Use set_marker_restricted_both.
1733 * xdisp.c (message_dolog): Likewise.
1734
1735 2013-02-10 Eli Zaretskii <eliz@gnu.org>
1736
1737 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1738 When text lines are longer than window's screen lines, don't move back
1739 too far. This speeds up some redisplay operations. (Bug#13675)
1740
1741 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1742
1743 * syntax.c (scan_sexps_forward): Fix byte position calculation
1744 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1745
1746 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1747
1748 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1749 that was not needed.
1750
1751 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1752
1753 Minor hashing refactoring.
1754 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1755 (sxhash_float): Return EMACS_UINT, for consistency with the other
1756 hash functions.
1757 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1758 non-static inline function and therefore can't use static vars.
1759 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1760 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1761 with the other hash functions.
1762
1763 2013-02-09 Eli Zaretskii <eliz@gnu.org>
1764
1765 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1766 XXXXXX part of the temporary file pattern is not downcased even
1767 when w32-downcase-file-names is non-nil. (Bug#13661)
1768
1769 * xdisp.c (decode_mode_spec): Remove handling of %t.
1770
1771 * msdos.c (careadlinkatcwd): Remove.
1772
1773 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1774
1775 * lread.c (skip_dyn_bytes): New function (bug#12598).
1776 (read1): Use it. Use getc instead of READCHAR to read bytes.
1777 (load_each_byte): Remove. Update users.
1778
1779 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1780
1781 * search.c (scan_buffer): Calculate end byte position just once.
1782 (scan_newline): Do not recalculate start_byte.
1783 (search_command): Use eassert.
1784 * syntax.c (struct lisp_parse_state): New member location_byte.
1785 (scan_sexps_forward): Record from_byte and avoid redundant
1786 character to byte position calculation ...
1787 (Fparse_partial_sexp): ... here. Break too long line.
1788
1789 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1790
1791 * lisp.h (make_uninit_vector): New function.
1792 * alloc.c (Fvector, Fmake_byte_code):
1793 * ccl.c (Fregister_ccl_program):
1794 * charset.c (Fdefine_charset_internal, define_charset_internal):
1795 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1796 * composite.c (syms_of_composite):
1797 * font.c (Fquery_font, Ffont_info, syms_of_font):
1798 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1799 * ftfont.c (ftfont_shape_by_flt):
1800 * indent.c (recompute_width_table):
1801 * nsselect.m (clean_local_selection_data):
1802 * syntax.c (init_syntax_once):
1803 * w32unsubscribe.c (uniscribe_shape):
1804 * window.c (Fcurrent_window_configuration):
1805 * xfaces.c (Fx_family_fonts):
1806 * xselect.c (selection_data_to_lisp_data): Use it.
1807
1808 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1809
1810 * coding.c (Fdefine_coding_system_internal): Use AREF where
1811 argument is known to be a vector.
1812 * fns.c (Flocale_info): Likewise for ASET.
1813 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1814 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1815
1816 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1817
1818 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1819 height.
1820
1821 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1822 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1823 updateCollectionBehaviour.
1824
1825 * nsterm.m (NEW_STYLE_FS): Remove.
1826 (ns_last_use_native_fullscreen): New variable.
1827 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1828 (x_set_window_size): Do not take title bar and tool bar into account
1829 if isFullscreen returns YES.
1830 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1831 (check_native_fs): New function.
1832 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1833 (ns_term_init): Remove NEW_STYLE_FS.
1834 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1835 and tool bar if isFullscreen returns NO.
1836 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1837 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1838 with HAVE_NATIVE_FS.
1839 (window:willUseFullScreenPresentationOptions:): New method.
1840 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1841 Hide toolbar if not enabled (Bug#13444).
1842 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1843 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1844 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1845 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1846 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1847 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1848 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1849 (syms_of_nsterm): Add ns-use-native-fullscreen.
1850
1851 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1852
1853 * fileio.c (Qchoose_write_coding_system): Now static.
1854
1855 2013-02-04 Eli Zaretskii <eliz@gnu.org>
1856
1857 * xdisp.c (window_buffer_changed): region_showing can be negative,
1858 which still means region is being displayed.
1859 (redisplay_internal): Resurrect code that forced redisplay of the
1860 whole window when showing region and the mark has changed.
1861 Record the new mark position to allow redisplay optimizations.
1862 (display_line): If it->region_beg_charpos is non-zero, set the
1863 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1864
1865 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1866 not bitfield of 1 bit.
1867
1868 2013-02-03 Daniel Colascione <dancol@dancol.org>
1869
1870 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1871 daemon mode works on cygw32 when Emacs is installed and not just
1872 during development.
1873
1874 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1875
1876 Avoid file time stamp bug on MS-Windows (Bug#13149).
1877 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1878 as FAT32 doesn't update time stamps when truncating them.
1879 Also, check that a file time stamp is not a multiple of 100 ns;
1880 this should catch all instances of the problem on MS-Windows,
1881 as its native file system resolution is 100 ns or worse, and
1882 checking for a non-multiple of 100 ns should impose only a small
1883 overhead on systems with ns resolution.
1884
1885 2013-02-02 Eli Zaretskii <eliz@gnu.org>
1886
1887 Avoid encoding file names on MS-Windows when they need to be run
1888 through dostounix_filename.
1889 * w32.c (normalize_filename): Accept an additional argument
1890 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1891 downcase it even if w32-downcase-file-names is non-nil.
1892 (dostounix_filename): Accept an additional argument MULTIBYTE and
1893 pass it to normalize_filename.
1894 (emacs_root_dir): Adjust.
1895
1896 * msdos.h (dostounix_filename): Adjust prototype.
1897
1898 * w32.h (dostounix_filename): Adjust prototype.
1899
1900 * msdos.c (dostounix_filename): Accept an additional argument and
1901 ignore it.
1902 (init_environment): Adjust callers of dostounix_filename.
1903
1904 * fileio.c (Ffile_name_directory, file_name_as_directory)
1905 (directory_file_name, Fexpand_file_name)
1906 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1907 dostounix_filename.
1908 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1909 non-nil.
1910 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1911 variables, as egetenv is case-insensitive for DOS_NT.
1912
1913 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1914 with an encoded file name.
1915
1916 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1917 Adjust calls to dostounix_filename.
1918
1919 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1920
1921 * unexw32.c (unexec): Adjust call to dostounix_filename.
1922
1923 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1924
1925 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1926 dostounix_filename.
1927
1928 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1929 dostounix_filename.
1930
1931 * callproc.c (Fcall_process): Make sure program name in PATH and
1932 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1933 is passed to exec/spawnve, which fails unless the file-name
1934 encoding is UTF-8.
1935
1936 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1937 even if w32-quote-process-args is nil.
1938
1939 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1940
1941 Fix timestamp bug when write-region appends nothing (Bug#13149).
1942 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1943 the file's time stamp doesn't change if Emacs happens to write nothing
1944 to the file, and on a buggy file system this could cause Emacs to
1945 incorrectly infer that the file system doesn't have the bug.
1946 Avoid this problem by inhibiting the inference in this case.
1947
1948 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1949
1950 * window.h (struct window): Convert base_line_number, base_line_pos
1951 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1952 Convert region_showing member from Lisp_Object to bitfield.
1953 Remove sequence_number member. Adjust comments.
1954 * window.c (sequence_number): Remove.
1955 (make_window): Initialize column_number_displayed.
1956 * print.c (print_object): Follow the printed representation of
1957 frames and print window pointer to distinguish between windows.
1958 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1959 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1960 (wset_column_number_displayed, wset_region_showing): Remove.
1961 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1962 (try_scrolling, try_cursor_movement, redisplay_window)
1963 (try_window_reusing_current_matrix, try_window_id, display_line)
1964 (display_mode_lines, decode_mode_spec): Adjust users.
1965 * .gdbinit (pwinx): Do not print sequence_number.
1966
1967 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1968
1969 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1970 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1971 * dired.c: Include <fcntl.h>.
1972 (open_directory): New function, which uses open and fdopendir
1973 rather than opendir. DOS_NT platforms still use opendir, though.
1974 (directory_files_internal, file_name_completion): Use it.
1975 (file_attributes): New function, with most of the old Ffile_attributes.
1976 (directory_files_internal, Ffile_attributes): Use it.
1977 (file_attributes, file_name_completion_stat): First arg is now fd,
1978 not dir name. All uses changed. Use fstatat rather than lstat +
1979 stat.
1980 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1981 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1982 (emacs_readlinkat): New function, with much of the old
1983 Ffile_symlink_p, but with an fd argument for speed.
1984 It uses readlinkat rather than careadlinkatcwd, so that it
1985 need not assume the working directory.
1986 (Ffile_symlink_p): Use it.
1987 * filelock.c (current_lock_owner): Use emacs_readlinkat
1988 rather than emacs_readlink.
1989 * lisp.h (emacs_readlinkat): New decl.
1990 (READLINK_BUFSIZE, emacs_readlink): Remove.
1991 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1992 (emacs_norealloc_allocator, emacs_readlink): Remove.
1993 This stuff is moved to fileio.c.
1994 * w32.c (fstatat, readlinkat): New functions.
1995 (careadlinkat): Don't check that fd == AT_FDCWD.
1996 (careadlinkatcwd): Remove; no longer needed.
1997
1998 2013-01-31 Glenn Morris <rgm@gnu.org>
1999
2000 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2001 (Fwrite_region): Update for new choose_write_coding_system args.
2002 Move the last piece of choose_write_coding_system here. (Bug#13522)
2003 (syms_of_fileio): Add choose-write-coding-system.
2004
2005 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2006
2007 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2008 (sys_close): Zero out the flags for the file descriptor before
2009 closing it. (Bug#13546)
2010
2011 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2012 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2013 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2014 DBCS. (Bug#13553)
2015
2016 * w32.c (w32_get_long_filename, init_environment, readlink):
2017 Support file names encoded in DBCS codepages.
2018 (readlink): Use the current file-name-coding-system, not the ANSI
2019 codepage, to decode and handle targets of symlinks.
2020
2021 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2022
2023 * w32.c (opendir): Now accepts a 'const char *'.
2024
2025 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2026
2027 Remove obsolete redisplay code. See the discussion at
2028 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2029 * dispnew.c (preemption_period, preemption_next_check): Remove.
2030 (Vredisplay_preemption_period): Likewise.
2031 (update_frame, update_single_window, update_window, update_frame_1):
2032 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2033 used, following the 2012-06-22 change.
2034
2035 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2036
2037 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2038
2039 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2040
2041 * font.c (num_fonts): Remove the leftover from old
2042 debugging code. Adjust comment style here and there.
2043 * insdel.c (insert_1): Remove.
2044 * lisp.h (insert_1): Remove prototype.
2045 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2046
2047 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2048
2049 * w32.c (max_filename_mbslen): New function.
2050 (normalize_filename, readdir): Use it to detect locales where ANSI
2051 encoding of file names uses a double-byte character set (DBCS).
2052 If a DBCS encoding is used, advance by characters using
2053 CharNextExA, instead of incrementing a 'char *' pointer.
2054 Use _mbslwr instead of _strlwr. (Bug#13515)
2055
2056 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2057 request of memory reservation to 1.7GB. (Bug#13065)
2058
2059 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2060
2061 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2062 at check_extra_latin label. (Bug#13505)
2063
2064 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2065
2066 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2067 Avoid redundant calls to strlen.
2068
2069 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2070
2071 Drop async_visible and async_iconified fields of struct frame.
2072 This is possible because async input is gone; for details, see
2073 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2074 * frame.h (struct frame): Remove async_visible and async_iconified
2075 members, convert garbaged to unsigned bitfield. Adjust comments.
2076 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2077 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2078 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2079 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2080 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2081 * w32term.c: Ditto.
2082 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2083 properly. Likewise for obscured.
2084 * xterm.c: Ditto.
2085 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2086 properly.
2087 * nsterm.m: Ditto.
2088 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2089
2090 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2091
2092 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2093 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2094
2095 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2096
2097 * xdisp.c (message2, message2_nolog): Remove functions.
2098 (message3, message3_nolog): Extract nbytes and multibyteness directly
2099 from the string. Change all callers.
2100 (message3_nolog): Don't set message_enable_multibyte since set_message
2101 will reset it anyway.
2102 (message1, message1_nolog): Use message3.
2103 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2104 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2105 (set_message): Drop all but the second arg, which has to be a string.
2106 (set_message_1): Simplify now that we know that a1 is NULL and the
2107 second arg is a string.
2108 * frame.h (struct frame): Remove `message_buf' field.
2109 Use glyphs_initialized_p instead.
2110 (FRAME_MESSAGE_BUF): Remove macro.
2111 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2112 * lisp.h (message2, message2_nolog): Remove declarations.
2113 (message3, message3_nolog): Update declarations.
2114 * keyboard.c (read_char_minibuf_menu_text)
2115 (read_char_minibuf_menu_width): Remove vars.
2116 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2117 to correctly handle multibyte strings.
2118 * frame.c (delete_frame): Don't free message_buf any more.
2119 * editfns.c (message_text, message_length): Remove vars.
2120 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2121 * fileio.c (auto_save_error): Use message3 instead of message2.
2122 * dispnew.c (adjust_frame_message_buffer): Remove function.
2123
2124 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2125
2126 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2127 real estate used for the tool bar and the menu bar.
2128
2129 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2130
2131 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2132 hidden buffer is prepared to modification (Bug#13164).
2133
2134 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2135
2136 * window.h (struct window): Change window_end_valid member from
2137 Lisp_Object to a bitfield. Adjust comments.
2138 (wset_window_end_valid): Remove.
2139 * window.c (adjust_window_count): Clear window_end_valid.
2140 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2141 (Fwindow_line_height, set_window_buffer, Frecenter)
2142 (Fsplit_window_internal, Fdelete_other_windows_internal)
2143 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2144 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2145 * xdisp.c (check_window_end, reconsider_clip_changes)
2146 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2147 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2148 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2149
2150 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2151
2152 * xdisp.c (mark_window_display_accurate): Simplify the loop
2153 assuming that the only one of vchild, hchild or buffer window
2154 slots is non-nil. Call mark_window_display_accurate_1 for
2155 the leaf windows only.
2156 (mark_window_display_accurate_1): Always assume leaf window.
2157 Adjust comment.
2158
2159 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2160
2161 * emacs.c (Qkill_emacs_hook): Now static.
2162
2163 * fileio.c (Finsert_file_contents): Simplify.
2164 Remove unnecessary assignments and tests.
2165
2166 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2167
2168 * w32.c (acl_set_file): Don't test for errors unless
2169 set_file_security returns FALSE. Avoids spurious errors when
2170 saving files.
2171
2172 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2173
2174 * fileio.c (Finsert_file_contents): Revert code introduced at
2175 2013-01-18 in favor of the simpler and generally better fix.
2176 Save stack space by removing 'buffer' and reusing 'read_buf'
2177 where appropriate.
2178
2179 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2180
2181 * lisp.h (eabs): Define unconditionally (Bug#13419).
2182 The old "#if !defined (eabs)" was an unnecessary revenant of back
2183 when this macro was called "abs". Document 'eabs' better.
2184
2185 2013-01-19 Glenn Morris <rgm@gnu.org>
2186
2187 * fns.c (Frandom): Doc fix.
2188
2189 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2190
2191 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2192 segfault when there are lots of overlays.
2193
2194 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2195 when there are lots of overlays.
2196 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2197 for the details and a way to reproduce.
2198
2199 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2200
2201 * fileio.c: Use O_APPEND to append.
2202 This corresponds better to the natural interpretation of "append",
2203 and avoids the need to open the output file twice, or to invoke
2204 lseek when APPEND is neither nil nor a number.
2205 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2206 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2207 file possibly twice, and lseeking to its end; this avoids the
2208 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2209 at the same time: the combination is never needed and apparently
2210 it doesn't work with DOS_NT.
2211
2212 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2213 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2214
2215 Allow floating-point file offsets.
2216 Problem reported by Vitalie Spinu in
2217 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2218 * fileio.c (emacs_lseek): Remove.
2219 (file_offset): New function.
2220 (Finsert_file_contents, Fwrite_region): Use it.
2221
2222 2013-01-19 Chong Yidong <cyd@gnu.org>
2223
2224 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2225 aborting on Fsignal (Bug#13289).
2226
2227 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2228
2229 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2230 set_file_security as failure due to insufficient privileges.
2231 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2232 (fstat): Return owner and group like 'stat' and 'lstat' do.
2233
2234 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2235
2236 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2237 The bug was observed on Ubuntu operating inside a virtual machine,
2238 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2239 The workaround introduces a race condition on non-buggy hosts,
2240 but it's an unlikely race and anyway there's a nearly identical
2241 nearby race that can't be fixed.
2242 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2243 New static vars.
2244 (Fwrite_region): Test for file system time stamp bug.
2245 (init_fileio): New function.
2246 * lisp.h (init_fileio): Declare it.
2247 * emacs.c (main): Call it.
2248
2249 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2250 and make it more consistent with other stat-failure diagnostics.
2251
2252 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2253
2254 Fix crash when inserting data from non-regular files.
2255 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2256 for the error description produced by valgrind.
2257 * fileio.c (read_non_regular): Rename to read_contents.
2258 Free Lisp_Save_Value object used to pass parameters.
2259 (read_non_regular_quit): Rename to read_contents_quit.
2260 (Finsert_file_contents): Redesign internal file reading loop to adjust
2261 gap and end positions after each read and so help make_gap to work
2262 properly. Do not signal an I/O error too early and so do not leave
2263 not yet decoded characters in a buffer, which was the reason of
2264 redisplay crash. Use list2 to build return value. Adjust comments.
2265
2266 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2267
2268 Close a race when statting and reading files (Bug#13149).
2269 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2270 This avoids a race if the file is renamed between stat and open.
2271 This race is not the problem originally noted in Bug#13149;
2272 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2273
2274 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2275
2276 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2277 objects, related functions and macros.
2278 (make_save_value): Adjust prototype.
2279 (make_save_pointer): New prototype.
2280 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2281 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2282 * alloc.c (format_save_value): Rename to make_save_value.
2283 (make_save_pointer): New function.
2284 (record_xmalloc): Use make_save_pointer.
2285 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2286 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2287 Change users of make_save_value to make_save_pointer.
2288 Likewise for format_save_value and make_save_value.
2289
2290 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2291
2292 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2293 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2294 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2295 debugging stubs.
2296
2297 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2298
2299 * alloc.c (free_save_value): Now static.
2300
2301 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2302
2303 * keymap.c (map_keymap_internal): Use format_save_value.
2304 (map_keymap_char_table_item): Adjust accordingly.
2305 * fileio.c (non_regular_fd, non_regular_inserted)
2306 (non_regular_nbytes): Remove.
2307 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2308 Use format_save_value to pass parameters to read_non_regular.
2309 (read_non_regular): Use XSAVE_ macros to extract parameters.
2310 Adjust comment.
2311 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2312 format_save_value.
2313 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2314
2315 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2316
2317 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2318 extraction from any Lisp_Save_Value slot. Add type checking.
2319 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2320 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2321 * xselect.c: All users changed.
2322
2323 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2324
2325 Some convenient bits to deal with Lisp_Save_Values.
2326 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2327 (allocate_misc): Remove prototype.
2328 (format_save_value): New prototype.
2329 * alloc.c (allocate_misc): Revert back to static.
2330 (format_save_value): New function to build Lisp_Save_Value
2331 object with the specified internal structure.
2332 (make_save_value): Reimplement using format_save_value.
2333 * editfns.c (save_excursion_save): Use format_save_value.
2334 (save_excursion_restore): Use XSAVE_OBJECT.
2335
2336 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2337
2338 Avoid needless casts with XSAVE_POINTER.
2339 * alloc.c (mark_object) [GC_MARK_STACK]:
2340 * dired.c (directory_files_internal_unwind):
2341 * fileio.c (do_auto_save_unwind):
2342 * gtkutil.c (pop_down_dialog):
2343 * keymap.c (map_keymap_char_table_item):
2344 * lread.c (load_unwind):
2345 * nsmenu.m (pop_down_menu):
2346 * print.c (print_object) [GC_MARK_STACK]:
2347 * xfns.c (clean_up_file_dialog):
2348 * xmenu.c (cleanup_widget_value_tree):
2349 Omit casts between XSAVE_POINTER and a pointer type.
2350
2351 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2352
2353 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2354 * eval.c (eval_sub): Protect `form' from being GCed before its
2355 car and cdr becomes protected with the backtrace entry.
2356
2357 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2358
2359 Make Lisp_Save_Value more versatile storage for up to four objects.
2360 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2361 (struct Lisp_Save_Value): New layout. Adjust comments.
2362 (XSAVE_POINTER): New macro.
2363 (XSAVE_INTEGER): Likewise.
2364 (allocate_misc): Add prototype.
2365 (free_misc): Likewise.
2366 * alloc.c (allocate_misc): Now global.
2367 (free_misc): Likewise. Adjust comment.
2368 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2369 (free_save_value): Likewise.
2370 (mark_object): Likewise.
2371 * editfns.c (save_excursion_save): Pack everything within
2372 Lisp_Save_Value and so avoid xmalloc.
2373 (save_excursion_restore): Adjust to match new layout. Use free_misc
2374 because we do not allocate extra memory any more. Add eassert.
2375 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2376 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2377 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2378 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2379 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2380
2381 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2382
2383 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2384 (nsfont_draw): Remove disabling of LCD smoothing.
2385 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2386 Bug#11484 with LCD smoothing on.
2387
2388 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
2389
2390 Fix SIGDANGER handlers, for AIX (Bug#13408).
2391 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2392 Move handlers here from emacs.c; they were out of place.
2393
2394 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2395
2396 * xterm.c (syms_of_xterm): Adjust documentation for
2397 scroll-bar-adjust-thumb-portion.
2398
2399 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2400
2401 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2402 determine whether scroll bar thumb size should be adjusted or
2403 not. Use variable for MOTIF.
2404
2405 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2406 GTK.
2407
2408 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2409
2410 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2411 event is generated.
2412 (doCommandBySelector:): Set processingCompose to NO.
2413
2414 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2415 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2416 (nsfont_list_family): Add block/unblock_input calls.
2417 (nsfont_open): Move block_input earlier. Add unblock_input before early
2418 return.
2419 (nsfont_draw): Add block/unblock_input calls.
2420
2421 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2422
2423 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2424 for old_charpos and old_bytepos.
2425
2426 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2427
2428 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2429 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2430 Clear tzvalbuf_in_environ if this workaround is in effect.
2431 Problem and fix reported by Kazuhiro Ito.
2432
2433 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2434
2435 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2436 Fix ambiguous doc string cross-reference(s).
2437
2438 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2439 doc string cross-reference(s).
2440
2441 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2442 string cross-reference(s).
2443
2444 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2445
2446 Avoid unnecessary byte position calculation for the gap movement.
2447 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2448 anyway, all of them should use move_gap_both instead.
2449 * lisp.h (move_gap): Remove prototype.
2450 * insdel.c (move_gap): Remove.
2451 (move_gap_both): Add eassert.
2452 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2453 * xml.c (parse_region): Likewise.
2454
2455 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2456
2457 emacsclient -t should not suspend Emacs server (Bug#13387)
2458 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2459 New functions.
2460 * term.c (init_tty): Use them instead of rolling our own code.
2461 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2462 switches from 'signal' to 'pthread_sigmask', which is safer in
2463 multithreaded applications.
2464 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2465 which has already arranged for that.
2466 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2467 This is the main part of the bug fix.
2468
2469 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
2470
2471 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2472 x_last_font_name (Bug#13403).
2473
2474 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2475
2476 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2477 the type of per-buffer values where appropriate.
2478 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2479 predicate, which is how it's really used now. Adjust comment.
2480 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2481 * buffer.c (buffer_slot_type_mismatch): Remove.
2482 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2483 predicate. Adjust comment.
2484 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2485 fill-column, left-margin, tab-width, buffer-saved-size,
2486 left-margin-width, right-margin-width, left-fringe-width,
2487 right-fringe-width, scroll-bar-width and buffer-display-count.
2488 Use Qstringp for default-directory, buffer-file-name,
2489 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2490 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2491 line-spacing.
2492 * data.c (store_symval_forwarding): Adjust to call the predicate.
2493
2494 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
2495
2496 * w32.c (get_name_and_id, acl_set_file):
2497 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2498
2499 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2500
2501 * lisp.h (make_gap_1): New prototype.
2502 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2503 gap size values.
2504 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2505 naming convention.
2506 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2507 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
2508 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2509 (make_gap_1): New function to adjust the gap of any buffer.
2510 * coding.c (coding_alloc_by_making_gap): Use it.
2511 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2512 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2513
2514 2013-01-08 Juri Linkov <juri@jurta.org>
2515
2516 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2517 of (supports :underline (:style wave)). (Bug#13000)
2518
2519 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2520
2521 * undo.c (Fprimitive_undo): Move to simple.el.
2522 (syms_of_undo): Remove declarations for Sprimitive_undo.
2523
2524 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2525
2526 * keyboard.c (echo_add_key): Rename from echo_add_char.
2527
2528 2013-01-06 Chong Yidong <cyd@gnu.org>
2529
2530 * keyboard.c (echo_add_char): New function, factored out from
2531 echo_char. Don't add a space if the previous echo string was
2532 empty (Bug#13255).
2533 (echo_char): Use it.
2534 (read_key_sequence): When echoing mock input, ensure that the
2535 trailing dash is properly added.
2536
2537 2013-01-05 Eli Zaretskii <eliz@gnu.org>
2538
2539 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2540 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
2541 digits for buffer positions, before misalignment starts.
2542 Display "0" for integer "object" field.
2543 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2544 Display the newline glyph more unambiguously.
2545
2546 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2547
2548 * nsterm.m (ns_draw_underwave):
2549 * w32term.c (w32_draw_underwave):
2550 * xterm.c (x_draw_underwave): Make underwave look more triangular
2551 and also degrade gracefully for small fonts. (Bug#13000)
2552
2553 * nsterm.m (ns_draw_text_decoration):
2554 * w32term.c (x_draw_glyph_string):
2555 * xterm.c (x_draw_glyph_string): Don't use previous underline
2556 thickness and position if previous underline type is underwave.
2557
2558 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2559
2560 * fileio.c (Ffile_acl): Undocument return format.
2561
2562 2013-01-02 Glenn Morris <rgm@gnu.org>
2563
2564 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2565
2566 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2567
2568 Simplify via eabs.
2569 * dired.c (file_name_completion):
2570 * doc.c (get_doc_string):
2571 * floatfns.c (round2):
2572 * font.c (font_score, font_delete_unmatched):
2573 * fringe.c (compute_fringe_widths):
2574 * lread.c (read_list):
2575 * minibuf.c (Ftry_completion):
2576 * term.c (tty_ins_del_lines):
2577 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2578 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2579
2580 2012-12-31 Eli Zaretskii <eliz@gnu.org>
2581
2582 * w32.c (unsetenv): Set up the string passed to _putenv
2583 correctly.
2584 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
2585 for the bug this caused.
2586
2587 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2588
2589 * coding.c (Qmac): Now static.
2590
2591 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2592
2593 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2594 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2595 handlebox_widget. Set toolbar_in_hbox to false/true, set
2596 toolbar_is_packed to true.
2597 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2598 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2599 Show all on TOOLBAR_TOP_WIDGET.
2600 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2601 by TOOLBAR_TOP_WIDGET.
2602 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2603 Check toolbar_is_packed.
2604 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2605 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2606 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2607 false.
2608 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2609 (xg_update_menubar): Update title only if
2610 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2611 (xg_update_submenu): Skip tearoff only if
2612 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2613 (xg_initialize): Initialize xg_detached_menus only if
2614 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2615
2616 * xterm.h (struct x_output): Surround handlebox_widget with
2617 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2618 toolbar_in_hbox is bool.
2619
2620 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2621
2622 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2623 (LIBS_GNUSTEP): Define.
2624 (LIBES): Add $(LIBS_GNUSTEP).
2625 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2626
2627 2012-12-30 Eli Zaretskii <eliz@gnu.org>
2628
2629 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2630 continuation glyph on a TTY with an indication of an empty line.
2631 (Bug#13277)
2632
2633 2012-12-29 Eli Zaretskii <eliz@gnu.org>
2634
2635 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2636 file's SELinux context or ACLs successfully set, nil otherwise.
2637 (Bug#13298)
2638 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
2639
2640 * w32proc.c (reader_thread): Avoid passing NULL handles to
2641 SetEvent and WaitForSingleObject.
2642
2643 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2644
2645 Port EXTERNALLY_VISIBLE to Clang 3.2.
2646 * conf_post.h (__has_attribute): New macro.
2647 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2648
2649 2012-12-27 Glenn Morris <rgm@gnu.org>
2650
2651 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2652 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2653
2654 2012-12-27 Eli Zaretskii <eliz@gnu.org>
2655
2656 * fileio.c (file_name_as_directory, directory_file_name):
2657 Accept an additional argument MULTIBYTE to indicate whether the input C
2658 came from a multibyte or a unibyte Lisp string; all callers
2659 adjusted. Don't assume the input string is always multibyte.
2660 (Bug#13262)
2661 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2662 don't ENCODE_FILE them, and return a unibyte string if the input
2663 was unibyte.
2664 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2665 don't assume the input strings will always be multibyte. If the
2666 input strings are multibyte, decode strings obtained from C
2667 library functions.
2668
2669 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2670
2671 * lisp.h (toplevel): Add two notices to the comment about
2672 defining a new Lisp data type.
2673 * print.c (print_object): If Lisp_Save_Value object's pointer
2674 is the address of a memory area containing Lisp_Objects, try
2675 to print them.
2676 * alloc.c (valid_lisp_object_p): Adjust comment.
2677
2678 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2679
2680 * keyboard.c (record_asynch_buffer_change): Initialize an event
2681 only if it's really needed.
2682 * frame.h (enum output_method): Remove output_mac member since
2683 it's a leftover from the deleted code.
2684 * frame.c (Fframep): Adjust user here ...
2685 * terminal.c (Fterminal_live_p): ... and here.
2686 * coding.c (Qmac): Now here because it's only used to denote
2687 end-of-line encoding type.
2688 (syms_of_coding): DEFSYM it.
2689 * frame.h (Qmac): Remove duplicated declaration.
2690
2691 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2692
2693 * window.c (select_window_1): Now static, since it's used only here.
2694
2695 2012-12-25 Eli Zaretskii <eliz@gnu.org>
2696
2697 * window.c (window_body_cols): Subtract display margins from the
2698 window body width on TTYs as well. See
2699 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2700 for the original report.
2701
2702 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2703
2704 * xdisp.c (redisplay_window): Remove inner local variable
2705 because the outer shadowed one has the same meaning.
2706 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2707 set but never used.
2708 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2709 (xg_create_tool_bar): Adjust users.
2710
2711 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2712
2713 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2714 * buffer.c (Fget_buffer_create): Use it to set compact field of
2715 struct buffer_text to avoid accessing an uninitialized value
2716 when compact_buffer is called for the first time.
2717 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2718 (Fset_buffer_modified_p): Use buffer_window_count to check
2719 whether the buffer is displayed in some window.
2720 * xdisp.c (message_dolog): Likewise.
2721
2722 2012-12-23 Eli Zaretskii <eliz@gnu.org>
2723
2724 * w32.c (acl_set_file): If setting the file security descriptor
2725 fails, and the new DACL is identical to the existing one, silently
2726 return success. This fixes problems for users backing up their
2727 own files without having the necessary privileges for setting
2728 security descriptors.
2729
2730 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2731 values.
2732 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2733 after WaitForSingleObject returns normally. This expedites reader
2734 thread shutdown when delete_child triggers it.
2735 (reap_subprocess): More accurate commentary for why we call
2736 delete_child only when cp->fd is negative.
2737
2738 * w32.c (sys_close): Do not call delete_child on a subprocess
2739 whose handle is not yet closed. Instead, set its file descriptor
2740 to a negative value, so that reap_subprocess will call
2741 delete_child on that subprocess when its SIGCHLD arrives.
2742 This avoids closing handles used for communications between sys_select
2743 and reader_thread, which doesn't give sys_select a chance to
2744 notice that the process exited and invoke the SIGCHLD handler for
2745 it.
2746
2747 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2748
2749 * nsfns.m (Fns_do_applescript): Run event loop until script has
2750 been executed (Bug#12969).
2751 (ns_run_ascript): Chech as_script for nil, set to nil after
2752 executing script.
2753
2754 2012-12-22 Martin Rudalics <rudalics@gmx.at>
2755
2756 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2757
2758 2012-12-22 Eli Zaretskii <eliz@gnu.org>
2759
2760 * w32term.c (w32fullscreen_hook): New function.
2761 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2762
2763 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2764
2765 * fileio.c (Finsert_file_contents): Doc fix.
2766
2767 * w32proc.c (new_child, delete_child, find_child_pid): For a
2768 subprocess, consider its slot being in use as long as its process
2769 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2770 slot when a new process is started immediately after killing
2771 another one, without waiting enough time for the first process to
2772 be reaped and resources allocated for it be orderly freed.
2773 (Bug#13086)
2774 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2775
2776 2012-12-21 Chong Yidong <cyd@gnu.org>
2777
2778 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2779
2780 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2781
2782 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2783
2784 * w32.c (get_name_and_id): Always pass NULL as the first argument
2785 of lookup_account_sid. Avoids crashes with UNC file names that
2786 refer to DFS domains, not to specific machine names. (Bug#12621)
2787 Remove now unused argument FNAME; all callers changed.
2788 (get_file_owner_and_group): Remove now unused argument FNAME; all
2789 callers changed.
2790
2791 2012-12-21 Chong Yidong <cyd@gnu.org>
2792
2793 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2794 error for invalid chars, don't check for a nil return value.
2795
2796 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2797
2798 Avoid calls to CHAR_TO_BYTE if byte position is known.
2799 * editfns.c (make_buffer_string_both): Use move_gap_both.
2800 (Fbuffer_string): Use make_buffer_string_both.
2801 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2802 Adjust comment.
2803 (buf_bytepos_to_charpos): Likewise.
2804 (charpos_to_bytepos): Remove.
2805 * fileio.c (Finsert_file_contents): Use move_gap_both.
2806 * search.c (Freplace_match): Likewise.
2807 * process.c (process_send_region): Likewise. Use convenient
2808 names for byte positions.
2809 * lisp.h (charpos_to_bytepos): Remove prototype.
2810 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2811 * insdel.c (move_gap): Likewise.
2812
2813 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2814
2815 * xdisp.c (redisplay_internal): Remove now-unused local.
2816
2817 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2818
2819 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2820 (redisplay_internal): Don't bother selecting the frame to get the
2821 proper value of frame-local variables (bug#13225).
2822
2823 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2824
2825 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2826 Rename 4th argument since it may be buffer or string. Adjust comment.
2827 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2828
2829 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2830
2831 * coding.c (Fdetect_coding_region): Do not check start and end with
2832 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2833 (code_convert_region): Likewise.
2834
2835 2012-12-18 Eli Zaretskii <eliz@gnu.org>
2836
2837 * w32.c (acl_get_file, acl_set_file): Run the file name through
2838 map_w32_filename, and resolve any symlinks in the file name, like
2839 Posix platforms do.
2840 (acl_set_file): Call revert_to_self, if any privileges were
2841 enabled.
2842
2843 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
2844
2845 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2846 ($(BLD)/w32.$(O)): Update dependencies.
2847
2848 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2849
2850 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2851 propagate redisplay's scrolling (if any) to the right window.
2852 (redisplay_internal): Use ensure_selected_frame.
2853 (display_mode_lines): Complete last fix.
2854 * window.c (select_window_1): New func, extracted from select_window.
2855 (select_window): Use it.
2856 * window.h (select_window_1): Declare.
2857
2858 2012-12-17 Eli Zaretskii <eliz@gnu.org>
2859
2860 Emulate Posix ACL APIs on MS-Windows.
2861 * w32.c: Include sddl.h and sys/acl.h.
2862 (SDDL_REVISION_1): Define if not already defined.
2863 (g_b_init_get_security_descriptor_dacl)
2864 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2865 (g_b_init_is_valid_security_descriptor)
2866 (g_b_init_set_file_security): New static flags.
2867 (globals_of_w32): Initialize them to zero.
2868 (SetFileSecurity_Name): New string constant.
2869 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2870 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2871 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2872 (IsValidSecurityDescriptor_Proc): New typedefs.
2873 (get_file_security, get_security_descriptor_owner)
2874 (get_security_descriptor_group): Set errno to ENOTSUP.
2875 (set_file_security, get_security_descriptor_dacl)
2876 (is_valid_security_descriptor, convert_sd_to_sddl)
2877 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2878 (acl_free, acl_get_file, acl_set_file): New functions.
2879
2880 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2881
2882 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2883
2884 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2885 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2886 for some of that bug's symptoms can now cause Emacs to abort.
2887 Remove the workaround.
2888 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2889 The bug that caused SIGCHLD to get lost has been fixed, and the
2890 workaround for it can now cause Emacs to abort.
2891
2892 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2893
2894 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2895 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2896 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2897
2898 2012-12-16 Romain Francoise <romain@orebokech.com>
2899
2900 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2901 (Fcopy_file): Change last arg to `preserve_extended_attributes'
2902 and copy ACL entries of file in addition to SELinux context if set.
2903 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2904
2905 * Makefile.in (LIBACL_LIBS): New macro.
2906 (LIBES): Use it.
2907
2908 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2909
2910 * fileio.c (internal_delete_file): Use bool for boolean.
2911
2912 2012-12-15 Eli Zaretskii <eliz@gnu.org>
2913
2914 Fix bug #13079 on MS-Windows with temp files not being deleted.
2915 * w32.h (_child_process): New members input_file and
2916 pending_deletion.
2917 (register_child): First argument is now pid_t.
2918 (record_infile, record_pending_deletion): New prototypes.
2919
2920 * w32proc.c (new_child): Initialize input_file and
2921 pending_deletion members of the child.
2922 (delete_child): Delete the child's temporary input file, if any,
2923 that is pending deletion.
2924 (register_child): First argument is now pid_t.
2925 (record_infile, record_pending_deletion): New functions.
2926 (reap_subprocess): Fix a typo in DebPrint string.
2927 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2928
2929 * fileio.c (internal_delete_file): Return an int again: non-zero
2930 if delete-file succeeds, zero otherwise.
2931
2932 * lisp.h (internal_delete_file): Adjust prototype.
2933
2934 * callproc.c (Fcall_process): Don't overwrite infile with result
2935 of DECODE_FILE.
2936 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2937 asynchronous subprocess, record the name of the input file name,
2938 if any.
2939 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2940 delete the file, record it as pending deletion when the subprocess
2941 exits.
2942
2943 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2944
2945 * editfns.c [HAVE_PWD_H]: Include grp.h.
2946
2947 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2948
2949 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2950
2951 Fix permissions bugs with setgid directories etc. (Bug#13125)
2952 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2953 to mark it as a placeholder. The old value was often wrong.
2954 The only user of this attribute has been changed to use
2955 file-ownership-preserved-p instead, with its new group arg.
2956 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2957
2958 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2959
2960 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2961 Keep selected_window and selected_frame in sync.
2962
2963 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2964
2965 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2966 try to get accurate owner and group information from NT file
2967 security APIs. This is to make most callers of 'stat' and
2968 'lstat', which don't need that information, much faster.
2969
2970 * dired.c (Ffile_attributes) [WINDOWSNT]:
2971 Set w32_stat_get_owner_group to a non-zero value, to request accurate
2972 owner and group information from 'lstat'.
2973
2974 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2975
2976 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2977 as that confuses set-auto-coding, so insist on the head-read
2978 returning the full 1024 bytes. Let lseek compute the tail offset;
2979 less work for us. Do not ignore I/O errors when reading the tail.
2980
2981 * xdisp.c: Minor style fixes.
2982 (init_iterator): Hoist assignment out of if-expression.
2983 (markpos_of_region): Callers now test for sign, not for -1.
2984
2985 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2986
2987 Minor redisplay optimization when the region length is zero.
2988 * xdisp.c (markpos_of_region): New function.
2989 (init_iterator): Do not highlight the region of zero length.
2990 (redisplay_window): Check whether the region is of non-zero length.
2991 (try_cursor_movement): Allow if the region length is zero.
2992 (try_window_reusing_current_matrix, try_window_id): Likewise.
2993
2994 2012-12-13 Eli Zaretskii <eliz@gnu.org>
2995
2996 * search.c (search_buffer): Check the inverse translations of each
2997 character in pattern when the buffer being searched is unibyte.
2998 (Bug#13084)
2999
3000 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3001
3002 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3003 files, fixing a regression from 24.2.
3004 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3005
3006 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3007
3008 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3009 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3010 Remove unnecessary S_ISLNK test, as (contra the comments) this
3011 function can't copy symlinks. Improve quality of error message
3012 when attempting to copy files that are neither regular files nor
3013 directories.
3014
3015 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3016
3017 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3018 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3019 * window.c (Frecenter):
3020 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3021 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3022
3023 2012-12-12 Daniel Colascione <dancol@dancol.org>
3024
3025 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3026 the dumped Emacs is not a sparse file, greatly improving Cygwin
3027 "make bootstrap" performance.
3028
3029 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3030
3031 * inotify.c (inotify_callback): Generate an Emacs event for every
3032 incoming inotify event.
3033
3034 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3035
3036 * xdisp.c (handle_face_prop): Fix logic of computing
3037 it->start_of_box_run_p.
3038 (append_space_for_newline): If the glyph row is R2L, reset the
3039 iterator's end_of_box_run_p flag before prepending the space glyph.
3040 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3041 iterator's start_of_box_run_p flag before prepending the stretch.
3042 (append_glyph, produce_image_glyph, append_composite_glyph)
3043 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3044 left_box_line_p and right_box_line_p flags of the glyph for R2L
3045 glyph rows. (Bug#13011)
3046
3047 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3048
3049 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3050 if changed buffer is not shown in a window.
3051 * insdel.c (prepare_to_modify_buffer): Likewise.
3052 * window.c (replace_buffer_in_windows_safely): Do nothing
3053 if buffer is not shown in a window.
3054 (Fforce_window_update): Likewise if string or buffer argument
3055 is passed.
3056
3057 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3058
3059 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3060 encoded_file_name, which is what it is.
3061
3062 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3063
3064 Consistently use marker_position and marker_byte_position.
3065 * fringe.c (Ffringe_bitmaps_at_pos):
3066 * indent.c (Fvertical_motion):
3067 * insdel.c (prepare_to_modify_buffer):
3068 * keyboard.c (make_lispy_position):
3069 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3070 (window_scroll_pixel_based, displayed_window_lines)
3071 (Fset_window_configuration):
3072 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3073 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3074 Replace direct access to marker fields with calls
3075 to marker_position and/or marker_byte_position.
3076
3077 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3078
3079 * makefile.w32-in (SIG2STR_H): New macro.
3080 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3081 ($(BLD)/w32notify.$(O)): Update dependencies.
3082
3083 2012-12-10 Daniel Colascione <dancol@dancol.org>
3084
3085 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3086 Windows file notification functionality unless WINDOWSNT.
3087
3088 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3089 declarations.
3090
3091 * w32fns.c (cache_system_info): Initialize the global hinst
3092 variable here so various initialization calls DTRT.
3093
3094 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3095 (hinst): Remove unneeded extern declaration.
3096 (_start): Remove initialization of above variables; remove
3097 initialization of hinst, as cache_system_info now does that.
3098
3099 * emacs.c (main): Call cache_system_info early in startup; we
3100 previously weren't calling it in Cygwin builds.
3101
3102 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3103 Teach the autoconf build system how to compile a Windows resource file
3104 and link it to Emacs.
3105
3106 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3107
3108 Per-buffer window counters.
3109 * buffer.h (struct buffer): New member window_count.
3110 (buffer_window_count): New function.
3111 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3112 Initialize window_count.
3113 (Fkill_buffer): Verify window_count for the buffer being killed.
3114 (modify_overlay): Do not force redisplay if buffer is not shown
3115 in any window.
3116 (init_buffer_once): Initialize window_count for buffer_defaults
3117 and buffer_local_symbols.
3118 * window.h (buffer_shared): Remove declaration.
3119 (wset_buffer): Convert from inline ...
3120 * window.c (wset_buffer): ... to an ordinary function.
3121 (adjust_window_count): New function.
3122 (make_parent_window): Use it.
3123 * xdisp.c (buffer_shared): Remove.
3124 (redisplay_internal, redisplay_window): Adjust users.
3125 (buffer_shared_and_changed): Use per-buffer window counter.
3126
3127 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3128
3129 Support for filesystem notifications on MS-Windows.
3130 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3131 and this is a TTY frame, signal the caller that keyboard input is
3132 available.
3133
3134 * w32xfns.c (drain_message_queue): Now returns an int: an
3135 indication whether any WM_EMACS_FILENOTIFY messages were found in
3136 the queue.
3137
3138 * w32inevt.c (handle_file_notifications): New function.
3139 (w32_console_read_socket): Call it to process file notifications.
3140
3141 * w32console.c (initialize_w32_display): Record the main thread ID
3142 in dwMainThreadId.
3143
3144 * deps.mk (inotify.o): New dependency list.
3145
3146 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3147
3148 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3149 (WM_EMACS_END): Bump value by 1.
3150 (notification_buffer_in_use, file_notifications)
3151 (notifications_size, notifications_desc): Declare.
3152 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3153 Add prototypes.
3154
3155 * w32term.c (lispy_file_action, queue_notifications): New functions.
3156 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3157 <Qrenamed_to>: New symbols.
3158 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3159
3160 * w32notify.c: New file, implements file event notifications for
3161 MS-Windows.
3162
3163 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3164 by posting it to the w32_read_socket queue.
3165
3166 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3167
3168 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3169 (GLOBAL_SOURCES): Add w32notify.c
3170 ($(BLD)/w32notify.$(O)): New set of dependencies.
3171
3172 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3173
3174 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3175 Handle FILE_NOTIFY_EVENT.
3176 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3177 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3178 w32notify-handle-event by default.
3179
3180 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3181 syms_of_w32notify.
3182
3183 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3184
3185 Support for filesystem notifications on GNU/Linux via inotify.
3186 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3187
3188 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3189
3190 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3191 (syms_of_keyboard): DEFSYM it.
3192 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3193 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3194 Qfile_inotify events.
3195 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3196 special-event-map to inotify-handle-event.
3197
3198 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3199
3200 * Makefile.in (base_obj): Add inotify.o.
3201
3202 * inotify.c: New file.
3203
3204 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3205
3206 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3207
3208 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3209
3210 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3211 DWORD_PTR, for compatibility with 64-bit builds.
3212
3213 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3214 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3215 (system_process_attributes): Use SIZE_T rather than DWORD, for
3216 compatibility with 64-bit builds.
3217
3218 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3219
3220 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3221
3222 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3223
3224 * indent.c (Fvertical_motion): If a display string will be
3225 displayed on the left or the right margin, don't consider it as a
3226 factor in cursor positioning. (Bug#13108)
3227
3228 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3229
3230 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3231
3232 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3233
3234 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3235 for string length.
3236
3237 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3238
3239 * w32.c (unsetenv): Return 0 if the input string is too long.
3240
3241 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3242
3243 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3244 * alloc.c (xputenv): New function.
3245 * dbusbind.c (Fdbus_init_bus):
3246 * emacs.c (main):
3247 * xterm.c (x_term_init):
3248 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3249 * editfns.c (initial_tz): Move static var decl up.
3250 (tzvalbuf_in_environ): New static var.
3251 (init_editfns): Initialize these two static vars.
3252 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3253 Save old TZ value on stack, if it's small.
3254 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3255 instead, use xputenv+unsetenv to set and restore TZ.
3256 (environbuf): Remove static var. All uses removed.
3257 (Fset_time_zone_rule): Do not save TZ and environ;
3258 no longer needed here.
3259 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3260 Move to inside set_time_zone_rule; they don't need file scope any more.
3261 (set_time_zone_rule): Maintain the TZ=value string separately.
3262 (syms_of_editfns): Don't initialize initial_tz;
3263 init_editfns now does it.
3264 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3265 * lisp.h (xputenv): New decl.
3266
3267 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3268
3269 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3270
3271 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3272
3273 * w32.c (unsetenv, sys_putenv): New functions.
3274
3275 2012-12-08 Chong Yidong <cyd@gnu.org>
3276
3277 * editfns.c (Finsert_char): Make the error message more
3278 informative (Bug#12992).
3279
3280 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 Simplify get_lim_data.
3283 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3284 Remove USG and vlimit methods; no longer used these days.
3285 Add #error catchall just in case.
3286
3287 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3288 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3289 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3290 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3291 (deleted_pid_list, Fdelete_process, create_process)
3292 (record_child_status_change, handle_child_signal, deliver_child_signal)
3293 (init_process_emacs, syms_of_process):
3294 Assume SIGCHLD is defined.
3295 (parse_signal): Remove. All uses removed.
3296 (abbr_to_signal): New static function.
3297 (Fsignal_process): Use it to convert signal names to ints.
3298 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3299 kill (getpgrp (), ...).
3300 (emacs_sigaction_init): Assume SIGCHLD is defined.
3301 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3302 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3303 * syssignal.h (EMACS_KILLPG): Remove.
3304 All uses replaced by 'kill' with a negative pid.
3305 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3306 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3307
3308 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3309
3310 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3311 This will cause a production Emacs to dump core instead of
3312 infinite-looping.
3313
3314 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3315
3316 * frame.c (make_frame): Do not set window's buffer to t.
3317 * window.c (Fsplit_window_internal): Likewise. Previously it was
3318 used to indicate that the window is being set up. Now we use
3319 set_window_buffer for all new windows, so the condition in ...
3320 (Fset_window_buffer): ... is always true and can be removed.
3321
3322 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3323
3324 Convenient macro to check whether the buffer is hidden.
3325 * buffer.h (BUFFER_HIDDEN_P): New macro.
3326 * frame.c (make_frame): Use it. Adjust comment.
3327 * buffer.c (candidate_buffer): New function.
3328 (Fother_buffer, other_buffer_safely): Use it.
3329
3330 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3331
3332 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3333 if the child process is still running. Instead, exit the wait
3334 loop and return zero. (Bug#13086)
3335
3336 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3337
3338 * frame.h (x_char_width, x_char_height): Remove prototypes.
3339 * w32term.h (x_char_width, x_char_height): Likewise.
3340 * xfns.c (x_char_width, x_char_height): Remove.
3341 * w32fns.c (x_char_width, x_char_height): Likewise.
3342 * nsfns.c (x_char_width, x_char_height): Likewise.
3343 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3344 all window frames.
3345 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3346 * keyboard.c (command_loop_1): Remove prototype.
3347 (command_loop_2, top_level_1): Add static to match prototype.
3348
3349 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3350
3351 Fix a recently-introduced delete-process race condition.
3352 * callproc.c, process.h (record_kill_process):
3353 New function, containing part of the old call_process_kill.
3354 (call_process_kill): Use it.
3355 This does not change call_process_kill's behavior.
3356 * process.c (Fdelete_process): Use record_kill_process to fix a
3357 race condition that could cause Emacs to lose track of a child.
3358
3359 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3360
3361 Avoid code duplication between prev_frame and next_frame.
3362 * frame.c (candidate_frame): New function. Add comment.
3363 (prev_frame, next_frame): Use it. Adjust comment.
3364
3365 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3366
3367 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3368 fails, signal an error instead of continuing with an empty
3369 string. (Bug#13079)
3370 Encode expanded temp file pattern before passing it to mkstemp or
3371 mktemp.
3372
3373 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3374 Encode the file name before passing it to dostounix_filename, in
3375 case it will downcase it (under w32-downcase-file-names).
3376 (Bug#12933)
3377
3378 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3379
3380 Minor call-process cleanups.
3381 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3382 at the same time as other platforms, to simplify analysis.
3383 No need for fd0_volatile since we have synch_process_fd.
3384 Avoid needless emacs_close; arg is always negative.
3385
3386 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3387
3388 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3389 processes.
3390
3391 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3392
3393 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3394 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3395 and mouse_face_hidden members to a bitfields.
3396 * frame.h (struct frame): Remove set-but-not-used space_width member.
3397 (FRAME_SPACE_WIDTH): Remove.
3398 * nsterm.m, w32term.c, xterm.c: Adjust users.
3399 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3400 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3401 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3402 members to a bitfields.
3403
3404 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3405
3406 Don't let call-process be a zombie factory (Bug#12980).
3407 Fixing this bug required some cleanup of the signal-handling code.
3408 As a side effect, this change also fixes a longstanding rare race
3409 condition whereby Emacs could mistakenly kill unrelated processes,
3410 and it fixes a bug where a second C-g does not kill a recalcitrant
3411 synchronous process in GNU/Linux and similar platforms.
3412 The patch should also fix the last vestiges of Bug#9488,
3413 a bug which has mostly been fixed on the trunk by other changes.
3414 * callproc.c, process.h (synch_process_alive, synch_process_death)
3415 (synch_process_termsig, sync_process_retcode):
3416 Remove. All uses removed, to simplify analysis and so that
3417 less consing is done inside critical sections.
3418 * callproc.c (call_process_exited): Remove. All uses replaced
3419 with !synch_process_pid.
3420 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3421 These take the role of what used to be in unwind-protect arg.
3422 All uses changed.
3423 (block_child_signal, unblock_child_signal):
3424 New functions, to avoid races that could kill innocent-victim processes.
3425 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3426 (call_process_kill): Record killed processes as deleted, so that
3427 zombies do not clutter up the system. Do this inside a critical
3428 section, to avoid a race that would allow the clutter.
3429 (call_process_cleanup): Fix code so that the second C-g works again
3430 on common platforms such as GNU/Linux.
3431 (Fcall_process): Create the child process in a critical section,
3432 to fix a race condition. If creating an asynchronous process,
3433 record it as deleted so that zombies do not clutter up the system.
3434 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3435 light of these changes. Omit unnecessary call to emacs_close
3436 before failure, as the unwind-protect code does that.
3437 * callproc.c (call_process_cleanup):
3438 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3439 * process.c (record_deleted_pid): New function, containing
3440 code refactored out of Fdelete_process.
3441 (Fdelete_process): Use it.
3442 (process_status_retrieved): Remove. All callers changed to use
3443 child_status_change.
3444 (record_child_status_change): Remove, folding its contents into ...
3445 (handle_child_signal): ... this signal handler. Now, this
3446 function is purely a handler for SIGCHLD, and is not called after
3447 a synchronous waitpid returns; the synchronous code is moved to
3448 wait_for_termination. There is no need to worry about reaping
3449 more than one child now.
3450 * sysdep.c (get_child_status, child_status_changed): New functions.
3451 (wait_for_termination): Now takes int * status and bool
3452 interruptible arguments, too. Do not record child status change;
3453 that's now the caller's responsibility. All callers changed.
3454 Reimplement in terms of get_child_status.
3455 (wait_for_termination_1, interruptible_wait_for_termination):
3456 Remove. All callers changed to use wait_for_termination.
3457 * syswait.h: Include <stdbool.h>, for bool.
3458 (record_child_status_change, interruptible_wait_for_termination):
3459 Remove decls.
3460 (record_deleted_pid, child_status_changed): New decls.
3461 (wait_for_termination): Adjust to API changes noted above.
3462
3463 * bytecode.c, lisp.h (Qbytecode): Remove.
3464 No longer needed after 2012-11-20 interactive-p changes.
3465
3466 2012-12-03 Eli Zaretskii <eliz@gnu.org>
3467
3468 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3469 the scroll margin, move point outside the margin. (Bug#13055)
3470
3471 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3472
3473 * gtkutil.c (my_log_handler): New function.
3474 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3475
3476 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3477
3478 * lisp.h (modify_region): Rename to...
3479 (modify_region_1): ...new prototype.
3480 * textprop.c (modify_region): Now static. Adjust users.
3481 * insdel.c (modify_region): Rename to...
3482 (modify_region_1): ...new function to work with current buffer.
3483 Adjust comment and users. Use true and false for booleans.
3484
3485 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3486
3487 * alloc.c (free_save_value): New function.
3488 (safe_alloca_unwind): Use it.
3489 * lisp.h (free_save_value): New prototype.
3490 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3491 Add comment.
3492 (save_excursion_restore): Adjust to match saved data structure.
3493 Use free_save_value to offload some work from GC. Drop obsolete
3494 #if 0 code.
3495
3496 2012-12-03 Chong Yidong <cyd@gnu.org>
3497
3498 * fileio.c (Vauto_save_list_file_name): Doc fix.
3499
3500 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
3501
3502 * w32fns.c: Remove prototype of atof.
3503 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
3504 builds.
3505 (file_dialog_callback): Make it UINT_PTR.
3506
3507 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3508 with 64-bit builds.
3509
3510 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3511 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3512 defined.
3513
3514 2012-12-03 Glenn Morris <rgm@gnu.org>
3515
3516 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
3517
3518 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3519
3520 Fix xpalloc confusion after memory is exhausted.
3521 * alloc.c (xpalloc): Comment fix.
3522 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3523 and signals an error, do not clear charset_table_size, as
3524 charset_table is still valid.
3525 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3526
3527 Use execve to avoid need to munge environ (Bug#13054).
3528 * callproc.c (Fcall_process):
3529 * process.c (create_process):
3530 Don't save and restore environ; no longer needed.
3531 * callproc.c (child_setup):
3532 Use execve, not execvp, to preserve environ.
3533
3534 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3535
3536 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3537
3538 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3539
3540 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3541 display for sliced images (Bug#10500).
3542
3543 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3544
3545 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
3546
3547 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3548 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3549
3550 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3551
3552 * xdisp.c (window_outdated): Remove eassert since it hits
3553 some suspicious corner cases (see Bug#13007 and Bug#13012).
3554 (mode_line_update_needed): New function.
3555 (redisplay_internal, redisplay_window): Use it.
3556 (ensure_selected_frame): New function.
3557 (redisplay_internal, unwind_redisplay): Use it.
3558 (redisplay_internal): Move comment about buffer_shared...
3559 (buffer_shared_and_changed): ...near to its real use.
3560
3561 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3562
3563 * callproc.c (Fcall_process): Don't misreport vfork failure.
3564
3565 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3566
3567 * callproc.c (Fcall_process): Fix vfork portability problems.
3568 Do not assume that fd[0], count, filefd, and save_environ survive
3569 vfork. Fix bug whereby wrong errno value could be reported for
3570 pipe failure. Some minor cleanups, too, as follows. Move buf and
3571 bufsize to the context where they're needed. Change new_argv to
3572 be of type char **, as this is more convenient and avoids casts.
3573 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3574 Now local constants, not macros.
3575
3576 2012-11-18 Kenichi Handa <handa@gnu.org>
3577
3578 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3579 for the variable "f".
3580
3581 2012-11-13 Kenichi Handa <handa@gnu.org>
3582
3583 * font.c (font_unparse_xlfd): Exclude special characters from the
3584 generating XLFD name.
3585
3586 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3587
3588 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3589 * dired.c (stat_uname, stat_gname):
3590 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3591
3592 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3593 * dired.c (directory_files_internal, file_name_completion):
3594 Assume EAGAIN and EINTR are defined.
3595
3596 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3597 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3598 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3599 * lread.c (readbyte_from_file): Assume EINTR is defined.
3600 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3601 Assume EIO and EAGAIN are defined.
3602 * unexcoff.c (write_segment): Assume EFAULT is defined.
3603
3604 2012-11-27 Eli Zaretskii <eliz@gnu.org>
3605
3606 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3607 (Bug#11964)
3608
3609 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3610 highlighting on the frame was cleared. Prevents assertion
3611 violations when repeatedly clicking on the "Top" link of the
3612 "bread-crumbs" in Info buffers.
3613
3614 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3615
3616 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3617
3618 2012-11-24 Ken Brown <kbrown@cornell.edu>
3619
3620 * keyboard.c (HAVE_MOUSE):
3621 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3622 were always defined.
3623
3624 2012-11-24 Eli Zaretskii <eliz@gnu.org>
3625
3626 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3627 between bpos_covered and bpos_max. This fixes cursor display when
3628 several display strings follow each other.
3629
3630 * .gdbinit (pgx): If the glyph's object is a string, display the
3631 pointer to string data, rather than the value of the string object
3632 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3633
3634 * indent.c (Fvertical_motion): If the starting position is covered
3635 by a display string, return to one position before that, to avoid
3636 overshooting it inside move_it_to. (Bug#12930)
3637
3638 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3639
3640 * frame.h (struct frame): Remove display_preempted member
3641 since all users are dead long ago.
3642 * nsterm.h (struct x_output): Use the only dummy member.
3643 * w32menu.c (pending_menu_activation): Remove since not
3644 really used.
3645 (set_frame_menubar): Adjust user.
3646 * w32term.h (struct x_output): Drop outdated #if 0 code.
3647 (struct w32_output): Use bitfields for explicit_parent,
3648 asked_for_visible and menubar_active members.
3649 Drop unused pending_menu_activation member.
3650 * xterm.h (struct x_output): Drop outdated #if 0 code.
3651 Use bitfields for explicit_parent, asked_for_visible,
3652 has_been_visible and net_wm_state_hidden_seen members.
3653
3654 2012-11-23 Eli Zaretskii <eliz@gnu.org>
3655
3656 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3657 of a literal "/". (Bug#12955)
3658 (gl-stamp): Invoke fc.exe directly, not through cmd.
3659
3660 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3661
3662 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3663 * dired.c: Assume HAVE_DIRENT_H.
3664 (NAMLEN): Remove, replacing with ...
3665 (dirent_namelen): New function. All uses changed. Use the GNU macro
3666 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3667 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3668 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3669 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3670 $(NT_INC)/dirent.h.
3671 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3672 * ndir.h: Rename to ../nt/inc/dirent.h.
3673 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3674 Do not include <dirent.h>; no longer needed.
3675 * w32.c: Include <dirent.h> rather than "ndir.h".
3676
3677 2012-11-23 Chong Yidong <cyd@gnu.org>
3678
3679 * xftfont.c (xftfont_open): Remove duplicate assignment.
3680
3681 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3682
3683 * alloc.c (Fgarbage_collect): Unblock input after clearing
3684 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3685 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3686 * msdos.c (IT_frame_up_to_date): Use it here...
3687 * w32term.c (w32_frame_up_to_date): ...here...
3688 * xterm.c (XTframe_up_to_date): ...and here...
3689 * nsterm.m (ns_frame_up_to_date): ...but not here.
3690 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3691 Adjust users.
3692 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3693 Do not check whether GC is in progress.
3694
3695 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3696
3697 * xdisp.c (window_buffer_changed): New function.
3698 (update_menu_bar, update_tool_bar): Use it to
3699 simplify large 'if' statements.
3700 (redisplay_internal): Generalize commonly used
3701 'tail' and 'frame' local variables.
3702
3703 2012-11-22 Eli Zaretskii <eliz@gnu.org>
3704
3705 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3706 with Windows system header.
3707
3708 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3709
3710 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3711 * alloc.c: Assume unistd.h exists.
3712 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3713 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3714 (getwd) [USG]: Remove; no longer needed.
3715 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3716 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3717 * w32.h (getcwd): Remove decl.
3718
3719 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3720
3721 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3722 Make it set selected_window as well.
3723 (update_tool_bar): Use it.
3724
3725 2012-11-21 Ken Brown <kbrown@cornell.edu>
3726
3727 * emacs.c (main): Set the G_SLICE environment variable for all
3728 Cygwin builds, not just GTK builds. See
3729 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3730
3731 2012-11-21 Eli Zaretskii <eliz@gnu.org>
3732
3733 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3734 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3735 Define for the MSVC compiler.
3736
3737 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
3738
3739 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3740 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3741 dostounix_filename. Prevents crashes down the road, because
3742 dostounix_filename assumes it gets a unibyte string.
3743 Reported by Michel de Ruiter <michel@sentient.nl>, see
3744 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3745
3746 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3747
3748 Conflate Qnil and Qunbound for `symbol-function'.
3749 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3750 * lread.c (init_obarray): Set `function' fields to Qnil.
3751 * eval.c (Fcommandp): Ignore Qunbound.
3752 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3753 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3754 Test NILP rather than Qunbound.
3755 (Ffmakunbound): Set to Qnil.
3756 (Fsymbol_function): Never signal an error.
3757 (Finteractive_form): Ignore Qunbound.
3758
3759 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3760
3761 * eval.c (interactive_p): Remove no-longer-used decl.
3762
3763 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3764
3765 * xdisp.c (buffer_shared): Adjust comment.
3766 (buffer_shared_and_changed): New function.
3767 (prepare_menu_bars, redisplay_internal): Use it to
3768 decide whether all windows or frames should be updated.
3769 (window_outdated): New function.
3770 (text_outside_line_unchanged_p, redisplay_window): Use it.
3771 (redisplay_internal): Likewise. Fix indentation.
3772
3773 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3774
3775 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3776 (syms_of_eval): Remove corresponding defsubr.
3777 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3778
3779 2012-11-19 Daniel Colascione <dancol@dancol.org>
3780
3781 * w32fns.c (Fx_file_dialog):
3782 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3783 cygwin_convert_file_name*.
3784
3785 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3786 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3787
3788 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3789
3790 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3791
3792 2012-11-18 Eli Zaretskii <eliz@gnu.org>
3793
3794 * w32select.c: Include w32common.h before w32term.h, so that
3795 windows.h gets included before w32term.h uses some of its
3796 features, see below.
3797
3798 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3799 New typedefs.
3800 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3801 New prototypes.
3802 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3803
3804 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
3805
3806 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3807 (ns_select): Return at once if events are held (Bug#12834).
3808
3809 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
3810
3811 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3812 Needed following 2012-10-20 change. (Bug#12902)
3813
3814 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
3815
3816 * w32proc.c (waitpid): Remove unused label get_result.
3817
3818 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
3819
3820 * makefile.w32-in (SYSWAIT_H): New macro.
3821 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3822 ($(BLD)/sysdep.$(O)): Update dependencies.
3823
3824 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3825
3826 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3827 * callproc.c (relocate_fd): Assume F_DUPFD.
3828 * emacs.c, term.c (O_RDWR): Remove.
3829 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3830 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3831 * nsterm.m: Assume <fcntl.h> exists.
3832 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3833 (create_pty, Fmake_network_process, server_accept_connection)
3834 (wait_reading_process_output, init_process_emacs):
3835 Assume O_NONBLOCK.
3836 (wait_reading_process_output): Put in a special case for WINDOWSNT
3837 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3838 It's not clear this is needed, but it's a more-conservative change.
3839 (create_process): Assume FD_CLOEXEC.
3840 (create_process, create_pty): Assume O_NOCTTY.
3841 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3842 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3843 Omit if not DOS_NT, since F_GETFL is not defined there.
3844 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3845 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3846 (O_NOCTTY): Remove.
3847 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3848 lack it, since gnulib guarantees this.
3849 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3850
3851 2012-11-17 Eli Zaretskii <eliz@gnu.org>
3852
3853 * w32.c (faccessat): Pretend that directories have the execute bit
3854 set. Emacs expects that, e.g., in files.el:cd-absolute.
3855
3856 * w32proc.c (create_child): Don't clip the PID of the child
3857 process to fit into an Emacs integer, as this is no longer a
3858 restriction.
3859 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3860 reaping only the process specified by PID argument, if that is
3861 positive. Use PID instead of dead_child to know which process to
3862 reap. Wait for the child to die only if WNOHANG is not in
3863 OPTIONS.
3864 (sys_select): Don't set dead_child.
3865
3866 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3867 as it is no longer needed.
3868
3869 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3870 no longer needed.
3871 (record_child_status_change): Remove the setting of
3872 record_at_most_one_child for the !WNOHANG case.
3873
3874 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3875
3876 Fix problems in ns port found by static checking.
3877 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3878 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3879 not to process group.
3880 (ns_select): Use emacs_write, not write, as that's more robust
3881 in the presence of signals.
3882 (fd_handler:): Check for read errors.
3883
3884 2012-11-16 Glenn Morris <rgm@gnu.org>
3885
3886 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3887
3888 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
3889
3890 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3891
3892 2012-11-16 Eli Zaretskii <eliz@gnu.org>
3893
3894 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3895 use the same value of thread handle.
3896 (start_timer_thread): If the timer thread exited (due to error),
3897 clean up by closing the two handles it used. Duplicate the caller
3898 thread's handle here, so it gets duplicated only once, when
3899 launching the timer thread. Set priority of the timer thread, not
3900 the caller thread.
3901 (getitimer): Don't duplicate the caller thread's handle here.
3902 (Bug#12832)
3903
3904 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
3905
3906 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3907 called (Bug#12834).
3908
3909 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3910
3911 Remove no-longer-used pty_max_bytes variable.
3912 * process.c (pty_max_bytes): Remove; unused.
3913 (send_process): Do not set it.
3914
3915 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
3916
3917 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3918 Update dependencies.
3919
3920 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3921
3922 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3923 This follows up on the 2012-09-29 patch that removed indirection
3924 for the 'function' field. Reported by Sergey Vinokurov in
3925 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3926
3927 2012-11-14 Eli Zaretskii <eliz@gnu.org>
3928
3929 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3930 different name, as the MS runtime does not have such a function,
3931 and probably never will.) All callers changed. Ignore DIRFD
3932 value if PATH is an absolute file name, to match Posix spec
3933 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3934 symlinks.
3935
3936 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3937
3938 * xdisp.c (echo_area_display, redisplay_internal):
3939 Omit redundant check whether frame_garbaged is set.
3940
3941 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3942
3943 Use faccessat, not access, when checking file permissions (Bug#12632).
3944 This fixes a bug that has been present in Emacs since its creation.
3945 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3946 which must set some sort of record. (Torek's bug report was against
3947 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3948 same common flaw.) See Torek's Usenet posting
3949 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3950 Posted: Fri Apr 8 14:18:56 1983.
3951 * Makefile.in (LIB_EACCESS): New macro.
3952 (LIBES): Use it.
3953 * callproc.c (init_callproc):
3954 * charset.c (init_charset):
3955 * fileio.c (check_existing, check_executable, check_writable)
3956 (Ffile_readable_p):
3957 * lread.c (openp, load_path_check):
3958 * process.c (allocate_pty):
3959 * xrdb.c (file_p):
3960 Use effective UID when checking permissions, not real UID.
3961 * callproc.c (init_callproc):
3962 * charset.c (init_charset):
3963 * lread.c (load_path_check, init_lread):
3964 Test whether directories are accessible, not merely whether they exist.
3965 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3966 * fileio.c (check_existing, check_executable, check_writable)
3967 (Ffile_readable_p):
3968 Use symbolic names instead of integers for the flags, as they're
3969 portable now.
3970 (check_writable): New arg AMODE. All uses changed.
3971 Set errno on failure.
3972 (Ffile_readable_p): Use faccessat, not stat + open + close.
3973 (Ffile_writable_p): No need to call check_existing + check_writable.
3974 Just call check_writable and then look at errno. This saves a syscall.
3975 dir should never be nil; replace an unnecessary runtime check
3976 with an eassert. When checking the parent directory of a nonexistent
3977 file, check that the directory is searchable as well as writable, as
3978 we can't create files in unsearchable directories.
3979 (file_directory_p): New function, which uses 'stat' on most platforms
3980 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3981 (Ffile_directory_p, Fset_file_times): Use it.
3982 (file_accessible_directory_p): New function, which uses a single
3983 syscall for efficiency.
3984 (Ffile_accessible_directory_p): Use it.
3985 * xrdb.c (file_p): Use file_directory_p.
3986 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3987 * lread.c (openp): When opening a file, use fstat rather than
3988 stat, as that avoids a permissions race. When not opening a file,
3989 use file_directory_p rather than stat.
3990 (dir_warning): First arg is now a usage string, not a format.
3991 Use errno. All uses changed.
3992 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3993 that merely introduced a race.
3994 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3995 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3996 and similarly for the other O_* flags.
3997 * w32.c (sys_faccessat): Rename from sys_access and switch to
3998 faccessat's API. All uses changed.
3999 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4000 (magic_db): Rename from magic_file_p.
4001 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4002 char *, so that we don't have to test for file existence
4003 separately from opening the file for reading. This removes a race
4004 fixes a permission-checking problem, and simplifies the code.
4005 All uses changed.
4006 (file_p): Remove; no longer needed.
4007
4008 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4009
4010 Omit glyphs initialization at startup.
4011 * dispnew.c (glyphs_initialized_initially_p): Remove.
4012 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4013 (Fredraw_frame): Move actual code from here...
4014 (redraw_frame): ...to here. Add eassert. Adjust comment.
4015 (Fredraw_display): Use redraw_frame.
4016 * xdisp.c (clear_garbaged_frames): Likewise.
4017
4018 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4019
4020 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4021 passed to pint2str and pint2hrstr to be at most the size of the
4022 frame's decode_mode_spec_buffer. This avoids crashes with very
4023 large values of FIELD_WIDTH argument to decode_mode_spec.
4024 (Bug#12867)
4025
4026 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4027
4028 Fix a race with verify-visited-file-modtime (Bug#12863).
4029 Since at least 1991 Emacs has ignored an mtime difference of no
4030 more than one second, but my guess is that this was to work around
4031 file system bugs that were fixed long ago. Since the race is
4032 causing problems now, let's remove that code.
4033 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4034 whose time stamp is off by no more than a second. Insist that the
4035 file time stamps match exactly.
4036
4037 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4038
4039 * frame.h (struct frame): Convert external_tool_bar member to
4040 1-bit unsigned bitfield.
4041 * termhooks.h (struct terminal): Remove mouse_moved member since
4042 all users are long dead. Adjust comment on mouse_position_hook.
4043
4044 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4045
4046 Simplify by using FOR_EACH_FRAME here and there.
4047 * frame.c (next_frame, prev_frame, other_visible_frames)
4048 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4049 * w32term.c (x_window_to_scroll_bar): Likewise.
4050 * window.c (window_list): Likewise.
4051 * xdisp.c (x_consider_frame_title): Likewise.
4052 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4053 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4054 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4055 * xmenu.c (menubar_id_to_frame): Likewise.
4056 * xselect.c (frame_for_x_selection): Likewise.
4057 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4058 (x_window_to_menu_bar): Likewise.
4059 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4060
4061 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4062
4063 * data.c (Qdefalias_fset_function): Now static.
4064
4065 Another tweak to vectorlike_header change.
4066 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4067 Remove, and replace all uses with ...
4068 (next_in_free_list, set_next_in_free_list):
4069 New functions, which respect C's aliasing rules better.
4070
4071 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4072
4073 * window.c (list4i): Rename from 'quad'. All uses changed.
4074 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4075
4076 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4077
4078 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4079 warning about mixing declarations and code in ISO C90.
4080
4081 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4082
4083 * window.c (Fsplit_window_internal): Set combination limit of
4084 new parent window to t iff Vwindow_combination_limit is t;
4085 fixing a regression introduced with the change from 2012-09-22.
4086 (Fset_window_combination_limit): Fix doc-string.
4087
4088 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4089
4090 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4091 amount when the scroll margins are too large. When scrolling
4092 backwards in the buffer, give up if cannot reach point or the
4093 scroll margin within a reasonable number of screen lines.
4094 Fixes point position in window under scroll-up/down-aggressively when
4095 point is positioned many lines beyond the window top/bottom.
4096 (Bug#12811)
4097
4098 * ralloc.c (relinquish): If real_morecore fails to return memory
4099 to the system, don't crash; instead, leave the last heap
4100 unchanged and return. (Bug#12774)
4101
4102 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4103
4104 * lisp.h (AUTOLOADP): New macro.
4105 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4106 * data.c (Ffset): Remove special ad-advice-info handling.
4107 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4108 (Fsubr_arity): CSE.
4109 (Finteractive_form): Simplify.
4110 (Fquo): Don't insist on having at least 2 arguments.
4111 (Qdefalias_fset_function): New var.
4112
4113 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4114
4115 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4116
4117 * nsfont.m (Qcondensed, Qexpanded): New variables.
4118 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4119 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4120
4121 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4122
4123 Fix recently introduced crash on MS-Windows (Bug#12839).
4124 * w32term.h (struct scroll_bar): Use convenient header.
4125 (SCROLL_BAR_VEC_SIZE): Remove.
4126 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4127
4128 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4129
4130 Tweak last vectorlike_header change.
4131 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4132 vectorlike object on the free list. This is introduced to avoid
4133 some (but not all) pointer casting and aliasing problems, see
4134 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4135 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4136 objects.
4137 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4138
4139 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4140
4141 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4142 been removed, so remove them here also.
4143
4144 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4145
4146 * doc.c (Fdocumentation): Handle new property
4147 dynamic-docstring-function to replace the old ad-advice-info.
4148
4149 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4150
4151 * fns.c (Qeql, hashtest_eq): Now static.
4152
4153 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4154
4155 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4156 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4157 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4158 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4159
4160 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4161
4162 Use same hash function for hashfn_profiler as for hash_string etc.
4163 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4164 * lisp.h (sxhash_combine): New inline function, with the contents
4165 of the old SXHASH_COMBINE.
4166 * profiler.c (hashfn_profiler): Use it, instead of having a
4167 special hash function containing a comparison that always yields 1.
4168
4169 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4170
4171 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4172 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4173 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4174 Remove unused vars.
4175
4176 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4177
4178 * image.c (xpm_make_color_table_h): Fix compiler error because
4179 make_hash_table changed.
4180
4181 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4182
4183 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4184
4185 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4186
4187 Use ad-hoc comparison function for the profiler's hash-tables.
4188 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4189 (make_log): Use them.
4190 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4191 call Fequal any more.
4192 (Ffunction_equal): New function.
4193 (cmpfn_profiler, hashfn_profiler): New functions.
4194 (syms_of_profiler): Initialize them.
4195 * lisp.h (struct hash_table_test): New struct.
4196 (struct Lisp_Hash_Table): Use it.
4197 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4198 * fns.c (make_hash_table): Take a struct to describe the test.
4199 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4200 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4201 (hash_lookup, hash_remove_from_table): Move assertion checking of
4202 hashfn result here. Check hash-equality before calling cmpfn.
4203 (Fmake_hash_table): Adjust call to make_hash_table.
4204 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4205 (syms_of_fns): Initialize them.
4206 * emacs.c (main): Move syms_of_fns earlier.
4207 * xterm.c (syms_of_xterm):
4208 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4209 * print.c (print_object): Adjust to new hash-table struct.
4210 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4211
4212 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4213
4214 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4215 value of w32-scroll-lock-modifier is neither nil nor one of the
4216 known key modifiers. (Bug#12806)
4217
4218 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4219
4220 Shrink struct vectorlike_header to the only size field.
4221 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4222 Adjust comment.
4223 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4224 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4225 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4226 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4227 information from the vector header. Adjust comment.
4228 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4229 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4230 layout.
4231 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4232 (struct vectorlike_header): Remove next member. Adjust comment.
4233 (struct Lisp_Subr): Add convenient header. Adjust comment.
4234 (allocate_pseudovector): Adjust prototype.
4235 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4236 (sweep_string, lisp_malloc): Remove useless prototypes.
4237 (enum mem_type): Adjust comment.
4238 (NEXT_IN_FREE_LIST): New macro.
4239 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4240 (Fmake_bool_vector): Likewise.
4241 (struct large_vector): New type to represent allocation unit for
4242 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4243 (large_vectors): Change type to struct large_vector.
4244 (allocate_vector_from_block): Simplify.
4245 (PSEUDOVECTOR_NBYTES): Replace with...
4246 (vector_nbytes): ...new function. Adjust users.
4247 (sweep_vectors): Adjust processing of large vectors.
4248 (allocate_vectorlike): Likewise.
4249 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4250 Add easserts. Adjust XSETPVECTYPESIZE usage.
4251 (allocate_buffer): Use BUFFER_PVEC_INIT.
4252 (live_vector_p): Adjust to match large vector.
4253 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4254 * buffer.h (struct buffer): Add next member.
4255 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4256 New macros.
4257 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4258 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4259 (copy_hash_table): Adjust to match vector header change.
4260 * lread.c (defsubr): Use XSETPVECTYPE.
4261 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4262 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4263 (xvecsize): New command.
4264
4265 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4266
4267 * keyboard.c (event_to_kboard): Do not dereference
4268 frame_or_window field of SELECTION_REQUEST_EVENT
4269 and SELECTION_CLEAR_EVENT events (Bug#12814).
4270 * xterm.h (struct selection_input_event): Adjust comment.
4271
4272 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4273
4274 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4275 such as Scroll Lock, if the respective keys are treated as
4276 function keys, not as modifiers. This avoids destroying non-ASCII
4277 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4278
4279 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4280
4281 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4282
4283 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4284
4285 Restore some duplicate definitions (Bug#12814).
4286 This undoes part of the 2012-11-03 changes. Some people build
4287 with plain -g rather than with -g3, and they need the duplicate
4288 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4289 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4290 Define as macros, as well as as enums or as constants.
4291
4292 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4293
4294 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4295 to keypad keys (Bug#12816).
4296
4297 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4298
4299 Minor adjustments of recently-changed frame functions.
4300 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4301 known to be a frame (we're in the FRAMEP branch).
4302 * lisp.h (Qframep): Remove decl. frame.h declares this.
4303 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4304 since they're meant for Lisp fixnum values.
4305
4306 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4307
4308 * window.c (Fwindow_combination_limit): Revert to the only
4309 required argument and adjust docstring as suggested in
4310 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4311 by Martin Rudalics <rudalics@gmx.at>.
4312
4313 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4314
4315 Widely used frame validity and checking functions.
4316 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4317 * frame.c (decode_live_frame, decode_any_frame): New functions.
4318 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4319 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4320 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4321 (Fframe_pointer_visible_p): Use decode_any_frame.
4322 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4323 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4324 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4325 (Fframe_focus): Likewise. Allow zero number of arguments.
4326 Adjust docstring.
4327 (frame_buffer_list, frame_buffer_predicate): Remove.
4328 * lisp.h (frame_buffer_predicate): Remove prototype.
4329 * buffer.c (Fother_buffer): Use decode_any_frame.
4330 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4331 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4332 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4333 (Fclose_font, Ffont_info): Use decode_live_frame.
4334 * fontset.c (check_fontset_name): Likewise.
4335 * terminal.c (Fframe_terminal): Likewise.
4336 * w32fns.c (check_x_frame): Likewise.
4337 * window.c (Fminibuffer_window, Fwindow_at)
4338 (Fcurrent_window_configuration): Likewise.
4339 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4340 Likewise. Allow zero number of arguments. Adjust docstring.
4341 * dispnew.c (Fredraw_frame): Likewise.
4342 * xfaces.c (frame_or_selected_frame): Remove.
4343 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4344 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4345 (Fframe_face_alist): Use decode_live_frame.
4346 * xfns.c (check_x_frame): Likewise.
4347
4348 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4349
4350 * window.c (quad): New function.
4351 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4352 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4353 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4354 (Fwindow_line_height): Use it.
4355 (Fwindow_fringes): Use list3.
4356 (Fwindow_scroll_bars): Use list4.
4357 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4358 (Fwindow_combination_limit): Allow zero number of arguments.
4359
4360 2012-11-05 Eli Zaretskii <eliz@gnu.org>
4361
4362 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4363
4364 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
4365 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
4366 file descriptor 2 for standard error. (Bug#12805)
4367
4368 2012-11-05 Chong Yidong <cyd@gnu.org>
4369
4370 * process.c (wait_reading_process_output): Revert previous change.
4371
4372 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4373
4374 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4375 This removes code that has been obsolete since around 1990.
4376 * callproc.c (Fcall_process):
4377 * emacs.c (main):
4378 * process.c (create_process):
4379 * term.c (dissociate_if_controlling_tty):
4380 Assume setsid exists.
4381 * callproc.c (child_setup): Assume setpgid exists and behaves as
4382 per POSIX.1-1988 or later.
4383 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4384 * emacs.c (shut_down_emacs):
4385 * sysdep.c (sys_suspend, init_foreground_group):
4386 Assume getpgrp behaves as per POSIX.1-1998 or later.
4387 * msdos.c (setpgrp): Remove.
4388 (tcgetpgrp, setpgid, setsid): New functions.
4389 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4390 * term.c (no_controlling_tty): Remove; unused.
4391 * w32proc.c (setpgrp): Remove.
4392 (setsid, tcgetpgrp): New functions.
4393
4394 Simplify by assuming __fpending.
4395 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4396 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4397 Do not assume that __fpending's result fits in int.
4398
4399 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4400
4401 Remove EMACS_OUTQSIZE+sleep hack.
4402 * dispnew.c (update_frame_1): Remove hack for terminals slower
4403 than 2400 bps, which throttled Emacs by having it sleep.
4404 This code hasn't worked since at least 2007, when the multi-tty stuff
4405 was added, and anyway those old terminals are long dead.
4406 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4407 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4408
4409 Fix data-loss with --version (Bug#9574).
4410 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4411 as we can't assume that emacs_strerror is initialized, and strerror
4412 is good enough here.
4413 (main): Invoke atexit earlier, to catch earlier instances of
4414 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4415
4416 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4417
4418 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4419 (keyDown): Remap keypad keys to X11 virtual key codes.
4420
4421 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4422
4423 Fix data-loss with --batch (Bug#9574).
4424 * emacs.c: Include <close-stream.h>.
4425 (close_output_streams): New function.
4426 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4427 and handles errors appropriately.
4428 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4429 does that now.
4430
4431 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4432 The symptom is a diagnostic "GLib-WARNING **: In call to
4433 g_spawn_sync(), exit status of a child process was requested but
4434 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4435 waitpid(), so exit status can't be returned." The diagnostic
4436 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4437 The real bug is a race condition between Emacs and glib: Emacs
4438 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4439 so that glib can't find it. Work around the bug by invoking
4440 waitpid only on subprocesses that Emacs itself creates.
4441 * process.c (create_process, record_child_status_change):
4442 Don't use special value -1 in pid field, as the caller now must
4443 know the pid rather than having the callee infer it.
4444 The inference was sometimes incorrect anyway, due to another race.
4445 (create_process): Set new 'alive' member if child is created.
4446 (process_status_retrieved): New function.
4447 (record_child_status_change): Use it.
4448 Accept negative 1st argument, which means to wait for the
4449 processes that Emacs already knows about. Move special-case code
4450 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4451 processes that have already been waited for, by testing and
4452 clearing new 'alive' member.
4453 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4454 now does this internally.
4455 (handle_child_signal): Let record_child_status_change do all
4456 the work, since we do not want to reap all exited child processes,
4457 only the child processes that Emacs itself created.
4458 * process.h (Lisp_Process): New boolean member 'alive'.
4459
4460 Omit duplicate definitions no longer needed with gcc -g3.
4461 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4462 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4463 Define only as macros. There's no longer any need to also define
4464 these symbols as enums or as constants, since we now assume
4465 gcc -g3 when debugging.
4466
4467 2012-11-03 Eli Zaretskii <eliz@gnu.org>
4468
4469 * lisp.mk: Adjust comments to the fact that term/internal is now
4470 loaded from loadup.el.
4471
4472 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4473 (msdos_fatal_signal): New function.
4474 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4475 its argument list.
4476
4477 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4478 for GCC versions before 4.
4479 (emacs_raise): Define to call msdos_fatal_signal.
4480
4481 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4482 iterator when starting in the middle of a display or overlay
4483 string. (Bug#12745)
4484
4485 2012-11-03 Chong Yidong <cyd@gnu.org>
4486
4487 * process.c (wait_reading_process_output): Clean up the last
4488 change.
4489
4490 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4491
4492 * process.c (wait_reading_process_output): Avoid a race condition
4493 with SIGIO delivery (Bug#11536).
4494
4495 2012-11-03 Chong Yidong <cyd@gnu.org>
4496
4497 * buffer.c (cursor_type): Untabify docstring.
4498
4499 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4500
4501 * frame.h (struct frame): Drop can_have_scroll_bars member
4502 which is meaningless for a long time. Adjust comments.
4503 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4504 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4505
4506 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4507
4508 * window.c (decode_next_window_args): Update window arg after
4509 calling decode_live_window and so fix crash reported at
4510 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4511 by Juanma Barranquero <lekktu@gmail.com>.
4512 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4513 * font.c (Ffont_at): Likewise.
4514
4515 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4516
4517 * widget.c (resize_cb): New function.
4518 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4519 (EmacsFrameResize): Check if all is up to date before changing frame
4520 size.
4521
4522 2012-11-02 Eli Zaretskii <eliz@gnu.org>
4523
4524 Implement backtrace output for fatal errors on MS-Windows.
4525 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4526 (BACKTRACE_LIMIT_MAX): New macro.
4527 (w32_backtrace): New function.
4528 (emacs_abort): Use w32_backtrace when the user chooses not to
4529 attach a debugger. Update the text of the abort dialog.
4530
4531 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4532
4533 Window-related stuff cleanup here and there.
4534 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4535 Use decode_any_window.
4536 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4537 * xdisp.c (Fformat_mode_line): Likewise.
4538 * font.c (Ffont_at): Use decode_live_window.
4539 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4540 * window.c (decode_next_window_args): Likewise.
4541 (decode_any_window): Remove static.
4542 * window.h (decode_any_window): Add prototype.
4543 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4544 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4545 respectively.
4546
4547 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4548
4549 Remove pad from struct input_event.
4550 * termhooks.h (struct input_event): Remove padding field.
4551 Adjust comment.
4552 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4553 member is never cons for a long time. Adjust comment.
4554 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4555 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4556 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4557 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4558
4559 2012-11-01 Eli Zaretskii <eliz@gnu.org>
4560
4561 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4562
4563 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4564
4565 Fix crash when using Emacs as commit editor for git (Bug#12697).
4566 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4567 and it is configured in conf_post.h.
4568 (Fcall_process): Don't invoke both setsid and setpgid; the former
4569 is enough, if it exists.
4570 * callproc.c (Fcall_process, child_setup):
4571 * process.c (create_process): Use setpgid.
4572 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4573 for the real thing.
4574 * dispnew.c (init_display): Initialize the foreground group
4575 if we are running a tty display.
4576 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4577 * lisp.h (init_foreground_group): New decl.
4578 * sysdep.c (inherited_pgroup): New static var.
4579 (init_foreground_group, tcsetpgrp_without_stopping)
4580 (narrow_foreground_group, widen_foreground_group): New functions.
4581 (init_sys_modes): Narrow foreground group.
4582 (reset_sys_modes): Widen foreground group.
4583
4584 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
4585
4586 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4587
4588 2012-10-31 Martin Rudalics <rudalics@gmx.at>
4589
4590 * minibuf.c (read_minibuf): Restore current buffer since
4591 choose_minibuf_frame calling Fset_frame_selected_window may
4592 change it (Bug#12766).
4593
4594 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4595
4596 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4597
4598 2012-10-30 Kenichi Handa <handa@gnu.org>
4599
4600 * font.c (Ffont_at): If WINDOW is specified and it is not
4601 displaying the current buffer, signal an error.
4602
4603 2012-10-29 Daniel Colascione <dancol@dancol.org>
4604
4605 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4606 In preparation for fixing bug#12739, move these functions from
4607 here...
4608
4609 * coding.h, coding.c: ... to here, and compile them only when
4610 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4611 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
4612
4613 2012-10-28 Eli Zaretskii <eliz@gnu.org>
4614
4615 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4616 (timer_loop, getitimer, setitimer): Use it instead of
4617 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4618 'clock'.
4619 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4620 literal 10000.
4621
4622 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4623
4624 * nsterm.m (NO_APPDEFINED_DATA): New define.
4625 (last_appdefined_event_data): New variable
4626 (last_appdefined_event): Remove.
4627 (ns_select): Initialize t from last_appdefined_event_data instead
4628 of [last_appdefined_event data1].
4629 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4630 remove last_appdefined_event (Bug#12698).
4631
4632 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4633
4634 * frame.c (x_set_font): Catch internal error.
4635
4636 2012-10-27 Eli Zaretskii <eliz@gnu.org>
4637
4638 Avoid overflow in w32 implementation of interval timers.
4639 When possible, for ITIMER_PROF count only times the main thread
4640 actually executes.
4641 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
4642 'volatile ULONGLONG' types. All the other data which was
4643 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
4644 (GetThreadTimes_Proc): New typedef.
4645 (w32_get_timer_time): New function, returns a suitable time value
4646 for the timer.
4647 (timer_loop): Enter critical section when accessing ULONGLONG
4648 values of the itimer_data struct, as these accesses are no longer
4649 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4650 Remove unused variable.
4651 (init_timers): Initialize s_pfn_Get_Thread_Times.
4652 (start_timer_thread): Don't assign itimer->caller_thread here.
4653 (getitimer): Assign itimer->caller_thread here.
4654 (setitimer): Always call getitimer to get the value of ticks_now.
4655 (sys_spawnve): Avoid compiler warning about format mismatch.
4656
4657 2012-10-26 Eli Zaretskii <eliz@gnu.org>
4658
4659 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4660 mouse movement events if the menu bar is active. This avoids
4661 producing a busy "hour-glass" cursor by Windows if the mouse
4662 pointer is positioned over a tooltip shown for some menu item.
4663
4664 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4665
4666 Don't assume process IDs fit in int.
4667 * emacs.c (shut_down_emacs) [!DOS_NT]:
4668 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4669 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4670 Use pid_t, not int, to store process IDs, as 'int'
4671 is not wide enough on a few platforms (e.g., AIX and IRIX).
4672
4673 2012-10-23 Kenichi Handa <handa@gnu.org>
4674
4675 The following change is to make face-font-rescale-alist work
4676 correctly for non-ASCII fonts.
4677
4678 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4679 (font_open_for_lface): Handle Vface_font_rescale_alist.
4680
4681 2012-10-23 Chong Yidong <cyd@gnu.org>
4682
4683 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4684
4685 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4686
4687 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4688 for screen font.
4689 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4690
4691 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4692 event (Bug#12681).
4693
4694 2012-10-21 Glenn Morris <rgm@gnu.org>
4695
4696 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4697
4698 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4699
4700 Port to OpenBSD 5.1.
4701 * frame.c (Fmouse_position, Fmouse_pixel_position):
4702 * xdisp.c (produce_stretch_glyph):
4703 Declare local vars only when they're needed.
4704 This is clearer and avoids a warning on OpenBSD about unused vars.
4705 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4706 This is safer, and avoids OpenBSD warnings about unused vars.
4707 * keyboard.c (record_menu_key): Remove unnecessary decl.
4708 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4709 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4710 as our definition clashes with OpenBSD's.
4711 * xfaces.c (load_face_colors, check_lface_attrs)
4712 (get_lface_attributes_no_remap, get_lface_attributes)
4713 (lface_fully_specified_p, x_supports_face_attributes_p)
4714 (tty_supports_face_attributes_p, face_fontset, realize_face)
4715 (realize_x_face, realize_tty_face):
4716 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4717 merely Lisp_Object *. This is more informative and avoids
4718 a warning on OpenBSD about accessing beyond an object's size.
4719
4720 2012-10-20 Chong Yidong <cyd@gnu.org>
4721
4722 * lread.c (Fload): Doc fix (Bug#12592).
4723
4724 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4725
4726 * font.c (Ffont_at): Fix previous change.
4727
4728 2012-10-19 Eli Zaretskii <eliz@gnu.org>
4729
4730 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4731 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
4732 for the reasons.
4733
4734 * alloc.c (NSTATICS): Decrease to 0x800.
4735
4736 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4737
4738 * fns.c (Fnreverse): Include the problem element when signaling an
4739 error (bug#12677).
4740
4741 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4742
4743 * nsterm.m (ns_select): Check writefds before call to
4744 FD_ISSET (Bug#12668).
4745
4746 2012-10-18 Daniel Colascione <dancol@dancol.org>
4747
4748 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4749 (staticpro): If we run out of staticpro slots, die with an
4750 informative error instead of just calling emacs_abort.
4751
4752 2012-10-18 Martin Rudalics <rudalics@gmx.at>
4753
4754 Fix two flaws reported by Dmitry Antipov.
4755 * window.c (Ftemp_output_buffer_show): Remove.
4756 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4757 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4758
4759 2012-10-17 Eli Zaretskii <eliz@gnu.org>
4760
4761 * makefile.w32-in ($(BLD)/w32.$(O)):
4762 ($(BLD)/vm-limit.$(O)):
4763 ($(BLD)/term.$(O)):
4764 ($(BLD)/unexw32.$(O)):
4765 ($(BLD)/fileio.$(O)):
4766 ($(BLD)/dispnew.$(O)): Update dependencies.
4767
4768 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4769 Add prototypes.
4770
4771 * w32proc.c: Include ctype.h.
4772
4773 * w32.h (init_environment, check_windows_init_file)
4774 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4775 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4776 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4777 (sys_link): Add prototypes.
4778
4779 * w32.c: Include w32select.h.
4780 (sys_access, e_malloc, sys_select): Add prototypes.
4781 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4782
4783 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4784
4785 * unexw32.c: Include lisp.h and w32.h.
4786
4787 * term.c [WINDOWSNT]: Include w32term.h.
4788
4789 * process.c [WINDOWSNT]: Add prototype of sys_select.
4790
4791 * fileio.c [WINDOWSNT]: Include w32.h.
4792
4793 * dispnew.c [WINDOWSNT]: Include w32.h.
4794
4795 * cygw32.c (Fcygwin_convert_path_to_windows)
4796 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4797 Lisp_Object values. (Bug#12661)
4798
4799 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4800 to Lisp_Object. (Bug#12661)
4801
4802 2012-10-17 Kenichi Handa <handa@gnu.org>
4803
4804 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4805 invalidate.
4806
4807 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4808
4809 * buffer.c (Fkill_buffer): When unchaining the marker,
4810 reset its buffer pointer to NULL (Bug#12652).
4811
4812 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4813
4814 Do not verify indirection counters of killed buffers (Bug#12579).
4815 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4816 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4817
4818 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4819
4820 * alloc.c (Fmake_byte_code): Fix typo in comment.
4821 * print.c (print_interval): Define as static to match prototype.
4822 * indent.c (disptab_matches_widthtab, recompute_width_table):
4823 Convert to eassert.
4824
4825 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4826
4827 * editfns.c (get_system_name): Remove.
4828 * lisp.h (get_system_name): Remove prototype.
4829 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4830 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4831
4832 2012-10-15 Daniel Colascione <dancol@dancol.org>
4833
4834 * dbusbind.c: Add comment explaining reason for previous change.
4835
4836 2012-10-15 Martin Rudalics <rudalics@gmx.at>
4837
4838 * window.c (Fwindow_end): Rewrite check whether cached position
4839 can be used (Bug#12600).
4840 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4841 Set windows_or_buffers_changed.
4842
4843 2012-10-15 Daniel Colascione <dancol@dancol.org>
4844
4845 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4846 enabled by undefining the symbol "interface", which the platform
4847 headers define to something incompatible.
4848
4849 2012-10-14 Daniel Colascione <dancol@dancol.org>
4850
4851 * image.c (init_tiff_functions, init_imagemagick_functions)
4852 (init_svg_functions): Fix cygw32 build break by using these
4853 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4854
4855 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4856
4857 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4858
4859 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4860
4861 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4862
4863 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4864
4865 * coding.c (detect_coding): Set coding->id before calling
4866 this->detector.
4867
4868 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4869
4870 * fileio.c: Formatting fixes.
4871
4872 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4873
4874 Fix some stat-related races.
4875 * fileio.c (Fwrite_region): Avoid race condition if a file is
4876 removed or renamed by some other process immediately after Emacs
4877 writes it but before Emacs stats it. Do not assume that stat (or
4878 fstat) succeeds.
4879 * image.c (slurp_file): Resolve the file name with fopen + fstat
4880 rather than stat + fopen.
4881 (pbm_read_file) [0]: Remove unused code with stat race.
4882 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4883 Remove ineffective code with stat race.
4884
4885 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4886
4887 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4888
4889 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4890
4891 * nsterm.m (hold_event_q): New static variable.
4892 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4893 ! q_event_ptr.
4894 (hold_event): New function.
4895 (ns_read_socket): If hold_event_q have events, store them and
4896 return (Bug#12384).
4897 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4898 is zero (Bug#12384).
4899
4900 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
4901
4902 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4903
4904 2012-10-12 Eli Zaretskii <eliz@gnu.org>
4905
4906 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4907
4908 * fileio.c (check_existing): New function.
4909 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4910 instead of calling 'stat', when what's needed is to check whether
4911 a file exists. This avoids expensive system calls on MS-Windows.
4912 (Bug#12587)
4913
4914 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
4915
4916 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4917 determine whether a file exists and is not a directory.
4918
4919 * lisp.h (check_existing): Add prototype.
4920
4921 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4922
4923 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4924
4925 2012-10-12 Glenn Morris <rgm@gnu.org>
4926
4927 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4928
4929 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4930
4931 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4932
4933 * eval.c (Fautoload): Remember previous autoload status in load-history.
4934
4935 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4936
4937 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4938 * lread.c (load_each_byte, new_backquote_flag, readchar)
4939 (read_filtered_event, lisp_file_lexically_bound_p)
4940 (safe_to_load_version, Fload, complete_filename_p, openp)
4941 (build_load_history, readevalloop, read_escape, read1)
4942 (string_to_number, read_vector, read_list):
4943 * macros.c (Fstart_kbd_macro):
4944 * marker.c (CONSIDER):
4945 * menu.c (parse_single_submenu, digest_single_submenu)
4946 (find_and_return_menu_selection, Fx_popup_menu):
4947 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4948 (Ftry_completion):
4949 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4950 (ns_menu_show):
4951 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4952 (xmenu_show, xdialog_show):
4953 Use bool for booleans.
4954 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4955 as it's not a predicate. All uses changed. Omit unnecessary
4956 buffer termination.
4957
4958 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4959
4960 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4961 (save_excursion_restore): Do not restore mark if it was not saved.
4962
4963 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4964
4965 * marker.c (cached_modiff): EMACS_INT, not int.
4966
4967 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4968 instead of having a wrong decl.
4969 * nsmenu.m (waiting_for_input): Remove wrong decl.
4970
4971 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4972
4973 keyboard.c, keymap.c: Use bool for booleans.
4974 * dispnew.c (sit_for): Distinguish between 3-way display_option
4975 and boolean do_display.
4976 * keyboard.c (single_kboard, this_command_key_count_reset)
4977 (waiting_for_input, echoing, immediate_quit, input_pending)
4978 (interrupt_input, interrupts_deferred, pop_kboard)
4979 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4980 (command_loop_1, adjust_point_for_property)
4981 (safe_run_hooks_error, input_polling_used, read_char):
4982 (help_char_p, readable_events, kbd_buffer_events_waiting)
4983 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4984 (lucid_event_type_list_p, get_input_pending):
4985 (gobble_input, menu_separator_name_p, menu_bar_item)
4986 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4987 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4988 (keyremap_step, test_undefined, read_key_sequence)
4989 (detect_input_pending, detect_input_pending_ignore_squeezables)
4990 (detect_input_pending_run_timers, requeued_events_pending_p)
4991 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4992 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4993 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4994 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4995 (accessible_keymaps_1, Fkey_description, push_key_description):
4996 (shadow_lookup, struct where_is_internal_data)
4997 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4998 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4999 (describe_map, describe_vector):
5000 * menu.c (single_menu_item):
5001 * nsmenu.m (ns_update_menubar):
5002 * process.c (wait_reading_process_output):
5003 * search.c (scan_buffer, scan_newline):
5004 Use bool for boolean.
5005 * keyboard.c (timers_run, swallow_events)
5006 (detect_input_pending_run_timers):
5007 * process.c (wait_reading_process_output):
5008 Use unsigned for counter where wraparound-on-overflow is desired,
5009 since unsigned is guaranteed to have that behavior and signed is not.
5010 (read_char): Use ptrdiff_t for string length.
5011 (get_input_pending): Remove first argument, since it was always
5012 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5013 and behave as if it had that value. Return new value of
5014 input_pending. All callers changed.
5015 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5016 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5017 a string length.
5018 * keymap.c (push_key_description): Omit last arg, which was always 1.
5019 All callers changed.
5020
5021 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5022
5023 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5024
5025 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5026 ($(BLD)/term.$(O)): Update dependencies.
5027
5028 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5029
5030 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5031 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5032 initializer for PVEC_NORMAL_VECTOR.
5033
5034 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5035
5036 Clean out old termopts cruft.
5037 * termopts.h (flow_control, meta_key): Remove unused decls.
5038 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5039 Don't include termopts.h.
5040
5041 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5042
5043 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5044
5045 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5046
5047 * commands.h (immediate_quit): Remove duplicate decl.
5048
5049 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5050
5051 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5052 caching.
5053 (nsfont_open): Remove setting of Vfonts_in_cache.
5054 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5055
5056 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5057
5058 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5059 match what GetLastError returns. Explain why the function is
5060 needed.
5061
5062 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5063 'is_tooltip_frame', to avoid confusion with its global namesake.
5064
5065 2012-10-08 Daniel Colascione <dancol@dancol.org>
5066
5067 * xdisp.c (start_hourglass): Call w32_note_current_window when
5068 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5069 build that caused Emacs to display the hourglass cursor forever.
5070
5071 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5072 which is broken under remote desktop, calculate the number of
5073 colors available for a display based on the display's number of
5074 planes and number of bits per pixel per plane. (bug#10397).
5075
5076 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5077
5078 * nsfont.m (Vfonts_in_cache): New variable.
5079 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5080 are used. Add cached fonts to Vfonts_in_cache.
5081 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5082
5083 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5084
5085 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5086 in nt/config.nt.
5087 (FONT_H): Define after FRAME_H.
5088 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5089 Update dependencies.
5090
5091 * w32term.c: Remove leftover declaration of keyboard_codepage.
5092
5093 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5094
5095 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5096 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5097 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5098 (GLOBAL_SOURCES): Add cygw32.c.
5099 ($(BLD)/unexw32.$(O)):
5100 ($(BLD)/w32.$(O)):
5101 ($(BLD)/w32console.$(O)):
5102 ($(BLD)/w32fns.$(O)):
5103 ($(BLD)/w32heap.$(O)):
5104 ($(BLD)/w32menu.$(O)):
5105 ($(BLD)/w32proc.$(O)): Add w32common.h.
5106
5107 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5108 'const char *'.
5109 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5110
5111 2012-10-08 Daniel Colascione <dancol@dancol.org>
5112
5113 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5114 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5115 accidental message numbering hole. Change other messages to
5116 match.
5117
5118 * w32select.h (HAVE_W32SELECT): Remove.
5119
5120 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5121 w32common.h instead of w32heap.h.
5122
5123 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5124 (get_allocation_unit, get_processor_type, get_w32_major_version)
5125 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5126 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5127 (OS_NT, os_subtype, cache_system_info): Move declarations to
5128 w32common.
5129
5130 * w32heap.c: Include w32common.h.
5131 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5132 (w32_minor_version, w32_build_number, w32_subtype):
5133 Remove duplicate definitions.
5134
5135 * w32fns.c: Include w32common.h; include w32heap.h only in
5136 WINDOWSNT.
5137
5138 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5139 Use `report_file_error' instead of `error' in order to better
5140 inform users of what went wrong. Increase NTGUI_UNICODE file
5141 dialog box file name length to 32k, the maximum allowed by the NT
5142 kernel.
5143
5144 * w32common.h: New file.
5145 (ROUND_UP, ROUND_DOWN, get_page_size)
5146 (get_allocation_unit, get_processor_type, get_w32_major_version)
5147 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5148 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5149 (OS_NT, os_subtype, cache_system_info): Move here.
5150
5151 * unexw32.c, unexcw.c: Include w32common.h.
5152
5153 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5154 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5155 to call syms_of_w32select.
5156
5157 * cygw32.h: Remove obsolete EXFUN declarations.
5158
5159 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5160
5161 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5162 of w32inevt.o from SOME_MACHINE_OBJECTS.
5163
5164 2012-10-08 Daniel Colascione <dancol@dancol.org>
5165
5166 * image.c: Permanent fix for JPEG compilation issue --- limit
5167 jpeglib `boolean' redefinition to Cygwin builds.
5168
5169 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5170
5171 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5172
5173 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5174 Cygwin.
5175
5176 2012-10-08 Daniel Colascione <dancol@dancol.org>
5177
5178 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5179 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5180 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5181 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5182 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5183 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5184 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5185 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5186 now a supported configuration.
5187
5188 * Makefile.in: consolidate image variables into LIBIMAGE; add
5189 W32_OBJ and W32_LIBS. Compile new files.
5190
5191 * conf_post.h:
5192 (_DebPrint) declare tracing facility for W32 debugging. We need
5193 to unify tracing later.
5194
5195 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5196 unconditional use of W32 Unicode functions. Cygwin runs only on
5197 100% Unicode operating systems.
5198
5199 * cygw32.c: New file. Define Cygwin-specific facilities.
5200 (Fcygwin_convert_path_to_windows)
5201 (Fcygwin_convert_path_from_windows): New user functions for
5202 accessing Cygwin path-munging routines.
5203
5204 * cygw32.h: New file.
5205 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5206 UTF-16LE strings temporarily inside non-Lisp-visible string
5207 objects.
5208
5209 (w32_strerror): Just what it says on the tin.
5210
5211 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5212 also run for Cygwin; both systems have the same problem with using
5213 GUI facilities in a forked child. Also call syms_of_cygw32,
5214 syms_of_w32select in correct places.
5215
5216 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5217 needs fork-then-exec for daemon launching.
5218
5219 * font.h: Include frame.h.
5220
5221 * image.c: Use the image library cache machinery only when we're
5222 compiling for native WINDOWSNT; Cygwin can use shared libraries
5223 like any other Unixlike system.
5224
5225 * keyboard.c: Clarify a comment regarding the input loop.
5226
5227 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5228 functions directly instead of trying to detect at runtime that our
5229 host operating system supports them. We make this change for two
5230 reasons: Cygwin lacks support for the multibyte character
5231 conversion functions used by the legacy menu code, and Cygwin
5232 never needs to rely on non-Unicode APIs.
5233
5234 * unexw32.c (hinst): Declare extern.
5235
5236 * w32.c: Change header order;
5237 (w32_strerror): Move to w32fns.c because we need it for
5238 non-WINDOWSNT builds.
5239
5240 * w32.h: Add #error macro to make sure we don't include w32.h for
5241 Cygwin builds. Remove w32select declarations.
5242
5243 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5244 w32fns.c. w32console.c is WINDOWSNT-only.
5245
5246 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5247 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5248 POSIXy alternative.
5249 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5250 (w32_major_version, w32_minor_version, w32_build_number)
5251 (os_subtype, sound_type): Define here
5252 (w32_defined_color): Make color parameter const for consistency
5253 with other _defined_color functions.
5254 (w32_createwindow): Unconditionally call w32_init_class instead of
5255 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5256 through the code is complex and unnecessary because class
5257 registration is practically free.
5258 (w32_name_of_message): New EMACSDEBUG-only function.
5259 (Fset_message_beep): Move here
5260 (Fx_open_connection): Require that the display name for Windows be
5261 "w32" for consistency, emacsclient disambiguation, and maybe, one
5262 day, multi-window-system support.
5263 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5264 Cygwin files for W32 GUI facilities, since these clearly don't
5265 expect Cygwin names.
5266 (_DebPrint): Define.
5267 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5268 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5269 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5270 (w32_last_error): Remove.
5271
5272 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5273
5274 * w32heap.c (syspage_mask): Declare here.
5275 (cache_system_info): Remove.
5276
5277 * w32inevt.c (faked_key): Define globally, not statically.
5278 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5279 (w32_console_toggle_lock_key): Move to w32fns.c.
5280
5281 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5282
5283 * w32proc.c (_DebPrint): Move to w32fns.c.
5284 * w32select.c: Include string.h, stdio.h for Cygwin.
5285 * w32select.h: New File.
5286
5287 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5288 get_osfhandle.
5289 (w32_message_fd): New variable. Under Cygwin, holds the file
5290 descriptor the system used to tell us about pending thread
5291 messages.
5292
5293 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5294 that prevented compilation under non-WINDOWSNT systems.
5295
5296 (w32_initialize): Open /dev/windows and assign it to
5297 w32_message_fd. Provide w32 feature.
5298
5299 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5300 (WM_EMACS_INPUT_READY): add.
5301 (prepend_msg, w32_message_fd): Declare globally.
5302
5303 * w32xfns.c:
5304 (keyboard_handle): Use only when WINDOWSNT.
5305 (notify_msg_ready): New function. Posts a message to the main
5306 thread's message queue under CYGWIN, which wakes up the main
5307 thread from select(2) by making the /dev/windows file descriptor
5308 ready. Under WINDOWSNT, it sets an event the same way the old
5309 code did.
5310
5311 (post, prepend_msg): Actually call notify_msg_ready instead of
5312 setting the input event directly.
5313
5314 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5315
5316 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5317 but it still has blocs in it, don't return it to the system,
5318 instead of aborting. (Bug#12402)
5319
5320 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5321
5322 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5323
5324 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5325 MAC_OS_X_VERSION_10_6.
5326 (syms_of_nsterm): Remove comment about Panther and above for
5327 ns-antialias-text.
5328 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5329 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5330 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5331
5332 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5333 MAC_OS_X_VERSION_10_4.
5334
5335 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5336 MAC_OS_X_VERSION_10_2.
5337
5338 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5339
5340 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5341 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5342
5343 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5344 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
5345 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5346 Remove ns_in_resize check.
5347 (ns_clear_frame_area): Remove resize handle code.
5348
5349 * nsfns.m (ns_in_resize): Remove.
5350 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5351 Remove ns_in_resize check.
5352
5353 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5354
5355 Improve sys_siglist detection.
5356 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5357 defined as a macro, as is done in Solaris.
5358 (sys_siglist_entries): New macro.
5359 (save_strsignal): Use it.
5360 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5361 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5362
5363 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5364
5365 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5366 fullscreen/Fullscreen.
5367
5368 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5369 tobar_height is new.
5370
5371 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5372 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5373 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5374 (windowDidResize:): Check for correct window if old style fullscreen.
5375 Capitalize word in comment. Remove incorrect comment.
5376 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5377 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5378 error in drawing background.
5379 (toggleFullScreen:): Remove comment. Rearrange calls.
5380 Set toolbar values to zero, save old height in tobar_height.
5381 Restore tool bar height when leaving fullscreen.
5382 (canBecomeMainWindow): New function.
5383
5384 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5385
5386 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5387
5388 2012-10-05 Eli Zaretskii <eliz@gnu.org>
5389
5390 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5391
5392 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
5393 that time stamps of directories could also be changed.
5394 Don't request the too broad GENERIC_WRITE, only the more restrictive
5395 FILE_WRITE_ATTRIBUTES access rights.
5396
5397 * fileio.c (Fset_file_times): Special-case ignoring errors for
5398 directories only on MSDOS, not on MS-Windows.
5399
5400 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
5401
5402 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5403
5404 2012-10-04 Eli Zaretskii <eliz@gnu.org>
5405
5406 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5407 see whether CreateFile failed.
5408
5409 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5410
5411 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5412 to avoid similar races.
5413 * keyboard.c (pending_signals): Now bool, not int.
5414
5415 Port timers to OpenBSD, plus check for timer failures.
5416 OpenBSD problem reported by Han Boetes.
5417 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5418 and/or setitimer.
5419 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5420 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5421 like OpenBSD, which has timer_settime but does not declare it.
5422 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5423 whether to use itimerspec-related primitives. All uses of
5424 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5425
5426 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5427
5428 * profiler.c (handle_profiler_signal): Fix a malloc race
5429 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5430
5431 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5432
5433 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5434
5435 2012-10-02 Eli Zaretskii <eliz@gnu.org>
5436
5437 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5438 consistent with the change in return value of 'safe_strsignal'.
5439
5440 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5441
5442 Prefer plain 'static' to 'static inline' (Bug#12541).
5443 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5444 (bidi_set_sor_type, bidi_push_embedding_level)
5445 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5446 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5447 (bidi_cache_search, bidi_cache_ensure_space)
5448 (bidi_cache_iterator_state, bidi_cache_find)
5449 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5450 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5451 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5452 Now 'static', not 'static inline'.
5453
5454 Count overruns when profiling; change units to ns.
5455 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5456 Give extra weight to samples after overruns, to attempt to count
5457 the time more accurately.
5458 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5459 the underlying primitives nominally do ns.
5460 (Fprofiler_cpu_start): Document the change. Mention that
5461 the sampling intervals are only approximate.
5462
5463 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5464
5465 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5466
5467 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5468 case for the special 0 coding-system.
5469
5470 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5471 (Fmake_overlay): Remove redundant tests.
5472 (fix_start_end_in_overlays): Remove redundant recentering.
5473
5474 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
5475
5476 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5477 Update dependencies.
5478
5479 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5480
5481 Fix a malloc race condition involving strsignal.
5482 A signal can arrive in the middle of a malloc, and Emacs's signal
5483 handler can invoke strsignal, which can invoke malloc, which is
5484 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5485 Fix it by altering the signal handler so that it does not invoke
5486 strsignal.
5487 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5488 * process.c (status_message): Use const pointer, in case strsignal
5489 is #defined to safe_strsignal.
5490 * sysdep.c (sys_siglist, init_signals): Always define and
5491 initialize a substitute sys_siglist if the system does not define
5492 one, even if HAVE_STRSIGNAL.
5493 (safe_strsignal): Rename from strsignal. Always define,
5494 using sys_siglist. Return a const pointer.
5495 * syssignal.h (safe_strsignal): New decl.
5496 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5497
5498 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5499
5500 * w32proc.c (timer_loop): Fix code that waits for timer
5501 expiration, to avoid high CPU usage.
5502
5503 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5504
5505 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5506 (sweep_weak_table): Remove redundant prototypes.
5507
5508 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5509
5510 * emacs.c: Move the inclusion of TERM_HEADER after including
5511 windows.h on WINDOWSNT. This avoids compilation problems with
5512 MSVC.
5513
5514 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5515
5516 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5517 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5518 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5519 as the previous version used 'void *'.
5520
5521 * ralloc.c (ROUNDUP): Fix last change.
5522 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5523 'size_t'.
5524
5525 * w32proc.c <disable_itimers>: New static flag.
5526 (init_timers): Initialize it to zero, after creating the critical
5527 sections used by the timer threads.
5528 (term_timers): Set to 1 before deleting the critical sections.
5529 (getitimer, setitimer): If disable_itimers is non-zero, return an
5530 error indication without doing anything. Reported by Fabrice
5531 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
5532 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5533 return results.
5534 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5535 support timers.
5536
5537 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5538 term_ntproc after all the other bookkeeping, to get timers working
5539 as long as possible.
5540
5541 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5542
5543 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5544 Suggested by Juri Linkov in
5545 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5546
5547 Prefer plain 'static' to 'static inline' (Bug#12541).
5548 With static functions, modern compilers inline pretty well by
5549 themselves; advice from programmers often hurts as much as it helps.
5550 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5551 this change shrinks the text size of the Emacs executable by 1.1%
5552 without affecting CPU significantly in my benchmark.
5553 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5554 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5555 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5556 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5557 (bset_auto_fill_function, bset_auto_save_file_format)
5558 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5559 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5560 (bset_cache_long_line_scans, bset_case_fold_search)
5561 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5562 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5563 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5564 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5565 (bset_header_line_format, bset_indicate_buffer_boundaries)
5566 (bset_indicate_empty_lines, bset_invisibility_spec)
5567 (bset_left_fringe_width, bset_major_mode, bset_mark)
5568 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5569 (bset_name, bset_overwrite_mode, bset_pt_marker)
5570 (bset_right_fringe_width, bset_save_length)
5571 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5572 (bset_scroll_up_aggressively, bset_selective_display)
5573 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5574 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5575 (set_buffer_overlays_after):
5576 * category.c (bset_category_table):
5577 * charset.c (read_hex):
5578 * coding.c (produce_composition, produce_charset)
5579 (handle_composition_annotation, handle_charset_annotation)
5580 (char_encodable_p):
5581 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5582 (assign_row, set_frame_matrix_frame, make_current)
5583 (add_row_entry):
5584 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5585 * fns.c (maybe_resize_hash_table):
5586 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5587 * gmalloc.c (register_heapinfo):
5588 * image.c (lookup_image_type):
5589 * intervals.c (set_interval_object, set_interval_left)
5590 (set_interval_right, copy_interval_parent, rotate_right)
5591 (rotate_left, balance_possible_root_interval):
5592 * keyboard.c (kset_echo_string, kset_kbd_queue)
5593 (kset_keyboard_translate_table, kset_last_prefix_arg)
5594 (kset_last_repeatable_command, kset_local_function_key_map)
5595 (kset_overriding_terminal_local_map, kset_real_last_command)
5596 (kset_system_key_syms, clear_event, set_prop):
5597 * lread.c (digit_to_number):
5598 * marker.c (attach_marker, live_buffer, set_marker_internal):
5599 * nsterm.m (ns_compute_glyph_string_overhangs):
5600 * process.c (pset_buffer, pset_command)
5601 (pset_decode_coding_system, pset_decoding_buf)
5602 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5603 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5604 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5605 * syntax.c (bset_syntax_table, dec_bytepos):
5606 * terminal.c (tset_param_alist):
5607 * textprop.c (interval_has_some_properties)
5608 (interval_has_some_properties_list):
5609 * window.c (wset_combination_limit, wset_dedicated)
5610 (wset_display_table, wset_hchild, wset_left_fringe_width)
5611 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5612 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5613 (wset_right_fringe_width, wset_right_margin_cols)
5614 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5615 (wset_vertical_scroll_bar_type, wset_window_parameters):
5616 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5617 (wset_column_number_displayed, wset_region_showing)
5618 (window_box_edges, run_window_scroll_functions)
5619 (append_glyph_string_lists, prepend_glyph_string_lists)
5620 (append_glyph_string, set_glyph_string_background_width)
5621 (append_glyph, append_composite_glyph)
5622 (take_vertical_position_into_account):
5623 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5624 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5625 (lface_hash, lface_same_font_attributes_p, lookup_face):
5626 * xml.c (libxml2_loaded_p):
5627 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5628 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5629 Now 'static', not 'static inline'.
5630
5631 * bidi.c: Tune.
5632 (bidi_copy_it): Do the whole copy with a single memcpy.
5633 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5634
5635 Revert the FOLLOW-SYMLINKS change for file-attributes.
5636 Doing it right would require several changes to Tramp, and there's
5637 not enough time to get that tested before the freeze today.
5638 * dired.c (directory_files_internal, Ffile_attributes):
5639 Undo last change.
5640
5641 * frame.c (x_report_frame_params): Port better to wider ints.
5642 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5643 or that pointers can be printed in 15 decimal digits.
5644 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5645
5646 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5647
5648 Support x64 build on MS-Windows.
5649 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5650 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5651 compatibility with x64.
5652 (x_get_focus_frame): Add prototype.
5653
5654 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5655 defining an XRectangle structure.
5656
5657 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5658 arithmetics for compatibility with x64.
5659
5660 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5661 compatibility with x64.
5662
5663 * w32heap.h: Adjust prototypes and declarations.
5664
5665 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5666 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5667 DWORD, long, and unsigned long, for compatibility with x64.
5668 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5669 (sbrk): Argument is now of type ptrdiff_t.
5670
5671 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5672 less than 0x0500.
5673 (w32_msg_pump): Use WPARAM type for 'result'.
5674
5675 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5676 architecture.
5677 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5678 compatibility with x64.
5679
5680 * vm-limit.c (lim_data): Now size_t.
5681 (check_memory_limits): Adjust prototypes of real_morecore and
5682 __morecore to receive argument of type ptrdiff_t. Use size_t for
5683 five_percent and data_size.
5684
5685 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5686 variables, for compatibility with x64.
5687 (rva_to_section, offset_to_section, relocate_offset)
5688 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5689 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5690 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5691 for compatibility with x64.
5692
5693 * sysdep.c (STDERR_FILENO): Define if not already defined.
5694
5695 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5696 (__morecore): Argument type is now ptrdiff_t.
5697 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5698 (relinquish): Use ptrdiff_t type for 'excess'.
5699 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5700
5701 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5702 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5703 instead of a literal number.
5704
5705 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5706 (min): Define only if not already defined.
5707
5708 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5709 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5710 hosts.
5711
5712 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5713 'bitmaps' is a pointer.
5714
5715 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5716
5717 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5718
5719 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5720
5721 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5722 * dired.c (directory_files_internal, Ffile_attributes):
5723 New arg follow_symlinks. All uses changed.
5724
5725 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5726
5727 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5728
5729 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5730
5731 Support atimers and CPU profiler via profile.c on MS-Windows.
5732 * w32proc.c (sig_mask, crit_sig): New static variables.
5733 (sys_signal): Support SIGALRM and SIGPROF.
5734 (sigemptyset, sigaddset, sigfillset, sigprocmask)
5735 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
5736 sigfillset, and sigprocmask are no longer no-ops.
5737 (sigismember): New function.
5738 (struct itimer_data): New definition.
5739 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5740 (crit_prof): New static variables.
5741 (MAX_SINGLE_SLEEP): New definition.
5742 (timer_loop, stop_timer_thread, term_timers, init_timers)
5743 (start_timer_thread, getitimer, setitimer): New functions.
5744 (alarm): No longer a no-op, calls setitimer.
5745
5746 * w32.c (term_ntproc): Call term_timers.
5747 (init_ntproc): Make sure all signals are unblocked at startup, to
5748 erase any traces of dumping. Call init_timers.
5749
5750 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5751 Windows-specific code to display the hourglass mouse pointer is no
5752 longer used.
5753 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5754 to hourglass timer expiration.
5755 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5756 Remove, no longer used.
5757 (w32_note_current_window, show_hourglass, hide_hourglass):
5758 New functions, in support of hourglass cursor display similar to other
5759 window systems.
5760 (syms_of_w32fns): Don't initialize hourglass_timer.
5761
5762 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5763 WINDOWSNT as well.
5764 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5765
5766 * w32.h (init_timers, term_timers): Add prototypes.
5767
5768 2012-09-30 Kenichi Handa <handa@gnu.org>
5769
5770 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5771 to the buffer relocation which may be caused by ccl_driver.
5772
5773 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5774
5775 * xfns.c (Fx_file_dialog): Update comment.
5776
5777 * w32fns.c (Fx_file_dialog): Update comment.
5778
5779 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5780 Initialize panel name field if OSX >= 10.6.
5781
5782 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5783
5784 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5785
5786 * nsterm.m (NEW_STYLE_FS): New define.
5787 (ns_fullscreen_hook, windowWillEnterFullScreen)
5788 (windowDidEnterFullScreen, windowWillExitFullScreen)
5789 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5790 (setFSValue): New functions.
5791 (EmacsFSWindow): New implementation.
5792 (canBecomeKeyWindow): New function for EmacsFSWindow.
5793 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5794 (dealloc): Release nonfs_window if in fullscreen.
5795 (updateFrameSize:): Call windowDidMove to update top/left.
5796 (windowWillResize:toSize:): Check if frame is still maximized.
5797 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5798 next_maximized, maximized_width, maximized_height and nonfs_window.
5799 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5800 tbar_height.
5801 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
5802 fullscreen. Set maximized_width/height. Act on next_maximized.
5803
5804 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5805 (EmacsView): Add variables for fullscreen.
5806 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5807 (EmacsFSWindow): New interface for fullscreen.
5808
5809 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
5810
5811 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5812
5813 2012-09-30 Chong Yidong <cyd@gnu.org>
5814
5815 * fns.c (Frandom): Doc fix.
5816
5817 2012-09-30 Martin Rudalics <rudalics@gmx.at>
5818
5819 * window.c (Vwindow_combination_limit): New default value.
5820 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5821
5822 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5823
5824 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5825 Suggested by Eli Zaretskii in
5826 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5827
5828 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5829
5830 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5831 HAVE_TIMER_SETTIME is defined.
5832
5833 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5834
5835 Profiler improvements: more-accurate timers, overflow checks.
5836 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5837 signal.h, setjmp.h. Include systime.h instead.
5838 (saturated_add): New function.
5839 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5840 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5841 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5842 New static vars.
5843 (enum profiler_cpu_running): New enum.
5844 (profiler_cpu_running): Now of that enum type, not bool.
5845 All uses changed to store the new value.
5846 (handle_profiler_signal): Rename from sigprof_handler_1,
5847 for consistency with other handlers. Do not check whether
5848 cpu_log is a hash-table if garbage collecting, since it
5849 doesn't matter in that case.
5850 (deliver_profiler_signal): Rename from sigprof_handler,
5851 for consistency with other handlers.
5852 (setup_cpu_timer): New function, with much of what used to be in
5853 Fprofiler_cpu_start. Check for out-of-range argument.
5854 Prefer timer_settime if available, and prefer
5855 thread cputime clocks, then process cputime clocks, then
5856 monotonic clocks, to the old realtime clock. Use make_timeval
5857 to round more-correctly when falling back to setitimer.
5858 (Fprofiler_cpu_start): Use it.
5859 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5860 Don't assume that passing NULL as the 2nd argument of setitimer
5861 is the same as passing a pointer to all-zero storage.
5862 Ignore SIGPROF afterwards.
5863 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5864 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5865 non-fatal signal handlers. Ignore SIGPROF on startup.
5866 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5867 in profiler.c, since sysdep.c now uses it.
5868
5869 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5870 Suggested by Eli Zaretskii in
5871 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5872
5873 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
5874
5875 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5876
5877 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5878
5879 * lisp.h (struct backtrace): Remove indirection for `function' field.
5880 * xdisp.c (redisplay_internal):
5881 * profiler.c (record_backtrace, sigprof_handler_1):
5882 * alloc.c (Fgarbage_collect):
5883 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5884 (Fbacktrace_frame): Adjust accordingly.
5885
5886 2012-09-28 Glenn Morris <rgm@gnu.org>
5887
5888 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5889 (Frun_hook_with_args_until_failure): Doc fixes.
5890
5891 2012-09-28 Eli Zaretskii <eliz@gnu.org>
5892
5893 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5894 Qautomatic_redisplay and change the symbol name. All users changed.
5895
5896 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5897
5898 * profiler.c (sigprof_handler): Fix race condition.
5899
5900 2012-09-28 Glenn Morris <rgm@gnu.org>
5901
5902 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5903
5904 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5905
5906 Check more robustly for timer_settime.
5907 * Makefile.in (LIB_TIMER_TIME): New macro.
5908 (LIBES): Add it.
5909 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5910 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5911 call timer_settime.
5912
5913 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5914
5915 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5916
5917 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
5918
5919 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5920
5921 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5922
5923 * character.h (MAYBE_UNIFY_CHAR): Remove.
5924 * charset.c, charset.h (maybe_unify_char): Now static.
5925 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5926 Since this stuff is now private to charset.c, there's no need for
5927 a public macro and no need to inline by hand.
5928
5929 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5930 Stefan Monnier <monnier@iro.umontreal.ca>
5931 Juanma Barranquero <lekktu@gmail.com>
5932
5933 * profiler.c: New file.
5934 * Makefile.in (base_obj): Add profiler.o.
5935 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5936 ($(BLD)/profiler.$(O)): New target.
5937 * emacs.c (main): Call syms_of_profiler.
5938 * alloc.c (Qautomatic_gc): New constant.
5939 (MALLOC_PROBE): New macro.
5940 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5941 (total_bytes_of_live_objects): New function.
5942 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5943 Call malloc_probe for the memory profiler.
5944 (syms_of_alloc): Define Qautomatic_gc.
5945 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5946 race condition.
5947 (struct backtrace): Move definition...
5948 * lisp.h (struct backtrace): ..here.
5949 (Qautomatic_gc, profiler_memory_running): Declare vars.
5950 (malloc_probe, syms_of_profiler): Declare functions.
5951 * xdisp.c (Qautomatic_redisplay): New constant.
5952 (redisplay_internal): Record itself in backtrace_list.
5953 (syms_of_xdisp): Define Qautomatic_redisplay.
5954
5955 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5956 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5957
5958 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5959
5960 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5961
5962 Prefer POSIX timers if available.
5963 They avoid a race if the timer is too close to the current time.
5964 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5965 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
5966 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
5967
5968 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5969
5970 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5971 CHAR_STRING_ADVANCE.
5972 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5973 STRING_CHAR_ADVANCE.
5974
5975 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5976
5977 Move Vlibrary_cache to emacs.c and reset before dumping.
5978
5979 * lisp.h (reset_image_types): Declare.
5980 [WINDOWSNT] (Vlibrary_cache): Declare.
5981
5982 * image.c (reset_image_types): New function.
5983
5984 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5985 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5986 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5987
5988 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5989 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5990
5991 * w32.h (Vlibrary_cache): Do not declare.
5992
5993 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5994
5995 * w32proc.c (sys_signal): Handle all signals defined by the
5996 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5997 handlers for signals supported by Windows. Don't override
5998 term_ntproc as the handler for SIGABRT.
5999 (sigaction): Rewrite to call sys_signal instead of duplicating its
6000 code.
6001 (sys_kill): Improve commentary.
6002
6003 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6004 consistency with a signature of a signal handler. All callers
6005 changed.
6006 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6007 install term_ntproc as a signal handler for SIGABRT, as that
6008 should be done by the dumped Emacs.
6009
6010 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6011
6012 * w32select.c (term_w32select): Protect against repeated
6013 invocation by setting clipboard_owner to NULL after calling
6014 DestroyWindow.
6015
6016 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6017 and term_ntproc to their modified signatures.
6018
6019 * character.c (char_string, string_char): Remove calls to
6020 MAYBE_UNIFY_CHAR. See the discussion starting at
6021 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6022 for the details.
6023
6024 2012-09-25 Chong Yidong <cyd@gnu.org>
6025
6026 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6027
6028 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6029
6030 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6031 when encountering an unknown bytecode.
6032
6033 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6034
6035 image.c, indent.c: Use bool for booleans.
6036 * dispextern.h (struct image_type): Members valid_p, load, init
6037 now return bool, not int. All uses changed.
6038 * image.c: Omit unnecessary static decls.
6039 (x_create_bitmap_mask, x_build_heuristic_mask):
6040 Return void, not int, since callers don't care about the return value.
6041 (x_create_bitmap_mask, define_image_type, valid_image_p)
6042 (struct image_keyword, parse_image_spec, image_spec_value)
6043 (check_image_size, image_background)
6044 (image_background_transparent, x_clear_image_1)
6045 (postprocess_image, lookup_image, x_check_image_size)
6046 (x_create_x_image_and_pixmap, xbm_image_p)
6047 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6048 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6049 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6050 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6051 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6052 (png_image_p, init_png_functions, png_load_body, png_load)
6053 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6054 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6055 (init_gif_functions, gif_load, imagemagick_image_p)
6056 (imagemagick_load_image, imagemagick_load, svg_image_p)
6057 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6058 (gs_load):
6059 * nsimage.m (ns_load_image):
6060 * nsterm.m (ns_defined_color):
6061 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6062 * xfns.c (x_defined_color):
6063 * xterm.c (x_alloc_lighter_color_for_widget)
6064 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6065 (x_alloc_lighter_color):
6066 * indent.c (disptab_matches_widthtab, current_column)
6067 (scan_for_column, string_display_width, indented_beyond_p)
6068 (compute_motion, vmotion, Fvertical_motion):
6069 Use bool for booleans.
6070
6071 2012-09-24 Chong Yidong <cyd@gnu.org>
6072
6073 * chartab.c (Fset_char_table_default): Obsolete function removed.
6074
6075 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6076
6077 Move pid_t related decls out of lisp.h.
6078 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6079 (interruptible_wait_for_termination):
6080 Move these decls from lisp.h to syswait.h, since they use pid_t.
6081 Needed on FreeBSD; see Herbert J. Skuhra in
6082 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6083 * callproc.c: Include syswait.h.
6084
6085 gnutls.c, gtkutil.c: Use bool for boolean.
6086 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6087 (emacs_gnutls_handle_error):
6088 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6089 (xg_hide_tooltip, xg_create_frame_widgets)
6090 (create_dialog, xg_uses_old_file_dialog)
6091 (xg_get_file_with_chooser, xg_get_file_with_selection)
6092 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6093 (xg_item_label_same_p, xg_update_menubar)
6094 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6095 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6096 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6097 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6098 (update_frame_tool_bar, free_frame_tool_bar):
6099 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6100 * nsmenu.m (ns_update_menubar):
6101 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6102 * xfns.c (Fx_show_tip) [USE_GTK]:
6103 Use bool for boolean.
6104 * gtkutil.c (xg_update_frame_menubar):
6105 * xmenu.c (update_frame_menubar):
6106 Return void, not int, since caller ignores return value.
6107 * gtkutil.c (xg_change_toolbar_position):
6108 Return void, not 1.
6109
6110 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6111
6112 * makefile.w32-in (BLOCKINPUT_H): Remove.
6113 (SYSSIGNAL_H): New macro.
6114 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6115 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6116 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6117 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6118 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6119 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6120 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6121 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6122 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6123 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6124 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6125 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6126 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6127 ($(BLD)/w32xfns.$(O)): Update dependencies.
6128
6129 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6130
6131 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6132 fatal_error_backtrace.
6133
6134 * w32proc.c (sys_kill): Undo last change: don't do anything when
6135 invoked to deliver SIGABRT to our own process. This is now
6136 handled by emacs_raise.
6137
6138 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6139
6140 * w32term.c (w32_read_socket): Remove leftover reference to
6141 interrupt_input_pending.
6142
6143 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6144
6145 Do not use SA_NODEFER.
6146 Problem reported by Dani Moncayo in
6147 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6148 * alloc.c (die):
6149 * sysdep.c (emacs_abort): Do not reset signal handler.
6150 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6151 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6152 wanted even on POSIXish hosts, and it doesn't work on Windows.
6153
6154 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6155
6156 * xterm.c (x_term_init): Call fixup_locale before and after calling
6157 gtk_init (Bug#12392).
6158
6159 2012-09-23 Chong Yidong <cyd@gnu.org>
6160
6161 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6162 Vdynamic_library_alist.
6163
6164 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6165 (Fgnutls_available_p): Caller changed.
6166
6167 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6168 (Flibxml_parse_xml_region): Likewise.
6169
6170 * dispextern.h (struct image_type): Remove arg from init function.
6171
6172 * image.c (Finit_image_library, lookup_image_type)
6173 (define_image_type): Remove now-unneeded second arg.
6174 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6175 (init_tiff_functions, init_gif_functions, init_svg_functions):
6176 Arglist and w32_delayed_load calling convention changed.
6177 (gs_type): Remove init_gs_functions; there is no such function.
6178 (valid_image_p, make_image): Fix caller to lookup_image_type.
6179
6180 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6181
6182 Simplify and avoid signal-handling races (Bug#12471).
6183 * alloc.c (die):
6184 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6185 Avoid recursive loop if there's a fatal error in the function itself.
6186 * atimer.c (pending_atimers):
6187 * blockinput.h: Don't include "atimer.h"; no longer needed.
6188 (interrupt_input_pending): Remove. All uses removed.
6189 pending_signals now counts both atimers and ordinary interrupts.
6190 This is less racy than having three separate pending-signal flags.
6191 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6192 (input_blocked_p):
6193 Rename from their upper-case counterparts BLOCK_INPUT,
6194 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6195 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6196 This makes it easier to access volatile variables more accurately.
6197 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6198 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6199 that's more reliable if the code is buggy and sets
6200 interrupt_input_blocked to a negative value. All uses changed.
6201 * atimer.c (deliver_alarm_signal):
6202 Remove. No need to deliver this to the parent; any thread can
6203 handle this signal now. All uses replaced by underlying handler.
6204 * atimer.c (turn_on_atimers):
6205 * dispnew.c (handle_window_change_signal):
6206 * emacs.c (handle_danger_signal):
6207 * keyboard.c (kbd_buffer_get_event):
6208 Don't reestablish signal handler; not needed with sigaction.
6209 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6210 (UNBLOCK_INPUT_TO):
6211 Rework to avoid unnecessary accesses to volatile variables.
6212 (UNBLOCK_INPUT_TO): Now a function.
6213 (totally_unblock_input, unblock_input): New decls.
6214 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6215 (init_data): Remove. Necessary stuff now done in init_signal.
6216 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6217 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6218 (fatal_error_code): Remove; no longer needed.
6219 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6220 it doesn't always backtrace. All uses changed. No need to reset
6221 signal to default, since sigaction and/or die does that for us now.
6222 Use emacs_raise (FOO), not kill (getpid (), FOO).
6223 (main): Check more-accurately whether we're dumping.
6224 Move fatal-error setup to sysdep.c
6225 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6226 * gtkutil.c (xg_get_file_name, xg_get_font):
6227 Remove no-longer-needed signal-mask manipulation.
6228 * keyboard.c, process.c (POLL_FOR_INPUT):
6229 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6230 * keyboard.c (read_avail_input): Remove.
6231 All uses replaced by gobble_input.
6232 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6233 (kbd_buffer_store_event_hold, gobble_input):
6234 (record_asynch_buffer_change) [USABLE_SIGIO]:
6235 (store_user_signal_events):
6236 No need to mess with signal mask.
6237 (gobble_input): If blocking input and there are terminals, simply
6238 set pending_signals to 1 and return. All hooks changed to not
6239 worry about whether input is blocked.
6240 (process_pending_signals): Clear pending_signals before processing
6241 them, in case a signal comes in while we're processing.
6242 By convention callers now test pending_signals before calling us.
6243 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6244 New functions, to support changes to blockinput.h.
6245 (handle_input_available_signal): Now extern.
6246 (reinvoke_input_signal): Remove. All uses replaced by
6247 handle_async_input.
6248 (quit_count): Now volatile, since a signal handler uses it.
6249 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6250 All callers changed. Block SIGINT only if not already blocked.
6251 Clear sigmask reliably, even if Fsignal returns, which it can.
6252 Omit unnecessary accesses to volatile var.
6253 (quit_throw_to_read_char): No need to restore sigmask.
6254 * keyboard.c (gobble_input, handle_user_signal):
6255 * process.c (wait_reading_process_output):
6256 Call signal-handling code rather than killing ourselves.
6257 * lisp.h: Include <float.h>, for...
6258 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6259 (pending_signals): Now volatile.
6260 (syms_of_data): Now const if IEEE floating point.
6261 (handle_input_available_signal) [USABLE_SIGIO]:
6262 (terminate_due_to_signal, record_child_status_change): New decls.
6263 * process.c (create_process): Avoid disaster if memory is exhausted
6264 while we're processing a vfork, by tightening the critical section
6265 around the vfork.
6266 (send_process_frame, process_sent_to, handle_pipe_signal)
6267 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6268 ignores SIGPIPE.
6269 (send_process): No need for setjmp/longjmp any more, since the
6270 SIGPIPE stuff is now gone. Instead, report an error if errno
6271 is EPIPE.
6272 (record_child_status_change): Now extern. PID and W are now args.
6273 Return void, not bool. All callers changed.
6274 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6275 Remove. All uses removed. This bug should be fixed now in a
6276 different way.
6277 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6278 and record the child status change directly. This avoids the
6279 need to futz with the signal mask.
6280 (process_fatal_action): Move here from emacs.c.
6281 (emacs_sigaction_flags): New function, containing
6282 much of what used to be in emacs_sigaction_init.
6283 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6284 caught by emacs, to make races less likely.
6285 (deliver_process_signal): Rename from handle_on_main_thread.
6286 All uses changed.
6287 (BACKTRACE_LIMIT_MAX): Now at top level.
6288 (thread_backtrace_buffer, threadback_backtrace_pointers):
6289 New static vars.
6290 (deliver_thread_signal, deliver_fatal_thread_signal):
6291 New functions, for more-accurate delivery of thread-specific signals.
6292 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6293 (deliver_arith_signal): Handle in this thread, not
6294 in the main thread, since it's triggered by this thread.
6295 (maybe_fatal_sig): New function.
6296 (init_signals): New arg DUMPING so that we can be more accurate
6297 about whether we're dumping. Caller changed.
6298 Treat thread-specific signals differently from process-general signals.
6299 Block all signals while handling fatal error; that's safer.
6300 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6301 on IEEE hosts.
6302 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6303 Ignore SIGPIPE unless batch.
6304 (emacs_backtrace): Output backtrace for the appropriate thread,
6305 which is not necessarily the main thread.
6306 * syssignal.h: Include <stdbool.h>.
6307 (emacs_raise): New macro.
6308 * xterm.c (x_connection_signal): Remove; no longer needed
6309 now that we use sigaction.
6310 (x_connection_closed): No need to mess with sigmask now.
6311 (x_initialize): No need to reset SIGPIPE handler here, since
6312 init_signals does this for us now.
6313
6314 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6315
6316 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6317 background rect may be larger (Bug#12245).
6318
6319 2012-09-23 Chong Yidong <cyd@gnu.org>
6320
6321 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6322
6323 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6324
6325 * .gdbinit: Just stop at fatal_error_backtrace.
6326 See Stefan Monnier's request in
6327 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6328 Remove no-longer-used query of system type.
6329
6330 2012-09-22 Chong Yidong <cyd@gnu.org>
6331
6332 * search.c (Freplace_match): Doc fix (Bug#12325).
6333
6334 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6335
6336 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6337 (Fline_end_position): Doc fix.
6338
6339 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6340
6341 2012-09-22 Chong Yidong <cyd@gnu.org>
6342
6343 * dispextern.h (struct image_type): Add new slot, storing a type
6344 initialization function.
6345
6346 * image.c (define_image_type): Call the image initializer function
6347 if it is defined. Arguments and return value changed.
6348 (valid_image_p, make_image): Callers changed.
6349 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
6350 (gif_type, imagemagick_type, svg_type, gs_type):
6351 Add initialization functions.
6352 (Finit_image_library): Call lookup_image_type.
6353 (CHECK_LIB_AVAILABLE): Macro deleted.
6354 (lookup_image_type): Call define_image_type here, rather than via
6355 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6356 (syms_of_image): Move define_image_type calls for xbm_type and
6357 pbm_type to lookup_image_type.
6358
6359 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6360
6361 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6362 'idle_timers' from here ...
6363 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6364 lists, to avoid infloops when the timer does something stupid,
6365 like reinvoke itself with the same or smaller time-out.
6366 (Bug#12447)
6367
6368 2012-09-22 Martin Rudalics <rudalics@gmx.at>
6369
6370 * window.c (Fsplit_window_internal): Handle only Qt value of
6371 Vwindow_combination_limit separately.
6372 (Qtemp_buffer_resize): New symbol.
6373 (Vwindow_combination_limit): New default value.
6374 Rewrite doc-string.
6375
6376 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6377
6378 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6379 the new overlay string. (Bug#10159)
6380
6381 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6382
6383 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6384 or that fprintf is async-signal-safe. POSIX doesn't require
6385 either assumption.
6386
6387 2012-09-22 Chong Yidong <cyd@gnu.org>
6388
6389 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6390 (Bug#8207).
6391
6392 2012-09-22 Kenichi Handa <handa@gnu.org>
6393
6394 * composite.c (composition_reseat_it): Handle the case that a
6395 grapheme cluster is not covered by a single font (Bug#12352).
6396
6397 2012-09-21 Chong Yidong <cyd@gnu.org>
6398
6399 * image.c (define_image_type): Avoid adding duplicate types to
6400 image_types (Bug#12463). Suggested by Jörg Walter.
6401
6402 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6403
6404 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6405 (print_load_command_name): Add case LC_DATA_IN_CODE.
6406 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6407
6408 2012-09-21 Glenn Morris <rgm@gnu.org>
6409
6410 * eval.c (Frun_hook_with_args_until_success)
6411 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6412
6413 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
6414
6415 * fileio.c (Ffile_selinux_context): Only call freecon when
6416 lgetfilecon succeeded.
6417 (Fset_file_selinux_context): Likewise. (Bug#12444)
6418
6419 2012-09-21 Eli Zaretskii <eliz@gnu.org>
6420
6421 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6422 reordering, locate the cursor by calling set_cursor_from_row; if
6423 that fails, clear the desired glyph matrix before returning a
6424 failure indication to the caller. Fixes leaving garbled display
6425 when fast scrolling with a down-key. (Bug#12403)
6426 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6427 scrolling through multibyte text.
6428
6429 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6430
6431 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6432 calling mark_vectorlike since that's the one that marks the window.
6433 (mark_discard_killed_buffers): Mark the final cdr.
6434 * window.h (struct window): Move prev/next_buffers to the
6435 non-standard fields.
6436 * window.c (make_window): Initialize prev/next_buffers manually.
6437
6438 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6439
6440 Omit unused arg EXPECTED from socket hooks.
6441 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6442 * nsterm.m (ns_term_init):
6443 * termhooks.h (struct terminal.read_socket_hook):
6444 * w32inevt.c (w32_console_read_socket):
6445 * w32term.c (w32_read_socket):
6446 * xterm.c (XTread_socket):
6447 Omit unused arg EXPECTED. All callers changed.
6448 (store_user_signal_events): Return void, not int, since callers no
6449 longer care about the return value. All uses changed.
6450
6451 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
6452
6453 * w32gui.h (XParseGeometry): Do not declare.
6454
6455 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6456
6457 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
6458 Ignore 'expected'. See Eli Zaretskii in
6459 <http://bugs.gnu.org/12471#8> (last line).
6460
6461 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6462 (XParseGeometry): Now static. Substitute extremal values for
6463 values that are out of range.
6464
6465 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6466
6467 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6468
6469 * nsfns.m (XParseGeometry): Remove.
6470 (Fx_create_frame): Call x_set_offset to correctly interpret
6471 top_pos in geometry.
6472
6473 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
6474 (Fx_parse_geometry): If there is a space in string, call
6475 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6476
6477 2012-09-17 Eli Zaretskii <eliz@gnu.org>
6478
6479 * search.c (scan_buffer): Use character positions in calls to
6480 region_cache_forward and region_cache_backward, not byte
6481 positions. (Bug#12196)
6482
6483 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6484 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6485
6486 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6487 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6488 emacs_blocked_malloc, now deleted.
6489
6490 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6491
6492 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6493 The workaround was for improving performance on Solaris 2.4, but
6494 is getting in the way now. Emacs will still work if someone is
6495 still running Solaris 2.4 in a museum somewhere; Sun dropped
6496 support for Solaris 2.4 in 2003.
6497 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6498 * process.c (create_process) [HAVE_WORKING_VFORK]:
6499 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6500 since Emacs no longer uses vfork on that platform.
6501
6502 2012-09-17 Glenn Morris <rgm@gnu.org>
6503
6504 * emacs.c: Use COPYRIGHT.
6505
6506 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6507
6508 Remove configure's --without-sync-input option (Bug#12450).
6509 When auditing signal-handling in preparation for cleaning it up,
6510 I found that SYNC_INPUT has race conditions and would be a real
6511 pain to fix. Since it's an undocumented and deprecated
6512 configure-time option, now seems like a good time to remove it.
6513 Also see <http://bugs.gnu.org/11080#16>.
6514 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6515 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6516 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6517 (malloc_hysteresis):
6518 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6519 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6520 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6521 (dont_register_blocks, bytes_used_when_reconsidered)
6522 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6523 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6524 [!SYSTEM_MALLOC && !SYNC_INPUT]:
6525 Remove. All uses removed.
6526 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6527 implementation, one that depends on whether the new macro
6528 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6529 is defined.
6530 * atimer.c (run_timers, handle_alarm_signal):
6531 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6532 (handle_async_input, process_pending_signals)
6533 (handle_input_available_signal, init_keyboard):
6534 * nsterm.m (ns_read_socket):
6535 * process.c (wait_reading_process_output):
6536 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6537 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6538 (emacs_write):
6539 * xterm.c (XTread_socket):
6540 Assume SYNC_INPUT.
6541 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6542 * eval.c (handling_signal): Remove. All uses removed.
6543 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6544 All uses replaced with the SYNC_INPUT version.
6545 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6546 Remove decls.
6547 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6548 Now static.
6549
6550 * font.c (Ffont_shape_gstring): Remove unused local.
6551
6552 2012-09-16 Glenn Morris <rgm@gnu.org>
6553
6554 * Makefile.in (clean): No longer run nextstep's clean.
6555
6556 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6557 (ns_frag): Remove.
6558 (ns-app): Move here from ns.mk, and simplify.
6559 (clean): Simplify nextstep entry.
6560 * ns.mk: Remove file.
6561
6562 2012-09-17 Kenichi Handa <handa@gnu.org>
6563
6564 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6565 not covert the last few charactes.
6566
6567 2012-09-16 Kenichi Handa <handa@gnu.org>
6568
6569 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6570 here, but just check the validity of glyphs in the glyph-string.
6571
6572 2012-09-16 Martin Rudalics <rudalics@gmx.at>
6573
6574 * window.c (Fwindow_parameter, Fset_window_parameter):
6575 Accept any window as argument (Bug#12452).
6576
6577 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6578
6579 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6580 to ns_term_init to avoid memory leak.
6581
6582 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6583 explicit retain/release.
6584 (ns_term_init): Only allow one display. Initialize outerpool and
6585 ns_*_types.
6586
6587 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6588
6589 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6590 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6591 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6592 the Microsoft problem in a different way, by altering ../nt/config.nt.
6593
6594 2012-09-15 Eli Zaretskii <eliz@gnu.org>
6595
6596 * w32xfns.c:
6597 * w32uniscribe.c:
6598 * w32term.c:
6599 * w32select.c:
6600 * w32reg.c:
6601 * w32proc.c:
6602 * w32menu.c:
6603 * w32inevt.c:
6604 * w32heap.c:
6605 * w32font.c:
6606 * w32fns.c:
6607 * w32console.c:
6608 * w32.c:
6609 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6610 by lisp.h. This completes removal of setjmp.h inclusion
6611 erroneously announced in the previous commit. (Bug#12446)
6612
6613 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6614 more accurate.
6615
6616 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6617 not defined as a macro. The latter happens on MS-Windows.
6618 (Bug#12446)
6619
6620 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6621
6622 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6623 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
6624 Some instances of '#include <setjmp.h>' removed, if the
6625 only reason for the instance was because "lisp.h" was included.
6626 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6627 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6628 and _longjmp with the new symbols. Emacs already uses _setjmp if
6629 available, so this change affects only POSIXish hosts that have
6630 sigsetjmp but not _setjmp, such as some versions of Solaris and
6631 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6632 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6633 (png_load_body) [HAVE_PNG]:
6634 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6635 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6636 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6637 since PNG requires jmp_buf. This is the only exception to the
6638 general rule that we now use sys_setjmp and sys_longjmp.
6639 This exception is OK since this code does not change the signal
6640 mask or longjmp out of a signal handler.
6641
6642 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6643
6644 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6645 Include "syssignal.h", for 'main_thread'.
6646
6647 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6648
6649 Avoid out-of-range marker position (Bug#12426).
6650 * insdel.c (replace_range, replace_range_2):
6651 Adjust markers before overlays, as suggested by comments.
6652 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6653 Remove redundant check before calling offset_intervals.
6654
6655 2012-09-14 Martin Rudalics <rudalics@gmx.at>
6656
6657 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6658 current buffer (Bug#12387).
6659
6660 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
6661
6662 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6663
6664 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6665
6666 Use a more backwards-compatible timer format (Bug#12430).
6667 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6668 vector element, not from the 4th, since PSECS is now at the end.
6669 (Fcurrent_idle_time): Doc fix.
6670
6671 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6672
6673 Function to mark objects and remove killed buffers at once.
6674 * alloc.c (discard_killed_buffers): Rename to ...
6675 (mark_discard_killed buffers) ... new name. Add marking
6676 of remaining objects. Fix comment. Adjust users.
6677 (mark_object): Do not touch frame buffer lists here.
6678 * frame.c (delete_frame): Reset frame buffer lists here.
6679
6680 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6681
6682 Better workaround for GNOME bug when --enable-gcc-warnings.
6683 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6684 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6685 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6686
6687 Simplify SIGIO usage (Bug#12408).
6688 The code that dealt with SIGIO was crufty and confusing, e.g., it
6689 played tricks like "#undef SIGIO" but these tricks were not used
6690 consistently. Simplify mostly by not #undeffing standard symbols,
6691 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6692 or not as we please) rather than "defined SIGIO" (standard symbol
6693 that we probably shouldn't #undef).
6694 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6695 Modules that need it can include it.
6696 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6697 * dispextern.h (ignore_sigio): New decl.
6698 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6699 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6700 * emacs.c (shut_down_emacs):
6701 * keyboard.c (kbd_buffer_store_event_hold):
6702 Use ignore_sigio rather than invoking 'signal' directly.
6703 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6704 for FIONREAD.
6705 (FIONREAD, SIGIO): Do not #undef.
6706 (tty_read_avail_input): Use #error rather than a syntax error.
6707 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6708 for I_PIPE, used by SETUP_SLAVE_PTY.
6709 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6710 * sysdep.c (croak): Remove; no longer needed. This bit of
6711 temporary code, with Fred N. Fish's comment that it's temporary,
6712 has been in Emacs since at least 1992!
6713 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6714 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6715 * syssignal.h (croak): Remove decl.
6716 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6717 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6718 now that we're termios-only.
6719 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6720 * term.c (dissociate_if_controlling_tty): Use #error rather than
6721 a run-time error.
6722
6723 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6724 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6725 to work around GNOME bug 683906.
6726 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6727 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6728 This works around GCC bug 54561.
6729
6730 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6731
6732 More fixes for 'volatile' and setjmp/longjmp.
6733 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6734 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6735 (png_load_body) [HAVE_PNG]:
6736 (jpeg_load_body) [HAVE_JPEG]:
6737 New function, with most of the old parent function's body.
6738 (png_load) [HAVE_PNG]:
6739 (jpeg_load) [HAVE_JPEG]:
6740 Invoke the new function, to avoid longjmp munging our locals.
6741 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6742 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6743 longjmp is passed 2, as the C standard doesn't guarantee this.
6744 Instead, store the failure code into mgr->failure_code.
6745
6746 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6747
6748 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6749 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6750 (syms_of_keyboard): Remove support for unread-command-char.
6751
6752 2012-09-12 Eli Zaretskii <eliz@gnu.org>
6753
6754 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6755 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6756 violation. (Bug#12426)
6757
6758 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6759
6760 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6761
6762 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6763
6764 * eval.c: Add `inhibit-debugger'.
6765 (Qinhibit_debugger): New symbol.
6766 (call_debugger): Bind it instead of Qdebug_on_error.
6767 (maybe_call_debugger): Test Vinhibit_debugger.
6768 (syms_of_eval): Define inhibit-debugger.
6769 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6770 (syms_of_xdisp): Remove inhibit-debug-on-message.
6771
6772 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6773
6774 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6775 If a nonvolatile local variable is written before a _longjmp to
6776 the frame containing the variable, and is read after the _longjmp,
6777 the value read is indeterminate. Some local variables of type
6778 'struct handler' and 'struct catchtag' are used in this way, so
6779 mark each of their slots as volatile if the slot can be set before
6780 _longjmp and read afterwards.
6781 * lisp.h (struct handler): var and chosen_clause are now volatile.
6782 (struct catchtag): val, next, and pdlcount are now volatile.
6783
6784 * bidi.c (bidi_push_it, bidi_pop_it):
6785 * fns.c (copy_hash_table):
6786 * image.c (define_image_type):
6787 * keyboard.c (kbd_buffer_store_event_hold):
6788 * process.c (Fprocess_send_eof):
6789 * xfaces.c (x_create_gc) [HAVE_NS]:
6790 * xgselect.c (xg_select):
6791 Prefer assignment to memcpy when either will do.
6792
6793 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6794 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6795 time an item is removed. No need to mark this function 'inline';
6796 the compiler knows better than we do.
6797
6798 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6799
6800 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6801 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6802 to change_frame_size (Bug#12388).
6803 (windowDidResize:): Pass YES to updateFrameSize.
6804
6805 * nsterm.h: Add delay parameter to updateFrameSize.
6806
6807 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6808
6809 Discard killed buffers from deleted window and frame objects.
6810 This reduces an amount of references to killed buffers and
6811 helps GC to reclaim them faster.
6812 * alloc.c (discard_killed_buffers): New function.
6813 (mark_object): Use it for deleted windows and frames.
6814 (mark_object): If symbol's value is set up for a killed buffer
6815 or deleted frame, restore its global binding.
6816 * data.c (swap_in_global_binding): Add GC notice.
6817 (swap_in_symval_forwarding): Use convenient set_blv_where.
6818 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6819 * window.h: ... to here.
6820
6821 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6822
6823 Convenient macro to check whether the buffer is live.
6824 * buffer.h (BUFFER_LIVE_P): New macro.
6825 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6826 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6827
6828 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6829
6830 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6831 composition cases (Bug#12364).
6832
6833 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6834 overhang of succeeding glyphs overlapping box cursor.
6835
6836 * w32term.c (x_draw_glyph_string): Likewise.
6837
6838 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6839
6840 Simplify, document, and port floating-point (Bug#12381).
6841 The porting part of this patch fixes bugs on non-IEEE platforms
6842 with frexp, ldexp, logb.
6843 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6844 Now static.
6845 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6846 support, by removing commented-out code and briefly listing the
6847 C89 functions excluded. The commented-out stuff was confusing
6848 maintenance, e.g., we thought we needed cbrt but it was commented out.
6849 (logb): Remove decl; no longer needed.
6850 (isfinite): New macro, if not already supplied.
6851 (isnan): Don't replace any existing macro.
6852 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6853 are present on all C89 platforms.
6854 (Ffrexp): Do not special-case zero, as frexp does the right thing
6855 for that case.
6856 (Flogb): Do not use logb, as it doesn't have the desired meaning
6857 on hosts that use non-base-2 floating point. Instead, stick with
6858 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6859 frexp, to avoid getting an unspecified result.
6860
6861 * xdisp.c (Qinhibit_debug_on_message): Now static.
6862
6863 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6864
6865 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6866 NSBezierPath (Bug#12131).
6867
6868 2012-09-10 Chong Yidong <cyd@gnu.org>
6869
6870 * fns.c (Fdelq, Fdelete): Doc fix.
6871
6872 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6873
6874 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6875 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6876
6877 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6878
6879 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6880 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6881 Use it.
6882
6883 2012-09-09 Eli Zaretskii <eliz@gnu.org>
6884
6885 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6886 left fringe if the window has a left margin. This avoids leaving
6887 traces of the cursor because its leftmost pixel is not drawn over.
6888
6889 * dispnew.c (update_window_line): When the left margin area of a
6890 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6891 that screen line. (Bug#12277)
6892
6893 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6894
6895 Assume C89 or later for math functions (Bug#12381).
6896 This simplifies the code, and makes it a bit smaller and faster,
6897 and (most important) makes it easier to clean up signal handling
6898 since we can stop worring about floating-point exceptions in
6899 library code. That was a problem before C89, but the problem
6900 went away many years ago on all practical Emacs targets.
6901 * data.c, image.c, lread.c, print.c:
6902 Don't include <math.h>; no longer needed.
6903 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6904 might be autoconfigured, as that never happens.
6905 * data.c (fmod):
6906 * doprnt.c (DBL_MAX_10_EXP):
6907 * print.c (DBL_DIG):
6908 Remove. C89 or later always defines these.
6909 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6910 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6911 (arith_error, domain_error, domain_error2):
6912 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6913 no longer needed -- we simply return what C returns. All uses removed.
6914 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6915 the wrapped code.
6916 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6917 Remove. All uses expanded, as these macros are no longer used
6918 more than once and are now more trouble than they're worth.
6919 (Ftan): Use tan, not sin / cos.
6920 (Flogb): Assume C89 frexp.
6921 (fmod_float): Assume C89 fmod.
6922 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6923 (init_floatfns): Remove. All uses removed.
6924
6925 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6926
6927 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6928 compositeToPoint for OSX < 10.6 (Bug#12390).
6929
6930 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6931
6932 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6933 This produces more-accurate results.
6934
6935 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6936
6937 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6938 changes (Bug#12088).
6939
6940 2012-09-08 Chong Yidong <cyd@gnu.org>
6941
6942 * syntax.c (Fstring_to_syntax): Doc fix.
6943
6944 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6945
6946 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6947 in the internal border.
6948 (x_set_window_size): Remove static variables and their usage.
6949 (ns_redraw_scroll_bars): Fix NSTRACE arg.
6950 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6951 Remove fringe/internal border adjustment (Bug#11052).
6952 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6953 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6954 (ns_fix_rect_ibw): Remove.
6955 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6956 (ns_dumpglyphs_box_or_relief): Ditto.
6957 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6958 adjustment.
6959 (ns_dumpglyphs_image): Ditto.
6960 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
6961 border adjustment.
6962 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6963 their usage. Add fringe_extended_p and its use as in other terms.
6964 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6965 scroll bar was removed.
6966 (updateFrameSize): New function.
6967 (windowDidResize): Move code to updateFrameSize and call it.
6968
6969 * nsterm.h (EmacsView): Add updateFrameSize.
6970
6971 2012-09-07 Chong Yidong <cyd@gnu.org>
6972
6973 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6974
6975 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6976
6977 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6978
6979 More signal-handler cleanup (Bug#12327).
6980 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6981 Problem introduced when merging patches. Noted by Eli Zaretskii in
6982 <http://bugs.gnu.org/12327#67>.
6983 * floatfns.c: Comment fix.
6984 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6985 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6986 and anyway the declaration is harmless even if SIGDANGER is not defined.
6987 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6988 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6989 source files not surprisingly expected syssignal.h to define, or
6990 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6991 Include <sys/ioctl.h>, for FIONREAD.
6992 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6993 This eliminates a problem whereby other files mysteriously had
6994 to include "syssignal.h" before including "systty.h" if they
6995 wanted to use "#ifdef SIGIO".
6996
6997 2012-09-07 Eli Zaretskii <eliz@gnu.org>
6998
6999 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7000
7001 * w32.c (sigemptyset): Empty the set.
7002 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7003
7004 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7005
7006 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7007
7008 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7009 (mark_object): Likewise for frame objects.
7010
7011 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7012
7013 * syssignal.h (handle_on_main_thread): Always declare,
7014 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7015 This ports to platforms without HAVE_PTHREAD.
7016
7017 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7018
7019 Signal-handler cleanup (Bug#12327).
7020 Emacs's signal handlers were written in the old 4.2BSD style with
7021 sigblock and sigmask and so forth, and this led to some
7022 inefficiencies and confusion. Rewrite these to use
7023 pthread_sigmask etc. without copying signal sets around. Also,
7024 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7025 'signal', and instead use functions that do not attempt to take
7026 over the system name space. This patch causes Emacs's text
7027 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7028 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7029 Do not include <signal.h> or "syssignal.h", as these
7030 modules do not use signals.
7031 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7032 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7033 Do not include <signal.h>, as "syssignal.h" does that for us now.
7034 * atimer.c (sigmask_atimers): New function.
7035 (block_atimers, unblock_atimers): New functions,
7036 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7037 All uses replaced.
7038 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7039 no longer needed here.
7040 * emacs.c (main): Inspect existing signal handler with sigaction,
7041 so that there's no need to block and unblock SIGHUP.
7042 * sysdep.c (struct save_signal): New member 'action', replacing
7043 old member 'handler'.
7044 (save_signal_handlers, restore_signal_handlers):
7045 Use sigaction instead of 'signal' to save and restore.
7046 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7047 New function. All users of 'signal' modified to use set_sighandler
7048 if they're writeonly, and to use sys_signal if they're read+write.
7049 (emacs_sigaction_init, forwarded_signal): New functions.
7050 (sys_signal): Remove. All uses replaced by calls to sigaction
7051 and emacs_sigaction_init, or by direct calls to 'signal'.
7052 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7053 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7054 all uses replaced by pthread_sigmask etc. calls.
7055 * syssignal.h: Include <signal.h>.
7056 (emacs_sigaction_init, forwarded_signal): New decls.
7057 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7058 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7059 (sigmask, sys_sigmask): Remove; no longer needed.
7060 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7061 (sigblock, sigunblock, sigfree):
7062 (sigsetmask) [!defined sigsetmask]:
7063 Remove. All uses replaced by pthread_sigmask.
7064 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7065 no longer need to be replaced, and its typical old uses
7066 are now done via emacs_sigaction_init and sigaction.
7067 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7068 (sys_sigdel): Remove; unused.
7069 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7070
7071 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7072
7073 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7074 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7075
7076 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7077
7078 Explicitly mark buffer_defaults and buffer_local_symbols.
7079 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7080 mark_local_symbols here.
7081 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7082 since special buffers aren't marked here any more.
7083 (allocate_buffer): Chain new buffer with all_buffers here...
7084 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7085 not here.
7086 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7087 (syms_of_buffer): Remove staticpro of the above.
7088 (init_buffer_once): Set names for buffer_defaults and
7089 buffer_local_symbols.
7090
7091 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7092
7093 Use bool for booleans in font-related modules.
7094 * font.c (font_intern_prop, font_style_to_value)
7095 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7096 (generate_otf_features, font_check_otf_features, font_check_otf)
7097 (font_match_p, font_list_entities, font_at):
7098 * fontset.c (fontset_id_valid_p, reorder_font_vector
7099 (fontset_find_font, Fset_fontset_font)
7100 (face_suitable_for_char_p) [0]:
7101 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7102 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7103 (m17n_flt_initialized, ftfont_shape_by_flt):
7104 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7105 * nsfont.m (nsfont_draw):
7106 * w32font.c (w32font_draw):
7107 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7108 Use bool for booleans.
7109 * font.h: Adjust to above API changes.
7110 (struct font, struct font_driver, struct font_driver_list):
7111 Use bool for booleans.
7112 (struct font): Remove useless member encoding_type.
7113 All users removed.
7114 * fontset.c, xftfont.c: Omit unnecessary static decls.
7115
7116 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7117
7118 * alloc.c (mark_object): Revert window marking code
7119 since it's unsafe for the Fset_window_configuration.
7120
7121 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7122
7123 Fix race conditions with signal handlers and errno (Bug#12327).
7124 Be more systematic about preserving errno whenever a signal
7125 handler returns, even if it's not in the main thread. Do this by
7126 renaming signal handlers to distinguish between signal delivery
7127 and signal handling. All uses changed.
7128 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7129 * data.c (deliver_arith_signal): Rename from arith_error.
7130 * dispnew.c (deliver_window_change_signal): Rename from
7131 window_change_signal.
7132 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7133 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7134 * keyboard.c (deliver_input_available_signal): Rename from
7135 input_available_signal.
7136 (deliver_user_signal): Rename from handle_user_signal.
7137 (deliver_interrupt_signal): Rename from interrupt_signal.
7138 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7139 (deliver_child_signal): Rename from sigchld_handler.
7140 * atimer.c (handle_alarm_signal):
7141 * data.c (handle_arith_signal):
7142 * dispnew.c (handle_window_change_signal):
7143 * emacs.c (handle_fatal_signal, handle_danger_signal):
7144 * keyboard.c (handle_input_available_signal):
7145 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7146 * process.c (handle_pipe_signal, handle_child_signal):
7147 New functions, with the actual signal-handling code taken from the
7148 original respective signal handlers, sans the sporadic attempts to
7149 preserve errno, since that's now done by handle_on_main_thread.
7150 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7151 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7152 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7153 Move to sysdep.c.
7154 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7155 Move initialization of main_thread to sysdep.c's init_signals.
7156 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7157 our usage, and simplifies the mainline code.
7158 (record_child_status_change): New static function, as a helper
7159 for handle_child_signal, and with most of the old child handler's
7160 contents.
7161 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7162 (handle_child_signal): Use the above.
7163 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7164 Moved here from emacs.c.
7165 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7166 code moved here from emacs.c's main function.
7167 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7168 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7169 This lets callers save and restore errno properly.
7170
7171 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7172
7173 Remove redundant or unused things here and there.
7174 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7175 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7176 * editfns.c (Fcompare_buffer_substrings): Likewise.
7177 * frame.h (struct terminal, struct font_driver_list):
7178 Remove redundant declarations.
7179 * window.h (Qleft, Qright): Likewise.
7180
7181 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7182
7183 Do not mark objects from deleted buffers, windows and frames.
7184 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7185 (mark_object): Likewise for windows and frames.
7186
7187 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7188
7189 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7190 buffer_defaults and buffer_local_symbols as valid objects.
7191 Return special value to denote them.
7192
7193 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7194
7195 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7196 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7197 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7198 (file_name_absolute_p, Fsubstitute_in_file_name):
7199 (check_executable, check_writable, Ffile_accessible_directory_p)
7200 (Fset_file_selinux_context, Fdefault_file_modes)
7201 (Finsert_file_contents, choose_write_coding_system)
7202 (Fwrite_region, build_annotations, a_write, e_write)
7203 (Fdo_auto_save):
7204 * filelock.c (boot_time_initialized, get_boot_time)
7205 (get_boot_time_1, lock_file_1, within_one_second):
7206 * floatfns.c (in_float):
7207 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7208 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7209 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7210 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7211 * window.c (compare_window_configurations):
7212 Use bool for booleans.
7213 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7214 (Fdefault_file_modes): Now mode_t, not int, for modes.
7215 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7216 (internal_delete_file): Now returns void, not a (boolean) int,
7217 since nobody was looking at the return value.
7218 * lisp.h, window.h: Adjust to above API changes.
7219
7220 * xdisp.c (set_message): Simplify and reindent last change.
7221
7222 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7223
7224 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7225
7226 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7227
7228 * eval.c (call_debugger): Make the function non-static so that we
7229 can call it from set_message.
7230
7231 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7232 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7233
7234 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7235
7236 Give more-useful info on a fatal error (Bug#12328).
7237 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7238 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7239 of doing the work ourselves.
7240 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7241 do most of the work.
7242 (fatal_error_backtrace): New function, taken from the guts
7243 of the old fatal_error_signal, but with a new option to output
7244 a backtrace.
7245 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7246 info about the signal than just its number.
7247 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7248 * sysdep.c: Include <execinfo.h>
7249 (emacs_backtrace): New function, taken partly from the previous
7250 code of the 'die' function.
7251 (emacs_abort): Call fatal_error_backtrace rather than abort.
7252
7253 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7254
7255 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7256 eager (load-time) macro-expansion.
7257 * lisp.mk (lisp): Add macroexp.
7258
7259 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7260
7261 Simplify redefinition of 'abort' (Bug#12316).
7262 Do not try to redefine the 'abort' function. Instead, redo
7263 the code so that it calls 'emacs_abort' rather than 'abort'.
7264 This removes the need for the NO_ABORT configure-time macro
7265 and makes it easier to change the abort code to do a backtrace.
7266 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7267 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7268 Remove; sysdep.c's emacs_abort now takes its place.
7269 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7270 'abort' changed to use 'emacs_abort'.
7271 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7272 (abort) [!defined abort]: Rename to ...
7273 (emacs_abort): ... new name.
7274 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7275 the place of the old 'abort' in emacs.c.
7276 * w32.c, w32fns.c (abort): Do not #undef.
7277 * w32.c (emacs_abort): Rename from w32_abort.
7278
7279 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7280
7281 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7282 offsets[j].dv, since the y axis of the screen coordinates points
7283 down, while the y axis of the font definition coordinates points
7284 up. This fixes display of Arabic diacritics such as KASRA and
7285 KASRATAN. (Bug#11860)
7286
7287 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7288
7289 Be more systematic about _setjmp vs setjmp.
7290 * alloc.c (test_setjmp, mark_stack):
7291 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7292 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7293 (png_load, my_error_exit, jpeg_load):
7294 * process.c (send_process_trap, send_process):
7295 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7296 The underscored versions are up to 30x faster on some hosts.
7297 Formerly, the code used setjmp+longjmp sometimes and
7298 _setjmp+_longjmp at other times, with no particular reason to
7299 prefer setjmp+longjmp.
7300
7301 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7302
7303 Fix minor problem found by static checking.
7304 * buffer.c (Fdelete_all_overlays): Return nil.
7305
7306 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7307
7308 * buffer.c (Fdelete_all_overlays): New function.
7309
7310 2012-09-03 Chong Yidong <cyd@gnu.org>
7311
7312 * gtkutil.c: Add extern decl for Qxft.
7313
7314 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7315
7316 * emacs.c, eval.c: Use bool for boolean.
7317 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7318 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7319 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7320 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7321 (main, decode_env_path, Fdaemon_initialized):
7322 * eval.c (call_debugger, Finteractive_p, interactive_p):
7323 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7324 (maybe_call_debugger, Fbacktrace):
7325 * process.c (read_process_output, exec_sentinel):
7326 Use bool for booleans.
7327 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7328 All callers changed.
7329 * eval.c (interactive_p): Omit always-true boolean argument
7330 EXCLUDE_SUBRS_P. All callers changed.
7331 * dispextern.h, lisp.h: Reflect above API changes.
7332 * firstfile.c (dummy): Use the address of 'main', whose signature
7333 won't change, instead of the address of 'initialize', whose
7334 signature just changed from int to bool.
7335 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7336 * msdos.c (fatal_error_in_progress): ... from here.
7337 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7338 of incrementing it.
7339 (redisplay_internal, unwind_redisplay): Simply clear
7340 REDISPLAYING_P when unwinding, instead of saving its previous,
7341 always-false value and then restoring it.
7342
7343 Clean up some extern decls.
7344 Mostly, this hoists extern decls out of .c files and into .h files.
7345 That way, we're more likely to catch errors if the interfaces change.
7346 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7347 declare xg_mark_data.
7348 * dispextern.h (x_frame_parm_handlers):
7349 * font.h (Qxft):
7350 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7351 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7352 (Qultra_bold, Qoblique, Qitalic):
7353 Move extern decl here from .c file.
7354 * alloc.c (xg_mark_data) [USE_GTK]:
7355 * doc.c (Qclosure):
7356 * eval.c (Qlexical_binding):
7357 * fns.c (time) [!HAVE_UNISTD_H]:
7358 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7359 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7360 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7361 * lread.c (Qinternal_interpreter_environment):
7362 * minibuf.c (Qbuffer):
7363 * process.c (QCfamily, QCfilter):
7364 * widget.c (free_frame_faces):
7365 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7366 * xfont.c (x_clear_errors):
7367 * xterm.c (x_frame_parm_handlers):
7368 Remove now-redundant extern decls.
7369 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7370 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7371 Now static.
7372 * xfaces.c: Remove unnecessary static decls.
7373 * xterm.c (updating_frame): Remove decl of nonexistent object.
7374
7375 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7376 when building globals.h, as the objects that are not built on
7377 this host are not needed to compile C files on this host.
7378
7379 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7380
7381 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7382
7383 * frame.h: Add missing prototype for x_wm_set_size_hint.
7384
7385 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7386
7387 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7388 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7389 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7390 (Fsubstitute_command_keys):
7391 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7392 (save_excursion_save, save_excursion_restore)
7393 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7394 (format_time_string, general_insert_function)
7395 (make_buffer_string, make_buffer_string_both)
7396 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7397 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7398 (copy_text, insert_1, insert_1_both, insert_from_string)
7399 (insert_from_string_before_markers, insert_from_string_1)
7400 (insert_from_buffer, insert_from_buffer_1, replace_range)
7401 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7402 (del_range_2, modify_region):
7403 * intervals.c (intervals_equal, balance_possible_root_interval)
7404 (adjust_intervals_for_insertion, merge_properties_sticky)
7405 (graft_intervals_into_buffer, lookup_char_property)
7406 (adjust_for_invis_intang, set_point_both)
7407 (get_property_and_range, compare_string_intervals)
7408 (set_intervals_multibyte_1, set_intervals_multibyte):
7409 * keyboard.c (decode_timer):
7410 Use bool for boolean.
7411 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7412 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7413
7414 2012-09-02 Chong Yidong <cyd@gnu.org>
7415
7416 * keymap.c (push_key_description): Print M-TAB as C-M-i
7417 (Bug#11758).
7418
7419 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
7420
7421 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7422 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7423 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7424 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7425 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7426 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7427 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7428
7429 2012-09-01 Eli Zaretskii <eliz@gnu.org>
7430
7431 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7432 more than one grapheme cluster passed to the shaper: compute the
7433 offset adjustment values separately for each cluster. (Bug#11860)
7434
7435 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7436 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7437 about implicit conversions from integer to pointer.
7438
7439 2012-09-01 Daniel Colascione <dancol@dancol.org>
7440
7441 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7442 system used too early.
7443
7444 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7445
7446 Better seed support for (random).
7447 * emacs.c (main): Call init_random.
7448 * fns.c (Frandom): Set the seed from a string argument, if given.
7449 Remove long-obsolete Gentzel cruft.
7450 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7451 (init_random): New function.
7452
7453 2012-09-01 Daniel Colascione <dancol@dancol.org>
7454
7455 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7456 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7457 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7458 x_wm_set_size_hint, x_query_colors, x_real_positions,
7459 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7460 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7461 all of which have been moved to common code.
7462
7463 * xfaces.c: Include TERM_HEADER instead of listing all possible
7464 window-system headers.
7465
7466 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7467 to match header.
7468
7469 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7470 directly accessing frame internals.
7471
7472 * w32font.h: Include font.h. Define syms_of_w32font and
7473 globals_of_w32font.
7474
7475 * process.c: Include TERM_HEADER instead of listing all possible
7476 window-system headers.
7477
7478 * nsterm.h: Remove declarations now in frame.h.
7479 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
7480
7481 * menu.c: Include TERM_HEADER instead of listing all possible
7482 window-system headers.
7483
7484 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7485 window system.
7486
7487 * keyboard.c: Include TERM_HEADER instead of listing all possible
7488 window-system headers.
7489
7490 * image.c: Include TERM_HEADER instead of listing all possible
7491 window-system headers. Declare Vlibrary_cache when compiling for
7492 Windows.
7493
7494 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7495 window system declarations.
7496
7497 * frame.h: Move common functions here: set_frame_menubar,
7498 x_set_window_size, x_sync, x_get_focus_frame,
7499 x_set_mouse_position, x_set_mouse_pixel_position,
7500 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7501 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7502 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7503 x_activate_menubar, x_real_positions, x_bitmap_icon,
7504 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7505 and x_query_colors.
7506
7507 * frame.c: Include TERM_HEADER instead of listing all possible
7508 window-system headers.
7509
7510 * font.c: Include TERM_HEADER instead of listing all possible
7511 window-system headers.
7512
7513 * emacs.c: Include TERM_HEADER.
7514
7515 * dispnew.c: Include TERM_HEADER instead of listing all possible
7516 window-system headers.
7517
7518 * ccl.h: Include character.h.
7519
7520 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7521 the current window system; include in list of objects to link into
7522 Emacs.
7523
7524 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7525
7526 Remove mark_ttys function and fix tty_display_info initialization.
7527 * lisp.h (mark_ttys): Remove prototype.
7528 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7529 to mark_ttys because all possible values of 'top_frame' slot are
7530 the frames which are reachable from Vframe_list.
7531 * term.c (mark_ttys): Remove.
7532 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7533
7534 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7535
7536 Change struct frame bitfields from unsigned char to unsigned.
7537 * frame.h (struct frame): Change type of 'display_preempted',
7538 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7539 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7540 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7541 bitfields from unsigned char to unsigned.
7542
7543 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7544
7545 Remove unused member of struct x_output and struct w32_output.
7546 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7547 * w32term.h (struct w32_output): Likewise.
7548
7549 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7550
7551 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7552 does not become zero (Bug#12234).
7553
7554 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7555
7556 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7557 for GCC 4.7.1 x86-64.
7558
7559 2012-08-30 Glenn Morris <rgm@gnu.org>
7560
7561 * lread.c (init_lread): For out-of-tree builds, only add the
7562 source directory's site-lisp dir to the load-path if it exists,
7563 consistent with in-tree builds. (Bug#12302)
7564
7565 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7566
7567 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
7568 button_values to NULL. Call setStykeMask so dialogs get a close button.
7569 (windowShouldClose:): Set window_closed.
7570 (dealloc): New member, free button_values.
7571 (process_dialog:): Make member function. Remove window argument,
7572 replace window with self. Count buttons and allocate and store values
7573 in button_values.
7574 (addButton:value:row:): value is int with the name tag. Call setTag
7575 with tag. Remove return self, declare return value as void.
7576 (addString:row:): Remove return self, declare return value as void.
7577 (addSplit): Remove return self, declare return value as void.
7578 (clicked:): Remove return self, declare return value as void.
7579 Set dialog_return to button_values[seltag]. Code formatting change.
7580 (initFromContents:isQuestion:): Adjust call to process_dialog.
7581 Code formatting change.
7582 (timeout_handler:): Set timer_fired to YES.
7583 (runDialogAt:): Set timer_fired to NO.
7584 Handle click on close button as quit.
7585
7586 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7587 Add window_closed and button_values. Add void as return value for
7588 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7589 Add process_dialog as new member.
7590
7591 2012-08-28 Eli Zaretskii <eliz@gnu.org>
7592
7593 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7594 is not one of the heaps we manage. (Bug#12242)
7595
7596 2012-08-28 Glenn Morris <rgm@gnu.org>
7597
7598 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7599
7600 2012-08-28 Martin Rudalics <rudalics@gmx.at>
7601
7602 * window.c (Fset_window_configuration): Remove handling of
7603 auto-buffer-name window parameter. Install revision of reverted
7604 fix.
7605
7606 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7607
7608 Do not allow to set major mode for a dead buffer.
7609 * buffer.c (Fset_buffer_major_mode): Signal an error
7610 if the buffer is dead.
7611 (Fother_buffer, other_buffer_safely): Remove redundant
7612 nested declaration.
7613
7614 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7615
7616 Always use set_buffer_if_live to restore original buffer at unwind.
7617 * buffer.h (record_unwind_current_buffer): New function.
7618 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7619 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7620 * undo.c, window.c: Adjust users.
7621 * buffer.c (set_buffer_if_live): Fix comment.
7622
7623 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7624
7625 Fix usage of set_buffer_internal.
7626 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7627 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7628 * coding.c (decode_coding): Omit redundant test.
7629 * fileio.c (decide_coding_unwind): Likewise.
7630 * fns.c (secure_hash): Likewise.
7631 * insdel.c (modify_region): Likewise.
7632 * keyboard.c (command_loop_1): Likewise.
7633 * print.c (PRINTFINISH): Likewise.
7634 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7635
7636 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7637
7638 * dispnew.c: Use bool for boolean.
7639 (frame_garbaged, display_completed, delayed_size_change)
7640 (fonts_changed_p, add_window_display_history)
7641 (add_frame_display_history, verify_row_hash)
7642 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7643 (row_equal_p, realloc_glyph_pool)
7644 (allocate_matrices_for_frame_redisplay)
7645 (showing_window_margins_p)
7646 (adjust_frame_glyphs_for_frame_redisplay)
7647 (build_frame_matrix_from_leaf_window, make_current)
7648 (mirrored_line_dance, mirror_line_dance, update_frame)
7649 (update_window_tree, update_single_window)
7650 (check_current_matrix_flags, update_window, update_text_area)
7651 (update_window_line, set_window_update_flags, scrolling_window)
7652 (update_frame_1, scrolling, buffer_posn_from_coords)
7653 (do_pending_window_change, change_frame_size)
7654 (change_frame_size_1, sit_for):
7655 Use bool for boolean.
7656 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7657 and remove last int (actually boolean) argument, which was always 0.
7658 All callers changed.
7659 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7660 * dispextern.h (struct composition_it): Use bool for boolean.
7661 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7662 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7663 * dired.c (file_name_completion):
7664 Use bool for boolean. (This was missed in an earlier change.)
7665
7666 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7667
7668 * window.c (Fset_window_configuration): Revert first part of
7669 last change.
7670
7671 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7672
7673 * nsterm.h (NSPanel): New class variable dialog_return.
7674
7675 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7676 Initialize dialog_return.
7677 (windowShouldClose:): Use stop instead of stopModalWithCode.
7678 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7679 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7680 event.
7681 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7682 modal loop returns.
7683
7684 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7685
7686 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7687 * composite.c (find_composition, composition_gstring_p)
7688 (composition_reseat_it, find_automatic_composition):
7689 * data.c (let_shadows_buffer_binding_p)
7690 (let_shadows_global_binding_p, set_internal, make_blv)
7691 (Fmake_variable_buffer_local, Fmake_local_variable)
7692 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7693 (cons_to_signed, arith_driver):
7694 * dbusbind.c (xd_in_read_queued_messages):
7695 * dired.c (directory_files_internal, file_name_completion):
7696 Use bool for booleans.
7697 * dired.c (file_name_completion):
7698 * process.h (fd_callback):
7699 Omit int (actually boolean) argument. It wasn't being used.
7700 All uses changed.
7701 * composite.h, lisp.h: Reflect above API changes.
7702
7703 * cmds.c, coding.c: Use bool for booleans.
7704 * cmds.c (move_point, Fself_insert_command):
7705 * coding.h (struct composition status, struct coding_system):
7706 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7707 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7708 (emacs_mule_char, decode_coding_emacs_mule)
7709 (encode_coding_emacs_mule, detect_coding_iso_2022)
7710 (decode_coding_iso_2022, encode_invocation_designation)
7711 (encode_designation_at_bol, encode_coding_iso_2022)
7712 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7713 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7714 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7715 (encode_coding_raw_text, detect_coding_charset)
7716 (decode_coding_charset, encode_coding_charset, detect_eol)
7717 (detect_coding, get_translation_table, produce_chars)
7718 (consume_chars, reused_workbuf_in_use)
7719 (make_conversion_work_buffer, code_conversion_save)
7720 (decode_coding_object, encode_coding_object)
7721 (detect_coding_system, char_encodable_p)
7722 (Funencodable_char_position, code_convert_region)
7723 (code_convert_string, code_convert_string_norecord)
7724 (Fset_coding_system_priority):
7725 * fileio.c (Finsert_file_contents):
7726 Use bool for booleans.
7727 * coding.h, lisp.h: Reflect above API changes.
7728 * coding.c: Remove unnecessary static function decls.
7729 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7730 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7731 not a boolean 'int', since callers never look at the return value.
7732 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7733 * coding.h (decoding_buffer_size, encoding_buffer_size)
7734 (emacs_mule_string_char): Remove unused extern decls.
7735 (struct iso_2022_spec, struct coding_system):
7736 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7737 (struct emacs_mule_spec): Remove unused field 'full_support'.
7738 All initializations removed.
7739 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7740
7741 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7742
7743 Fix spare memory change (Bug#12286).
7744 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7745 (valid_lisp_object_p): Likewise.
7746
7747 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7748
7749 * window.c (Fset_window_configuration): Record any window's old
7750 buffer if it's replaced (see Bug#8789). If the new current
7751 buffer doesn't appear in the selected window, go to its old
7752 point (Bug#12208).
7753
7754 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7755
7756 Special MEM_TYPE_SPARE to denote reserved memory.
7757 * alloc.c (enum mem_type): New memory type.
7758 (refill_memory_reserve): Use new type for spare memory.
7759 This prevents live_cons_p and live_string_p from incorrect
7760 detection of uninitialized objects from spare memory as live.
7761
7762 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7763
7764 Spelling fixes.
7765 * Makefile.in (.PHONY): versioclean -> versionclean.
7766
7767 Remove unused external symbols.
7768 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7769 * window.c (Qwindow_valid_p, decode_valid_window):
7770 Now static, not extern.
7771 * data.c (Qinterval): Remove; unused.
7772 (syms_of_data): Do not define 'interval'.
7773 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7774 * window.h (decode_valid_window):
7775 Remove decls.
7776
7777 * character.c, charset.c, chartab.c: Use bool for booleans.
7778 * character.c (lisp_string_width, string_count_byte8)
7779 (string_escape_byte8):
7780 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7781 (load_charset_map_from_file, map_charset_chars)
7782 (Fdefine_charset_internal, define_charset_internal)
7783 (Fdeclare_equiv_charset, find_charsets_in_text)
7784 (Ffind_charset_region, char_charset, Fiso_charset):
7785 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7786 (sub_char_table_set, sub_char_table_set_range)
7787 (char_table_set_range, optimize_sub_char_table)
7788 (map_sub_char_table):
7789 Use bool for boolean.
7790 * character.c (str_to_unibyte): Omit last boolean argument; it was
7791 always 0. All callers changed.
7792 * character.h, charset.h: Adjust to match previous changes.
7793 * character.h (char_printable_p): Remove decl of nonexistent function.
7794 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7795 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7796 are all boolean, so make them single-bit bitfields.
7797
7798 * lisp.h (ASET): Remove attempt to detect side effects.
7799 It was meant to be temporary and it often doesn't work,
7800 because when IDX has side effects the behavior of IDX==IDX
7801 is undefined. See Stefan Monnier in
7802 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7803
7804 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7805
7806 * lisp.h (functionp): New function (extracted from Ffunctionp).
7807 (FUNCTIONP): Use it.
7808 * eval.c (Ffunctionp): Use it.
7809
7810 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7811
7812 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7813 as that's faster and simpler than static storage. Don't bother
7814 with the g_main_context_query overhead if g_main_context_pending
7815 says no events are pending.
7816 (gfds, gfds_size): Remove these static vars.
7817 (xgselect_initialize): Remove; no longer needed.
7818 All uses and decls removed.
7819
7820 * emacs.c (fatal_error_signal_hook): Remove.
7821 All uses removed. This leftover from old code was always 0.
7822
7823 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7824 * casefiddle.c (casify_object, casify_region):
7825 * casetab.c (set_case_table):
7826 * category.c, category.h (word_boundary_p):
7827 * category.h (CHAR_HAS_CATEGORY):
7828 Use bool for booleans, instead of int.
7829
7830 2012-08-25 Eli Zaretskii <eliz@gnu.org>
7831
7832 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7833
7834 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7835
7836 On assertion failure, print backtrace if available.
7837 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7838 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7839 * Makefile.in (LIB_EXECINFO): New macro.
7840 (LIBES): Use it.
7841
7842 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7843 * bytecode.c (exec_byte_code):
7844 * callint.c (check_mark, Fcall_interactively):
7845 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7846 (getenv_internal, sync_process_alive, call_process_exited):
7847 * lisp.h (USE_SAFE_ALLOCA):
7848 Use bool for booleans, instead of int.
7849 * lisp.h, process.h: Adjust prototypes to match above changes.
7850 * callint.c (Fcall_interactively): Don't assume the mark's
7851 offset fits in 'int'.
7852
7853 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7854
7855 * buffer.c, buffer.h: Use bool for boolean.
7856 * buffer.c (reset_buffer_local_variables)
7857 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7858 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7859 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7860 (overlay_touches_p, overlay_strings, Foverlay_put)
7861 (report_overlay_modification, call_overlay_mod_hooks):
7862 (mmap_enlarge, mmap_set_vars):
7863 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7864 Use bool for booleans, instead of int.
7865 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7866 since the 1-or-0 return value is always ignored anyway.
7867 (mmap_initialized_p):
7868 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7869 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7870
7871 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7872
7873 * bidi.c: Use bool for boolean.
7874 This is a bit more readable, and makes the text segment of bidi.o
7875 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7876 Presumably it's faster too.
7877 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7878 Now bool.
7879 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7880 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7881 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7882 (bidi_explicit_dir_char, bidi_level_of_next_char)
7883 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7884 Use bool for booleans, instead of int.
7885 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7886 (bidi_unshelve_cache): Adjust decls to match code.
7887
7888 2012-08-23 Martin Rudalics <rudalics@gmx.at>
7889
7890 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7891 argument.
7892
7893 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7894
7895 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7896 * atimer.h: Include <stdbool.h>.
7897
7898 2012-08-22 Dan Nicolaescu <dann@gnu.org>
7899
7900 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7901 compile time tests instead of run time tests on systems that do
7902 not use them.
7903 (FRAME_MAC_P): Remove leftover from deleted code.
7904 * frame.c (syms_of_frame): Remove leftover from deleted code.
7905
7906 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7907
7908 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7909
7910 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7911
7912 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7913 Otherwise, the compiler complains about (A?B:C) where B is void
7914 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
7915 (fontset_add): Return void, for FONTSET_ADD.
7916
7917 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7918
7919 * alloc.c: Use bool for booleans.
7920 (gc_in_progress, abort_on_gc)
7921 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7922 (dont_register_blocks) [GC_MALLOC_CHECK]:
7923 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7924 (check_string_bytes, make_specified_string, memory_full)
7925 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7926 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7927 (mark_stack, valid_pointer_p, make_pure_string)
7928 (Fgarbage_collect, survives_gc_p, gc_sweep):
7929 Use bool for booleans, instead of int.
7930 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7931 Remove unused local.
7932 * alloc.c (PURE_POINTER_P):
7933 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7934 * editfns.c (Fformat):
7935 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7936 (Fdo_auto_save):
7937 * fns.c (sweep_weak_table):
7938 * lisp.h (suppress_checking, push_message, survives_gc_p)
7939 (make_pure_string, gc_in_progress, abort_on_gc):
7940 * lread.c (readchar, read1):
7941 * print.c (Fprin1_to_string):
7942 * xdisp.c (push_message):
7943 Use bool for booleans affected directly or indirectly by
7944 alloc.c's changes.
7945
7946 Make recently-introduced setters macros.
7947 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7948 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7949 (set_fontset_default, set_fontset_fallback): Rename from their
7950 upper-case counterparts, and make them functions rather than macros.
7951 This is more consistent with the other recently-introduced setters.
7952 These don't need to be inline, since they're local.
7953
7954 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7955
7956 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7957 the loop (Bug#12247).
7958
7959 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7960
7961 * lisp.h (vcopy): Use memcpy rather than our own loop.
7962 This fixes a performance regression introduced by the recent
7963 addition of vcopy. This means 'vcopy' will need to be modified
7964 for a copying collector, but that's OK. Also, tighten the
7965 checking in the assertion.
7966
7967 2012-08-21 Eli Zaretskii <eliz@gnu.org>
7968
7969 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7970 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7971 non-base glyph for the width of the base character, according to
7972 what x_draw_composite_glyph_string_foreground expects.
7973 Generate WADJUST value according to composition_gstring_width's
7974 expectations, to produce correct width of the composed character.
7975 Reverse the sign of the DU offset produced by ScriptPlace.
7976
7977 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7980
7981 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7982
7983 Avoid direct writes to contents member of struct Lisp_Vector.
7984 * lisp.h (vcopy): New function to copy data into vector.
7985 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7986 * fns.c (Ffillarray): Use ASET.
7987 * keyboard.c (timer_check_2): Use AREF and ASET.
7988 (append_tool_bar_item, Frecent_keys): Use vcopy.
7989 * lread.c (read_vector): Use ASET.
7990 * msdos.c (Frecent_doskeys): Use vcopy.
7991 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7992 (Finternal_merge_in_global_face): Use ASET and vcopy.
7993 * xfont.c (xfont_list_pattern): Likewise.
7994
7995 2012-08-21 Martin Rudalics <rudalics@gmx.at>
7996
7997 * window.c (Fwindow_point): For the selected window always return
7998 the position of its buffer's point.
7999 (Fset_window_point): For the selected window always go in its
8000 buffer to the specified position.
8001
8002 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8003
8004 Setter macros for fontsets.
8005 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8006 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8007 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8008 Adjust users.
8009
8010 2012-08-20 Glenn Morris <rgm@gnu.org>
8011
8012 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8013 Don't assume that `ln -f' works.
8014
8015 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8016
8017 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8018 and later about non-assignments with no effect. See discussion at
8019 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8020 details.
8021
8022 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8023
8024 Inline setter functions for Lisp_Objects slots of struct specbinding.
8025 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8026 Adjust users.
8027
8028 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8029
8030 * window.c (select_window): Always make selected window's buffer
8031 current.
8032
8033 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8034
8035 Use AREF and ASET for docstrings of category tables.
8036 * category.h (CATEGORY_DOCSTRING): Use AREF.
8037 (SET_CATEGORY_DOCSTRING): Use ASET.
8038 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8039
8040 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8041
8042 Inline setter functions for hash table members.
8043 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8044 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8045 (set_hash_key_and_value, set_hash_index, set_hash_next)
8046 (set_hash_hash): New functions.
8047 * charset.c, fns.c: Adjust users.
8048
8049 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8050
8051 Inline getter and setter functions for per-buffer values.
8052 * buffer.h (per_buffer_default, set_per_buffer_default)
8053 (per_buffer_value, set_per_buffer_value): New functions.
8054 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8055 * buffer.c, data.c: Adjust users.
8056
8057 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8058
8059 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8060
8061 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8062
8063 Rely on <config.h> + <unistd.h> to declare 'environ',
8064 as gnulib does this if the system doesn't.
8065 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8066 Remove declaration. MS-Windows declares it on stdlib.h which is
8067 included by conf_post.h.
8068 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8069 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8070 * vm-limit.c: Include <unistd.h>, for 'environ'.
8071
8072 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8073 (start_of_data): Remove decl; mem-limits.h provides it.
8074
8075 * xdisp.c (handle_invisible_prop): Make it a bit faster
8076 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8077
8078 2012-08-19 Chong Yidong <cyd@gnu.org>
8079
8080 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8081 ends (Bug#3874).
8082
8083 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8084
8085 * .gdbinit: Use call instead of set when calling a function in the
8086 inferior.
8087
8088 * data.c (set_internal): Don't use set_blv_found.
8089 (Fkill_local_variable): Likewise.
8090
8091 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8092
8093 * nsfont.m (ns_ascii_average_width): Ensure the string
8094 ascii_printable is initialized with a null-terminated character
8095 array. Otherwise, it can contain undesired extra characters.
8096
8097 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8098
8099 port new setting code to Sun C 5.8 2005/10/13
8100 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8101 Return void, not Lisp_Object. Otherwise, the compiler
8102 complains about (A?B:C) where B is void and C is Lisp_Object
8103 when compiling CHAR_TABLE_SET, due to the recent change to
8104 the API of sub_char_table_set_contents.
8105
8106 2012-08-18 Chong Yidong <cyd@gnu.org>
8107
8108 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8109 for the string case (Bug#3874).
8110
8111 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8112
8113 * buffer.h (BSET): Remove (Bug#12215).
8114 Replace all uses with calls to new setter functions.
8115 (bset_bidi_paragraph_direction, bset_case_canon_table)
8116 (bset_case_eqv_table, bset_directory, bset_display_count)
8117 (bset_display_time, bset_downcase_table)
8118 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8119 (bset_last_selected_window, bset_local_var_alist)
8120 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8121 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8122 (bset_width_table):
8123 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8124 (bset_auto_fill_function, bset_auto_save_file_format)
8125 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8126 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8127 (bset_cache_long_line_scans, bset_case_fold_search)
8128 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8129 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8130 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8131 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8132 (bset_header_line_format, bset_indicate_buffer_boundaries)
8133 (bset_indicate_empty_lines, bset_invisibility_spec)
8134 (bset_left_fringe_width, bset_major_mode, bset_mark)
8135 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8136 (bset_name, bset_overwrite_mode, bset_pt_marker)
8137 (bset_right_fringe_width, bset_save_length)
8138 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8139 (bset_scroll_up_aggressively, bset_selective_display)
8140 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8141 (bset_word_wrap, bset_zv_marker):
8142 * category.c (bset_category_table):
8143 * syntax.c (bset_syntax_table):
8144 New setter functions.
8145
8146 * process.h (PSET): Remove (Bug#12215).
8147 Replace all uses with calls to new setter functions.
8148 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8149 (PROCESS_INLINE): New macro.
8150 (pset_childp): New setter function.
8151 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8152 * process.c (PROCESS_INLINE):
8153 Define to EXTERN_INLINE, so that the corresponding functions
8154 are compiled into code.
8155 (pset_buffer, pset_command, pset_decode_coding_system)
8156 (pset_decoding_buf, pset_encode_coding_system)
8157 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8158 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8159 (pset_type, pset_write_queue): New setter functions.
8160
8161 * window.h (WSET): Remove (Bug#12215).
8162 Replace all uses with calls to new setter functions.
8163 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8164 (WINDOW_INLINE): New macro.
8165 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8166 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8167 (wset_total_lines, wset_vertical_scroll_bar)
8168 (wset_window_end_pos, wset_window_end_valid)
8169 (wset_window_end_vpos): New setter functions.
8170 * window.c (WINDOW_INLINE):
8171 Define to EXTERN_INLINE, so that the corresponding functions
8172 are compiled into code.
8173 (wset_combination_limit, wset_dedicated, wset_display_table)
8174 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8175 (wset_new_normal, wset_new_total, wset_next_buffers)
8176 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8177 (wset_prev_buffers, wset_right_fringe_width)
8178 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8179 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8180 (wset_window_parameters):
8181 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8182 (wset_column_number_displayed, wset_region_showing):
8183 New setter functions.
8184
8185 * termhooks.h (TSET): Remove (Bug#12215).
8186 Replace all uses with calls to new setter functions.
8187 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8188 (TERMHOOKS_INLINE): New macro.
8189 (tset_charset_list, tset_selection_alist): New setter functions.
8190 * terminal.c (TERMHOOKS_INLINE):
8191 Define to EXTERN_INLINE, so that the corresponding functions
8192 are compiled into code.
8193 (tset_param_alist): New setter function.
8194
8195 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8196
8197 * keyboard.h (KSET): Remove (Bug#12215).
8198 Replace all uses with calls to new setter functions.
8199 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8200 (KEYBOARD_INLINE): New macro.
8201 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8202 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8203 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8204 New setter functions.
8205 * keyboard.c (KEYBOARD_INLINE):
8206 Define to EXTERN_INLINE, so that the corresponding functions
8207 are compiled into code.
8208 (kset_echo_string, kset_kbd_queue)
8209 (kset_keyboard_translate_table, kset_last_prefix_arg)
8210 (kset_last_repeatable_command, kset_local_function_key_map)
8211 (kset_overriding_terminal_local_map, kset_real_last_command)
8212 (kset_system_key_syms): New setter functions.
8213
8214 * frame.h (FSET): Remove (Bug#12215).
8215 Replace all uses with calls to new setter functions.
8216 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8217 (FRAME_INLINE): New macro.
8218 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8219 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8220 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8221 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8222 (fset_param_alist, fset_root_window, fset_scroll_bars)
8223 (fset_selected_window, fset_title, fset_tool_bar_items)
8224 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8225 * frame.c (FRAME_INLINE):
8226 Define to EXTERN_INLINE, so that the corresponding functions
8227 are compiled into code.
8228 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8229
8230 A few more naming-convention fixes for getters and setters.
8231 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8232 and rename from buffer_overlays_set_before.
8233 (set_buffer_overlays_after): Move here from buffer.h, and rename
8234 from buffer_overlays_set_after.
8235 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8236 All uses changed.
8237 (set_buffer_intervals): Rename from buffer_set_intervals.
8238 * intervals.c (set_interval_object): Move here from intervals.h,
8239 and rename from interval_set_object.
8240 (set_interval_left): Move here from intervals.h, and rename from
8241 interval_set_left.
8242 (set_interval_right): Move here from intervals.h, and rename from
8243 interval_set_right.
8244 (copy_interval_parent): Move here from intervals.h, and rename from
8245 interval_copy_parent.
8246 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8247 (set_interval_plist): Rename from interval_set_plist.
8248 Return void, not Lisp_Object, since no caller uses the result.
8249 * lisp.h (string_intervals): Rename from string_get_intervals.
8250 (set_string_intervals): Rename from string_set_intervals.
8251
8252 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8253 (set_char_table_contents): Rename from char_table_set_contents.
8254 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8255 All uses changed. See the end of
8256 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8257
8258 * lisp.h (CSET): Remove (Bug#12215).
8259 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8260 (set_char_table_purpose): New functions,
8261 replacing CSET. All uses changed. For example, replace
8262 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8263 "set_char_table_parent (char_table, parent);".
8264 The old version was confusing because it used the same name
8265 'parent' for two different things.
8266
8267 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8268
8269 Functions to get and set Lisp_Object fields of buffer-local variables.
8270 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8271 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8272 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8273 * data.c, eval.c, frame.c: Adjust users.
8274
8275 2012-08-17 Chong Yidong <cyd@gnu.org>
8276
8277 * xfaces.c (merge_face_vectors): If the target font specfies a
8278 font spec, make the font's attributes take precedence over
8279 directly-specified attributes.
8280 (merge_face_ref): Recognize :font.
8281
8282 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8283
8284 Do not use memcpy for copying intervals.
8285 * intervals.c (reproduce_interval): New function.
8286 (reproduce_tree, reproduce_tree_obj): Use it.
8287 (reproduce_tree_obj): Remove prototype.
8288
8289 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8290
8291 * lisp.h (duration_to_sec_usec): Remove unused decl.
8292
8293 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8294
8295 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8296 to an allocated instance of NSString, not to the class itself.
8297
8298 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8299
8300 * makefile.w32-in (C_CTYPE_H): New macro.
8301 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8302 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8303 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8304
8305 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 Use ASCII tests for character types.
8308 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8309 * xfns.c, xterm.c:
8310 Don't include <ctype.h>; was not needed.
8311 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8312 * sysdep.c, xfaces.c:
8313 Include <c-ctype.h> instead of <ctype.h>.
8314 * nsterm.m: Include <c-ctype.h>.
8315 * charset.c (read_hex):
8316 * doc.c (Fsnarf_documentation):
8317 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8318 (DRIVE_LETTER) [DOS_NT]:
8319 (Ffile_name_directory, Fexpand_file_name)
8320 (Fsubstitute_in_file_name):
8321 * font.c (font_parse_xlfd, font_parse_fcname):
8322 * frame.c (x_set_font_backend):
8323 * gtkutil.c (xg_get_font):
8324 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8325 * nsimage.m (hexchar):
8326 * nsterm.m (ns_xlfd_to_fontname):
8327 * sysdep.c (system_process_attributes):
8328 * xfaces.c (hash_string_case_insensitive):
8329 Use C-locale tests instead of locale-specific tests for character
8330 types, since we want the ASCII interpretation here, not the
8331 interpretation suitable for whatever happens to be the current locale.
8332
8333 2012-08-16 Martin Rudalics <rudalics@gmx.at>
8334
8335 Consistently check windows for validity/liveness
8336 (Bug#11984, Bug#12025, Bug#12026).
8337 * lisp.h (CHECK_VALID_WINDOW): New macro.
8338 * window.c (decode_window): Rename to decode_live_window.
8339 (decode_valid_window, Fwindow_valid_p): New functions.
8340 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8341 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8342 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8343 (Fwindow_prev_sibling, Fwindow_combination_limit)
8344 (Fset_window_combination_limit, Fwindow_use_time)
8345 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8346 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8347 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8348 (Fwindow_hscroll, Fset_window_hscroll)
8349 (Fwindow_redisplay_end_trigger)
8350 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8351 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8352 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8353 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8354 (Fwindow_end, Fset_window_point, Fset_window_start)
8355 (Fpos_visible_in_window_p, Fwindow_line_height)
8356 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8357 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8358 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8359 (Fset_window_parameter, Fwindow_display_table)
8360 (Fset_window_display_table, Fdelete_other_windows_internal)
8361 (Fset_window_buffer, Fset_window_new_total)
8362 (Fset_window_new_normal, Fdelete_window_internal)
8363 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8364 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8365 (Fwindow_scroll_bars): Check whether argument window is a valid or
8366 live window. Update doc-strings.
8367 (syms_of_window): New symbol Qwindow_valid_p.
8368 * keyboard.c (Fposn_at_x_y): Check whether argument
8369 frame_or_window denotes a valid window.
8370
8371 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8372
8373 Fix previous char table change.
8374 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8375 * chartab.c (optimize_sub_char_table): Likewise.
8376
8377 2012-08-16 Chong Yidong <cyd@gnu.org>
8378
8379 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8380
8381 * xfont.c (xfont_open):
8382 * xftfont.c (xftfont_open): Set the font's max_width field.
8383
8384 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8385 min_width to space_width and average_width to the average over
8386 printable ASCII characters.
8387 (ns_char_width): Code cleanup.
8388 (ns_ascii_average_width): New utility function.
8389
8390 * font.h (struct font): Update comments.
8391
8392 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8393
8394 Simple interface to set Lisp_Object fields of character tables.
8395 * lisp.h (CSET): New macro.
8396 (char_table_set_extras, char_table_set_contents)
8397 (sub_char_table_set_contents): New function.
8398 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8399 * syntax.c: Adjust users.
8400
8401 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8402
8403 * eval.c (eval_sub): Bind lexical-binding.
8404 * lread.c (Qlexical_binding): Make non-static.
8405
8406 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8407
8408 * nsmenu.m (popupSession): Remove.
8409 (pop_down_menu): Remove endModalSession.
8410 (timeout_handler:): New method.
8411 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8412 Call runModalForWindow. Check timer_fired when it returns.
8413 If not set, cancel timer and break out of loop.
8414 Otherwise loop again, with a new timeout.
8415
8416 * nsterm.m: Include fcntl.h if present.
8417 (fd_entry, t_readfds, inNsSelect): Remove.
8418 (select_writefds, select_valid, select_timeout, selfds)
8419 (select_mutex, apploopnr): Add.
8420 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8421 Otherwise call kbd_buffer_store_event.
8422 (ns_send_appdefined): Remove release of fd_entry.
8423 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8424 Increment and decrement apploopnr.
8425 (ns_select): If no file descriptors, just do a NSTimer.
8426 Otherwise copy read/write masks and start select thread (fd_handler).
8427 Start main loop and wait for application defined event.
8428 Inform select thread to stop selecting after main loop is exited.
8429 (ns_term_init): Create selfds pipe and set non-blocking.
8430 Initialize select_mutex. Start the select thread (fd_handler).
8431 (fd_handler:): Loop forever, wait for info from the main thread
8432 to either start or stop selecting. When select returns, send
8433 and appdefined event.
8434 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8435 If not call kbd_buffer_store_event.
8436
8437 * nsterm.h (EmacsApp): fd_handler takes id argument.
8438 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8439
8440 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8441
8442 2012-08-15 Eli Zaretskii <eliz@gnu.org>
8443
8444 * region-cache.c (move_cache_gap): Update gap_len using the actual
8445 growth of the boundaries array. Do not change cache_len.
8446 (Bug#12196)
8447
8448 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8449
8450 Generalize and cleanup font subsystem checks.
8451 * font.h (FONT_DEBUG, font_assert): Remove.
8452 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8453 Change font_assert to eassert. Use eassert where appropriate.
8454
8455 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8456
8457 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8458
8459 2012-08-15 Chong Yidong <cyd@gnu.org>
8460
8461 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8462 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8463 extract the font descriptor instead of just the font name.
8464 In that case, return a font spec instead of a string.
8465 (x_last_font_name): Move to this file from xfns.c.
8466
8467 * xfns.c (Fx_select_font): The return value can also be a font
8468 spec. Move x_last_font_name management to gtkutil.c.
8469
8470 * xfaces.c: Make font weight and style symbols non-static.
8471
8472 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8473
8474 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8475 (bug#12117).
8476
8477 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8478
8479 * alloc.c (Fgarbage_collect): Use plural form consistently.
8480
8481 2012-08-14 Eli Zaretskii <eliz@gnu.org>
8482
8483 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8484 iteration through the command loop. Fixes a problem whereby mouse
8485 movements are ignored until the first mouse click.
8486
8487 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8488
8489 Use bool, not int, for Lisp booleans.
8490 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8491 makes Emacs a bit smaller and presumably a bit faster.
8492 * lisp.h: Include <stdbool.h>.
8493 (struct Lisp_Boolfwd, defvar_bool):
8494 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8495 * regex.c [!emacs]: Include <stdbool.h>.
8496 (false, true): Remove; <stdbool.h> does this for us now.
8497
8498 2012-08-14 Chong Yidong <cyd@gnu.org>
8499
8500 * character.c (Fcharacterp): Doc fix (Bug#12076).
8501
8502 * data.c (Findirect_variable): Doc fix (Bug#11040).
8503
8504 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8505
8506 * editfns.c (Fformat): Doc fix (Bug#12059).
8507 (Fsave_current_buffer): Doc fix (Bug#11542).
8508
8509 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8510
8511 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8512 (bug#12022).
8513
8514 2012-08-14 Martin Rudalics <rudalics@gmx.at>
8515
8516 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8517 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8518 * minibuf.c (choose_minibuf_frame, read_minibuf):
8519 * w32fns.c (x_create_tip_frame):
8520 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8521 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8522
8523 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8524
8525 * intervals.c (offset_intervals): Remove obsolete comment.
8526
8527 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8528
8529 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8530
8531 2012-08-14 Gergely Risko <gergely@risko.hu>
8532
8533 * coding.c (decode_coding): Record buffer modification before
8534 disabling undo_list (Bug#11773).
8535
8536 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8537
8538 Revert and cleanup some recent overlay changes.
8539 * buffer.h (enum overlay_type): Remove.
8540 (buffer_get_overlays, buffer_set_overlays): Likewise.
8541 (buffer_set_overlays_before, buffer_set_overlays_after):
8542 New function. Adjust users.
8543 (unchain_both): Add eassert.
8544
8545 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8546
8547 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8548
8549 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8550
8551 * gtkutil.c (xg_mark_data): Don't assume C99.
8552
8553 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8554
8555 * gtkutil.c (xg_frame_tb_info): New struct.
8556 (TB_INFO_KEY): New define.
8557 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8558 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8559 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8560 if not present.
8561 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
8562 is up to date. Otherwise store new data.
8563 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8564
8565 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8566
8567 Use KSET for write access to Lisp_Object members of struct kboard.
8568 * keyboard.h (KSET): New macro.
8569 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8570 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8571 * xterm.c: Adjust users.
8572
8573 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8574
8575 Use BSET for write access to Lisp_Object members of struct buffer.
8576 * buffer.h (BSET): New macro.
8577 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8578 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8579 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8580 * window.c, xdisp.c, xfns.c: Adjust users.
8581
8582 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8583
8584 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8585
8586 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8587
8588 * nsterm.m (not_in_argv): New function.
8589 (application:openFile, application:openTempFile:):
8590 (application:openFileWithoutUI:, application:openFiles:): Open file
8591 if not_in_argv returns non-zero (bug#12171).
8592
8593 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
8594 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8595 Define for Gtk+ versions less than 3.2.
8596 (xg_get_font_name): Use those functions/macros here.
8597 Reported by Frans Oilinki <moilinki@gmail.com>.
8598
8599 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8600
8601 * unexmacosx.c (copy_data_segment): Copy initialized data in
8602 statically linked libraries from input file rather than memory.
8603
8604 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8605 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8606 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8607
8608 2012-08-10 Glenn Morris <rgm@gnu.org>
8609
8610 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8611 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8612
8613 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8614
8615 Fix last change to allow compilation with low optimization levels.
8616 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8617 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8618
8619 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8620
8621 Use common inline syntax in intervals.h.
8622 * intervals.h (INTERVALS_INLINE): New macro.
8623 Change all users from LISP_INLINE.
8624
8625 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8626
8627 Define Qnone once for all platforms.
8628 * frame.c (Qnone): Define here.
8629 (syms_of_frame): DEFSYM it.
8630 * lisp.h (Qnone): New declaration.
8631 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8632 * xfns.c: Remove duplication. Adjust users.
8633
8634 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8635
8636 Remove unused macros from intervals.h.
8637 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8638 * intervals.c: Adjust comment.
8639
8640 2012-08-10 Eli Zaretskii <eliz@gnu.org>
8641
8642 * w32fns.c <w32_unicode_gui>: New static variable.
8643 (globals_of_w32fns): Initialize it according to os_subtype.
8644 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8645 testing os_subtype.
8646
8647 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
8648 Eli Zaretskii <eliz@gnu.org>
8649
8650 Fix bug #10299 with Unicode characters sent by customized
8651 keyboards created by MSKLC.
8652 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8653 (w32_init_class): Use it to initialize the Emacs class with either
8654 ANSI or Unicode API calls.
8655 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8656 later.
8657 (w32_wnd_proc): If the character code sent by WM_CHAR or
8658 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8659 original message. Call DefWindowProcW on NT and later.
8660
8661 2012-08-10 Glenn Morris <rgm@gnu.org>
8662
8663 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8664
8665 * lisp.h (DIRECTORY_SEP): Let configure set it.
8666
8667 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8668
8669 Use TSET for write access to Lisp_Object slots of struct terminal.
8670 * termhooks.h (TSET): New macro.
8671 * coding.c, terminal.c, xselect.c: Adjust users.
8672
8673 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8674
8675 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8676 the failing expression, include them in the error message.
8677 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8678 * lisp.h (internal_condition_case_n): Update declaration.
8679
8680 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8681
8682 Inline functions to examine and change buffer overlays.
8683 * buffer.c (unchain_both): New function.
8684 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8685 (buffer_has_overlays): New function.
8686 (enum overlay_type): New enum.
8687 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8688 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8689
8690 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8691
8692 Inline functions to examine and change buffer intervals.
8693 * alloc.c (mark_interval_tree): Remove.
8694 (MARK_INTERVAL_TREE): Simplify.
8695 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8696 * intervals.c (buffer_balance_intervals): New function.
8697 (graft_intervals_into_buffer): Adjust indentation.
8698 (set_intervals_multibyte): Simplify.
8699 * buffer.h (BUF_INTERVALS): Remove.
8700 (buffer_get_intervals, buffer_set_intervals): New function.
8701 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8702 * intervals.c, textprop.c: Adjust users.
8703
8704 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8705
8706 Inline functions to examine and change string intervals.
8707 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8708 (string_get_intervals, string_set_intervals): New function.
8709 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8710 * lread.c, print.c, textprop.c: Adjust users.
8711
8712 2012-08-08 Glenn Morris <rgm@gnu.org>
8713
8714 * lisp.mk (lisp): Remove language/persian.elc.
8715
8716 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8717
8718 Cleanup intervals.
8719 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8720 (NULL_INTERVAL_P): Likewise. Adjust users.
8721 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8722 Adjust comment. Move under #if 0.
8723 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8724 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8725
8726 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8727
8728 Check total length of intervals with eassert.
8729 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8730 * intervals.c: Change all users to eassert.
8731
8732 2012-08-07 Eli Zaretskii <eliz@gnu.org>
8733
8734 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8735 Rename fields to match removal of FGET and WGET and disuse of
8736 INTERNAL_FIELD in Lisp_Cons.
8737
8738 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8739
8740 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8741 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8742 name since all xname users are fixed long time ago. Do not
8743 use INTERNAL_FIELD.
8744 (set_symbol_name, set_symbol_function, set_symbol_plist):
8745 (set_symbol_next, set_overlay_plist): New function.
8746 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8747 (struct Lisp_Overlay): Likewise.
8748 (CVAR, MVAR, SVAR): Remove.
8749 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8750 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8751 * xterm.c: Adjust users.
8752 * .gdbinit: Change to use name field of struct Lisp_Symbol
8753 where appropriate.
8754
8755 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8756
8757 Basic functions to set Lisp_Object and pointer slots of intervals.
8758 * intervals.h (interval_set_parent, interval_set_object):
8759 (interval_set_left, interval_set_right, interval_set_plist):
8760 (interval_copy_parent): New function.
8761 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
8762 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8763 Adjust indentation.
8764 (INTERVAL_SIZE): Remove. Adjust users.
8765 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8766
8767 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8768
8769 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8770 * process.h (PGET): Remove.
8771 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8772 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8773
8774 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8775
8776 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8777 * window.h (WGET): Remove.
8778 (struct window): Do not use INTERNAL_FIELD.
8779 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8780 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8781 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8782 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8783 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8784 Adjust users.
8785
8786 2012-08-07 Chong Yidong <cyd@gnu.org>
8787
8788 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8789 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8790 (Fdelete_window_internal): Signal an error if the window is not on
8791 a live frame (Bug#12025).
8792
8793 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8794
8795 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8796 * frame.h (FGET): Remove.
8797 (struct frame): Do not use INTERNAL_FIELD.
8798 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8799 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8800 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8801 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8802
8803 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
8804
8805 * w32.c: Silence compiler warnings.
8806 (map_w32_filename): Remove unused variable `is_fat'.
8807 (chase_symlinks): Add parentheses around expression.
8808
8809 2012-08-06 Glenn Morris <rgm@gnu.org>
8810
8811 * sysdep.c: Respect BROKEN_GETWD.
8812
8813 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8814 Let configure handle it.
8815 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8816
8817 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8818
8819 Use GCALIGNMENT where appropriate.
8820 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8821 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8822 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8823
8824 2012-08-06 Eli Zaretskii <eliz@gnu.org>
8825
8826 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8827 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
8828
8829 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8830
8831 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8832 that should be sufficient for everyone.
8833
8834 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8835
8836 * keyboard.c (timer_check_2): Add break so timer_check returns next
8837 timeout.
8838
8839 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8840
8841 Fix Windows build errors introduced after converting to WGET and WSET.
8842 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8843 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8844
8845 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8846
8847 * nsterm.m (ns_frame_rehighlight): Use FSET.
8848
8849 * nsmenu.m (ns_update_menubar): Use FSET.
8850
8851 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8852
8853 Separate read and write access to Lisp_Object slots of Lisp_Process.
8854 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8855 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8856
8857 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8858
8859 Separate read and write access to Lisp_Object slots of struct window.
8860 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8861 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8862 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8863 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8864 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8865 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8866 Adjust users.
8867
8868 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8869
8870 Fix Windows build errors introduced after converting to FGET and FSET.
8871 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8872 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8873 (w32_judge_scroll_bars): Change to use FSET.
8874 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8875
8876 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8877
8878 Fix replacement typo.
8879 * window.c (replace_window): Set root_window instead of
8880 selected_window. This fixes a total window subsystem
8881 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8882
8883 2012-08-06 Glenn Morris <rgm@gnu.org>
8884
8885 * lisp.mk (lisp): Add language/persian.elc.
8886
8887 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8888
8889 Separate read and write access to Lisp_Object slots of struct frame.
8890 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8891 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8892 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8893 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8894 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8895
8896 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8897
8898 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8899
8900 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8901
8902 Generalize common compile-time constants.
8903 * lisp.h (header_size, bool_header_size, word_size): Now here.
8904 (struct Lisp_Vector): Add comment.
8905 (struct Lisp_Bool_Vector): Move up to define handy constants.
8906 (VECSIZE, PSEUDOVECSIZE): Simplify.
8907 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8908 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8909 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8910 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8911 * xfont.c, xmenu.c: Use word_size where appropriate.
8912
8913 2012-08-05 Lawrence Mitchell <wence@gmx.li>
8914
8915 * search.c (Freplace_match): Treat \? in the replacement text
8916 literally (Bug#8161).
8917
8918 2012-08-05 Chong Yidong <cyd@gnu.org>
8919
8920 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8921 * frame.c (Vdelete_frame_functions):
8922 * emacs.c (Vkill_emacs_hook): Doc fix.
8923
8924 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8925
8926 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8927 --with-x-toolkit=no builds.
8928 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8929
8930 2012-08-04 Chong Yidong <cyd@gnu.org>
8931
8932 * syntax.c (Fmodify_syntax_entry): Doc fix.
8933
8934 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8935
8936 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8937 * w32.c (init_environment): Change the default values of many
8938 environment variables in dflt_envvars[] to NULL, to avoid pushing
8939 them into environment when they were not already defined.
8940 Remove the code that deletes site-lisp subdirectories from the default
8941 value of EMACSLOADPATH, as it is no longer needed.
8942 (check_windows_init_file): Now external, not static.
8943 Use Vload_path as is, without adding anything, as this function is now
8944 called when Vload_path is already set up.
8945
8946 * w32.h (check_windows_init_file): Add prototype.
8947
8948 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8949 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8950 compatibility with Posix platforms.
8951 (main): Move the call to check_windows_init_file to here from
8952 w32.c.
8953 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8954 any, in the DEFALT argument into the root of the Emacs build or
8955 installation tree, as appropriate.
8956
8957 * callproc.c (init_callproc_1): Call decode_env_path instead of
8958 doing its equivalent by hand.
8959 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8960 the code that sets Vexec_path run on MS-Windows.
8961
8962 * lread.c (init_lread): Add comments to #ifdef's.
8963
8964 * msdos.c (dos_set_window_size, IT_update_begin)
8965 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8966 instead of direct references.
8967
8968 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8969
8970 Export DEFAULT_REHASH_* to GDB.
8971 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8972 Now constants, not macros.
8973
8974 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8975
8976 Remove unnecessary casts involving pointers.
8977 These casts are no longer needed now that we assume C89 or later,
8978 since they involve casting to or from void *.
8979 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8980 (make_pure_float, make_pure_vector):
8981 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8982 * macros.c (Fstart_kbd_macro):
8983 * menu.c (find_and_return_menu_selection):
8984 * minibuf.c (read_minibuf_noninteractive):
8985 * sysdep.c (closedir):
8986 * xdisp.c (x_produce_glyphs):
8987 * xfaces.c (compare_fonts_by_sort_order):
8988 * xfns.c (x_real_positions, select_visual):
8989 * xselect.c (x_stop_queuing_selection_requests)
8990 (x_get_window_property, x_get_window_property_as_lisp_data):
8991 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8992 Remove unnecessary pointer casts.
8993 * alloc.c (record_xmalloc): New function.
8994 * lisp.h (record_xmalloc): New decl.
8995 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8996 more like a function. This is because the pointer cast is not
8997 needed. All uses changed.
8998 * print.c (print_string, print_error_message): Avoid length recalc.
8999
9000 Improve fix for macroexp crash with debugging (Bug#12118).
9001 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9002 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9003 not supposed to be invoked from the garbage collector.
9004 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9005 (gc_aset): New function, which is like ASET but can be
9006 used in the garbage collector.
9007 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9008 (set_hash_index): Use it instead of ASET.
9009
9010 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9011
9012 Support symlinks on latest versions of MS-Windows.
9013 * w32.c: Include winioctl.h and aclapi.h.
9014 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9015 (revert_to_self): Forward declarations of static functions.
9016 <static BOOL g_b_init_get_security_info>:
9017 <g_b_init_create_symbolic_link>: New static flags.
9018 (globals_of_w32): Initialize them to zero.
9019 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9020 (map_w32_filename): Improve commentary. Simplify switch.
9021 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9022 headers (most versions of MinGW w32api don't).
9023 (get_security_info, create_symbolic_link)
9024 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9025 New functions.
9026 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9027 in the argument file name.
9028 (sys_access): Call unc_volume_file_attributes only if
9029 GetFileAttributes fails with network-related error codes.
9030 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9031 have the required privileges.
9032 (get_file_security_desc_by_name): Rename from
9033 get_file_security_desc.
9034 (stat_worker): New function, with most of the guts of 'stat', and
9035 with addition of handling of symlinks and support for 'lstat'.
9036 If possible, get file's attributes and security information by
9037 handle, not by name. Produce S_IFLNK bit for symlinks, when
9038 called from 'lstat'.
9039 (stat, lstat): New functions, call 'stat_worker'.
9040 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9041 symlinks when the underlying filesystem supports them.
9042
9043 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9044
9045 Fix macroexp crash on Windows with debugging (Bug#12118).
9046 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9047 checking subscripts; problem introduced with the recent
9048 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9049 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9050 since it's used in non-static inline functions now.
9051
9052 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9053 Don't assume buffer size fits in 'int'. Remove unused local.
9054
9055 Use C99-style 'extern inline' if available.
9056 * buffer.h (BUFFER_INLINE):
9057 * category.h (CATEGORY_INLINE):
9058 * character.h (CHARACTER_INLINE):
9059 * charset.h (CHARSET_INLINE):
9060 * composite.h (COMPOSITE_INLINE):
9061 * dispextern.h (DISPEXTERN_INLINE):
9062 * lisp.h (LISP_INLINE):
9063 * systime.h (SYSTIME_INLINE):
9064 New macro, replacing 'static inline' in this header.
9065 * buffer.h, category.h, character.h, charset.h, composite.h:
9066 * dispextern.h, lisp.h, systime.h:
9067 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9068 * alloc.c (LISP_INLINE):
9069 * buffer.c (BUFFER_INLINE):
9070 * category.c (CATEGORY_INLINE):
9071 * character.c (CHARACTER_INLINE):
9072 * charset.c (CHARSET_INLINE):
9073 * composite.c (COMPOSITE_INLINE):
9074 * dispnew.c (DISPEXTERN_INLINE):
9075 * sysdep.c (SYSTIME_INLINE):
9076 Define to EXTERN_INLINE, so that the corresponding functions
9077 are compiled into code.
9078 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9079 (INLINE_HEADER_END): New macros.
9080 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9081 since it's used in non-static inline functions now.
9082 (VALMASK) [!USE_LSB_TAG]: Likewise.
9083
9084 2012-08-02 Glenn Morris <rgm@gnu.org>
9085
9086 * s/: Remove empty directory.
9087
9088 * s/ms-w32.h: Move to ../nt/inc.
9089 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9090 Update for new ms-w32.h location.
9091
9092 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9093
9094 Port to Solaris 8.
9095 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9096
9097 2012-08-02 Glenn Morris <rgm@gnu.org>
9098
9099 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9100 hard-coding the path separator.
9101
9102 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9103
9104 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9105 This how ASET and AREF are supposed to work, and makes
9106 it easier to think about future improvements. See
9107 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9108 * charset.h (set_charset_attr): New function.
9109 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9110 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9111 (aref_addr): New function. All uses of &AREF(...) changed.
9112 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9113 (set_hash_index): New functions. All lvalue-style uses of
9114 HASH_KEY etc. changed.
9115 * keyboard.c (set_prop): New function. All lvalue-style uses
9116 of PROP changed.
9117
9118 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9119
9120 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9121 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9122 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9123 * nsfns.m (ns_set_name_as_filename): Likewise.
9124 * nsmenu.m (ns_update_menubar): Likewise.
9125 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9126
9127 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9128
9129 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9130 Adapt to latest changes in field names of the corresponding Lisp
9131 objects.
9132
9133 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9134
9135 2012-08-01 Glenn Morris <rgm@gnu.org>
9136
9137 * s/msdos.h: Remove file.
9138 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9139 * Makefile.in (S_FILE): Remove.
9140 (config_h): Remove S_FILE.
9141
9142 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9143
9144 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9145 Remove; moved to nt/config.nt.
9146
9147 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9148
9149 Use INTERNAL_FIELD for conses and overlays.
9150 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9151 Remove obsolete comment.
9152 (MVAR): New macro.
9153 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9154 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9155
9156 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9157
9158 Use INTERNAL_FIELD for symbols.
9159 * lisp.h (SVAR): New macro. Adjust users.
9160 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9161 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9162
9163 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9164
9165 Use INTERNAL_FIELD for processes.
9166 * process.h (PVAR): New macro. Adjust style.
9167 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9168 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9169
9170 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9171
9172 Use INTERNAL_FIELD for windows.
9173 * window.h (WVAR): New macro.
9174 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9175 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9176 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9177 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9178 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9179 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9180
9181 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9182
9183 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9184
9185 2012-08-01 Glenn Morris <rgm@gnu.org>
9186
9187 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9188 Move to configure.ac.
9189
9190 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9191
9192 * makefile.w32-in (CONFIG_H): Update dependencies.
9193 (CONF_POST_H): New macro.
9194
9195 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9196
9197 2012-07-31 Glenn Morris <rgm@gnu.org>
9198
9199 * Makefile.in (S_FILE): No longer set by configure.
9200
9201 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9202 is available.
9203 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9204
9205 * process.h (NULL_DEVICE):
9206 * emacs.c (SEPCHAR):
9207 * editfns.c (USER_FULL_NAME): Let configure set them.
9208
9209 * s/README, s/template.h: Remove files.
9210
9211 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9212
9213 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9214 Move to configure.ac.
9215
9216 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9217
9218 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9219 resulting renaming of 'struct frame' members.
9220
9221 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9222
9223 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9224 after introduction of FVAR.
9225
9226 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9227
9228 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9229
9230 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9231 instead of compositeToPoint.
9232 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9233
9234 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9235
9236 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9237
9238 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9239 * lisp.h (INTERNAL_FIELD): New macro.
9240 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9241 (BVAR): Change to use INTERNAL_FIELD.
9242 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9243 (KVAR): Change to use INTERNAL_FIELD.
9244 * frame.h (FVAR): New macro.
9245 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9246 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9247 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9248 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9249 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9250
9251 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9252
9253 Miscellaneous fixes for non-default X toolkits.
9254 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9255 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9256 Move under #ifdef USE_LUCID.
9257 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9258 definition and usage to avoid warnings.
9259
9260 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9261
9262 * nsterm.m (openFiles): Fix previous checkin.
9263
9264 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9265
9266 * indent.c (compute_motion): Remove unused local.
9267
9268 2012-07-31 Glenn Morris <rgm@gnu.org>
9269
9270 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9271
9272 * conf_post.h [USG5_4]:
9273 Move remaining contents of s/usg5-4-common.h here.
9274 * s/usg5-4-common.h: Remove file.
9275
9276 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9277 * s/irix6-5.h: Remove file.
9278
9279 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9280 * s/darwin.h: Remove file.
9281
9282 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9283 * s/hpux10-20.h: Remove file, which is now empty.
9284
9285 2012-07-30 Glenn Morris <rgm@gnu.org>
9286
9287 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9288 * Makefile.in (config_h): Add conf_post.h.
9289 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9290
9291 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9292
9293 * nsterm.m (ns_do_open_file): New variable.
9294 (ns_term_init): Set ns_do_open_file to YES after run returns.
9295 (openFile, openTempFile, openFileWithoutUI, openFiles):
9296 Open files only if ns_do_open_file.
9297
9298 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9299
9300 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9301 This no-op macro hasn't been needed for many years.
9302 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9303
9304 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9305 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9306 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9307 gdb_make_enums_visible.
9308 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9309 (DIRECTORY_SEP): Now a constant, not a macro.
9310
9311 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9312
9313 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9314 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9315
9316 * w32term.c <w32_keyboard_codepage>: Renamed from
9317 keyboard_codepage and now external. All users changed.
9318
9319 * w32term.h: Add declaration of w32_keyboard_codepage.
9320
9321 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9322 the codepage to translate keys to Unicode. If this argument is
9323 -1, use the value returned by GetConsoleCP. All callers changed.
9324
9325 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9326
9327 Update .PHONY listings in makefiles.
9328 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9329 bootstrap-clean, distclean, maintainer-clean, versioclean,
9330 extraclean, frc.
9331
9332 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9333 This is a bit clearer. Fix some commentary typos.
9334
9335 2012-07-30 Glenn Morris <rgm@gnu.org>
9336
9337 * s/netbsd.h: Let configure include signal.h if needed.
9338 Remove file, which is now empty.
9339
9340 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9341 Let configure set them.
9342 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9343 No more need to undefine.
9344
9345 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9346
9347 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9348 non-single-byte char when adding meta modifier. (Bug#12090)
9349
9350 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9351
9352 Convert safe_call to use variable number of arguments.
9353 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9354 (safe_call2): Fix comment.
9355 * lisp.h (safe_call): Adjust prototype.
9356 * coding.c (encode_coding_object): Change to use safe_call2.
9357 * xfaces.c (merge_face_heights): Change to use safe_call1.
9358
9359 2012-07-30 Glenn Morris <rgm@gnu.org>
9360
9361 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
9362 does that unconditionally. Remove file, which is now empty.
9363
9364 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9365 Remove empty files.
9366
9367 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9368
9369 Export to GDB most of lisp.h's remaining object-like macros.
9370 * lisp.h (min, max): Move earlier, because they're used earlier now.
9371 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9372 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9373 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9374 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9375 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9376 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9377 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9378 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9379 Now constants, for GDB. They need not be macros.
9380 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9381 Now constants, for GDB, as well as macros, for static initializers.
9382 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9383 Move to after the definition of struct Lisp_Char_Table,
9384 since the former now needs that type defined.
9385 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9386 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9387 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9388 New enums, for gdb_make_enums_visible.
9389 (GLYPH_MODE_LINE_FACE): Remove; unused.
9390 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
9391 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9392 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9393 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9394 enum maxargs, enum MAX_ALLOCA.
9395 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9396 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9397 no longer needed, now that they are done in lisp.h.
9398
9399 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9400
9401 Cleanup string bytes checking.
9402 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9403 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9404 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9405 (check_sblock, compact_small_strings): Simplify.
9406
9407 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9408
9409 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9410 These macros are confusing and no longer need to be defined, as
9411 the enum values now suffice. All uses replaced with definiens.
9412 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9413
9414 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
9415
9416 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9417 ($(BLD)/w32console.$(O)): Update dependencies.
9418
9419 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9420
9421 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9422 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9423 time. Adjust users.
9424 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9425
9426 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9427
9428 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9429 setting sitelisp (Bug#12010).
9430
9431 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9432
9433 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
9434
9435 * w32heap.c (cache_system_info):
9436 * w32.c (sys_rename):
9437 * w32proc.c (find_child_console, sys_kill): All users changed.
9438
9439 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9440
9441 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9442
9443 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9444
9445 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9446
9447 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9448
9449 Cleanup statistics calculation in Fgarbage_collect.
9450 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9451 Fix zombies percentage calculation. Simplify elapsed time calculation.
9452
9453 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9454
9455 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9456 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9457 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9458 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9459 (replace_range, replace_range_2, del_range_2): Change to eassert.
9460 * marker.c (byte_char_debug_check): Adjust style.
9461
9462 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9463
9464 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9465 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9466 long-ago-commented-out code that talks about "WIN32".
9467 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9468 All uses changed.
9469
9470 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9471
9472 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9473 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9474 Simplify by using alignof.
9475 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9476 * lisp.h: Include <stdalign.h>.
9477 (GCALIGNMENT): New macro and constant.
9478 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9479 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9480 (stdalign): New macro, if not already defined.
9481
9482 2012-07-28 Eli Zaretskii <eliz@gnu.org>
9483
9484 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9485 * w32inevt.c: Include w32inevt.h.
9486 (w32_read_console_input): New inline function, calls either
9487 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9488 w32_console_unicode_input.
9489 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9490 (w32_kbd_patch_key, key_event): Use the codepage returned by
9491 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9492 (key_event): use uChar.UnicodeChar only if
9493 w32_console_unicode_input is non-zero.
9494
9495 * w32console.c: Include w32heap.h.
9496 <w32_console_unicode_input>: New global variable.
9497 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9498 family of Windows, zero otherwise.
9499
9500 * w32inevt.h: Declare w32_console_unicode_input.
9501
9502 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9503 --without-x. (Bug#11742)
9504
9505 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9506
9507 Adjust GDB to reflect pvec_type changes (Bug#12036).
9508 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
9509 2012-07-04 changes to pseudovector representation.
9510 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
9511
9512 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
9513
9514 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9515 bus address.
9516 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9517
9518 2012-07-27 Eli Zaretskii <eliz@gnu.org>
9519
9520 * alloc.c (listn): Fix the order the arguments are consed onto the
9521 list.
9522
9523 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9524 enumeration constants, as PURE and HEAP are too general, and clash
9525 with other headers and sources, such as gmalloc.c and the
9526 MS-Windows system headers. All users changed.
9527
9528 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9529
9530 Revert last save_excursion_save and save_excursion_restore changes.
9531 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9532 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9533
9534 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9535
9536 Fix recently-introduced typos in Windows port.
9537 Reported by Martin Rudalics <rudalics@gmx.at>.
9538 * w32.c (init_environment): Replace comma with semicolon.
9539 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
9540
9541 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9542
9543 Improve GDB symbol export (Bug#12036).
9544 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9545 arms of an 'if', not using conditional expressions; otherwise GDB
9546 complains about the types in the unevaluated arm when the argument
9547 is an integer literal.
9548 (xgetint): Simplify expression.
9549 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9550 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9551 Zaretskii in <http://bugs.gnu.org/12036#13>.
9552 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9553 needed now that we have gdb_make_enums_visible.
9554 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9555 (enum enum_USE_LSB_TAG):
9556 New enum types, packaging up enums that need to be exported to GDB.
9557
9558 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9559
9560 Utility function to make a list from specified amount of objects.
9561 * lisp.h (enum constype): New datatype.
9562 (listn): New prototype.
9563 * alloc.c (listn): New function.
9564 (Fmemory_use_count, syms_of_alloc): Use it.
9565 * buffer.c (syms_of_buffer): Likewise.
9566 * callint.c (syms_of_callint): Likewise.
9567 * charset.c (define_charset_internal): Likewise.
9568 * coding.c (syms_of_coding): Likewise.
9569 * keymap.c (syms_of_keymap): Likewise.
9570 * search.c (syms_of_search): Likewise.
9571 * syntax.c (syms_of_syntax): Likewise.
9572 * w32.c (init_environment): Likewise.
9573 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9574 * xdisp.c (syms_of_xdisp): Likewise.
9575 * xfns.c (syms_of_xfns): Likewise.
9576
9577 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9578
9579 Fast save_excursion_save and save_excursion_restore.
9580 * lisp.h (struct Lisp_Excursion): New data type.
9581 (PVEC_EXCURSION): New pseudovector type.
9582 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9583 to deal with it. Adjust comments.
9584 (init_marker, attach_marker): New prototype.
9585 (unchain_marker): Adjust prototype.
9586 * marker.c (attach_marker): Change to global.
9587 (init_marker): New function.
9588 * alloc.c (Fmake_marker, build_marker): Use it.
9589 (build_marker): More easserts.
9590 (mark_object): Handle struct Lisp_Excursion.
9591 * editfns.c (save_excursion_save, save_excursion_restore):
9592 Reimplement to use struct Lisp_Excursion. Add comments.
9593
9594 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9595
9596 Fix export of symbols to GDB (Bug#12036).
9597 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9598 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9599 emacs.c, as this is a more-suitable home. Had this been done earlier
9600 the fix for 12036 would have avoided some of the problems noted in
9601 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9602 would have been more obvious.
9603 * emacs.c: Do not include <verify.h>; no longer needed.
9604 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
9605 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9606 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9607 Remove; now done in lisp.h.
9608 * lisp.h (PUBLISH_TO_GDB): New macro.
9609 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9610 (DATA_SEG_BITS): Use it.
9611 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9612 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9613 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9614 not be usable in #if. This simplifies things.
9615
9616 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
9617
9618 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9619
9620 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9621
9622 Simplify export of symbols to GDB (Bug#12036).
9623 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9624 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9625 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9626 Adjust to changes in lisp.h and emacs.c, by using
9627 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9628 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9629 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9630 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9631 instead of gdb_valbits.
9632 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9633 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9634 instead of gdb_array_mark_flag.
9635 (xboolvector): Get size from $->size, not $->header.size.
9636 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9637 (xreload, hook-run, hookpost-run): Remove.
9638 * emacs.c: Include <verify.h>.
9639 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9640 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9641 Remove.
9642 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9643 (gdb_USE_LSB_TAG): New enum constants.
9644 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9645 Also define these as enum constants, so they're visible to GDB.
9646 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9647 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9648 as constants, so they're visible to GDB.
9649 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9650 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9651 Now enum constants, not macros, so they're visible to GDB.
9652 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9653 more convenient now. All uses changed.
9654 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9655 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9656
9657 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9658
9659 Explicitly free restriction data that are not needed anymore.
9660 * editfns.c (save_restriction_restore): Free restriction data.
9661
9662 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9663
9664 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9665 add argument, tune behavior, and adjust all callers.
9666
9667 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9668
9669 Use typedef for EMACS_INT, EMACS_UINT.
9670 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9671 than macros. This simplifies debugging in the usual case, since
9672 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9673 and it allows expressions involving EMACS_INT casts.
9674 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9675
9676 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9677
9678 * nsterm.m (ns_read_socket): Return early if there is a modal
9679 window (Bug#12043).
9680
9681 2012-07-25 Martin Rudalics <rudalics@gmx.at>
9682
9683 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9684 that FOCUS-FRAME can be omitted.
9685
9686 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9687
9688 Adjust buffer text indirection counters at the end of Fkill_buffer.
9689 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9690 buffer is definitely dead. This should really fix an issue reported
9691 by Christoph Scholtes again. (Bug#12007).
9692 (init_buffer_once): Initialize indirection counters of
9693 buffer_defaults and buffer_local_symbols (for sanity and safety).
9694
9695 2012-07-24 Eli Zaretskii <eliz@gnu.org>
9696
9697 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9698 and continuation glyphs on tooltip frames, leave them at zero.
9699 Avoids continued lines in tooltips. (Bug#11832)
9700
9701 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9702
9703 Simplify copy_overlay.
9704 * buffer.c (copy_overlay): Simplify. Use build_marker.
9705 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9706
9707 2012-07-23 Eli Zaretskii <eliz@gnu.org>
9708
9709 * print.c (print_object): Don't crash when a frame's name is nil
9710 or invalid. (Bug#12025)
9711
9712 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9713 it signals an error when a tooltip frame is being created.
9714
9715 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9716
9717 Cleanup miscellaneous objects allocation and initialization.
9718 * alloc.c (allocate_misc): Change to static. Add argument to
9719 specify the subtype. Adjust comment and users.
9720 (build_overlay): New function.
9721 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9722 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9723 (allocate_misc): Remove prototype.
9724 (build_overlay): Add prototype.
9725
9726 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9727
9728 Swap buffer text indirection counters in Fbuffer_swap_text.
9729 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9730 This avoids crash reported by Christoph Scholtes at
9731 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9732
9733 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9734
9735 * nsmenu.m (Popdown_data): New struct.
9736 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9737 free Popdown_data.
9738 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9739 (initWithContentRect): Make imgView and contentView non-static
9740 and autorelease them. Also autorelease img and matrix (Bug#12005).
9741 (dealloc): Remove (Bug#12005).
9742
9743 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9744
9745 Adjust consing_since_gc when objects are explicitly freed.
9746 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9747 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9748 (free_cons, free_misc): Subtract object size from consing_since_gc.
9749
9750 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9751
9752 Simplify and cleanup markers positioning code.
9753 * marker.c (attach_marker): More useful eassert.
9754 (live_buffer, set_marker_internal): New function.
9755 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9756 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9757
9758 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9759
9760 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9761 as it's limited by the amount of memory, not by INT_MAX.
9762
9763 2012-07-21 Eli Zaretskii <eliz@gnu.org>
9764
9765 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9766 in special-event-map. See the discussion at
9767 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9768 for the reasons.
9769
9770 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
9771 info.dwItemData. Fixes crashes on 64-bit Windows.
9772 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
9773
9774 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9775
9776 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
9777 (conversationIdentifier): Return value is NSInteger.
9778 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
9779
9780 2012-07-21 Chong Yidong <cyd@gnu.org>
9781
9782 * window.c (decode_any_window): Signal an error if the window is
9783 on a dead frame (Bug#11984).
9784
9785 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9786
9787 Add indirection counting to speed up Fkill_buffer.
9788 * buffer.h (struct buffer): New member.
9789 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9790 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9791 base buffer indirection counter.
9792 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9793 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9794 through buffer list if indirection counter is 0.
9795
9796 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9797
9798 Extend the value returned by Fgarbage_collect with heap statistics.
9799 * alloc.c (Qheap): New symbol.
9800 (syms_of_alloc): DEFSYM it.
9801 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9802 (Fmemory_free): Remove.
9803 (syms_of_alloc): Don't defsubr it.
9804 * buffer.c (Fcompact_buffer): Remove.
9805 (syms_of_buffer): Don't defsubr it.
9806
9807 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9808
9809 Make maybe_gc inline.
9810 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9811 * lisp.h (consing_since_gc, gc_relative_threshold)
9812 (memory_full_cons_threshold): Revert declaration.
9813 (maybe_gc): Remove prototype, define as inline.
9814 * alloc.c: Remove old commented-out code.
9815 (consing_since_gc, gc_relative_threshold)
9816 (memory_full_cons_threshold): Revert to global.
9817 (maybe_gc): Remove.
9818
9819 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9820
9821 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9822 * lisp.h (build_unibyte_string): New function.
9823 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9824 * sysdep.c, w32fns.c, xfns.c: Use it.
9825 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9826 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9827 Adjust users accordingly.
9828 * font.h (font_open_by_name): Adjust prototype.
9829
9830 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9831
9832 Cleanup calls to Fgarbage_collect.
9833 * lisp.h (maybe_gc): New prototype.
9834 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9835 Remove declarations.
9836 * alloc.c (maybe_gc): New function.
9837 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9838 Make them static.
9839 * bytecode.c (MAYBE_GC): Use maybe_gc.
9840 * eval.c (eval_sub, Ffuncall): Likewise.
9841 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9842 to avoid dependency from auto-save feature.
9843
9844 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9845
9846 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9847 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9848 'for_each_per_buffer_object_at'.
9849 All uses changed. It's better to use upper-case for macros that
9850 cannot be implemented as functions, to give the reader a clue
9851 that they're special.
9852
9853 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9854
9855 * alloc.c (Fgarbage_collect): Tweak docstring.
9856
9857 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9858
9859 Tweak the value returned from Fgarbage_collect again.
9860 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9861 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9862 Adjust documentation.
9863 (total_vector_bytes): Rename to total_vector_slots, adjust
9864 accounting.
9865 (total_free_vector_bytes): Rename to total_free_vector_slots,
9866 adjust accounting.
9867 (Qstring_bytes, Qvector_slots): New symbols.
9868 (syms_of_alloc): DEFSYM them.
9869
9870 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9871
9872 Buffer compaction primitive which may be used from Lisp.
9873 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9874 (syms_of_buffer): Register Fcompact_buffer.
9875 * alloc.c (Fgarbage_collect): Use compact_buffer.
9876 * buffer.h (compact_buffer): New prototype.
9877 (struct buffer_text): New member.
9878
9879 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9880
9881 New macro to iterate over all buffers, miscellaneous cleanups.
9882 * lisp.h (all_buffers): Remove declaration.
9883 * buffer.h (all_buffers): Add declaration, with comment.
9884 (for_each_buffer): New macro.
9885 * alloc.c (Fgarbage_collect, mark_object): Use it.
9886 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9887 (init_buffer): Likewise.
9888 * data.c (Fset_default): Likewise.
9889 * coding.c (code_conversion_restore): Remove redundant check
9890 for dead buffer.
9891 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9892
9893 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9894
9895 Fix bug that created negative-length intervals.
9896 * intervals.c (merge_interval_right, merge_interval_left):
9897 Do not zero out this interval if it is absorbed by its children,
9898 as this interval's total length doesn't change in that case. See
9899 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9900
9901 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9902
9903 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9904 when invoking (make-bool-vector N t) and N is a positive
9905 multiple of 8 -- the last 8 bits were mistakenly cleared.
9906
9907 Remove some struct layout assumptions in bool vectors.
9908 * alloc.c (bool_header_size): New constant.
9909 (header_size, word_size): Move earlier, as they're now used earlier.
9910 Use 'word_size' in a few more places, where it's appropriate.
9911 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9912 padding before the data member of a bool vector.
9913 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9914 than doing the check by hand with an abort ().
9915
9916 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9917
9918 * eval.c (Fdefvar): Don't check constants since we only set the var if
9919 it's not yet defined anyway (bug#11904).
9920
9921 * lisp.h (last_undo_boundary): Declare new var.
9922 * keyboard.c (command_loop_1): Set it.
9923 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9924 were auto-added by the command loop (bug#11774).
9925
9926 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9927
9928 * w32font.c (Qsymbol): Remove local definition.
9929 (syms_of_w32font): Don't DEFSYM it.
9930
9931 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9932
9933 Fix sweep_vectors to handle large bool vectors correctly.
9934 * alloc.c (sweep_vectors): Account total_vector_bytes for
9935 bool vectors larger than VBLOCK_BYTES_MAX.
9936
9937 2012-07-18 Chong Yidong <cyd@gnu.org>
9938
9939 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9940 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9941
9942 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9943
9944 Return more descriptive data from Fgarbage_collect.
9945 Suggested by Stefan Monnier in
9946 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9947 * alloc.c (bounded_number): New function.
9948 (total_buffers, total_vectors): New variable.
9949 (total_string_size): Rename to total_string_bytes, adjust users.
9950 (total_vector_size): Rename to total_vector_bytes, adjust users.
9951 (sweep_vectors): Account total_vectors and total_vector_bytes.
9952 (Fgarbage_collect): New return value. Adjust documentation.
9953 (gc_sweep): Account total_buffers.
9954 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9955 (VECTOR_SIZE): Remove.
9956 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9957 (Qinterval, Qmisc): New symbols.
9958 (syms_of_data): Initialize them.
9959 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9960 (Qcons, Qbuffer): New declarations.
9961
9962 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9963
9964 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9965 Round up, not down. Improve doc.
9966
9967 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9968
9969 Restore old code in allocate_string_data to avoid Faset breakage.
9970 Reported by Julien Danjou <julien@danjou.info> in
9971 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9972 * alloc.c (allocate_string_data): Restore old code with minor
9973 adjustments, fix comment to explain this subtle issue.
9974
9975 2012-07-17 Eli Zaretskii <eliz@gnu.org>
9976
9977 Remove FILE_SYSTEM_CASE.
9978 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9979
9980 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9981 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9982 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9983 call-process-region passes it through expand-file-name.
9984
9985 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9986
9987 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9988
9989 Fix crash when creating indirect buffer (Bug#11917)
9990 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9991 Don't handle unbound variables specially if non-zero.
9992 (Fbuffer_local_variables): Pass zero.
9993 (clone_per_buffer_values): Pass non-zero.
9994
9995 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9996
9997 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9998 to make the loop interruptible.
9999
10000 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10001
10002 * gnutls.c (emacs_gnutls_handshake): Only retry if
10003 GNUTLS_E_INTERRUPTED.
10004
10005 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10006
10007 Cleanup and convert miscellaneous checks to eassert.
10008 * alloc.c (mark_interval): Fix comment, partially rephrase
10009 old comment from intervals.h (see below).
10010 * intervals.c (find_interval, adjust_intervals_for_insertion)
10011 (delete_interval, adjust_intervals_for_deletion)
10012 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10013 Convert to eassert.
10014 (adjust_intervals_for_insertion, make_new_interval):
10015 Remove obsolete and unused code.
10016 * intervals.h (struct interval): Remove obsolete comment.
10017 * textprotp.c (erase_properties): Remove unused code.
10018 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10019 (Fremove_list_of_text_properties): Convert to eassert.
10020
10021 2012-07-17 Chong Yidong <cyd@gnu.org>
10022
10023 * editfns.c (Finsert_char): Doc fix.
10024
10025 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10026
10027 Fix previous change to make Fmemory_free always accurate.
10028 * alloc.c (make_interval): Update total_free_intervals.
10029 (make_float): Likewise for total_free_floats.
10030 (free_cons, Fcons): Likewise for total_free_conses.
10031 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10032 Likewise for total_free_vector_bytes.
10033 (Fmake_symbol): Likewise for total_free_symbols.
10034 (bytes_free): Remove.
10035
10036 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10037
10038 Simple free memory accounting feature.
10039 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10040 (sweep_vectors): Accumulate size of free vectors.
10041 (Fgarbage_collect): Setup bytes_free.
10042 (Fmemory_free): New function.
10043 (syms_of_alloc): Register it.
10044
10045 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10046
10047 Cleanup overlays checking.
10048 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10049 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10050 eassert and OVERLAYP.
10051 (sort_overlays): Change to use OVERLAYP.
10052
10053 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10054
10055 * editfns.c (Finsert_char): Make it interactive, and make the
10056 second arg optional. Copy interactive spec and docstring from
10057 ucs-insert.
10058
10059 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10060
10061 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10062 Unlike the other wrapped functions, fabs has an unspecified
10063 effect on errno.
10064
10065 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10066
10067 * nsterm.m (keyDown): Interpret flags without left/right bits
10068 as the left key (Bug#11670).
10069
10070 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10071
10072 Remove empty and useless init functions.
10073 * lisp.h (init_character_once, init_fns, init_image)
10074 (init_filelock, init_sound): Remove prototype.
10075 * character.c (init_character_once): Remove.
10076 * filelock.c (init_filelock): Likewise.
10077 * fns.c (init_fns): Likewise.
10078 * image.c (init_image): Likewise.
10079 * sound.c (init_sound): Likewise.
10080 * emacs.c (main): Adjust accordingly.
10081
10082 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10083
10084 * gtkutil.h: Tiny cleanups.
10085 (use_old_gtk_file_dialog): Remove useless declaration.
10086 (xg_uses_old_file_dialog): Add suggested const attribute.
10087
10088 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10089
10090 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10091 (bidi_paragraph_init): Use it to limit search forward for a strong
10092 directional character in abnormally large paragraphs full of
10093 neutral or weak characters. (Bug#11943)
10094
10095 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10096
10097 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10098 the toolbar (Bug#9451).
10099 (xg_make_tool_item): Give the widget event box a transparent
10100 background.
10101
10102 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10103
10104 Cleanup basic allocation variables and functions.
10105 * alloc.c (ignore_warnings, init_intervals, init_float)
10106 (init_cons, init_symbol, init_marker): Remove.
10107 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10108 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10109 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10110 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10111 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10112 (staticidx, init_alloc_once, init_strings, free_ablock):
10113 Remove redundant initialization.
10114 * fns.c (init_weak_hash_tables): Remove.
10115 * lisp.h (init_weak_hash_tables): Remove prototype.
10116
10117 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10118
10119 Use zero_vector where appropriate.
10120 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10121 accordingly.
10122 * lisp.h (zero_vector): New declaration.
10123 * font.c (null_vector): Remove.
10124 (syms_of_font): Remove initialization and staticpro.
10125 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10126 * keymap.c (Faccessible_keymaps): Likewise.
10127
10128 2012-07-15 Leo Liu <sdl.web@gmail.com>
10129
10130 * fringe.c: Fix typo in comments.
10131
10132 2012-07-14 Leo Liu <sdl.web@gmail.com>
10133
10134 * fringe.c: Add a new bitmap exclamation-mark.
10135
10136 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10137
10138 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10139
10140 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10141 (HAVE_MENUS): Don't define, defined by editing config.in with
10142 msdos/sed2v2.inp.
10143 (GMALLOC_INHIBIT_VALLOC): Don't define.
10144 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10145
10146 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10147
10148 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10149
10150 2012-07-14 Glenn Morris <rgm@gnu.org>
10151
10152 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10153 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10154 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10155
10156 2012-07-13 Glenn Morris <rgm@gnu.org>
10157
10158 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10159
10160 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10161 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10162
10163 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10164
10165 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10166 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10167 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10168 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10169 where appropriate.
10170 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10171 as boolean expression.
10172 (x_set_window_size): Remove unused variable toolbar.
10173 (ns_get_color_default, ns_mod_to_lisp): Remove.
10174 (ns_mouse_position): Remove unused variables xchar and ychar.
10175 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10176 (ns_set_vertical_scroll_bar): Remove unused variable count.
10177 (ns_delete_terminal): Remove unused variable i.
10178 (ns_term_init): Remove unused variables r, g and b.
10179 (mouseDown): Remove unused variable window.
10180 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10181 (initFrameFromEmacs): Remove unused variable vbextra.
10182 (mouseEntered): Remove unused variables p and dpyinfo.
10183 (mouseExited): Remove unused variables p and r.
10184 (ns_define_frame_cursor, ns_clear_frame_area)
10185 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10186 (menuDown): Assign [sender tag] to variable and cast the variable.
10187
10188 * nsterm.h (menuDown): Add id as type to argument sender.
10189 (ns_display_info_for_name): Add Lisp_Object argument.
10190 (ns_term_init): Add Lisp_Object argument.
10191 (ns_map_event_to_object): Add void argument.
10192 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10193 prototype with arguments and only declare if __OBJC__.
10194 (nxatoms_of_nsselect): Add void argument.
10195 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10196 (ns_alloc_autorelease_pool): Add void argument.
10197 (ns_release_autorelease_pool): Add void* argument.
10198 (ns_get_defaults_value): Add const char* argument.
10199
10200 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10201 (initFromContents): Use SSDATA where appropriate.
10202 (ns_update_menubar): Add braces to ambigous if-else.
10203 (initWithTitle): Put () around assignment in if statement.
10204 (ns_menu_show): Remove unused variables window and keymap.
10205 (update_frame_tool_bar): Remove unused variable selected_p.
10206 (initWithContentRect): Remove unused variable this_cmd_name.
10207
10208 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10209 appropriate.
10210 (setXBMColor): Remove unused variable len.
10211 (setPixmapData): Put () around assignment in loop statement.
10212
10213 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10214 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10215 where appropriate.
10216 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10217 around assignment in loop statement.
10218 (nsfont_open): Remove unused variable i.
10219 (nsfont_open): Remove unused variable len.
10220 (nsfont_draw): Remove unused variable cs.
10221
10222 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10223 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10224 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10225 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10226 (Fns_font_name, Fns_perform_service)
10227 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10228 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10229 (ns_set_name): Remove unused variable view.
10230 (x_set_menu_bar_lines): Remove unused variable olines.
10231 (x_set_tool_bar_lines): Remove unused variable root_window.
10232 (Fns_list_colors): Put () around assignment in while statement.
10233 (Fns_perform_service): Remove unused variable len.
10234 (Fns_display_usable_bounds): Remove unused variable top.
10235 (syms_of_nsfns): Remove unused variable i.
10236
10237 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10238 memcpy (Bug#11907).
10239
10240 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10241
10242 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10243 and free it with DestroyExceptionInfo (Bug#11558).
10244
10245 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10246
10247 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10248 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10249 Set here, not in nt/config.nt.
10250
10251 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10252
10253 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10254 cursor overflow into the last glyph on display line when the right
10255 fringe is off. (Bug#11832)
10256
10257 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10258
10259 * xdisp.c (produce_special_glyphs): Now static.
10260 * dispextern.h (produce_special_glyphs): Remove decl.
10261
10262 2012-07-13 Glenn Morris <rgm@gnu.org>
10263
10264 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10265 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10266
10267 * s/usg5-4-common.h (USG, USG5):
10268 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10269 * s/sol2-6.h (SOLARIS2):
10270 * s/irix6-5.h (IRIX6_5):
10271 * s/hpux10-20.h (USG, USG5, HPUX):
10272 * s/gnu-linux.h (USG, GNU_LINUX):
10273 * s/freebsd.h (BSD_SYSTEM):
10274 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10275 * s/cygwin.h (CYGWIN):
10276 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10277 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10278
10279 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10280
10281 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10282
10283 2012-07-13 Glenn Morris <rgm@gnu.org>
10284
10285 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10286
10287 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10288
10289 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10290 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10291
10292 2012-07-12 Glenn Morris <rgm@gnu.org>
10293
10294 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10295
10296 * process.c (init_process_emacs): Rename from init_process.
10297 The old name is also the name of a Mach system call.
10298 * lisp.h, emacs.c: Update for this name change.
10299 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10300 longer needed.
10301
10302 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10303
10304 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10305 memmove call that removes glyphs covered by the left truncation
10306 glyph. Improve commentary.
10307 (display_line): Fix display of continuation glyphs on GUI frames
10308 when the right fringe is turned off and variable-size fonts are
10309 used in the window. Move the code that appends a stretch glyph to
10310 produce_special_glyphs, so that it could be used for truncation
10311 and continuation glyphs alike.
10312 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10313 glyph of a suitably computed width, to align the special glyphs at
10314 the window margin. Code moved from display_line. (Bug#11832)
10315
10316 2012-07-12 Glenn Morris <rgm@gnu.org>
10317
10318 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10319
10320 * s/gnu-linux.h, s/hpux10-20.h:
10321 Do not unconditionally define HAVE_XRMSETDATABASE.
10322
10323 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10324
10325 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10326
10327 Fix typos that broke OS X build.
10328 Reported by Randal L. Schwartz in
10329 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10330 * nsterm.m (ns_timeout): Add missing local decl.
10331 (ns_get_color): snprintf -> sprintf, to fix typo.
10332
10333 2012-07-12 Glenn Morris <rgm@gnu.org>
10334
10335 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10336 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10337 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10338 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10339
10340 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10341 Move PTY_OPEN to configure.
10342
10343 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10344 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10345 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10346
10347 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10348
10349 Use empty_unibyte_string where applicable.
10350 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10351 * lread.c (read1): Likewise.
10352 * xsettings.c (syms_of_xsettings): Likewise.
10353
10354 2012-07-12 Glenn Morris <rgm@gnu.org>
10355
10356 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10357 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
10358 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10359 * s/hpux10-20.h (RUN_TIME_REMAP):
10360 * s/bsd-common.h (TABDLY): Move to configure.
10361
10362 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10363
10364 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10365
10366 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10367 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
10368
10369 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
10370
10371 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10372 * s/template.h: Move NARROWPROTO to configure.
10373
10374 2012-07-11 Glenn Morris <rgm@gnu.org>
10375
10376 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10377 unused since 2011-01-17 change to systty.h.
10378
10379 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10380 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10381 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10382
10383 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10384
10385 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10386
10387 2012-07-11 Glenn Morris <rgm@gnu.org>
10388
10389 * s/darwin.h, s/gnu-linux.h, s/template.h:
10390 Move INTERRUPT_INPUT to configure.
10391
10392 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10393
10394 Minor adjustments to interning code.
10395 * lisp.h (intern, intern_c_string): Redefine as static inline
10396 wrappers for intern_1 and intern_c_string_1, respectively.
10397 (intern_1, intern_c_string_1): Rename prototypes.
10398 * lread.c (intern_1, intern_c_string_1, oblookup):
10399 Simplify Vobarray checking.
10400 * font.c (font_intern_prop): Likewise. Adjust comment.
10401 * w32font.c (intern_font_name): Likewise.
10402
10403 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10404
10405 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10406
10407 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10408 of Fcar/Fcdr if possible.
10409 * font.c (check_otf_features): Likewise.
10410 * fontset.c (Fnew_fontset): Likewise.
10411 * gnutls.c (Fgnutls_boot): Likewise.
10412 * minibuf.c (read_minibuf): Likewise.
10413 * msdos.c (IT_set_frame_parameters): Likewise.
10414 * xmenu.c (Fx_popup_dialog): Likewise.
10415 * w32menu.c (Fx_popup_dialog): Likewise.
10416
10417 2012-07-11 Glenn Morris <rgm@gnu.org>
10418
10419 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10420 since nothing has defined it on these platforms.
10421
10422 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10423 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10424
10425 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10426 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10427 Move CLASH_DETECTION to configure.
10428
10429 * s/gnu.h: Remove file, which is now empty.
10430
10431 * s/gnu.h, s/gnu-linux.h:
10432 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10433
10434 2012-07-11 John Wiegley <johnw@newartisans.com>
10435
10436 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10437 function attribute, so we only use it if it exists in the
10438 compiler.
10439
10440 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10441
10442 Avoid call to strlen in fast_c_string_match_ignore_case.
10443 * search.c (fast_c_string_match_ignore_case): Change to use
10444 length argument. Adjust users accordingly.
10445 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10446
10447 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10448
10449 Assume mkdir, rmdir.
10450 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10451 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10452
10453 Assume rename.
10454 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10455
10456 Assume perror.
10457 * s/hpux10-20.h (HAVE_PERROR): Remove.
10458 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10459 Remove dummy definition, as this problem was obsolete long ago.
10460
10461 Assume strerror.
10462 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10463
10464 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10465
10466 Avoid calls to strlen in font processing functions.
10467 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
10468 (font_open_by_name): Change to use length argument.
10469 Adjust users accordingly.
10470 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10471 Adjust prototypes.
10472 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10473 Change to return ptrdiff_t.
10474 (xfont_list_pattern, xfont_match): Use length returned by
10475 xfont_decode_coding_xlfd.
10476 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10477
10478 2012-07-11 Glenn Morris <rgm@gnu.org>
10479
10480 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10481 Move DONT_REOPEN_PTY to configure.
10482
10483 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10484 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10485
10486 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10487
10488 Remove "#define unix" that is no longer needed (Bug#11905).
10489 * s/aix4-2.h (unix): Remove; no longer needed.
10490
10491 EMACS_TIME simplification (Bug#11875).
10492 This replaces macros (which typically do not work in GDB)
10493 with functions, typedefs and enums, making the code easier to debug.
10494 The functional style also makes code easier to read and maintain.
10495 * systime.h: Include <sys/time.h> on all hosts, not just if
10496 WINDOWSNT, since 'struct timeval' is needed in general.
10497 (EMACS_TIME): Now a typedef, not a macro.
10498 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10499 not macros.
10500 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10501 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10502 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10503 (EMACS_TIME_LE): Now functions, not macros.
10504 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10505 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10506 which are not functions. All uses rewritten to use:
10507 (make_emacs_time): New function.
10508 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10509 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10510 not functions. All uses rewritten to use the following, respectively:
10511 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10512 (add_emacs_time, sub_emacs_time): New functions.
10513 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
10514 * fileio.c (Fcopy_file):
10515 * xterm.c (XTflash): Get the current time closer to when it's used.
10516 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10517
10518 * bytecode.c (targets): Suppress -Woverride-init warnings.
10519
10520 Simplify by avoiding confusing use of strncpy etc.
10521 * doc.c (Fsnarf_documentation):
10522 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10523 * frame.c (Fmake_terminal_frame):
10524 * gtkutil.c (get_utf8_string):
10525 * lread.c (openp):
10526 * nsmenu.m (ns_update_menubar):
10527 * regex.c (regerror):
10528 Prefer memcpy to strncpy and strncat when either will do.
10529 * fileio.c (Fsubstitute_in_file_name):
10530 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10531 (menu_separator_name_p):
10532 * nsmenu.m (ns_update_menubar):
10533 Prefer memcmp to strncmp when either will do.
10534 * nsterm.m: Include <ftoastr.h>.
10535 (ns_get_color):
10536 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10537 Prefer snprintf to strncpy.
10538 * nsterm.m (ns_term_init):
10539 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10540 * nsterm.m (ns_term_init):
10541 Avoid the need for strncpy, by using build_string or
10542 make_unibyte_string directly. Use dtoastr, not snprintf.
10543 * process.c (Fmake_network_process): Diagnose service names that
10544 are too long, rather than silently truncating them or creating
10545 non-null-terminated names.
10546 (Fnetwork_interface_info): Likewise, for interface names.
10547 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10548 Prefer sprintf to strncat.
10549 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10550 Prefer vsnprintf to vsprintf + strncpy.
10551
10552 2012-07-10 Glenn Morris <rgm@gnu.org>
10553
10554 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10555 Clarify fallback case.
10556
10557 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10558
10559 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10560 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10561 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
10562 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
10563 where argument type is known to be a Lisp_Cons.
10564
10565 2012-07-10 Tom Tromey <tromey@redhat.com>
10566
10567 * bytecode.c (BYTE_CODE_THREADED): New macro.
10568 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10569 (enum byte_code_op): New type.
10570 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10571 (exec_byte_code): Use them. Use token threading when applicable.
10572
10573 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10574
10575 Optimize pure C strings initialization.
10576 * lisp.h (make_pure_string): Fix prototype.
10577 (build_pure_c_string): New function, defined as static inline. This
10578 provides a better opportunity to optimize away calls to strlen when
10579 the function is called with compile-time constant argument.
10580 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10581 argument, adjust users accordingly. Use build_pure_c_string where
10582 appropriate.
10583 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10584 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10585 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10586
10587 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10588
10589 Avoid calls to strlen in miscellaneous functions.
10590 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10591 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10592 * lread.c (openp): Likewise.
10593
10594 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10595
10596 Avoid calls to strlen in path processing functions.
10597 * fileio.c (file_name_as_directory): Add comment. Change to add
10598 srclen argument and return the length of result. Adjust users
10599 accordingly.
10600 (directory_file_name): Fix comment. Change to add srclen argument,
10601 swap 1st and 2nd arguments to obey the common convention.
10602 Adjust users accordingly.
10603 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10604
10605 2012-07-10 Glenn Morris <rgm@gnu.org>
10606
10607 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10608 Move PENDING_OUTPUT_COUNT definition to configure.
10609
10610 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10611 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10612 * s/gnu.h (DATA_START): Move definitions to configure.
10613
10614 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10615 We include usg5-4-common.h, which defines them both.
10616
10617 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10618 O_RDONLY already includes it).
10619
10620 Stop ns builds setting the EMACSLOADPATH environment variable.
10621 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10622 Now it does not set EMACSLOADPATH, just returns the load-path string.
10623 * nsterm.h: Update accordingly.
10624 * lread.c [HAVE_NS]: Include nsterm.h.
10625 (init_lread) [HAVE_NS]: Use ns_load_path.
10626 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10627
10628 2012-07-09 Glenn Morris <rgm@gnu.org>
10629
10630 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10631 since the included bsd-common.h does so.
10632
10633 Stop ns builds setting the EMACSPATH environment variable.
10634 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10635 (ns_init_paths): Do not set EMACSPATH.
10636 * nsterm.h (ns_exec_path): Add it.
10637 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10638 Use ns_exec_path.
10639
10640 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10641
10642 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10643
10644 * process.c (wait_reading_process_output): 'waitchannels' was unset
10645 when read_kbd || !NILP (wait_for_cell); fix this.
10646
10647 Add GCC-style 'const' attribute to functions that can use it.
10648 * character.h (char_resolve_modifier_mask):
10649 * keyboard.h (make_ctrl_char):
10650 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10651 (init_character_once, next_almost_prime, init_fns, init_image)
10652 (flush_pending_output, init_sound):
10653 * mem-limits.h (start_of_data):
10654 * menu.h (finish_menu_items):
10655 Add ATTRIBUTE_CONST.
10656 * emacs.c (DEFINE_DUMMY_FUNCTION):
10657 Declare the dummy function with ATTRIBUTE_CONST.
10658 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10659 Add decls with ATTRIBUTE_CONST.
10660
10661 Minor improvements to make_formatted_string.
10662 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10663 where int is good enough, as vsprintf returns an int.
10664 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10665
10666 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10667
10668 Use make_formatted_string to avoid double length calculation.
10669 * lisp.h (make_formatted_string): New prototype.
10670 * alloc.c (make_formatted_string): New function.
10671 * buffer.c (Fgenerate_new_buffer_name): Use it.
10672 * dbusbind.c (syms_of_dbusbind): Likewise.
10673 * editfns.c (Fcurrent_time_zone): Likewise.
10674 * filelock.c (get_boot_time): Likewise.
10675 * frame.c (make_terminal_frame, set_term_frame_name)
10676 (x_report_frame_params): Likewise.
10677 * image.c (gs_load): Likewise.
10678 * minibuf.c (get_minibuffer): Likewise.
10679 * msdos.c (dos_set_window_size): Likewise.
10680 * process.c (make_process): Likewise.
10681 * xdisp.c (ensure_echo_area_buffers): Likewise.
10682 * xsettings.c (apply_xft_settings): Likewise.
10683
10684 2012-07-09 Glenn Morris <rgm@gnu.org>
10685
10686 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10687 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10688 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10689 * nsterm.h (ns_etc_directory): Add it.
10690 * callproc.c [HAVE_NS]: Include nsterm.h.
10691 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10692
10693 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10694
10695 Move marker debugging code under MARKER_DEBUG.
10696 * marker.c (MARKER_DEBUG): Move marker debugging code under
10697 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10698 for bootstrap with --enable-checking (~3x slowdown reported
10699 by Juanma Barranquero <lekktu@gmail.com>).
10700 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10701
10702 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10703
10704 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10705 See <http://bugs.gnu.org/11825#29>.
10706
10707 2012-07-08 Eli Zaretskii <eliz@gnu.org>
10708
10709 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10710 has no font, use the frame's font. (Bug#11813)
10711 (display_line): Add commentary about displaying truncation glyphs
10712 on GUI frames.
10713 (produce_special_glyphs): Move here from term.c.
10714
10715 * term.c (produce_special_glyphs): Move to xdisp.c.
10716
10717 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10718 section.
10719
10720 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10721
10722 * xdisp.c (display_line): Avoid warning about implicit declaration
10723 of FRAME_FONT.
10724
10725 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10726
10727 * lisp.h: Remove empty conditional.
10728
10729 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10730
10731 * lread.c (load_path_check): Now static.
10732
10733 Fix some minor --with-ns problems found by static checking.
10734 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10735 (x_set_font) [!HAVE_X_WINDOWS]:
10736 * image.c (xpm_load_image) [HAVE_NS]:
10737 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10738 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10739 Remove unused local.
10740 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10741 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10742 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10743 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10744 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10745 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10746 Fix pointer signedness problem.
10747 * xfaces.c (FRAME_X_FONT_TABLE):
10748 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10749
10750 2012-07-07 Glenn Morris <rgm@gnu.org>
10751
10752 * lread.c (load_path_check): New function, split from init_lread.
10753 (init_lread): Reorganize. Motivation:
10754 If EMACSLOADPATH is set, check/warn about that rather than the
10755 defaults, which we are not going to use. Hence we can remove
10756 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10757 Don't warn if site-lisp directories are missing.
10758 If not installed, start from a blank load-path, since
10759 PATH_LOADSEARCH refers to the eventual installation directories.
10760
10761 2012-07-07 Eli Zaretskii <eliz@gnu.org>
10762
10763 Support truncation and continuation glyphs on GUI frames, when
10764 fringes are disabled. (Bug#11832)
10765 * xdisp.c (init_iterator): Get dimensions of truncation and
10766 continuation glyphs even if on GUI frames.
10767 Adjust it->last_visible_x on GUI frames when the left or right fringes,
10768 or both, are absent.
10769 (start_display, move_it_in_display_line_to): Handle the case of a
10770 GUI frame without a fringe to display continuation or truncation
10771 glyphs.
10772 (insert_left_trunc_glyphs): Support GUI frames: make sure
10773 truncation glyphs overwrite enough glyphs from the current line to
10774 have sufficient space in pixels.
10775 (display_line): Support truncation and continuation glyphs on GUI
10776 frames. If some spare pixels are left on the line after inserting
10777 the truncation glyphs, fill that space with a stretch glyph of a
10778 suitably computed width.
10779
10780 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10781 produce_glyphs, to support GUI sessions.
10782
10783 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10784
10785 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10786
10787 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10788
10789 Do not require float-time's arg to fit in time_t (Bug#11825).
10790 This works better on hosts where time_t is unsigned, and where
10791 float-time is applied to the (negative) difference between two times.
10792 * editfns.c (decode_time_components): Last arg is now double *,
10793 not int *, and means to store all the result as a double, without
10794 worrying about whether the seconds part fits in time_t.
10795 All callers changed.
10796 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10797 All callers changed.
10798 (Ffloat_time): Do not fail merely because the specified time falls
10799 outside of time_t range.
10800
10801 2012-07-07 Glenn Morris <rgm@gnu.org>
10802
10803 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10804 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10805 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10806
10807 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
10808
10809 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10810 Update dependencies.
10811
10812 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10813
10814 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10815
10816 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10817 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10818 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10819 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10820 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10821 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10822
10823 * xfont.c (compare_font_names): Redo to omit the need for casts.
10824
10825 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10826
10827 * xfns.c (Fx_change_window_property): Doc fix.
10828 * w32fns.c (Fx_change_window_property): Doc fix.
10829
10830 * w32fns.c (Fx_window_property): Accept the same arguments as the
10831 X Windows version. Doc fix.
10832 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10833
10834 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
10835 Eli Zaretskii <eliz@gnu.org>
10836
10837 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10838 Windows-specific code from nt/config.nt moved here.
10839 Obsolete settings removed.
10840
10841 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10842
10843 * process.c: Avoid unnecessary calls to gettime.
10844 (wait_reading_process_output): Don't get the time of day
10845 when gobbling data immediately and not waiting, as there's no need
10846 for it in that case. This removes a FIXME.
10847
10848 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10849
10850 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10851 is defined (Bug#11768).
10852
10853 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10854
10855 Fix marker debugging code.
10856 * marker.c (byte_char_debug_check): Do not perform the check
10857 if buffer is not multibyte.
10858 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10859 Call byte_char_debug_check with correct arguments.
10860
10861 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10862
10863 Compile marker debugging code only if ENABLE_CHECKING is defined.
10864 * marker.c (byte_char_debug_check, count_markers):
10865 Use only if ENABLE_CHECKING is defined.
10866 (byte_debug_flag): Remove.
10867 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10868 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10869
10870 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10871
10872 Avoid code repetition in marker-related functions.
10873 * marker.c (attach_marker): New function.
10874 (Fset_marker, set_marker_restricted, set_marker_both)
10875 (set_marker_restricted_both): Use it.
10876 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10877 Consistently rename charno to charpos.
10878 (marker_position): Add eassert.
10879 (marker_byte_position): Convert to eassert.
10880
10881 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10882
10883 Simplify list operations in unchain_overlay and unchain_marker.
10884 * buffer.c (unchain_overlay): Simplify. Add comment.
10885 * marker.c (unchain_marker): Simplify. Fix comments.
10886
10887 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10888
10889 Introduce fast path for the widely used marker operation.
10890 * alloc.c (build_marker): New function.
10891 * lisp.h (build_marker): New prototype.
10892 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10893 * composite.c (autocmp_chars): Likewise.
10894 * editfns.c (buildmark): Remove.
10895 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10896 (save_restriction_save): Use build_marker.
10897 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10898 * window.c (save_window_save): Likewise.
10899
10900 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10901
10902 Do not use Fdelete_overlay in delete_all_overlays
10903 to avoid redundant calls to unchain_overlay.
10904 * buffer.c (drop_overlay): New function.
10905 (delete_all_overlays, Fdelete_overlay): Use it.
10906 * minibuf.c (get_minibuffer): Fix comment.
10907
10908 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10909
10910 Port to OpenBSD 5.1 amd64.
10911 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10912 This is needed for OpenBSD, and should be harmless on all BSD systems.
10913 Also, include <sys/sysctl.h>, as it should be available on all
10914 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10915 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10916 use p_pid member, not kp_proc.pid.
10917
10918 2012-07-06 Glenn Morris <rgm@gnu.org>
10919
10920 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10921
10922 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10923
10924 More xmalloc and related cleanup.
10925 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10926 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10927 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10928 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10929 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10930 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10931 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10932 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10933 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10934 * xterm.c:
10935 Omit needless casts involving void * pointers and allocation.
10936 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10937 as the former is more robust if P's type is changed.
10938 Prefer xzalloc to xmalloc + memset 0.
10939 Simplify malloc-or-realloc to realloc.
10940 Don't worry about xmalloc returning a null pointer.
10941 Prefer xstrdup to xmalloc + strcpy.
10942 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10943 growing it.
10944 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10945 alloca of a constant.
10946
10947 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10948
10949 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10950 hscroll is larger than the line width. Fixes long and futile
10951 looping inside extend_face_to_end_of_line (on a TTY) producing
10952 glyphs that are not needed and thrown away.
10953
10954 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10955
10956 * marker.c (set_marker_restricted_both): Simplify by using
10957 clip_to_bounds.
10958
10959 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10960
10961 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10962
10963 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10964
10965 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10966 not defined (Bug#11768).
10967 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10968 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10969 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10970 followed by gtk_box_set_homogeneous (Bug#11768).
10971 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
10972 (update_theme_scrollbar_width, xg_create_scroll_bar):
10973 Use gtk_scrollbar_new (Bug#11768).
10974 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10975 (is_box_type): New function (Bug#11768).
10976 (xg_tool_item_stale_p): Call is_box_type.
10977 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
10978 with default display (Bug#11768).
10979
10980 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10981
10982 * xdisp.c (window_hscroll_limited): New function.
10983 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10984 coordinates when window's hscroll is set to insanely large
10985 values. (Bug#11857)
10986
10987 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
10988
10989 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10990 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10991
10992 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10993
10994 Cleanup xmalloc.
10995 * lisp.h (xzalloc): New prototype. Omit needless casts.
10996 * alloc.c (xzalloc): New function. Omit needless casts.
10997 * charset.c: Omit needless casts. Convert all calls to
10998 xmalloc with following memset to xzalloc.
10999 * dispnew.c: Likewise.
11000 * fringe.c: Likewise.
11001 * image.c: Likewise.
11002 * sound.c: Likewise.
11003 * term.c: Likewise.
11004 * w32fns.c: Likewise.
11005 * w32font.c: Likewise.
11006 * w32term.c: Likewise.
11007 * xfaces.c: Likewise.
11008 * xfns.c: Likewise.
11009 * xterm.c: Likewise.
11010 * atimer.c: Omit needless casts.
11011 * buffer.c: Likewise.
11012 * callproc.c: Likewise.
11013 * ccl.c: Likewise.
11014 * coding.c: Likewise.
11015 * composite.c: Likewise.
11016 * doc.c: Likewise.
11017 * doprnt.c: Likewise.
11018 * editfns.c: Likewise.
11019 * emacs.c: Likewise.
11020 * eval.c: Likewise.
11021 * filelock.c: Likewise.
11022 * fns.c: Likewise.
11023 * gtkutil.c: Likewise.
11024 * keyboard.c: Likewise.
11025 * lisp.h: Likewise.
11026 * lread.c: Likewise.
11027 * minibuf.c: Likewise.
11028 * msdos.c: Likewise.
11029 * print.c: Likewise.
11030 * process.c: Likewise.
11031 * region-cache.c: Likewise.
11032 * search.c: Likewise.
11033 * sysdep.c: Likewise.
11034 * termcap.c: Likewise.
11035 * terminal.c: Likewise.
11036 * tparam.c: Likewise.
11037 * w16select.c: Likewise.
11038 * w32.c: Likewise.
11039 * w32reg.c: Likewise.
11040 * w32select.c: Likewise.
11041 * w32uniscribe.c: Likewise.
11042 * widget.c: Likewise.
11043 * xdisp.c: Likewise.
11044 * xmenu.c: Likewise.
11045 * xrdb.c: Likewise.
11046 * xselect.c: Likewise.
11047
11048 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11049
11050 * fileio.c (time_error_value): Check the right error number.
11051 Problem reported by Troels Nielsen in
11052 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11053
11054 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11055
11056 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11057 This should be fixed in a better way; see Eli Zaretskii in
11058 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11059 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11060
11061 * fileio.c (time_error_value): Rename from special_mtime.
11062 The old name's problems were noted by Eli Zaretskii in
11063 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11064
11065 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11066 This variable's comment says Emacs needs at least one GDB-visible
11067 symbol of type enum pvec_type, to work around GDB problems.
11068 The symbol's value doesn't matter.
11069
11070 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11071 that causes compilation to fail on pre-C99 compilers.
11072
11073 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11074
11075 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11076 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11077
11078 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11079
11080 * buffer.c (init_buffer_once): Fix initialization of
11081 headers for buffer_defaults and buffer_local_symbols.
11082 Reported by Juanma Barranquero <lekktu@gmail.com>.
11083
11084 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11085
11086 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11087 * lisp.h (enum pvec_type): Use fewer bits.
11088 (PSEUDOVECTOR_SIZE_BITS): New constant.
11089 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11090 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11091 change in pvec_type.
11092 (PSEUDOVECTOR_TYPEP): New macro.
11093 (TYPED_PSEUDOVECTORP): Use it.
11094 * fns.c (internal_equal): Adapt code to extract pvectype.
11095 * emacs.c (gdb_pvec_type): Update type.
11096 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11097 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11098 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11099 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11100 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11101 abusing vector->header.next.nbytes.
11102 (live_vector_p): Use PVEC_TYPE.
11103 (mark_object): Adapt code to extract pvectype. Use switch.
11104
11105 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11106
11107 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11108 Tighten new eassert a bit.
11109
11110 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11111
11112 Fix compilation with --enable-gcc-warnings and -O1
11113 optimization level.
11114 * doprnt.c (doprnt): Change type of tem to int, initialize
11115 to avoid compiler warning. Add eassert.
11116 * search.c (simple_search): Initialize match_byte to avoid
11117 compiler warning. Add eassert.
11118
11119 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11120
11121 Avoid weird behavior with large horizontal scrolls.
11122 Without this change, for example, large hscroll values would
11123 mess up Emacs's display on Fedora 15 x86, presumably due to
11124 overflows in int calculations in the display code.
11125 Also, if buffers had long lines, Emacs would freeze.
11126 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11127 (set_window_hscroll): New function, containing the old guts of
11128 Fset_window_hscroll. Return the clipped value.
11129 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11130 This avoids the need to check against PTRDIFF_MAX.
11131
11132 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11133
11134 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11135
11136 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11137
11138 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11139
11140 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11141 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11142 since GCC 4.4.6 issues a bogus warning for them.
11143
11144 Fix bugs in file timestamp newness comparisons.
11145 * fileio.c (Ffile_newer_than_file_p):
11146 * lread.c (Fload): Use full timestamp resolution of files,
11147 not just the 1-second resolution, so that files that are only
11148 slightly newer still count as newer.
11149 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11150 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11151
11152 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11153
11154 * fileio.c: Improve handling of file time marker. (Bug#11852)
11155 (special_mtime): New function.
11156 (Finsert_file_contents, Fverify_visited_file_modtime):
11157 Use it to set special mtime values consistently.
11158
11159 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11160
11161 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11162 marker for non-existing file. (Bug#11852)
11163
11164 2012-07-03 Glenn Morris <rgm@gnu.org>
11165
11166 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11167 and did not make it into globals.h).
11168
11169 2012-07-03 Tom Tromey <tromey@redhat.com>
11170
11171 * window.c (Fset_window_margins, Fset_window_fringes)
11172 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11173 * textprop.c (Fprevious_property_change): No longer static.
11174 * syntax.c (Fsyntax_table_p): No longer static.
11175 * process.c (Fget_process, Fprocess_datagram_address): No longer
11176 static.
11177 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11178 * keyboard.c (Fcommand_execute): No longer static.
11179 Remove EXFUN.
11180 * insdel.c (Fcombine_after_change_execute): No longer static.
11181 * image.c (Finit_image_library): No longer static.
11182 * fileio.c (Fmake_symbolic_link): No longer static.
11183 * eval.c (Ffetch_bytecode): No longer static.
11184 * editfns.c (Fuser_full_name): No longer static.
11185 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11186 No longer static.
11187 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11188 static.
11189 * dired.c (Ffile_attributes): No longer static.
11190 * composite.c (Fcomposition_get_gstring): No longer static.
11191 * callproc.c (Fgetenv_internal): No longer static.
11192
11193 * ccl.h: Remove EXFUNs.
11194 * buffer.h: Remove EXFUNs.
11195 * dispextern.h: Remove EXFUNs.
11196 * intervals.h: Remove EXFUNs.
11197 * fontset.h: Remove EXFUN.
11198 * font.h: Remove EXFUNs.
11199 * dosfns.c (system_process_attributes): Remove EXFUN.
11200 * keymap.h: Remove EXFUNs.
11201 * lisp.h: Remove EXFUNs.
11202 * w32term.h: Remove EXFUNs.
11203 * window.h: Remove EXFUNs.
11204 * xsettings.h: Remove EXFUN.
11205 * xterm.h: Remove EXFUN.
11206
11207 2012-07-03 Glenn Morris <rgm@gnu.org>
11208
11209 * lisp.h (Frandom): Make it visible to C.
11210 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11211 buffer for invisible buffers. (Bug#1229)
11212
11213 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11214
11215 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11216 values which aren't power of 2.
11217 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11218 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11219 accordingly.
11220
11221 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11222
11223 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11224
11225 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11226
11227 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11228
11229 * alloc.c (allocate_vector_block): Remove redundant
11230 calls to mallopt if DOUG_LEA_MALLOC is defined.
11231 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11232 avoid calls to mallopt if zero_vector is returned.
11233
11234 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11235
11236 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11237 is enabled, avoid dereferencing NULL current_sblock if
11238 running undumped.
11239
11240 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11241
11242 Cleanup basic buffer management.
11243 * buffer.h (struct buffer): Change layout to use generic vector
11244 marking code. Fix some comments. Change type of 'clip_changed'
11245 to bitfield. Remove unused #ifndef old.
11246 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11247 (GET_OVERLAYS_AT): Fix indentation.
11248 (for_each_per_buffer_object_at): New macro.
11249 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11250 (Fbuffer_local_variables): Use it.
11251 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11252 * alloc.c (allocate_buffer): Adjust to match new layout of
11253 struct buffer. Fix comment.
11254 (mark_overlay): New function.
11255 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11256 Lisp area of struct buffer.
11257 (mark_object): Use it. Adjust marking of misc objects
11258 and related comments.
11259
11260 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11261
11262 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11263 wrapper that is not needed because the wrapped code is a no-op (zero
11264 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11265 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11266
11267 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11268
11269 * alloc.c (mark_buffer): Simplify. Remove prototype.
11270 (mark_object): Add comment. Reorganize marking of vector-like
11271 objects. Use CHECK_LIVE for all vector-like objects except buffers
11272 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11273 Avoid redundant calls to mark_vectorlike for bool vectors.
11274
11275 2012-06-30 Glenn Morris <rgm@gnu.org>
11276
11277 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11278
11279 * epaths.in (PATH_SITELOADSEARCH): New.
11280 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11281 This is rather than relying on --enable-locallisppath elements
11282 having "site-lisp" in their names. (Bug#10208#25, 11658)
11283
11284 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11285
11286 * w32proc.c (sys_select): Accept and ignore one more argument.
11287
11288 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11289
11290 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11291 (pselect) [!MS_DOS]: Redirect to sys_select.
11292
11293 * sysdep.c: Don't include dos.h and dosfns.h.
11294
11295 * process.c (sys_select):
11296 * msdos.c (sys_select): Accept one more argument and ignore it.
11297
11298 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11299 adapt data types and code to that.
11300
11301 * dosfns.c:
11302 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11303 which clashes with the gnulib function of the same name.
11304
11305 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11306
11307 * font.c (font_style_to_value, font_style_symbolic)
11308 (font_prop_validate_style): Add type checks for values in
11309 font_style_table.
11310
11311 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11312 argument.
11313 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11314 uses.
11315
11316 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11317
11318 * xdisp.c (try_window_id): Undo last change.
11319
11320 * w32.c (getwd): Adjust commentary about startup_dir.
11321 (init_environment): Always call sys_access, even in non-MSVC
11322 builds. Don't chdir to the directory of the Emacs executable.
11323 This undoes code from 1997 which was justified by the need to
11324 "avoid conflicts when removing and renaming directories". But its
11325 downside was that every relative file name was being interpreted
11326 relative to the directory of the Emacs executable, which can never
11327 be TRT. In particular, it broke sys_access when called with
11328 relative file names.
11329 (sys_access): Map GetLastError to errno.
11330
11331 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11332
11333 * window.h (struct window): Change type of 'fringes_outside_margins'
11334 to bitfield. Fix comment. Adjust users accordingly.
11335 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
11336 Adjust comment.
11337 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11338 to ptrdiff_t.
11339
11340 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
11341
11342 * gnutls.c (emacs_gnutls_handshake):
11343 Add QUIT to make the loop interruptible.
11344
11345 2012-06-29 Glenn Morris <rgm@gnu.org>
11346
11347 * charset.c (init_charset): Make lack of etc/charsets fatal.
11348
11349 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11350
11351 * editfns.c (region_limit): Fix type mismatch.
11352
11353 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11354
11355 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11356 undefined. Convert from xassert to eassert.
11357 * nsmenu.m: Convert from xassert to eassert.
11358 * nsterm.m: Likewise.
11359
11360 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11361
11362 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11363
11364 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11365
11366 Avoid integer overflow on scroll-left and scroll-right.
11367 * window.c (HSCROLL_MAX): New macro.
11368 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11369 overflow when requested scroll falls outside ptrdiff_t range.
11370
11371 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11372
11373 * window.h (struct window): Change type of 'hscroll',
11374 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11375 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11376 Adjust users accordingly.
11377 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11378 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11379 from EMACS_INT to ptrdiff_t.
11380 (make_window): Omit redundant initialization.
11381
11382 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
11383
11384 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11385
11386 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11387
11388 * window.h (struct window): Change type of 'use_time' and
11389 'sequence_number' from Lisp_Object to int.
11390 * frame.c (make_frame): Adjust users accordingly.
11391 * print.c (print_object): Likewise.
11392 * window.c (select_window, Fwindow_use_time, make_parent_window)
11393 (make_window): Likewise.
11394
11395 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11396
11397 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11398 enabled with --enable-checking=[all,glyphs] configure option.
11399 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11400 adjust comments accordingly.
11401 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11402 undefined, adjust comments accordingly.
11403 * image.c: Likewise.
11404 * scroll.c: Likewise.
11405 * w32fns.c: Likewise.
11406 * w32term.c: Likewise.
11407 * xdisp.c: Likewise.
11408 * xfaces.c: Likewise.
11409 * xfns.c: Likewise.
11410 * xterm.c: Likewise.
11411
11412 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11413
11414 Generalize run-time debugging checks.
11415 * dispextern.h (XASSERTS): Remove.
11416 * fontset.c (xassert): Remove.
11417 Convert from xassert to eassert.
11418 * alloc.c: Convert from xassert to eassert.
11419 * bidi.c: Likewise.
11420 * dispnew.c: Likewise.
11421 * fns.c: Likewise.
11422 * fringe.c: Likewise.
11423 * ftfont.c: Likewise.
11424 * gtkutil.c: Likewise.
11425 * image.c: Likewise.
11426 * keyboard.c: Likewise.
11427 * menu.c: Likewise.
11428 * process.c: Likewise.
11429 * scroll.c: Likewise.
11430 * sound.c: Likewise.
11431 * term.c: Likewise.
11432 * w32console.c: Likewise.
11433 * w32fns.c: Likewise.
11434 * w32term.c: Likewise.
11435 * window.c: Likewise.
11436 * xdisp.c: Likewise.
11437 * xfaces.c: Likewise.
11438 * xfns.c: Likewise.
11439 * xselect.c: Likewise.
11440 * xterm.c: Likewise.
11441
11442 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11443
11444 * fns.c (maybe_resize_hash_table): Output message when growing the
11445 purify-hashtable.
11446
11447 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11448
11449 * alloc.c (allocate_string_data): Remove dead code.
11450 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11451 avoid GCC warning about unused macro.
11452
11453 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11454
11455 * alloc.c (allocate_string): Omit intervals initialization.
11456 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11457 as in make_pure_string and make_pure_c_string.
11458
11459 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11460
11461 * alloc.c (allocate_string): Fix last change.
11462
11463 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11464
11465 * alloc.c (allocate_string): Remove two redundant calls
11466 to memset, add explicit initialization where appropriate.
11467
11468 2012-06-27 Glenn Morris <rgm@gnu.org>
11469
11470 * lisp.mk (lisp): Remove paths.elc.
11471
11472 2012-06-27 Chong Yidong <cyd@gnu.org>
11473
11474 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11475
11476 2012-06-26 John Wiegley <johnw@newartisans.com>
11477
11478 * unexmacosx.c (copy_data_segment): Add two section names used
11479 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11480
11481 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11482 when building with Clang.
11483
11484 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11485
11486 * eval.c (Fapply): Allow calling it with a single argument.
11487
11488 2012-06-26 Eli Zaretskii <eliz@gnu.org>
11489
11490 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11491 _stricmp and _strnicmp.
11492 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11493
11494 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11495
11496 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11497 allocated window.
11498 (allocate_process): Likewise for new process.
11499 (allocate_terminal): Change to use offsetof.
11500 (allocate_frame): Likewise.
11501 * frame.c (make_frame): Omit redundant initialization.
11502 * window.c (make_parent_window): Use memset.
11503 (make_window): Omit redundant initialization.
11504 * process.c (make_process): Omit redundant initialization.
11505 * terminal.c (create_terminal): Likewise.
11506
11507 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11508
11509 * term.c (delete_tty): Remove redundant call to memset.
11510
11511 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11512
11513 * alloc.c: Remove build_string.
11514 * lisp.h: Define build_string as static inline. This provides
11515 a better opportunity to optimize away calls to strlen when the
11516 function is called with compile-time constant argument.
11517 * image.c (imagemagick_error): Convert to build_string.
11518 * w32proc.c (sys_spawnve): Likewise.
11519 * xterm.c (x_term_init): Likewise.
11520
11521 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11522
11523 Use sprintf return value instead of invoking strlen on result.
11524 In the old days this wasn't portable, since some sprintf
11525 implementations returned char *. But they died out years ago and
11526 Emacs already assumes sprintf returns int.
11527 Similarly for float_to_string.
11528 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11529 * ccl.c (ccl_driver):
11530 * character.c (string_escape_byte8):
11531 * data.c (Fnumber_to_string):
11532 * doprnt.c (doprnt):
11533 * print.c (print_object):
11534 * xdisp.c (message_dolog):
11535 * xfns.c (syms_of_xfns):
11536 Use sprintf or float_to_string result to avoid need to call strlen.
11537 * data.c (Fnumber_to_string):
11538 Use make_unibyte_string, since the string must be ASCII.
11539 * lisp.h, print.c (float_to_string): Now returns int length.
11540 * term.c (produce_glyphless_glyph):
11541 Use sprintf result rather than recomputing it.
11542
11543 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11544 * Makefile.in (ALL_CFLAGS):
11545 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11546 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11547
11548 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11549
11550 * dispextern.h (xstrcasecmp): Define to library function
11551 strcasecmp if available.
11552 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11553
11554 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11555
11556 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11557 Avoid comma operator.
11558 * menu.c (push_submenu_start, push_submenu_end)
11559 (push_left_right_boundary, push_menu_pane): Likewise.
11560 * msdos.c (dos_rawgetc): Likewise.
11561
11562 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11563
11564 * xfns.c (xic_create_fontsetname): Remove redundant calls
11565 to memset.
11566
11567 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11568
11569 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11570 sprintf already null-terminates its output.
11571
11572 * xfns.c (x_window): Remove redundant cast.
11573
11574 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11575
11576 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11577 `const char *' to `char *' to avoid compiler warning.
11578
11579 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11580
11581 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11582 instead of truncating it to 63 (admittedly a generous limit).
11583
11584 * process.c: Fix spelling and caps in comments.
11585
11586 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11587
11588 * emacs.c (setpgrp): Remove definition, unused.
11589 * sysdep.c (setpgrp): Remove definition, not used in this file.
11590
11591 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
11592
11593 * makefile.w32-in: Update dependencies.
11594
11595 2012-06-24 Eli Zaretskii <eliz@gnu.org>
11596
11597 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11598 (SYSTIME_H): Add nt/inc/sys/time.h.
11599
11600 * systime.h [WINDOWSNT]: Include sys/time.h.
11601
11602 * s/ms-w32.h (struct timespec): Definition moved from
11603 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11604
11605 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11606
11607 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11608 * buffer.h (buffer_slot_type_mismatch):
11609 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11610 * eval.c (unwind_to_catch):
11611 * image.c (my_png_error, my_error_exit):
11612 * keyboard.c (quit_throw_to_read_char, user_error)
11613 (Fexit_recursive_edit, Fabort_recursive_edit):
11614 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11615 (wrong_type_argument, buffer_overflow, __executable_start)
11616 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11617 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11618 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11619 (fatal):
11620 (child_setup) [!DOS_NT]:
11621 * lread.c (end_of_file_error, invalid_syntax):
11622 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11623 * puresize.h (pure_write_error):
11624 * search.c (matcher_overflow):
11625 * sound.c (sound_perror, alsa_sound_perror):
11626 * sysdep.c, syssignal.h (croak):
11627 * term.c (maybe_fatal, vfatal):
11628 * textprop.c (text_read_only):
11629 * undo.c (user_error):
11630 * unexmacosx.c (unexec_error):
11631 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11632 Use _Noreturn rather than NO_RETURN.
11633 No need for separate decl merely because of _Noreturn.
11634 * sound.c (sound_warning, parse_sound):
11635 Remove unnecessary forward decls.
11636
11637 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11638
11639 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11640 * lisp.h (WAIT_READING_MAX): New macro.
11641 * dispnew.c (Fsleep_for, sit_for):
11642 * keyboard.c (kbd_buffer_get_event):
11643 * process.c (Faccept_process_output):
11644 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11645 This improves on the previous patch, which introduced a bug
11646 when time_t is unsigned and as wide as intmax_t.
11647 See <http://bugs.gnu.org/9000#51>.
11648
11649 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11650
11651 * dispnew.c (sit_for, Fsleep_for):
11652 * keyboard.c (kbd_buffer_get_event):
11653 * process.c (Faccept_process_output): Avoid compiler warnings when
11654 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11655
11656 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
11657
11658 * makefile.w32-in: Update dependencies.
11659
11660 * w32.c (ltime): Add return type and declare static.
11661 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11662
11663 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11664
11665 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11666 Privately reported by Herbert J. Skuhra.
11667 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11668 All uses changed.
11669 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11670 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11671
11672 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11673
11674 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11675 last argument of make_unibyte_string.
11676
11677 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11678 language ID in the event parameters.
11679
11680 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11681 event.code, not the obscure "character set ID".
11682
11683 2012-06-23 Chong Yidong <cyd@gnu.org>
11684
11685 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11686
11687 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11688
11689 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11690 * w32.c (fdutimens): New function.
11691
11692 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11693
11694 * s/ms-w32.h (pselect): Redirect to sys_select.
11695
11696 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11697
11698 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11699 in the logic of incrementing and decrementing the value of
11700 use_relocatable_buffers.
11701
11702 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11703
11704 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11705 Privately reported by Herbert J. Skuhra.
11706 [__FreeBSD__]: Remove "*/" typo after "#include".
11707 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11708 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11709 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11710 Don't assume EMACS_TIME and struct timeval are the same type.
11711
11712 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11713
11714 Support higher-resolution time stamps (Bug#9000).
11715 The time stamps are only nanosecond-resolution at the C level,
11716 since that's the best that any real-world system supports now.
11717 But they are picosecond-resolution at the Lisp level, as that's
11718 easy, and leaves room for future OS improvements.
11719
11720 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11721 (LIBES): Use it.
11722
11723 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11724 Don't get current time unless it's needed.
11725
11726 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11727 now provides it if it's absent.
11728 (start_atimer): Port to higher-res time stamps.
11729 Check for time stamp overflow. Don't get current time more
11730 often than is needed.
11731
11732 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11733 Include systime.h, not time.h.
11734 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11735
11736 * dired.c: Include stat-time.h.
11737 (Ffile-attributes): File times now have higher resolution.
11738
11739 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11740 (struct image): Timestamp now has higher resolution.
11741
11742 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11743 has at least microseconds now. All uses removed.
11744 (update_frame, update_single_window, update_window, update_frame_1)
11745 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
11746 (duration_to_sec_usec): Remove; no longer needed.
11747
11748 * editfns.c (time_overflow): Now extern.
11749 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11750 (float-time, Fformat_time_string, Fcurrent_time_string)
11751 (Fcurrent_time_zone): Accept and generate higher-resolution
11752 time stamps.
11753 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11754 (decode_time_components, lisp_seconds_argument): New functions.
11755 (make_time): Now static.
11756 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11757 Report an error if the time is invalid, rather than having the caller
11758 do that.
11759
11760 * fileio.c: Include <stat-time.h>
11761 (Fcopy_file): Copy higher-resolution time stamps.
11762 Prefer to set the time stamp via a file descriptor if that works.
11763 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11764 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11765 (Fvisited_file_modtime, Fset_visited_file_modtime):
11766 Support higher-resolution time stamps.
11767
11768 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11769
11770 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11771
11772 * image.c (prepare_image_for_display, clear_image_cache)
11773 (lookup_image): Port to higer-resolution time stamps.
11774
11775 * keyboard.c (start_polling, bind_polling_period):
11776 Check for time stamp overflow.
11777 (read_char, kbd_buffer_get_event, timer_start_idle)
11778 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11779 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11780 Port to higher-resolution time stamps. Do not assume time_t is signed.
11781 (decode_timer): New function. Timers are now vectors of length 9,
11782 not 8, to accommodate the picosecond component.
11783 (timer_check_2): Use it.
11784
11785 * nsterm.m (select_timeout, timeval_subtract): Remove.
11786 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11787 as they're a bit more accurate and handle overflow better.
11788 (ns_select): Change prototype to be compatible with pselect.
11789 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11790 * nsterm.h (ns_select): Adjust prototype.
11791
11792 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11793 us-resolution time stamps.
11794 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11795
11796 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11797
11798 * lisp.h (time_overflow): New decl.
11799 (wait_reading_process_output): First arg is now intmax_t, not int,
11800 to accommodate larger waits.
11801
11802 * process.h (struct Lisp_Process.read_output_delay):
11803 Now counts nanoseconds, not microseconds.
11804 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11805 EMACS_HAS_USECS.
11806 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11807 (wait_reading_process_output):
11808 Port to ns-resolution time stamps.
11809 (Faccept_process_output, wait_reading_process_output):
11810 Check for time stamp overflow. Do not assume time_t is signed.
11811 (select_wrapper): Remove; we now use pselect.
11812 (Fprocess_attributes): Now generates ns-resolution time stamps.
11813
11814 * sysdep.c: Include utimens.h. Don't include utime.h
11815 or worry about struct utimbuf; gnulib does that for us now.
11816 (gettimeofday): Remove; gnulib provides a substitute.
11817 (make_timeval): New function.
11818 (set_file_times): Now sets ns-resolution time stamps.
11819 New arg FD; all uses changed.
11820 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11821 (system_process_attributes):
11822 Now returns ns-resolution time stamp. All uses changed.
11823 Check for time stamp overflow.
11824
11825 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11826 provides a substitute now.
11827
11828 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11829 since it guarantees struct timespec.
11830 (EMACS_TIME): Now struct timespec, so that we can support
11831 ns-resolution time stamps.
11832 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11833 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11834 (EMACS_USECS): Remove.
11835 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11836 so multiply the arg by 1000 before storing it.
11837 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11838 New macros.
11839 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11840 Port to ns-resolution time stamps.
11841 (EMACS_TIME_NEG_P): Remove; replaced by....
11842 (EMACS_TIME_SIGN): New macro.
11843 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11844 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11845 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11846 (make_timeval, make_lisp_time, decode_time_components): New decls.
11847 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11848 that it mishandled time_t overflow. You can't compare by subtracting!
11849 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11850 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11851
11852 * term.c: Include <sys/time.h>.
11853 (timeval_to_Time): New function, for proper overflow wraparound.
11854 (term_mouse_position, term_mouse_click): Use it.
11855
11856 * undo.c (record_first_change): Support higher-resolution time stamps
11857 in the undo buffer.
11858 (Fprimitive_undo): Use them when restoring time stamps.
11859
11860 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11861 (w32_get_internal_run_time):
11862 Port to higher-resolution Emacs time stamps.
11863 (ltime): Now accepts single 64-bit integer, as that's more convenient
11864 for callers.
11865
11866 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11867
11868 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11869 for compatibility with pselect. Support ns-resolution time stamps.
11870
11871 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11872
11873 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11874 Check for time stamp overflow, and support ns-resolution time stamps.
11875
11876 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11877 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11878 (timeval_subtract): Remove; no longer needed.
11879 (XTflash, XTring_bell, x_wait_for_event):
11880 Port to ns-resolution time stamps. Don't assume time_t is signed.
11881
11882 2012-06-22 Chong Yidong <cyd@gnu.org>
11883
11884 * xdisp.c (x_consider_frame_title): Revert last change.
11885
11886 2012-06-22 Eli Zaretskii <eliz@gnu.org>
11887
11888 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11889 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11890 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11891 staticidx goes up to 1597 out of 1600 = 0x640.)
11892
11893 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11894
11895 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11896 Otherwise, the umask might be mistakenly 0 while handling input signals.
11897
11898 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11899
11900 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11901
11902 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11903
11904 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11905 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11906 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11907 access to `contents' member of Lisp_Vector objects with AREF and ASET
11908 where appropriate.
11909
11910 2012-06-19 Chong Yidong <cyd@gnu.org>
11911
11912 * frame.c (delete_frame): When selecting a frame on a different
11913 text terminal, do not alter the terminal's top-frame.
11914
11915 * xdisp.c (format_mode_line_unwind_data): Record the target
11916 frame's selected window and its terminal's top-frame.
11917 (unwind_format_mode_line): Restore them.
11918 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11919 Callers changed.
11920 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11921 since tty frames can be explicitly named.
11922 (prepare_menu_bars): Likewise.
11923
11924 * term.c (Ftty_top_frame): New function.
11925
11926 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11927
11928 Port byte-code-meter to modern targets.
11929 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11930 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
11931 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
11932 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11933 (METER_1, METER_2): Simplify.
11934
11935 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11936
11937 * data.c (Fdefalias): Return `symbol' (bug#11686).
11938
11939 2012-06-18 Martin Rudalics <rudalics@gmx.at>
11940
11941 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
11942 gets killed during executing of this function (Bug#11665).
11943 Try to always return Qt when the buffer has been actually killed.
11944 (Vkill_buffer_query_functions): In doc-string say that functions
11945 run by this hook should not change the current buffer.
11946
11947 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11948
11949 Fix recently-introduced process.c problems found by static checking.
11950 * process.c (write_queue_push, write_queue_pop, send_process):
11951 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11952 (write_queue_pop): Fix pointer signedness problem.
11953 (send_process): Remove unused local.
11954
11955 2012-06-17 Chong Yidong <cyd@gnu.org>
11956
11957 * xdisp.c (redisplay_internal): No need to redisplay terminal
11958 frames that are not on top.
11959
11960 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
11961
11962 * process.c (make_process): Initialize write_queue.
11963 (write_queue_push, write_queue_pop): New functions.
11964 (send_process): Use them to maintain correct ordering of process
11965 writes (Bug#10815).
11966
11967 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11968
11969 * lisp.h (eassert): Assume C89 or later.
11970 This removes the need for CHECK.
11971 (CHECK): Remove. Its comments about always evaluating its
11972 argument were confusing, as 'eassert' typically does not evaluate
11973 its argument.
11974
11975 * coding.c (produce_chars): Use ptrdiff_t, not int.
11976
11977 * xterm.c (x_draw_underwave): Check for integer overflow.
11978 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11979
11980 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
11981
11982 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11983 referenced (Bug#11583).
11984
11985 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11986
11987 Implement wave-style variant of underlining.
11988 * dispextern.h (face_underline_type): New enum.
11989 (face): Add field for underline type.
11990 * nsterm.m (ns_draw_underwave): New function.
11991 (ns_draw_text_decoration): Use it.
11992 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11993 New functions.
11994 (x_draw_glyph_string): Use them.
11995 * xfaces.c (Qline, Qwave): New Lisp objects.
11996 (check_lface_attrs, merge_face_ref)
11997 (Finternal_set_lisp_face_attribute, realize_x_face):
11998 Handle wave-style underline face attributes.
11999 * xterm.c (x_draw_underwave): New function.
12000 (x_draw_glyph_string): Use it.
12001
12002 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12003
12004 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12005 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12006 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12007 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12008 ($(BLD)/w32select.$(O)): Update dependencies.
12009
12010 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12011
12012 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12013 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12014 * character.c (_fetch_multibyte_char_p): Remove.
12015 * alloc.c: Include "character.h" before "buffer.h".
12016 * bidi.c: Likewise.
12017 * buffer.c: Likewise.
12018 * bytecode.c: Likewise.
12019 * callint.c: Likewise.
12020 * callproc.c: Likewise.
12021 * casefiddle.c: Likewise.
12022 * casetab.c: Likewise.
12023 * category.c: Likewise.
12024 * cmds.c: Likewise.
12025 * coding.c: Likewise.
12026 * composite.c: Likewise.
12027 * dired.c: Likewise.
12028 * dispnew.c: Likewise.
12029 * doc.c: Likewise.
12030 * dosfns.c: Likewise.
12031 * editfns.c: Likewise.
12032 * emacs.c: Likewise.
12033 * fileio.c: Likewise.
12034 * filelock.c: Likewise.
12035 * font.c: Likewise.
12036 * fontset.c: Likewise.
12037 * fringe.c: Likewise.
12038 * indent.c: Likewise.
12039 * insdel.c: Likewise.
12040 * intervals.c: Likewise.
12041 * keyboard.c: Likewise.
12042 * keymap.c: Likewise.
12043 * lread.c: Likewise.
12044 * macros.c: Likewise.
12045 * marker.c: Likewise.
12046 * minibuf.c: Likewise.
12047 * nsfns.m: Likewise.
12048 * nsmenu.m: Likewise.
12049 * print.c: Likewise.
12050 * process.c: Likewise.
12051 * regex.c: Likewise.
12052 * region-cache.c: Likewise.
12053 * search.c: Likewise.
12054 * syntax.c: Likewise.
12055 * term.c: Likewise.
12056 * textprop.c: Likewise.
12057 * undo.c: Likewise.
12058 * unexsol.c: Likewise.
12059 * w16select.c: Likewise.
12060 * w32fns.c: Likewise.
12061 * w32menu.c: Likewise.
12062 * window.c: Likewise.
12063 * xdisp.c: Likewise.
12064 * xfns.c: Likewise.
12065 * xmenu.c: Likewise.
12066 * xml.c: Likewise.
12067 * xselect.c: Likewise.
12068
12069 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12070
12071 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12072 If all the glyphs of the glyph row came from strings, and we have no
12073 cursor positioning clues, put the cursor on the first glyph of the
12074 row.
12075 (handle_face_prop): Use chunk-relative overlay string index when
12076 indexing into it->string_overlays array. (Bug#11653)
12077 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12078 the rightmost. (Bug#11720)
12079
12080 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12081
12082 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12083 (CATEGORY_MEMBER): Enforce 1/0 value.
12084 * category.c (_temp_category_set): Remove.
12085
12086 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12087
12088 * window.c (Fdelete_other_windows_internal)
12089 (Fdelete_window_internal): Don't access frame's mouse highlight
12090 info of the initial frame. (Bug#11677)
12091
12092 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12093
12094 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12095 Assume USE_2_TAGS_FOR_INTS.
12096 (xreload): Adjust $tagmask width to match recent lisp.h change.
12097
12098 Simplify lisp.h in minor ways that should not affect code.
12099 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12100 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12101 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12102 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12103 (INTTYPEBITS): New macro, for clarity.
12104 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12105 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12106 Simplify now that USE_LSB_TAG is always defined.
12107 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12108 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12109
12110 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12111
12112 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12113
12114 2012-06-13 Glenn Morris <rgm@gnu.org>
12115
12116 * s/bsd-common.h (BSD4_3):
12117 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12118
12119 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12120
12121 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12122 instead of union.
12123 (XLI, XIL): Define.
12124 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12125 Use them.
12126 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12127 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12128 * alloc.c (widen_to_Lisp_Object): Remove.
12129 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12130 * frame.c (delete_frame): Remove outdated comment.
12131 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12132 USE_LISP_UNION_TYPE.
12133 (Fw32_unregister_hot_key): Likewise.
12134 (Fw32_toggle_lock_key): Likewise.
12135 * w32menu.c (add_menu_item): Likewise.
12136 (w32_menu_display_help): Use XIL instead of checking
12137 USE_LISP_UNION_TYPE.
12138 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12139 (init_heap): Likewise.
12140 * w32term.c (w32_read_socket): Update comment.
12141
12142 2012-06-13 Glenn Morris <rgm@gnu.org>
12143
12144 * s/usg5-4-common.h, src/s/unixware.h:
12145 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12146
12147 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12148
12149 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12150
12151 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12152 * alloc.c (make_number) [!defined make_number]:
12153 Remove, as lisp.h always defines this now.
12154 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12155 (roundup_size): Verify that it is a power of 2.
12156 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12157 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12158 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12159 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12160 USE_LSB_TAG now is always defined to be either 0 or 1.
12161 All uses changed.
12162 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12163 code works fine either way, and efficiency is not a concern here,
12164 as the union type is for debugging, not for production.
12165 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12166 Use an inline function on all platforms when using the union type,
12167 since this is simpler and 'static inline' can be used portably
12168 within Emacs now.
12169 (LISP_INITIALLY_ZERO): New macro.
12170 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12171 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12172
12173 2012-06-12 Glenn Morris <rgm@gnu.org>
12174
12175 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12176
12177 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12178
12179 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12180 Move BROKEN_SIGIO to configure.
12181
12182 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12183 Move NO_TERMIO to configure.
12184
12185 2012-06-12 Chong Yidong <cyd@gnu.org>
12186
12187 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12188 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12189 MagickExportImagePixels is undefined.
12190
12191 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12192
12193 * image.c (imagemagick_load_image): Remove unused label.
12194
12195 2012-06-11 Glenn Morris <rgm@gnu.org>
12196
12197 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12198 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12199 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12200 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12201
12202 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12203
12204 * alloc.c (make_byte_code): New function.
12205 (Fmake_byte_code): Use it. Don't purify here.
12206 * lread.c (read1): Use it as well to avoid extra allocation.
12207
12208 2012-06-11 Chong Yidong <cyd@gnu.org>
12209
12210 * image.c (imagemagick_load_image): Implement transparency.
12211
12212 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12213
12214 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12215 account for preceding backslashes. (Bug#11663)
12216
12217 2012-06-09 Chong Yidong <cyd@gnu.org>
12218
12219 * term.c: Support italics in capable terminals (Bug#9652).
12220 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12221 (turn_on_face): Output using TS_enter_italic_mode if available.
12222 Don't handle unused blinking and alt-charset cases.
12223 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12224 and tty_alt_charset_p cases.
12225 (tty_capable_p, init_tty): Support italics.
12226
12227 * termchar.h (struct tty_display_info): Add field for italics.
12228 Remove unused blink field.
12229
12230 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12231 Handle slant.
12232
12233 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12234 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12235 tty_alt_charset_p. Add tty_italic_p.
12236
12237 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12238
12239 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12240 dbus_type_is_basic if available.
12241 (xd_extract_signed, xd_extract_unsigned): Rename from
12242 extract_signed and extract_unsigned, respectively. Adapt callers.
12243
12244 2012-06-09 Chong Yidong <cyd@gnu.org>
12245
12246 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12247
12248 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12249 case (Bug#9752).
12250
12251 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12252
12253 * xdisp.c (vmessage): Treat frame message as multibyte.
12254 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12255 would generate the diagnostic "Making \302\247 buffer-local while
12256 let-bound!".
12257
12258 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12259
12260 * dispnew.c (showing_window_margins_p): Undo last change, which
12261 was done due to an inadvertent commit.
12262 (adjust_frame_glyphs_for_frame_redisplay): Do call
12263 showing_window_margins_p.
12264
12265 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12266
12267 * eval.c (Fmake_var_non_special): New primitive.
12268 (syms_of_eval): Defsubr it.
12269 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12270
12271 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12272
12273 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12274 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12275
12276 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12277
12278 * alloc.c (allocate_vectorlike): Fix last change.
12279
12280 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12281
12282 Block-based vector allocation of small vectors.
12283 * lisp.h (struct vectorlike_header): New field `nbytes',
12284 adjust comment accordingly.
12285 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12286 to denote vector blocks. Adjust users (live_vector_p,
12287 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12288 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12289 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12290 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12291 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12292 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12293 (roundup_size): New constant.
12294 (struct vector_block): New data type.
12295 (vector_blocks, vector_free_lists, zero_vector): New variables.
12296 (all_vectors): Rename to `large_vectors'.
12297 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12298 (sweep_vectors): New functions.
12299 (allocate_vectorlike): Return `zero_vector' as the only vector of
12300 0 items. Allocate new vector from block if vector size is less than
12301 or equal to VBLOCK_BYTES_MAX.
12302 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12303 (init_alloc_once): Add call to init_vectors.
12304
12305 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12306
12307 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12308
12309 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12310
12311 * doprnt.c (doprnt): Truncate multibyte char correctly.
12312 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12313 would mishandle a string argument "Xc" if X was a multibyte
12314 character of length 2: it would truncate after X's first byte
12315 rather than including all of X.
12316
12317 2012-06-06 Chong Yidong <cyd@gnu.org>
12318
12319 * buffer.c (word_wrap): Doc fix.
12320
12321 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12322
12323 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12324
12325 2012-06-03 Glenn Morris <rgm@gnu.org>
12326
12327 * xdisp.c (tool-bar-style): Doc fix.
12328
12329 2012-06-03 Ulrich Müller <ulm@gentoo.org>
12330
12331 * Makefile.in (PAXCTL): Define.
12332 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12333 binary via PaX flags if the paxctl utility is available.
12334 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12335 Restore PaX flags to their default. (Bug#11398)
12336
12337 2012-06-03 Chong Yidong <cyd@gnu.org>
12338
12339 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12340 buffer (Bug#11226).
12341
12342 2012-06-03 Chong Yidong <cyd@gnu.org>
12343
12344 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12345 (note_mode_line_or_margin_highlight): If there is no help echo,
12346 use mode-line-default-help-echo. Handle the case where the mouse
12347 position is past the end of the mode line string.
12348
12349 * buffer.c (buffer_local_value_1): New function, split from
12350 Fbuffer_local_value; can return Qunbound.
12351 (Fbuffer_local_value): Use it.
12352 (Vmode_line_format): Docstring tweaks.
12353
12354 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12355
12356 * sysdep.c (system_process_attributes): Improve comment.
12357
12358 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12359
12360 * keyboard.c: Export real-this-command to Elisp.
12361 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12362 and DEFVAR it. Update all users.
12363
12364 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12365
12366 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12367
12368 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12369 Convert pctcpu and pctmem to Lisp float properly.
12370 Let the compiler fold better, as 100.0/0x8000 is exact.
12371
12372 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12373
12374 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12375 cons_block.
12376
12377 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12378
12379 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12380
12381 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12382
12383 For a 'struct window', replace some Lisp_Object fields to
12384 bitfields where appropriate, remove unused fields.
12385 * window.h (struct window): Remove unused 'last_mark_x' and
12386 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
12387 change its type from Lisp_Object to bitfield.
12388 Change type of 'force_start', 'optional_new_start',
12389 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
12390 fields from Lisp_Object to bitfield. Adjust users accordingly.
12391
12392 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12393
12394 Pacify gcc -Wdouble-precision when using Xaw.
12395 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12396 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12397 Use 'float' consistently, rather than 'float' in most places
12398 and 'double' in a couple of places.
12399
12400 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12401
12402 * xdisp.c (handle_stop): Detect whether we have overlay strings
12403 loaded by testing it->current.overlay_string_index to be
12404 non-negative, instead of checking whether n_overlay_strings is
12405 positive. (Bug#11587)
12406
12407 2012-05-31 Chong Yidong <cyd@gnu.org>
12408
12409 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12410
12411 * doc.c (Fsubstitute_command_keys): Doc fix.
12412
12413 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12414
12415 * search.c (search_buffer): Remove calls to
12416 r_alloc_inhibit_buffer_relocation, as it is now called by
12417 maybe_unify_char, which was the cause of relocation of buffer text
12418 in bug#11519.
12419
12420 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12421
12422 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12423 for the duration of call to load_charset, to avoid problems with
12424 callers of maybe_unify_char that access buffer text through C
12425 pointers.
12426
12427 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12428 decrement the inhibition flag, instead of just setting or
12429 resetting it.
12430
12431 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12432
12433 Remove obsolete '#define static' cruft.
12434 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12435 This #undef was "temporary" in 2000; it is no longer needed
12436 now that '#define static' has gone away.
12437 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12438 (gray_bitmap_bits): Remove; no longer needed.
12439 All uses replaced with definiens.
12440 * xterm.c: Include "bitmaps/gray.xbm".
12441
12442 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12443
12444 Clean up __executable_start, monstartup when --enable-profiling.
12445 The following changes affect the code only when profiling.
12446 * dispnew.c (__executable_start): Rename from safe_bcopy.
12447 Define only on platforms that need it.
12448 * emacs.c: Include <sys/gmon.h> when profiling.
12449 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12450 (__executable_start): Remove decl, since lisp.h does it now.
12451 (safe_bcopy): Remove decl; no longer has that name.
12452 (main): Coalesce #if into single bit of code, for simplicity.
12453 Cast pointers to uintptr_t, since standard libraries want integers
12454 and not pointers.
12455 * lisp.h (__executable_start): New decl.
12456
12457 2012-05-31 Glenn Morris <rgm@gnu.org>
12458
12459 * image.c (Fimagemagick_types): Doc fix.
12460
12461 2012-05-30 Jim Meyering <meyering@redhat.com>
12462
12463 * callproc.c (Fcall_process_region): Include directory component
12464 in mkstemp error message (Bug#11586).
12465
12466 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12467
12468 * alloc.c, lisp.h (make_pure_vector): Now static.
12469
12470 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12471
12472 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12473 Move to byte-run.el.
12474 (Fautoload): Do the hash-doc more carefully.
12475 * data.c (Fdefalias): Purify definition, except for keymaps.
12476 (Qdefun): Move from eval.c.
12477 * lisp.h (Qdefun): Remove.
12478 * lread.c (read1): Tiny simplification.
12479
12480 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
12481
12482 Do not create empty overlays with the evaporate property (Bug#9642).
12483 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12484 Bug#9642, but explicitly check that the buffer the overlay would
12485 be moved to is live and rearrange lines to make sure that errors
12486 will not put the overlay in an inconsistent state.
12487 (Fdelete_overlay): Cosmetics.
12488
12489 2012-05-28 Eli Zaretskii <eliz@gnu.org>
12490
12491 * w32term.c (my_bring_window_to_top): New function.
12492 (x_raise_frame): Use handle returned by DeferWindowPos, which
12493 could be different from the original one.
12494 Call my_bring_window_to_top instead of my_set_foreground_window.
12495 (Bug#11513)
12496
12497 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12498 by calling BringWindowToTop.
12499
12500 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12501 (WM_EMACS_END): Increase by one.
12502
12503 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12504
12505 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12506 This avoids undefined behavior that might cause the eassert
12507 to not catch an out-of-range value.
12508
12509 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
12510
12511 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12512 Update dependencies.
12513
12514 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12515
12516 * bidi.c (bidi_mirror_char): Fix last change.
12517
12518 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12519
12520 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12521 when referring to sectname field in printf format.
12522
12523 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12524
12525 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12526 Only r_alloc_inhibit_buffer_relocation needed to be added;
12527 the others were already declared.
12528
12529 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12530 before checking whether it's out of range. Put the check inside
12531 eassert. See
12532 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12533
12534 2012-05-27 Ken Brown <kbrown@cornell.edu>
12535
12536 * callproc.c (Fcall_process): Restore a line that was accidentally
12537 commented out in the 2011-02-13 change (bug#11547).
12538
12539 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12540
12541 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12542 defined on ralloc.c.
12543
12544 * buffer.c [REL_ALLOC]: Remove prototypes of
12545 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12546 they are now on lisp.h.
12547
12548 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12549
12550 * search.c (search_buffer): Use it to inhibit relocation of buffer
12551 text while re_search_2 is doing its job, because re_search_2 is
12552 passed C pointers to buffer text. (Bug#11519)
12553
12554 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12555 Update value to 24.
12556
12557 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12558 state after an additional call to move_it_in_display_line_to, keep
12559 the values of it->max_ascent and it->max_descent found for the
12560 entire line.
12561 (pos_visible_p): Revert the comparison against bottom_y to what it
12562 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12563 (Bug#11464)
12564
12565 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12566
12567 Fix coding-related core dumps with gcc -ftrapv.
12568 The code was computing A - B, where A and B are pointers, and B is
12569 random garbage. This can lead to core dumps on platforms that
12570 have special pointer registers, and it also leads to core dumps on
12571 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12572 A - B only when B is initialized properly.
12573 * coding.c (coding_set_source, coding_set_destination): Return void.
12574 (coding_change_source, coding_change_destinations): New functions,
12575 with the old behaviors of coding_set_source and coding_set_destination.
12576 All callers that need an offset changed to use these new functions.
12577
12578 2012-05-26 Glenn Morris <rgm@gnu.org>
12579
12580 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12581
12582 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12583
12584 Extend mouse support on W32 text-mode console.
12585 * xdisp.c (draw_row_with_mouse_face):
12586 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
12587
12588 * w32console.c: Include window.h.
12589 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12590 New functions.
12591 (initialize_w32_display): Initialize mouse-highlight data.
12592
12593 * w32inevt.c: Include termchar.h and window.h.
12594 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12595 moves, call note_mouse_highlight. If help_echo changed, call
12596 gen_help_event to produce help-echo message in the echo area.
12597 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12598 highlight info.
12599
12600 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12601
12602 * lread.c (read1): Simplify slightly to avoid an overflow warning
12603 with GCC 4.7.0 on x86-64.
12604
12605 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12606
12607 * bidi.c (bidi_mirror_char): Revert last change: an int is
12608 definitely wide enough here.
12609
12610 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
12611
12612 Fix integer width and related bugs (Bug#9874).
12613 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
12614 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12615 (string_bytes, check_sblock, allocate_string_data):
12616 (compact_small_strings, Fmake_bool_vector, make_string)
12617 (make_unibyte_string, make_multibyte_string)
12618 (make_string_from_bytes, make_specified_string)
12619 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12620 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12621 (mark_vectorlike):
12622 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12623 (allocate_pseudovector):
12624 Use int, not EMACS_INT, where int is wide enough.
12625 (inhibit_garbage_collection, Fgarbage_collect):
12626 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12627 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12628 int might not be wide enough.
12629 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12630 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12631 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12632 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12633 (bidi_level_of_next_char, bidi_move_to_visually_next):
12634 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12635 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12636 (Fkill_buffer, Fset_buffer_major_mode)
12637 (advance_to_char_boundary, Fbuffer_swap_text)
12638 (Fset_buffer_multibyte, overlays_at, overlays_in)
12639 (overlay_touches_p, struct sortvec, record_overlay_string)
12640 (overlay_strings, recenter_overlay_lists)
12641 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12642 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12643 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12644 (Foverlay_recenter, last_overlay_modification_hooks_used)
12645 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12646 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12647 (validate_region): Omit unnecessary test for b <= e,
12648 since that's guaranteed by the previous test.
12649 (adjust_overlays_for_delete): Avoid pos + length overflow.
12650 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12651 (report_overlay_modification):
12652 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12653 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12654 Omit pointer cast, which isn't needed anyway, and doesn't work
12655 after the EMACS_INT -> ptrdiff_t change.
12656 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
12657 * buffer.h: Adjust decls to match defn changes elsewhere.
12658 (struct buffer_text, struct buffer):
12659 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12660 Use EMACS_INT, not int, where int might not be wide enough.
12661 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12662 not int, to avoid needless 32-bit limit on 64-bit hosts.
12663 (exec_byte_code): Use tighter memory-full test, one that checks
12664 for alloca overflow. Don't compute the address of the object just
12665 before an array, as that's not portable. Use EMACS_INT, not
12666 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
12667 * callint.c (Fcall_interactively):
12668 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12669 * callproc.c (call_process_kill, Fcall_process):
12670 Don't assume pid_t fits into an Emacs fixnum.
12671 (call_process_cleanup, Fcall_process, child_setup):
12672 Don't assume pid_t fits into int.
12673 (call_process_cleanup, Fcall_process, delete_temp_file)
12674 (Fcall_process_region):
12675 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12676 (Fcall_process): Simplify handling of volatile integers.
12677 Use int, not EMACS_INT, where int will do.
12678 * casefiddle.c (casify_object, casify_region, operate_on_word)
12679 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12680 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12681 (casify_object): Avoid integer overflow when overallocating buffer.
12682 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
12683 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
12684 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12685 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12686 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12687 integers are now checked earlier. All uses replaced with XINT.
12688 (ccl_driver):
12689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12690 For CCL_MapSingle, check that content and value are in int range.
12691 (ccl_driver, Fregister_code_conversion_map):
12692 Check that Vcode_version_map_vector is a vector.
12693 (resolve_symbol_ccl_program): Check that vector header is in range.
12694 Always copy the vector, so that we can check its contents reliably
12695 now rather than having to recheck each instruction as it's being
12696 executed. Check that vector words fit in 'int'.
12697 (ccl_get_compiled_code, Fregister_ccl_program)
12698 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12699 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12700 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12701 contents are in range.
12702 (Fccl_execute_on_string): Check that status is in range.
12703 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12704 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12705 Accept and return EMACS_INT, not int, because callers can pass values
12706 out of 'int' range.
12707 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12708 (multibyte_chars_in_text, parse_str_as_multibyte)
12709 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12710 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12711 (string_escape_byte8, Fget_byte):
12712 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12713 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
12714 avoid mishandling large integers.
12715 * character.h: Adjust decls to match defn changes elsewhere.
12716 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12717 (Ffind_charset_region):
12718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12719 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12720 (load_charset_map_from_vector, Fdefine_charset_internal):
12721 Don't assume fixnum fits in int.
12722 (load_charset_map_from_vector, Fmap_charset_chars):
12723 Remove now-unnecessary CHECK_NATNUMs.
12724 (Fdefine_charset_internal): Check ranges here, more carefully.
12725 Don't rely on undefined behavior with signed left shift overflow.
12726 Don't assume unsigned int fits into fixnum, or that fixnum fits
12727 into unsigned int. Don't require max_code to be a valid fixnum;
12728 that's not true for gb10830 4-byte on a 32-bit host. Allow
12729 invalid_code to be a cons, for the same reason. Require code_offset
12730 to be a character. Avoid int overflow if max_char is close
12731 to INT_MAX.
12732 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12733 this is intended anyway and avoids some undefined behavior.
12734 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12735 INDEX_TO_CODE_POINT, as that's what it expects.
12736 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
12737 * charset.h (DECODE_CHAR): Return int, not unsigned;
12738 this is what was intended anyway, and it avoids undefined behavior.
12739 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12740 integer-overflow issues.
12741 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12742 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12743 where the argument is EMACS_INT, and this behavior is not intended.
12744 * chartab.c (Fmake_char_table, Fset_char_table_range)
12745 (uniprop_get_decoder, uniprop_get_encoder):
12746 Don't assume fixnum fits in int.
12747 * cmds.c (move_point): New function, that does the gist of
12748 Fforward_char and Fbackward_char, but does so while checking
12749 for integer overflow more accurately.
12750 (Fforward_char, Fbackward_char): Use it.
12751 (Fforward_line, Fend_of_line, internal_self_insert)
12752 (internal_self_insert):
12753 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12754 Fix a FIXME, by checking for integer overflow when calculating
12755 target_clm and actual_clm.
12756 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
12757 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
12758 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12759 (coding_alloc_by_making_gap, alloc_destination)
12760 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12761 (encode_coding_utf_16, detect_coding_emacs_mule)
12762 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12763 (detect_coding_iso_2022, decode_coding_iso_2022)
12764 (encode_invocation_designation, encode_designation_at_bol)
12765 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12766 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12767 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12768 (encode_coding_ccl, encode_coding_raw_text)
12769 (detect_coding_charset, decode_coding_charset)
12770 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12771 (produce_composition, produce_charset, produce_annotation)
12772 (decode_coding, handle_composition_annotation)
12773 (handle_charset_annotation, consume_chars, decode_coding_gap)
12774 (decode_coding_object, encode_coding_object, detect_coding_system)
12775 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12776 (code_convert_region, code_convert_string)
12777 (Fdefine_coding_system_internal)
12778 (coding_set_source, coding_set_destination):
12779 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12780 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12781 (Fdefine_coding_system_internal):
12782 Don't assume fixnums fit in int.
12783 (decode_coding_gap, decode_coding_object, encode_coding_object)
12784 (Fread_coding_system, Fdetect_coding_region)
12785 (Funencodable_char_position, Fcheck_coding_systems_region)
12786 (get_translation, handle_composition_annotation, consume_chars):
12787 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12788 (consume_chars): Rewrite to not calculate an address outside buffer.
12789 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
12790 Don't access memory outside of the args array.
12791 (Fdefine_coding_system_internal): Check for charset-id overflow.
12792 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12793 result of ENCODE_CHAR.
12794 * coding.h: Adjust decls to match defn changes elsewhere.
12795 (struct coding_system):
12796 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12797 * composite.c (get_composition_id, find_composition)
12798 (run_composition_function, update_compositions)
12799 (compose_text, composition_gstring_put_cache)
12800 (composition_gstring_p, composition_gstring_width)
12801 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12802 (composition_compute_stop_pos, composition_reseat_it)
12803 (composition_update_it, struct position_record)
12804 (find_automatic_composition, composition_adjust_point)
12805 (Fcomposition_get_gstring, Ffind_composition_internal):
12806 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12807 (update_compositions):
12808 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12809 * composite.h: Adjust decls to match defn changes elsewhere.
12810 (struct composition):
12811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12812 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12813 Do not attempt to compute the address of the object just before a
12814 buffer; this is not portable.
12815 (Faref, Faset):
12816 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12817 (Faset): Use int, not EMACS_INT, where int is wide enough.
12818 (Fstring_to_number): Don't assume fixnums fit in int.
12819 (Frem): Don't assume arg is nonnegative.
12820 * dbusbind.c (xd_append_arg): Check for integers out of range.
12821 (Fdbus_call_method): Don't overflow the timeout int.
12822 (extract_signed, extract_unsigned): New functions.
12823 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12824 (xd_get_connection_references): Return ptrdiff_t, not int.
12825 All uses changed.
12826 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12827 (xd_read_message_1):
12828 Use int, not unsigned, where the dbus API uses int.
12829 (Fdbus_message_internal): Don't overflow mtype.
12830 (syms_of_dbusbind): Allocate right-sized buffer for integers.
12831 * dired.c (directory_files_internal, file_name_completion, scmp)
12832 (file_name_completion_stat):
12833 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12834 (file_name_completion): Don't overflow matchcount.
12835 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12836 * dispextern.h: Adjust decls to match defn changes elsewhere.
12837 (struct text_pos, struct glyph, struct bidi_saved_info)
12838 (struct bidi_string_data, struct bidi_it, struct composition_it)
12839 (struct it):
12840 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12841 (struct display_pos, struct composition_it, struct it):
12842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12843 * dispnew.c (increment_matrix_positions)
12844 (increment_row_positions, mode_line_string)
12845 (marginal_area_string):
12846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12847 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
12848 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12849 (duration_to_sec_usec): New function, to check for overflow better.
12850 (Fsleep_for, sit_for): Use it.
12851 * doc.c (get_doc_string, store_function_docstring):
12852 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12853 (get_doc_string, Fsnarf_documentation):
12854 Use int, not EMACS_INT, where int is wide enough.
12855 (get_doc_string):
12856 Use SAFE_ALLOCA, not alloca.
12857 Check for overflow when converting EMACS_INT to off_t.
12858 * doprnt.c (doprnt):
12859 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12860 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12861 Don't assume uid_t fits into fixnum.
12862 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12863 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12864 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12865 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12866 (general_insert_function)
12867 (Finsert_char, make_buffer_string, make_buffer_string_both)
12868 (update_buffer_properties, Fbuffer_substring)
12869 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12870 (Fsubst_char_in_region, check_translation)
12871 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12872 (transpose_markers, Ftranspose_regions):
12873 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12874 (clip_to_bounds): Move to lisp.h as an inline function).
12875 (Fconstrain_to_field): Don't assume integers are nonnegative.
12876 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12877 (Fsubst_char_in_region, Fsave_restriction):
12878 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12879 (Femacs_pid): Don't assume pid_t fits into fixnum.
12880 (lo_time): Use int, not EMACS_INT, when int suffices.
12881 (lisp_time_argument): Check for usec out of range.
12882 (Fencode_time): Don't assume fixnum fits in int.
12883 (Fuser_login_name, Fuser_full_name): Signal an error
12884 if a uid argument is out of range, rather than relying on
12885 undefined behavior.
12886 (Fformat_time_string): Remove now-unnecessary check.
12887 lisp_time_argument checks for out-of-range usec now.
12888 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
12889 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12890 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12891 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12892 (init_cmdargs, Fdump_emacs):
12893 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12894 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12895 the bottom (typically) 32 bits of the fixnum.
12896 * eval.c (specpdl_size, call_debugger):
12897 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12898 (when_entered_debugger, Fbacktrace_debug):
12899 Don't assume fixnum can fit in int.
12900 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12901 the object just before a buffer; this is not portable.
12902 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12903 (grow_specpdl, unbind_to):
12904 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12905 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12906 (grow_specpdl): Simplify allocation by using xpalloc.
12907 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
12908 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12909 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12910 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12911 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12912 (a_write, e_write):
12913 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12914 (Fcopy_file, non_regular_nbytes, read_non_regular)
12915 (Finsert_file_contents):
12916 Use int, not EMACS_INT, where int is wide enough.
12917 (READ_BUF_SIZE): Verify that it fits in int.
12918 (Finsert_file_contents): Check that counts are in proper range,
12919 rather than assuming fixnums fit into ptrdiff_t etc.
12920 Don't assume fixnums fit into int.
12921 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
12922 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12923 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
12924 (string_char_to_byte, string_byte_to_char)
12925 (string_make_multibyte, string_to_multibyte)
12926 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12927 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12928 (substring_both, Fdelete, internal_equal, Ffillarray)
12929 (Fclear_string, mapcar1)
12930 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12931 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12932 (larger_vector, make_hash_table, maybe_resize_hash_table)
12933 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12934 (Fmaphash, secure_hash):
12935 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12936 (concat): Check for string index and length overflow.
12937 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12938 (Frequire):
12939 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12940 (larger_vector): New API (vec, incr_min, size_max) replaces old
12941 one (vec, new_size, init). This catches size overflow.
12942 INIT was removed because it was always Qnil.
12943 All callers changed.
12944 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12945 the upper bound on a hash table index size.
12946 (make_hash_table, maybe_resize_hash_table): Use it.
12947 (secure_hash): Computer start_byte and end_byte only after
12948 they're known to be in ptrdiff_t range.
12949 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12950 (Ffont_get_glyphs, Ffont_at):
12951 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12952 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12953 (Flist_fonts, Fopen_font):
12954 Don't assume fixnum can fit in int.
12955 (check_gstring): Don't assume index can fit in int.
12956 (font_match_p): Check that fixnum is a character, not a nonnegative
12957 fixnum, since the later code needs to stuff it into an int.
12958 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12959 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12960 conversion overflow issues.
12961 (Fopen_font): Check for integer out of range.
12962 (Ffont_get_glyphs): Don't assume index can fit in int.
12963 * font.h: Adjust decls to match defn changes elsewhere.
12964 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12965 integer overflow.
12966 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12967 printmax_t, where ptrdiff_t is wide enough.
12968 (Finternal_char_font):
12969 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12970 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12971 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12972 (Fset_frame_position, x_set_frame_parameters)
12973 (x_set_line_spacing, x_set_border_width)
12974 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12975 Check that fixnums are in proper range for system types.
12976 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12978 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12979 Use SAFE_ALLOCA_LISP, not alloca.
12980 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12981 intptr_t is wide enough.
12982 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12983 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12984 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12985 Check for fixnum out of range.
12986 * ftfont.c (ftfont_list): Don't assume index fits in int.
12987 Check that fixnums are in proper range for system types.
12988 (ftfont_shape_by_flt):
12989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12990 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12991 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12992 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12993 Check that fixnums are in proper range for system types.
12994 * gnutls.h: Adjust decls to match defn changes elsewhere.
12995 * gtkutil.c (xg_dialog_run):
12996 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12997 (update_frame_tool_bar):
12998 Check that fixnums are in proper range for system types.
12999 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13000 (lookup_image): Check that fixnums are in range for system types.
13001 * indent.c (last_known_column, last_known_column_point):
13002 (current_column_bol_cache):
13003 (skip_invisible, current_column, check_display_width):
13004 (check_display_width, scan_for_column, current_column_1)
13005 (Findent_to, Fcurrent_indentation, position_indentation)
13006 (indented_beyond_p, Fmove_to_column, compute_motion):
13007 (Fcompute_motion, Fvertical_motion):
13008 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13009 (last_known_column_modified): Use EMACS_INT, not int.
13010 (check_display_width):
13011 (Fcompute_motion):
13012 Check that fixnums and floats are in proper range for system types.
13013 (compute_motion): Don't assume index or fixnum fits in int.
13014 (compute_motion, Fcompute_motion):
13015 Use int, not EMACS_INT, when it is wide enough.
13016 (vmotion): Omit local var start_hpos that is always 0; that way
13017 we don't need to worry about overflow in expressions involving it.
13018 * indent.h: Adjust decls to match defn changes elsewhere.
13019 (struct position):
13020 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13021 Use int, not EMACS_INT, where int is wide enough.
13022 Remove unused members ovstring_chars_done and tab_offset;
13023 all uses removed.
13024 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13025 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13026 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13027 (make_gap, copy_text, insert, insert_and_inherit)
13028 (insert_before_markers, insert_before_markers_and_inherit)
13029 (insert_1, count_combining_before, count_combining_after)
13030 (insert_1_both, insert_from_string)
13031 (insert_from_string_before_markers, insert_from_string_1)
13032 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13033 (adjust_after_replace, adjust_after_insert, replace_range)
13034 (replace_range_2, del_range, del_range_1, del_range_byte)
13035 (del_range_both, del_range_2, modify_region)
13036 (prepare_to_modify_buffer, signal_before_change)
13037 (signal_after_change, Fcombine_after_change_execute):
13038 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13039 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13040 (balance_an_interval, split_interval_right, split_interval_left)
13041 (find_interval, next_interval, update_interval)
13042 (adjust_intervals_for_insertion, delete_node, delete_interval)
13043 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13044 (static_offset_intervals, offset_intervals)
13045 (merge_interval_right, merge_interval_left, make_new_interval)
13046 (graft_intervals_into_buffer, temp_set_point_both)
13047 (temp_set_point, set_point, adjust_for_invis_intang)
13048 (set_point_both, move_if_not_intangible, get_property_and_range)
13049 (get_local_map, copy_intervals, copy_intervals_to_string)
13050 (compare_string_intervals, set_intervals_multibyte_1):
13051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13052 * intervals.h: Adjust decls to match defn changes elsewhere.
13053 (struct interval):
13054 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13055 * keyboard.c (this_command_key_count, this_single_command_key_start)
13056 (before_command_key_count, before_command_echo_length, echo_now)
13057 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13058 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13059 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13060 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13062 (last_non_minibuf_size, last_point_position, echo_truncate)
13063 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13064 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13065 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13066 (stuff_buffered_input):
13067 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13068 (last_auto_save, command_loop_1, read_char):
13069 Use EMACS_INT, not int, to avoid integer overflow.
13070 (record_char): Avoid overflow in total_keys computation.
13071 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13072 * keyboard.h: Adjust decls to match defn changes elsewhere.
13073 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13074 (Fkey_description, Fdescribe_vector, Flookup_key):
13075 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13076 (click_position): New function, to check that positions are in range.
13077 (Fcurrent_active_maps):
13078 (describe_command):
13079 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13080 (Faccessible_keymaps, Fkey_description):
13081 (preferred_sequence_p):
13082 Don't assume fixnum can fit into int.
13083 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13084 Check for integer overflow in size calculations.
13085 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13086 avoid mishandling large integers.
13087 * lisp.h: Adjust decls to match defn changes elsewhere.
13088 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13089 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13090 (struct Lisp_Marker):
13091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13092 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13093 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13094 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13095 All callers changed.
13096 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13097 Assume the arg has valid form, since it always does.
13098 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13099 unsigned integer system type.
13100 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13101 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13102 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13103 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13104 (duration_to_sec_usec): New decl.
13105 * lread.c (read_from_string_index, read_from_string_index_byte)
13106 (read_from_string_limit, readchar, unreadchar, openp)
13107 (read_internal_start, read1, oblookup):
13108 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13109 (Fload, readevalloop, Feval_buffer, Feval_region):
13110 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13111 (openp): Check for out-of-range argument to 'access'.
13112 (read1): Use int, not EMACS_INT, where int is wide enough.
13113 Don't assume fixnum fits into int.
13114 Fix off-by-one error that can read outside a buffer.
13115 (read_filtered_event): Use duration_to_sec_usec
13116 to do proper overflow checking on durations.
13117 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13118 in size calculation.
13119 (Fexecute_kbd_macro):
13120 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13121 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13122 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13123 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13124 (set_marker_both, set_marker_restricted_both, marker_position)
13125 (marker_byte_position, Fbuffer_has_markers_at):
13126 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13127 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13128 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13129 It now merely ensures that the menu is large enough, without
13130 necessarily growing it, as this avoids some integer overflow issues.
13131 All callers changed.
13132 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13133 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13134 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13135 Use SAFE_ALLOCA_LISP, not alloca.
13136 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13137 to EMACS_INT. Check that fixnums are in proper range for system types.
13138 * minibuf.c (minibuf_prompt_width, string_to_object)
13139 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13140 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13142 (get_minibuffer, read_minibuf_unwind):
13143 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13144 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13145 this simplifies overflow checking. All callers changed.
13146 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13147 (Ftest_completion):
13148 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13149 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13150 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13151 Check that fixnums are in proper range for system types.
13152 (Fx_create_frame, Fx_show_tip):
13153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13154 * nsfont.m (ns_findfonts, nsfont_list_family):
13155 Don't assume fixnum fits in long.
13156 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13157 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13158 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13159 wide enough.
13160 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13161 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13162 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13163 (PRINTDECLARE, PRINTPREPARE):
13164 (strout, print_string):
13165 (print, print_preprocess, print_check_string_charset_prop)
13166 (print_object):
13167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13168 (PRINTDECLARE):
13169 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13170 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13171 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13172 (printchar, strout): Use xpalloc to catch size calculation overflow.
13173 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13174 (print_error_message): Use SAFE_ALLOCA, not alloca.
13175 (print_object): Use int, not EMACS_INT, where int is wide enough.
13176 (print_depth, new_backquote_output, print_number_index):
13177 Use ptrdiff_t, not int, where int might not be wide enough.
13178 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13179 (Fset_process_window_size, Fformat_network_address)
13180 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13181 (sigchld_handler):
13182 Check that fixnums are in proper range for system types.
13183 (Fsignal_process): Simplify by avoiding a goto.
13184 Check for process-ids out of pid_t range rather than relying on
13185 undefined behavior.
13186 (process_tick, update_tick): Use EMACS_INT, not int.
13187 (Fformat_network_address, read_process_output, send_process)
13188 (Fprocess_send_region, status_notify):
13189 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13190 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13191 (wait_reading_process_output, read_process_output, exec_sentinel):
13192 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13193 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13194 (Faccept_process_output): Use duration_to_sec_usec to do proper
13195 overflow checking on durations.
13196 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13197 Don't assume pid_t fits in int.
13198 * process.h (struct Lisp_Process): Members tick and update_tick
13199 are now of type EMACS_INT, not int.
13200 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13201 configured --with-wide-int.
13202 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13203 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13204 * search.c (looking_at_1, string_match_1):
13205 (fast_string_match, fast_c_string_match_ignore_case)
13206 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13207 (scan_newline, find_before_next_newline, search_command)
13208 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13209 (set_search_regs, wordify):
13210 (Freplace_match):
13211 (Fmatch_data):
13212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13213 (string_match_1, search_buffer, set_search_regs):
13214 (Fmatch_data):
13215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13216 (wordify): Check for overflow in size calculation.
13217 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13218 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13219 Check that fixnums are in proper range for system types.
13220 * sound.c (struct sound_device)
13221 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13223 (Fplay_sound_internal):
13224 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13225 * syntax.c (struct lisp_parse_state, find_start_modiff)
13226 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13227 (Fparse_partial_sexp):
13228 Don't assume fixnums can fit in int.
13229 (struct lisp_parse_state, find_start_pos, find_start_value)
13230 (find_start_value_byte, find_start_begv)
13231 (update_syntax_table, char_quoted, dec_bytepos)
13232 (find_defun_start, prev_char_comend_first, back_comment):
13233 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13234 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13236 (Finternal_describe_syntax_value): Check that match_lisp is a
13237 character, not an integer, since the code stuffs it into int.
13238 (scan_words, scan_sexps_forward):
13239 Check that fixnums are in proper range for system types.
13240 (Fforward_word):
13241 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13242 (scan_sexps_forward):
13243 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13244 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13245 * syntax.h: Adjust decls to match defn changes elsewhere.
13246 (struct gl_state_s):
13247 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13248 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13249 MOST_POSITIVE_FIXNUM.
13250 * sysdep.c (wait_for_termination_1, wait_for_termination)
13251 (interruptible_wait_for_termination, mkdir):
13252 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13253 (emacs_read, emacs_write):
13254 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13255 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13256 and double all fit in int.
13257 * term.c (set_tty_color_mode):
13258 Check that fixnums are in proper range for system types.
13259 * termhooks.h (struct input_event):
13260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13261 * textprop.c (validate_interval_range, interval_of)
13262 (Fadd_text_properties, set_text_properties_1)
13263 (Fremove_text_properties, Fremove_list_of_text_properties)
13264 (Ftext_property_any, Ftext_property_not_all)
13265 (copy_text_properties, text_property_list, extend_property_ranges)
13266 (verify_interval_modification):
13267 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13268 (Fnext_single_char_property_change)
13269 (Fprevious_single_char_property_change):
13270 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13271 (copy_text_properties):
13272 Check for integer overflow in index calculation.
13273 * undo.c (last_boundary_position, record_point, record_insert)
13274 (record_delete, record_marker_adjustment, record_change)
13275 (record_property_change):
13276 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13277 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13278 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13279 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13280 (Fx_hide_tip, Fx_file_dialog):
13281 * w32menu.c (set_frame_menubar):
13282 Use ptrdiff_t, not int, for consistency with rest of code.
13283 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13284 (select_window, Fdelete_other_windows_internal)
13285 (window_scroll_pixel_based, window_scroll_line_based)
13286 (Frecenter, Fset_window_configuration):
13287 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13288 (Fset_window_hscroll, run_window_configuration_change_hook)
13289 (set_window_buffer, temp_output_buffer_show, scroll_command)
13290 (Fscroll_other_window, Frecenter):
13291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13292 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13293 Don't assume fixnum fits in int.
13294 (Fset_window_scroll_bars):
13295 Check that fixnums are in proper range for system types.
13296 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13297 (string_pos, c_string_pos, number_of_chars, init_iterator)
13298 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13299 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13300 (compute_display_string_end, handle_face_prop)
13301 (face_before_or_after_it_pos, handle_invisible_prop)
13302 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13303 (display_prop_intangible_p, string_buffer_position_lim)
13304 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13305 (get_overlay_strings_1, get_overlay_strings)
13306 (iterate_out_of_display_property, forward_to_next_line_start)
13307 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13308 (get_next_display_element, set_iterator_to_next)
13309 (get_visually_first_element, compute_stop_pos_backwards)
13310 (handle_stop_backwards, next_element_from_buffer)
13311 (move_it_in_display_line_to, move_it_in_display_line)
13312 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13313 (add_to_log, message_dolog, message_log_check_duplicate)
13314 (message2, message2_nolog, message3, message3_nolog
13315 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13316 (current_message_1, truncate_echo_area, truncate_message_1)
13317 (set_message, set_message_1, store_mode_line_noprop)
13318 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13319 (text_outside_line_unchanged_p, check_point_in_composition)
13320 (reconsider_clip_changes)
13321 (redisplay_internal, set_cursor_from_row, try_scrolling)
13322 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13323 (redisplay_window, find_last_unchanged_at_beg_row)
13324 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13325 (trailing_whitespace_p, find_row_edges, display_line)
13326 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13327 (display_mode_element, store_mode_line_string)
13328 (pint2str, pint2hrstr, decode_mode_spec)
13329 (display_count_lines, display_string, draw_glyphs)
13330 (x_produce_glyphs, x_insert_glyphs)
13331 (rows_from_pos_range, mouse_face_from_buffer_pos)
13332 (fast_find_string_pos, mouse_face_from_string_pos)
13333 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13334 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13335 (safe_call, init_from_display_pos, handle_fontified_prop)
13336 (handle_single_display_spec, load_overlay_strings)
13337 (with_echo_area_buffer, setup_echo_area_for_printing)
13338 (display_echo_area, echo_area_display)
13339 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13340 (update_tool_bar, hscroll_window_tree, redisplay_internal)
13341 (redisplay_window, dump_glyph_row, display_mode_line)
13342 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
13343 (handle_display_spec, display_prop_string_p):
13344 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13345 (handle_single_display_spec, build_desired_tool_bar_string)
13346 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13347 (get_specified_cursor_type):
13348 Check that fixnums are in proper range for system types.
13349 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13350 (Flookup_image_map):
13351 Don't assume fixnums fit in int.
13352 (compare_overlay_entries):
13353 Avoid mishandling comparisons due to subtraction overflow.
13354 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13355 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13356 (handle_tool_bar_click):
13357 Use int, not unsigned, since we prefer signed and the signedness
13358 doesn't matter here.
13359 (get_next_display_element, next_element_from_display_vector):
13360 Use int, not EMACS_INT, when int is wide enough.
13361 (start_hourglass): Use duration_to_sec_usec to do proper
13362 overflow checking on durations.
13363 * xfaces.c (Fbitmap_spec_p):
13364 Check that fixnums are in proper range for system types.
13365 (compare_fonts_by_sort_order):
13366 Avoid mishandling comparisons due to subtraction overflow.
13367 (Fx_family_fonts, realize_basic_faces):
13368 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13369 (Fx_family_fonts):
13370 Don't assume fixnum fits in int.
13371 Use SAFE_ALLOCA_LISP, not alloca.
13372 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13373 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13374 (face_at_buffer_position, face_for_overlay_string)
13375 (face_at_string_position):
13376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13377 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13378 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13379 (Fx_show_tip):
13380 Check that fixnums are in proper range for system types.
13381 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13382 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13383 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13384 (Fx_change_window_property): Don't assume fixnums fit in int.
13385 * xfont.c (xfont_chars_supported):
13386 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13387 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13388 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13389 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13390 * xml.c (parse_region):
13391 * xrdb.c (magic_file_p):
13392 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13393 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13394 (x_get_local_selection, x_reply_selection_request)
13395 (x_handle_selection_request, wait_for_property_change):
13396 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13397 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13398 short is wide enough.
13399 (x_send_client_event): Don't assume fixnum fits in int.
13400 * xterm.c (x_x_to_emacs_modifiers):
13401 Don't assume EMACS_INT overflows nicely into int.
13402 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13403 may come from Lisp.
13404 (handle_one_xevent): NATNUMP can eval its arg twice.
13405 (x_connection_closed):
13406 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13407 * xterm.h: Adjust decls to match defn changes elsewhere.
13408 (struct scroll_bar): Use struct vectorlike_header
13409 rather than rolling our own approximation.
13410 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13411
13412 2012-05-25 Glenn Morris <rgm@gnu.org>
13413
13414 * lisp.mk (lisp): Update for more files being compiled now.
13415
13416 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13417
13418 * lread.c: Remove `read_pure' which makes no difference.
13419 (read_pure): Remove var.
13420 (unreadpure): Remove function.
13421 (readevalloop): Don't call read_list with -1 flag.
13422 (read1, read_vector): Don't test read_pure any more.
13423 (read_list): Simplify.
13424
13425 * fileio.c, character.h: Minor style tweaks.
13426
13427 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13428
13429 * window.h (clip_changed): Remove useless declaration.
13430
13431 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
13432
13433 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13434 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13435
13436 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13437
13438 Remove src/m/*.
13439 This directory predates autoconf and is no longer needed nowadays.
13440 Move its few remaining bits of functionality to where they're needed.
13441 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13442 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13443 * m/template.h: Remove.
13444 * Makefile.in (M_FILE): Remove. All uses removed.
13445 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13446 * lisp.h (USE_LSB_TAG):
13447 * mem-limits.h (EXCEEDS_LISP_PTR):
13448 Use VAL_MAX, not VALBITS, in #if.
13449 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13450 (EMACS_UINT): Define unconditionally now.
13451 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13452 (BITS_PER_EMACS_INT): New constants, replacing
13453 what used to be in config.h, but not useful in #if.
13454 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13455 define them any more.
13456 (VAL_MAX): New macro.
13457 (VALMASK): Use it.
13458 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13459 BITS_PER_EMACS_INT, in #if.
13460 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13461 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13462 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13463 * s/ms-w32.h (DATA_START):
13464 Move here from removed file m/intel386.h.
13465 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13466 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13467
13468 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13469
13470 Assume C89 or later.
13471 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13472 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13473 (xrealloc):
13474 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13475 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13476 * textprop.c, tparam.c (NULL): Remove.
13477 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13478 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13479 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13480 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13481 * xterm.c (input_signal_count): Assume volatile works.
13482
13483 2012-05-21 Ken Brown <kbrown@cornell.edu>
13484
13485 * xgselect.c (xg_select): Fix first argument in call to 'select'
13486 (bug#11508).
13487
13488 2012-05-20 Ken Brown <kbrown@cornell.edu>
13489
13490 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
13491 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
13492
13493 2012-05-19 Ken Brown <kbrown@cornell.edu>
13494
13495 * xfns.c (x_in_use): Remove `static' qualifier.
13496 * xterm.h (x_in_use): Declare.
13497 * xgselect.c: Include xterm.h.
13498 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13499 and `display_arg' (bug#9754).
13500
13501 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13502
13503 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13504
13505 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13506 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13507
13508 2012-05-18 Eli Zaretskii <eliz@gnu.org>
13509
13510 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13511
13512 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
13513 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
13514
13515 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13516 reference to image_cache->refcount.
13517 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13518
13519 2012-05-17 Juri Linkov <juri@jurta.org>
13520
13521 * search.c (Fword_search_regexp, Fword_search_backward)
13522 (Fword_search_forward, Fword_search_backward_lax)
13523 (Fword_search_forward_lax): Move functions to isearch.el
13524 (bug#10145, bug#11381).
13525
13526 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13527
13528 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13529
13530 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13531
13532 * lread.c (init_obarray): Declare Qt and Qnil as special.
13533
13534 2012-05-14 Glenn Morris <rgm@gnu.org>
13535
13536 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
13537 Put "libexec" before "bin", for the sake of init_callproc_1.
13538
13539 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13540
13541 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13542
13543 * unexaix.c: Port to more-recent AIX compilers.
13544 (report_error, report_error_1, make_hdr, copy_sym)
13545 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13546 Make arguments const char *, not char *, to avoid violations of C
13547 standard and to fix some AIX warnings reported by Gilles Pion.
13548
13549 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13550
13551 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13552 already have overlays loaded.
13553 (handle_single_display_spec): Before returning without displaying
13554 fringe bitmap, synchronize the bidi iterator with the main display
13555 iterator, by calling iterate_out_of_display_property.
13556 (iterate_out_of_display_property): Detect buffer iteration by
13557 testing that it->string is a Lisp string.
13558 (get_next_display_element): When the current object is exhausted,
13559 and there's something on it->stack, call set_iterator_to_next to
13560 proceed with what's on the stack, instead of returning zero.
13561 (set_iterator_to_next): If called at the end of a Lisp string,
13562 proceed to consider_string_end without incrementing string
13563 position. Don't increment display vector index past the end of
13564 the display vector. (Bug#11417)
13565 (pos_visible_p): Don't report a position visible when move_it_to
13566 stopped at the last line of window, which happens to be scanned
13567 backwards by the bidi iteration. (Bug#11464)
13568
13569 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13570
13571 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13572 and right-margin display specs even if the spec is invalid or we
13573 are on a TTY, and thus unable to display on the fringes.
13574 That's because the text with the property will not be displayed anyway,
13575 so we need to signal to the caller that this is a "replacing"
13576 display spec. This fixes display when the spec is invalid or we
13577 are on a TTY.
13578
13579 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13580
13581 * unexaix.c (make_hdr): Fix typo in prototype.
13582 This bug broke the build on AIX. Problem reported by Gilles Pion.
13583
13584 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
13585
13586 * keyboard.c (kbd_buffer_get_event): Read special events also in
13587 batch mode. (Bug#11415)
13588
13589 2012-05-12 Glenn Morris <rgm@gnu.org>
13590
13591 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13592
13593 2012-05-12 Eli Zaretskii <eliz@gnu.org>
13594
13595 * lisp.mk (lisp): Add newcomment.elc.
13596
13597 2012-05-12 Glenn Morris <rgm@gnu.org>
13598
13599 * Makefile.in (MKDIR_P): New, set by configure.
13600 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13601
13602 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13603
13604 Remove unused function hourglass_started.
13605 * dispextern.h (hourglass_started):
13606 * w32fns.c (hourglass_started):
13607 * xdisp.c (hourglass_started): Remove.
13608
13609 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
13610
13611 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13612 Update dependencies.
13613
13614 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13615
13616 * xgselect.c (xg_select): Put maxfds+1 into a var.
13617 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13618
13619 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13620
13621 2012-05-10 Dave Abrahams <dave@boostpro.com>
13622
13623 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13624 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13625
13626 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
13627
13628 * dbusbind.c (xd_registered_buses): New internal Lisp object.
13629 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
13630 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13631 Initialize xd_registered_buses.
13632
13633 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13634
13635 Untag more efficiently if USE_LSB_TAG.
13636 This is based on a proposal by YAMAMOTO Mitsuharu in
13637 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13638 For an admittedly artificial (nth 8000 longlist) benchmark on
13639 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13640 Emacs's overall text size by 1%.
13641 * lisp.h (XUNTAG): New macro.
13642 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13643 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13644 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13645 * eval.c (Fautoload):
13646 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13647 * frame.h (XFRAME): Use XUNTAG.
13648
13649 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13650 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13651 Remove unportable assumptions about print widths of types like
13652 dbus_uint32_t.
13653 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13654 intptr_t when converting between pointer and integer, to avoid GCC
13655 warnings about wrong width.
13656
13657 2012-05-09 Eli Zaretskii <eliz@gnu.org>
13658
13659 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13660 stack for each reader_thread, instead of defaulting to 8MB
13661 determined by the linker. This avoids failures in creating
13662 subprocesses on Windows 7, see the discussion in this thread:
13663 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13664
13665 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13666
13667 Fix up display of the *Minibuf-0* buffer in the mini window.
13668 * keyboard.c (read_char): Don't clear the echo area if there's no
13669 message to clear.
13670 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
13671 contents of *Minibuf-0*) if there's no message displayed in its stead.
13672
13673 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
13674
13675 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13676 batch mode.
13677
13678 2012-05-06 Chong Yidong <cyd@gnu.org>
13679
13680 * lisp.mk (lisp): Update.
13681
13682 2012-05-05 Jim Meyering <meyering@redhat.com>
13683
13684 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13685
13686 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13687
13688 * data.c (PUT_ERROR): New macro.
13689 (syms_of_data): Use it. Add new error type `user-error'.
13690 * undo.c (user_error): New function.
13691 (Fprimitive_undo): Use it.
13692 * print.c (print_error_message): Adjust print style for `user-error'.
13693 * keyboard.c (user_error): New function.
13694 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13695
13696 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13697
13698 Do not limit current-time-string to years 1000..9999.
13699 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13700 (Fcurrent_time_string): Support any year that is supported by the
13701 underlying localtime representation. Don't use asctime, as it
13702 has undefined behavior for years outside the range -999..9999.
13703
13704 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13705
13706 Fix race conditions involving setenv, gmtime, localtime, asctime.
13707 Without this fix, interrupts could mess up code that uses these
13708 nonreentrant functions, since setting TZ invalidates existing
13709 tm_zone or tzname values, and since most of these functions return
13710 pointers to static storage.
13711 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13712 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13713 Grow the critical sections to include not just invoking
13714 localtime/gmtime, but also accessing these functions' results
13715 including their tm_zone values if any, and any related TZ setting.
13716 (format_time_string): Last arg is now struct tm *, not struct tm **,
13717 so that the struct tm is saved in the critical section.
13718 All callers changed. Simplify allocation of initial buffer, partly
13719 motivated by the fact that memory allocation needs to be outside
13720 the critical section.
13721
13722 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13723
13724 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13725 with RESET_INTERVAL.
13726
13727 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13728 Remove duplicated buffer name initialization.
13729
13730 2012-05-02 Jim Meyering <jim@meyering.net>
13731
13732 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13733
13734 * xfns.c (x_window): Use xstrdup (Bug#11375).
13735
13736 2012-05-02 Eli Zaretskii <eliz@gnu.org>
13737
13738 * xdisp.c (pos_visible_p): If already at a newline from the
13739 display string before the 'while' loop, don't walk back the glyphs
13740 from it3.glyph_row. Solves assertion violation when the display
13741 string begins with a newline (egg.el). (Bug#11367)
13742
13743 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13744
13745 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13746 Move to simple.el.
13747
13748 2012-05-01 Glenn Morris <rgm@gnu.org>
13749
13750 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13751 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13752 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13753 All were removed before 23.1.
13754
13755 * dispnew.c: Remove HAVE_LIBNCURSES test;
13756 it is always true on relevant platforms.
13757
13758 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13759 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13760
13761 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13762
13763 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13764
13765 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13766 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13767 Remove.
13768
13769 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13770
13771 Do not avoid creating empty evaporating overlays (Bug#9642).
13772 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13773 That is, do not delete an evaporating overlay if it becomes
13774 empty after its bounds are adjusted to fit within its buffer.
13775 This fix caused other problems, and I'm reverting it until we get
13776 to the bottom of them.
13777
13778 2012-04-27 Chong Yidong <cyd@gnu.org>
13779
13780 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13781
13782 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13783
13784 * xdisp.c (pos_visible_p): If the window start position is beyond
13785 ZV, start the display from buffer beginning. Prevents assertion
13786 violation in init_iterator when the minibuffer window is scrolled
13787 via the scroll bar.
13788
13789 * window.c (window_scroll_pixel_based): Likewise.
13790
13791 2012-04-27 Chong Yidong <cyd@gnu.org>
13792
13793 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13794
13795 2012-04-27 Glenn Morris <rgm@gnu.org>
13796
13797 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13798 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13799
13800 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13801
13802 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13803 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
13804
13805 2012-04-26 Eli Zaretskii <eliz@gnu.org>
13806
13807 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13808 display element, check also the underlying string or buffer
13809 character. (Bug#11341)
13810
13811 * w32menu.c: Include w32heap.h.
13812 (add_menu_item): If the call to AppendMenuW (via
13813 unicode_append_menu) fails, disable Unicode menus only if we are
13814 running on Windows 9X/Me.
13815
13816 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13817
13818 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13819 (xgetint): Add missing shift for LSB tags.
13820
13821 2012-04-24 Martin Rudalics <rudalics@gmx.at>
13822
13823 * keyboard.c (read_char): Don't wipe echo area for select window
13824 events: These might get delayed via `mouse-autoselect-window'
13825 (Bug#11304).
13826
13827 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
13828
13829 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13830 manipulation of :loaded-from data.
13831
13832 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
13833
13834 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13835 now a cons (bug#11311).
13836
13837 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13838
13839 Do not create empty overlays with the evaporate property (Bug#9642).
13840 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13841 if it becomes empty after its bounds are adjusted to fit within
13842 its buffer. Without this fix, in a nonempty buffer (let ((o
13843 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13844 yields an empty overlay that has the evaporate property, which is
13845 not supposed to happen.
13846
13847 Fix minor GTK3 problems found by static checking.
13848 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13849 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13850 (struct _EmacsFixedClass, emacs_fixed_get_type):
13851 Move decls here from emacsgtkfixed.h, since they needn't be public.
13852 (emacs_fixed_get_type): Now static.
13853 (emacs_fixed_class_init): Omit unused local.
13854 (emacs_fixed_child_type): Remove; unused.
13855 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13856 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13857 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13858 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13859 (EMACS_FIXED_GET_CLASS): Remove; unused.
13860 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13861
13862 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13863 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13864
13865 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13866
13867 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
13868 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
13869 (__malloc_size_t, __malloc_ptrdiff_t):
13870 Remove. All uses removed, replaced by the definiens if needed,
13871 since we can assume C89 or better now.
13872 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13873 (protect_malloc_state, align, get_contiguous_space)
13874 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13875 (malloc_atfork_handler_child, malloc_enable_thread)
13876 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13877 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13878 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13879 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13880 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13881 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13882 Define using prototypes, not old style.
13883 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13884 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13885 (align): Don't assume that signed integer overflow wraps around.
13886 Omit unused local var.
13887 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13888 (_free_internal_nolock, memalign, mallochook, reallochook):
13889 Omit no-longer-needed casts.
13890 (valloc): Use getpagesize, not __getpagesize.
13891 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13892 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13893
13894 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13895
13896 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
13897
13898 Move functions from C to Lisp. Make non-blocking method calls
13899 the default. Implement further D-Bus standard interfaces.
13900
13901 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13902 (QCdbus_request_name_allow_replacement)
13903 (QCdbus_request_name_replace_existing)
13904 (QCdbus_request_name_do_not_queue)
13905 (QCdbus_request_name_reply_primary_owner)
13906 (QCdbus_request_name_reply_in_queue)
13907 (QCdbus_request_name_reply_exists)
13908 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13909 (QCdbus_registered_serial, QCdbus_registered_method)
13910 (QCdbus_registered_signal): New Lisp objects.
13911 (XD_DEBUG_MESSAGE): Use sizeof.
13912 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13913 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13914 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13915 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13916 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13917 (xd_signature, xd_append_arg): Allow float for integer types.
13918 (xd_get_connection_references): New function.
13919 (xd_get_connection_address): Rename from xd_initialize.
13920 Return cached address.
13921 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13922 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13923 level.
13924 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
13925 Return number of refcounts.
13926 (Fdbus_get_unique_name): Make stronger parameter check.
13927 (Fdbus_message_internal): New defun.
13928 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13929 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13930 (Fdbus_send_signal, Fdbus_register_service)
13931 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13932 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13933 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13934 (Vdbus_compiled_version, Vdbus_runtime_version)
13935 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13936 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13937 (Vdbus_message_type_signal): New defvars.
13938 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13939 Adapt docstring.
13940
13941 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13942
13943 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13944 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13945 Do not assume ptrdiff_t is the same width as 'int'.
13946
13947 * alloc.c: Handle unusual debugging option combinations.
13948 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13949 since the two debugging options are incompatible.
13950 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13951 is defined.
13952 (mem_init, mem_insert, mem_insert_fixup):
13953 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13954 (NEED_MEM_INSERT): Remove; no longer needed.
13955
13956 2012-04-22 Leo Liu <sdl.web@gmail.com>
13957
13958 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13959
13960 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13961
13962 * sysdep.c [__FreeBSD__]: Minor cleanups.
13963 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13964 Use Emacs indenting style more consistently. Avoid some casts.
13965 Use 'double' consistently rather than mixing 'float' and 'double'.
13966
13967 2012-04-21 Eduard Wiebe <usenet@pusto.de>
13968
13969 * sysdep.c (list_system_processes, system_process_attributes):
13970 Add implementation for FreeBSD (Bug#5243).
13971
13972 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13973
13974 * lisp.mk (lisp): Update.
13975
13976 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13977
13978 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13979 It is never used otherwise.
13980
13981 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13982
13983 * print.c (print_preprocess): Only check print_depth if print-circle
13984 is nil.
13985 (print_object): Check for cycles even when print-circle is nil and
13986 print-gensym is t, but only check print_depth if print-circle is nil.
13987
13988 2012-04-20 Chong Yidong <cyd@gnu.org>
13989
13990 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13991 set the status to "failed" and ensure that sentinel is run.
13992
13993 2012-04-20 Glenn Morris <rgm@gnu.org>
13994
13995 * process.c (Fset_process_inherit_coding_system_flag)
13996 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
13997 (Fmake_network_process, Fmake_serial_process): Doc fix.
13998
13999 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14000
14001 * xdisp.c (string_buffer_position_lim): Limit starting position to
14002 BEGV.
14003 (set_cursor_from_row): If called for a mode-line or header-line
14004 row, return zero immediately.
14005 (try_cursor_movement): If inside continuation line, don't back up
14006 farther than the first row after the header line, if any.
14007 Don't consider the header-line row as "partially visible", even if
14008 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14009
14010 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14011
14012 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14013 (bug#11238).
14014
14015 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14016 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14017
14018 configure: new option --enable-gcc-warnings (Bug#11207)
14019 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14020 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14021 (ALL_CFLAGS): Use new macros rather than old.
14022 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14023 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14024 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14025 -Wunused-result, -Wunused-variable. This should go away once
14026 the Emacs and Gnulib regex code is merged.
14027 (xmalloc, xrealloc): Now static.
14028
14029 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14030
14031 * dired.c (Fsystem_groups): Remove unused local.
14032
14033 2012-04-17 Glenn Morris <rgm@gnu.org>
14034
14035 * dired.c (Fsystem_users): Doc fix.
14036
14037 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14038
14039 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14040 (syms_of_dired): Add them.
14041
14042 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14043
14044 Fix minor alloc.c problems found by static checking.
14045 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14046 New extern decls, to avoid calling undeclared functions.
14047 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14048 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14049 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14050 (NEED_MEM_INSERT): New macro.
14051 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14052 Remove one incorrect comment and fix another.
14053
14054 Fix minor ralloc.c problems found by static checking.
14055 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14056 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14057 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14058 (r_alloc_sbrk): Now static.
14059
14060 Improve ralloc.c interface checking.
14061 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14062 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14063 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14064 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14065 [REL_ALLOC]: ... to here, to check interface.
14066 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14067 Remove decls. This fixes an "It stinks!".
14068
14069 * alloc.c (which_symbols): Fix alignment issue / type clash.
14070
14071 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14072
14073 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14074 (struct Lisp_Misc_Any): Likewise.
14075 (struct Lisp_Free): Likewise.
14076 * alloc.c (union aligned_Lisp_Symbol): Define.
14077 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14078 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14079 (union aligned_Lisp_Misc): Define.
14080 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14081 aligned_Lisp_Misc instead of union Lisp_Misc.
14082 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14083
14084 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14085
14086 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14087 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14088 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14089 * s/netbsd.h, s/sol2-6.h:
14090 Remove definition of GC_MARK_STACK, since the default now works.
14091 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14092 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14093 no longer the default.
14094 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14095
14096 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14097
14098 * lread.c (lisp_file_lexically_bound_p):
14099 Fix hang at ";-*-\n" (bug#11238).
14100
14101 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14102
14103 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14104 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14105
14106 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14107
14108 * nsterm.m (constrainFrameRect): Always constrain when there is only
14109 one screen (Bug#10962).
14110
14111 2012-04-13 Ken Brown <kbrown@cornell.edu>
14112
14113 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14114
14115 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14116
14117 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14118
14119 2012-04-11 Daniel Colascione <dancol@dancol.org>
14120
14121 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14122 against is gone. It's better to use vfork now so that when Cygwin
14123 gains a new, working vfork, we use it automatically (bug#10398).
14124
14125 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14126
14127 * window.c (save_window_save): Obey window-point-insertion-type.
14128
14129 2012-04-11 Glenn Morris <rgm@gnu.org>
14130
14131 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14132
14133 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14134
14135 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14136
14137 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14138
14139 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14140 (force_quit_count): New var.
14141 (handle_interrupt): Use it.
14142
14143 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14144
14145 * w32.c (w32_delayed_load): Record the full path of the library
14146 being loaded (bug#10424).
14147
14148 2012-04-09 Glenn Morris <rgm@gnu.org>
14149
14150 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14151 not just in the obarray, before snarfing them. (Bug#11036)
14152
14153 * Makefile.in ($(leimdir)/leim-list.el):
14154 Pass EMACS rather than BUILT_EMACS.
14155
14156 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14157
14158 * process.c (make_process):
14159 * process.h: Add integer `gnutls_handshakes_tried' member to
14160 process struct.
14161
14162 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14163 Add convenience `GNUTLS_LOG2i' macro.
14164
14165 * gnutls.c (gnutls_log_function2i): Convenience log function.
14166 (emacs_gnutls_read): Use new log functions,
14167 `gnutls_handshakes_tried' process member, and
14168 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14169 attempts per process (connection).
14170
14171 2012-04-09 Chong Yidong <cyd@gnu.org>
14172
14173 * eval.c (Fuser_variable_p, user_variable_p_eh)
14174 (lisp_indirect_variable): Functions deleted.
14175 (Fdefvar): Caller changed.
14176
14177 * callint.c (Finteractive, Fcall_interactively):
14178 * minibuf.c (Fread_variable): Callers changed.
14179
14180 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14181
14182 * xdisp.c (set_cursor_from_row): If the display string appears in
14183 the buffer at position that is closer to point than the position
14184 after the display string, display the cursor on the first glyph of
14185 the display string. Fixes cursor display when a 'display' text
14186 property immediately follows invisible text. (Bug#11094)
14187
14188 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14189
14190 composite.c: use 'double' consistently
14191 * composite.c (get_composition_id): Use 'double' consistently
14192 instead of converting 'float' to 'double' and vice versa; this is
14193 easier to understand and avoids a GCC warning.
14194
14195 2012-04-09 Glenn Morris <rgm@gnu.org>
14196
14197 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14198 preparation for dumping it with emacs. (Bug#4789)
14199 (leimdir): New variable.
14200 ($(leimdir)/leim-list.el): New rule.
14201 (emacs$(EXEEXT)): Depend on leim-list.el.
14202
14203 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14204 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14205 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14206
14207 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14208
14209 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14210 proper alignment.
14211
14212 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14213
14214 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14215 Remove unused local variable.
14216
14217 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14218
14219 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14220 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14221 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14222 objects, as mark_maybe_pointer will catch them otherwise.
14223 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14224 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14225
14226 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14227
14228 Fix typo that broke non-Windows builds.
14229 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14230
14231 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14232
14233 Support building on MS-Windows with libxml2.
14234
14235 * makefile.w32-in (OBJ2): Add xml.$(O).
14236 (GLOBAL_SOURCES): Add xml.c.
14237 ($(BLD)/xml.$(O)): New dependency list.
14238
14239 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14240 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14241 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14242 [!WINDOWSNT]: New macros.
14243 (init_libxml2_functions, libxml2_loaded_p): New functions.
14244 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14245 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14246 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14247 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14248 linked in).
14249 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14250 Call init_libxml2_functions before calling libxml2 functions.
14251 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14252
14253 * emacs.c: Don't include libxml/parser.h.
14254 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14255 xmlCleanupParser directly.
14256
14257 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14258
14259 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14260
14261 * indent.c (Fvertical_motion): If there is a display string at
14262 point, use it.vpos to compute how many lines to backtrack after
14263 move_it_to point. (Bug#11133)
14264
14265 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14266
14267 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14268 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14269 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14270 macros related to unification of CJK characters. For the details,
14271 see the discussion following the message here:
14272 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14273
14274 2012-04-04 Chong Yidong <cyd@gnu.org>
14275
14276 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14277
14278 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14279
14280 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14281 instead of alloca. (Bug#11138)
14282
14283 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14284
14285 * w32menu.c (is_simple_dialog): Properly check lisp types.
14286 (Bug#11141)
14287
14288 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14289
14290 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14291 position we get to after a call to move_it_to fails the
14292 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14293 only if we wind up in a string from display property. (Bug#11063)
14294
14295 * window.c (Fdelete_other_windows_internal): Invalidate the row
14296 and column information about mouse highlight, so that redisplay
14297 restores it after reallocating the glyph matrices. (Bug#7464)
14298
14299 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14300 string comes from a `display' text property, use the buffer
14301 position of that property as if we actually saw that position in
14302 the row's glyphs.
14303 (move_it_by_lines): Remove the assertion that
14304 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14305 violated when there's a before-string at the beginning of a line.
14306 (Bug#11063)
14307
14308 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14309
14310 * xdisp.c (append_space_for_newline): If the default face was
14311 remapped, use the remapped face for the appended newline.
14312 (extend_face_to_end_of_line): Use the remapped default face for
14313 extending the face to the end of the line.
14314 (display_line): Call extend_face_to_end_of_line when the default
14315 face was remapped. (Bug#11068)
14316
14317 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14318
14319 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14320
14321 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14322
14323 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14324
14325 2012-03-27 Glenn Morris <rgm@gnu.org>
14326
14327 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14328 Doc fixes.
14329
14330 2012-03-26 Kenichi Handa <handa@m17n.org>
14331
14332 * dispextern.h (struct glyph): Fix previous change. Change the
14333 bit length of glyphless.ch to 25 (Bug#11082).
14334
14335 2012-03-26 Chong Yidong <cyd@gnu.org>
14336
14337 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14338 (command_loop_1): Use it; inhibit selection update for
14339 handle-select-window too (Bug#8996).
14340
14341 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14342
14343 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
14344
14345 2012-03-25 Kenichi Handa <handa@m17n.org>
14346
14347 * dispextern.h (struct glyph): Change the bit length of
14348 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14349
14350 2012-03-24 Eli Zaretskii <eliz@gnu.org>
14351
14352 * s/ms-w32.h (tzname): Include time.h before redirecting to
14353 _tzname. Fixes the MSVC build. (Bug#9960)
14354
14355 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14356
14357 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14358 characters.
14359
14360 * xterm.c (XTread_socket): Only modify handling_signal if
14361 !SYNC_INPUT. (Bug#11080)
14362
14363 2012-03-23 Eli Zaretskii <eliz@gnu.org>
14364
14365 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14366 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14367 when fetching a multibyte character consumes more bytes than
14368 CHAR_BYTES returns, due to unification of CJK characters in
14369 string_char. (Bug#11073)
14370
14371 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14372
14373 * process.c (wait_reading_process_output): Handle pty disconnect
14374 by refraining from sending oneself a SIGCHLD (bug#10933).
14375
14376 2012-03-22 Chong Yidong <cyd@gnu.org>
14377
14378 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14379
14380 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
14381 Mark string as coming from a prefix property.
14382 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14383 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14384
14385 2012-03-21 Chong Yidong <cyd@gnu.org>
14386
14387 * xfaces.c (Vface_remapping_alist): Doc fix.
14388
14389 2012-03-20 Eli Zaretskii <eliz@gnu.org>
14390
14391 * w32proc.c (Fw32_set_console_codepage)
14392 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14393 Doc fixes.
14394
14395 2012-03-20 Chong Yidong <cyd@gnu.org>
14396
14397 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14398 to reflect default non-nil value of redisplay-dont-pause.
14399
14400 2012-03-19 Kenichi Handa <handa@m17n.org>
14401
14402 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14403 it fit in a valid range (Bug#11003).
14404
14405 2012-03-18 Eli Zaretskii <eliz@gnu.org>
14406
14407 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14408 that is not from display property, accept the row as a "cursor
14409 row" if one of the string's character has a non-nil `cursor'
14410 property. Fixes cursor positioning when there are newlines in
14411 overlay strings, e.g. in icomplete.el. (Bug#11035)
14412
14413 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14414
14415 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14416
14417 2012-03-12 Chong Yidong <cyd@gnu.org>
14418
14419 * eval.c (inhibit_lisp_code): Rename from
14420 inhibit_window_configuration_change_hook; move from window.c.
14421
14422 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14423 * window.c (run_window_configuration_change_hook)
14424 (syms_of_window): Callers changed.
14425
14426 2012-03-11 Chong Yidong <cyd@gnu.org>
14427
14428 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14429
14430 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14431
14432 2012-03-10 Chong Yidong <cyd@gnu.org>
14433
14434 * frame.c (other_visible_frames): Don't assume the selected frame
14435 is visible (Bug#10955).
14436
14437 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14438
14439 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14440
14441 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14442
14443 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14444 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14445 zero (Bug#10954).
14446
14447 2012-03-03 Glenn Morris <rgm@gnu.org>
14448
14449 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
14450
14451 2012-03-02 Eli Zaretskii <eliz@gnu.org>
14452
14453 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14454 position past the first glyph_row that ends at ZV. (Bug#10902)
14455 (redisplay_window, next_element_from_string): Fix typos in
14456 comments.
14457 (redisplay_window): Pass to move_it_vertically the margin in
14458 pixels, not in screen lines.
14459
14460 2012-03-02 Glenn Morris <rgm@gnu.org>
14461
14462 * buffer.c (buffer-list-update-hook): Doc fix.
14463
14464 2012-02-29 Eli Zaretskii <eliz@gnu.org>
14465
14466 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14467 push_it before setting up the iterator for the first overlay
14468 string, even if we have an empty string loaded.
14469 (next_overlay_string): If there's an empty string on the iterator
14470 stack, pop the stack. (Bug#10903)
14471
14472 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14473
14474 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14475 Suggested by Stefan Monnier in
14476 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14477 * alloc.c (widen_to_Lisp_Object): New static function.
14478 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14479 and widening them to Lisp_Objects. This would work even if
14480 USE_LSB_TAG is defined and wide integers are used, which might
14481 happen in a future version of Emacs.
14482
14483 2012-02-25 Chong Yidong <cyd@gnu.org>
14484
14485 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14486 Doc fix.
14487
14488 * xselect.c (Fx_selection_exists_p): Doc fix.
14489 (x_clipboard_manager_save_all): Print an informative message
14490 before saving to clipboard manager.
14491
14492 2012-02-24 Chong Yidong <cyd@gnu.org>
14493
14494 * keyboard.c (process_special_events): Handle all X selection
14495 requests in kbd_buffer, not just the next one (Bug#8869).
14496
14497 2012-02-23 Chong Yidong <cyd@gnu.org>
14498
14499 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14500 call when setting menu-bar-lines and tool-bar-lines parameters.
14501 (unwind_create_frame_1): New helper function.
14502
14503 * window.c (inhibit_window_configuration_change_hook): New var.
14504 (run_window_configuration_change_hook): Obey it.
14505 (syms_of_window): Initialize it.
14506
14507 2012-02-22 Chong Yidong <cyd@gnu.org>
14508
14509 * xterm.c (x_draw_image_relief): Add missing type check for
14510 Vtool_bar_button_margin (Bug#10743).
14511
14512 2012-02-21 Chong Yidong <cyd@gnu.org>
14513
14514 * fileio.c (Vfile_name_handler_alist): Doc fix.
14515
14516 * buffer.c (Fget_file_buffer): Protect against invalid file
14517 handler return value.
14518
14519 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14520
14521 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14522 when computing $valmask.
14523
14524 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14525 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14526 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14527 It's useless in that case, and it can cause problems on hosts
14528 that allocate halves of EMACS_INT values separately.
14529 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14530 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14531 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14532 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14533 it avoids undefined behavior on hosts where shifting right by more
14534 than the word width has undefined behavior.
14535
14536 2012-02-19 Chong Yidong <cyd@gnu.org>
14537
14538 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14539 (Funhandled_file_name_directory, Ffile_name_as_directory)
14540 (Fdirectory_file_name, Fexpand_file_name)
14541 (Fsubstitute_in_file_name): Protect against invalid file handler
14542 return values (Bug#10845).
14543
14544 2012-02-18 Eli Zaretskii <eliz@gnu.org>
14545
14546 * .gdbinit (pitx): Fix incorrect references to fields of the
14547 iterator stack.
14548
14549 2012-02-17 Chong Yidong <cyd@gnu.org>
14550
14551 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14552
14553 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14554
14555 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14556 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14557
14558 2012-02-15 Chong Yidong <cyd@gnu.org>
14559
14560 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14561 marked as special. Also, starting docstrings with * is obsolete.
14562
14563 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14564
14565 * gnutls.c (emacs_gnutls_write): Fix last change.
14566
14567 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14568
14569 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14570 send_process.
14571
14572 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14573
14574 * keymap.c (Fsingle_key_description): Handle char ranges.
14575
14576 2012-02-12 Chong Yidong <cyd@gnu.org>
14577
14578 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14579 as that creates a dangerous corner case.
14580
14581 * window.c (Fdelete_window_internal): Invalidate the mouse
14582 highlight (Bug#9904).
14583
14584 2012-02-12 Glenn Morris <rgm@gnu.org>
14585
14586 * xselect.c (Fx_own_selection_internal)
14587 (Fx_get_selection_internal, Fx_disown_selection_internal)
14588 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14589 * nsselect.m (Fx_own_selection_internal)
14590 (Fx_disown_selection_internal, Fx_selection_exists_p)
14591 (Fx_selection_owner_p, Fx_get_selection_internal):
14592 Sync docs and argument specs with the xselect.c versions.
14593
14594 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14595
14596 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14597
14598 2012-02-11 Eli Zaretskii <eliz@gnu.org>
14599
14600 * w32select.c (Fx_selection_exists_p): Sync doc string and
14601 argument list with xselect.c. (Bug#10783)
14602
14603 * w16select.c (Fx_selection_exists_p): Sync doc string and
14604 argument list with xselect.c. (Bug#10783)
14605
14606 2012-02-10 Glenn Morris <rgm@gnu.org>
14607
14608 * fns.c (Fsecure_hash): Doc fix.
14609
14610 2012-02-09 Kenichi Handa <handa@m17n.org>
14611
14612 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14613
14614 2012-02-07 Chong Yidong <cyd@gnu.org>
14615
14616 * buffer.c (Fbuffer_local_variables)
14617 (buffer_lisp_local_variables): Handle unbound vars correctly;
14618 don't let Qunbound leak into Lisp.
14619
14620 2012-02-07 Glenn Morris <rgm@gnu.org>
14621
14622 * image.c (Fimagemagick_types): Doc fix.
14623
14624 * image.c (imagemagick-render-type): Change it from a lisp object
14625 to an integer. Move the doc here from the lisp manual.
14626 Treat all values not equal to 0 the same.
14627
14628 2012-02-06 Chong Yidong <cyd@gnu.org>
14629
14630 * doc.c (store_function_docstring): Avoid applying docstring of
14631 alias to base function (Bug#2603).
14632
14633 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14634
14635 * .gdbinit (pp1, pv1): Remove redundant defines.
14636 (pr): Use pp.
14637
14638 2012-02-04 Chong Yidong <cyd@gnu.org>
14639
14640 * nsterm.m: Declare a global (Bug#10694).
14641
14642 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14643
14644 * w32.c (get_emacs_configuration_options):
14645 Include --enable-checking, if specified, in the return value.
14646
14647 2012-02-04 Martin Rudalics <rudalics@gmx.at>
14648
14649 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14650 after rounding frame sizes. (Bug#9723)
14651
14652 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14653
14654 * keyboard.c (adjust_point_for_property): Don't position point
14655 before BEGV. (Bug#10696)
14656
14657 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14658
14659 Handle overflow when computing char display width (Bug#9496).
14660 * character.c (char_width): Return EMACS_INT, not int.
14661 (char_width, c_string_width): Check for overflow when
14662 computing the width; this is possible now that individual
14663 characters can have unbounded width. Problem introduced
14664 by merge from Emacs 23 on 2012-01-19.
14665
14666 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
14667
14668 * dbusbind.c (Fdbus_register_method): Mention the return value
14669 :ignore in the docstring.
14670
14671 2012-02-02 Glenn Morris <rgm@gnu.org>
14672
14673 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14674
14675 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14676 Unconditionally set to t. (Bug#10673)
14677 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14678 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14679 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14680
14681 2012-02-02 Kenichi Handa <handa@m17n.org>
14682
14683 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14684 0, do not call append_composite_glyph.
14685
14686 2012-02-02 Kenichi Handa <handa@m17n.org>
14687
14688 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14689 NULL (Bug#6988).
14690 (x_produce_glyphs): If the component of a composition is a null
14691 string, set it->pixel_width to 1 to avoid zero-width glyph.
14692
14693 2012-02-01 Eli Zaretskii <eliz@gnu.org>
14694
14695 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14696 first 2 arguments are identical. This makes inserting large
14697 output from a subprocess an order of magnitude faster on
14698 MS-Windows, where all sbrk'ed memory is always contiguous.
14699
14700 2012-01-31 Glenn Morris <rgm@gnu.org>
14701
14702 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14703 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14704 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14705
14706 2012-01-29 Glenn Morris <rgm@gnu.org>
14707
14708 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14709
14710 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14711
14712 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14713
14714 2012-01-28 Chong Yidong <cyd@gnu.org>
14715
14716 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14717
14718 2012-01-26 Chong Yidong <cyd@gnu.org>
14719
14720 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14721
14722 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14723 repeat counts (Bug#10507).
14724
14725 2012-01-26 Glenn Morris <rgm@gnu.org>
14726
14727 * lread.c (syms_of_lread): Doc fix.
14728
14729 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14730
14731 * coding.c (encode_designation_at_bol): Change return value to
14732 EMACS_INT.
14733
14734 2012-01-25 Chong Yidong <cyd@gnu.org>
14735
14736 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14737
14738 2012-01-21 Chong Yidong <cyd@gnu.org>
14739
14740 * floatfns.c (Fcopysign): Make the second argument non-optional,
14741 since nil is not allowed anyway.
14742
14743 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14744
14745 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14746 (send_process): Likewise.
14747
14748 2012-01-19 Martin Rudalics <rudalics@gmx.at>
14749
14750 * window.c (save_window_save, Fcurrent_window_configuration)
14751 (Vwindow_persistent_parameters): Do not use Qstate.
14752 Rewrite doc-strings.
14753
14754 2012-01-19 Kenichi Handa <handa@m17n.org>
14755
14756 * character.c (char_width): New function.
14757 (Fchar_width, c_string_width, lisp_string_width):
14758 Use char_width (Bug#9496).
14759
14760 2012-01-16 Martin Rudalics <rudalics@gmx.at>
14761
14762 * window.c (Vwindow_persistent_parameters): New variable.
14763 (Fset_window_configuration, save_window_save): Handle persistent
14764 window parameters.
14765
14766 2012-01-14 Eli Zaretskii <eliz@gnu.org>
14767
14768 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14769 thrashing the stack of the thread. (Bug#9087)
14770
14771 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14772
14773 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14774
14775 2012-01-11 Eli Zaretskii <eliz@gnu.org>
14776
14777 * xdisp.c (rows_from_pos_range): Handle the case where the
14778 highlight ends on a newline. (Bug#10464)
14779 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14780 he end column for display of highlight that ends on a newline
14781 before a R2L line.
14782
14783 2012-01-11 Glenn Morris <rgm@gnu.org>
14784
14785 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14786 from load-path also when installation-directory is nil. (Bug#10208)
14787
14788 2012-01-10 Glenn Morris <rgm@gnu.org>
14789
14790 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14791
14792 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14793 Update template values to be closer to their typical values these days.
14794
14795 2012-01-09 Eli Zaretskii <eliz@gnu.org>
14796
14797 * xdisp.c (rows_from_pos_range): Accept additional argument
14798 DISP_STRING, and accept any glyph in a row whose object is that
14799 string as eligible for mouse highlight. Fixes mouse highlight of
14800 display strings from overlays. (Bug#10464)
14801
14802 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
14803
14804 emacs: fix an auto-save permissions race condition (Bug#10400)
14805 * fileio.c (auto_saving_dir_umask): New static var.
14806 (Fmake_directory_internal): Use it.
14807 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14808 creating the directory. The old code temporarily assigns
14809 too-generous permissions to the directory.
14810 (do_auto_save_eh): Clear it.
14811 (Fdo_auto_save): Catch all errors, not just file errors, so
14812 that the var is always cleared.
14813
14814 2012-01-07 Eli Zaretskii <eliz@gnu.org>
14815
14816 * search.c (scan_buffer): Pass character positions to
14817 know_region_cache, not byte positions. (Bug#6540)
14818
14819 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
14820
14821 * w32.c (sys_rename): Report EXDEV when rename of a directory
14822 fails because the target is on another logical disk. (Bug#10284)
14823
14824 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14825
14826 * xterm.c (x_embed_request_focus): New function.
14827
14828 * xterm.h: Add prototype.
14829
14830 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14831
14832 2012-01-05 Glenn Morris <rgm@gnu.org>
14833
14834 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14835
14836 2012-01-01 Eli Zaretskii <eliz@gnu.org>
14837
14838 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14839 Load gnutls_transport_set_lowat only if GnuTLS version is below
14840 2.11.1.
14841 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14842 GnuTLS versions below 2.11.1.
14843
14844 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14845
14846 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14847 to the doc string advising against its use for altering the way
14848 windows are scrolled.
14849
14850 2011-12-28 Kenichi Handa <handa@m17n.org>
14851
14852 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14853 coding-system ASCII compatible only when it does not produce BOM
14854 on encoding (Bug#10383).
14855
14856 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14857
14858 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14859 can scroll.
14860 (create_and_show_popup_menu): Always use menu_position_func for
14861 Gtk3 (Bug#10361).
14862
14863 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14864
14865 * callint.c (Fcall_interactively): Don't truncate prompt string.
14866
14867 2011-12-23 Eli Zaretskii <eliz@gnu.org>
14868
14869 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14870 property that ends at ZV, so that the bidi iteration could be
14871 resumed from there (after widening). (Bug#10360)
14872
14873 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14874
14875 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14876
14877 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14878
14879 * nsterm.m (x_free_frame_resources):
14880 Release f->output_data.ns->miniimage.
14881 (ns_index_color): Fix indentation. Do not retain
14882 color_table->colors[i].
14883
14884 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14885 before returning.
14886
14887 * nsfns.m (x_set_background_color): Assign return value from
14888 ns_index_color to face-background instead of NSColor*.
14889 (ns_implicitly_set_icon_type): Fix indentation.
14890 Change assignment in for loop to comparison.
14891
14892 * emacs.c (ns_pool): New variable.
14893 (main): Assign ns_pool.
14894 (Fkill_emacs): Call ns_release_autorelease_pool.
14895
14896 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14897 autorelease fdesc, release fdAttrs and tdict.
14898 (ns_get_covering_families): Release charset.
14899 (ns_findfonts): Release NSFontDescriptor created with new.
14900 (ns_uni_to_glyphs): Fix indentation.
14901 (setString): Release attrStr before assigning new value.
14902
14903 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14904
14905 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14906 and NS_IMPL_COCOA.
14907 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14908 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14909
14910 2011-12-18 David Reitter <reitter@cmu.edu>
14911
14912 * nsterm.m (ns_term_init): Subscribe for notifications
14913 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14914 to method trackingNotification in EmacsMenu.
14915
14916 * nsmenu.m (trackingMenu): New variable.
14917 (trackingNotification): New method (from Aquamacs).
14918 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
14919 from Aquamacs (Bug#7030).
14920
14921 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14922
14923 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14924 (symbol_to_nsstring): Fix indentation.
14925 (ns_symbol_to_pb): New function.
14926 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14927 (Fns_rotate_cut_buffers_internal): Remove.
14928 (Fns_store_selection_internal): Rename from
14929 Fns_store_cut_buffer_internal.
14930 (ns_get_foreign_selection, Fx_own_selection_internal)
14931 (Fx_disown_selection_internal, Fx_selection_exists_p)
14932 (Fns_get_selection_internal, Fns_store_selection_internal):
14933 Use ns_symbol_to_pb and check if return value is nil.
14934 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14935 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
14936 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14937 renamed to Sns_store_selection_internal.
14938 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14939 and remove this function.
14940 (ns_handle_selection_clear): Remove, never used.
14941 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14942 here.
14943
14944 2011-12-17 Ken Brown <kbrown@cornell.edu>
14945
14946 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14947 GID is unknown (Bug#10257).
14948
14949 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14950
14951 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14952 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14953 which caused a build failure on GNU/Linux IA-64. This problem was
14954 introduced by my 2011-10-07 patch.
14955
14956 2011-12-15 Juri Linkov <juri@jurta.org>
14957
14958 * image.c (imagemagick_error): New function. (Bug#10112)
14959 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14960 Use `imagemagick_error' where ImageMagick functions return
14961 `MagickFalse'.
14962 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14963 proper order.
14964
14965 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14966
14967 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14968 fill background (Bug#8992).
14969
14970 2011-12-13 Martin Rudalics <rudalics@gmx.at>
14971
14972 * window.c (Vwindow_combination_resize)
14973 (Vwindow_combination_limit): Use t instead of non-nil in
14974 doc-strings.
14975 (Vrecenter_redisplay): Add first sentence of doc-string on
14976 separate line.
14977 (Frecenter): Fix doc-string typo.
14978
14979 2011-12-11 Kenichi Handa <handa@m17n.org>
14980
14981 * coding.c (Funencodable_char_position): Pay attention to the
14982 buffer text relocation (Bug#9389).
14983
14984 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14985
14986 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14987 gtk_init (Bug#10100).
14988
14989 2011-12-10 Eli Zaretskii <eliz@gnu.org>
14990
14991 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14992 IT->string is nil. (Bug#10263)
14993
14994 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14995
14996 * nsterm.h (x_free_frame_resources): Declare.
14997
14998 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14999 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15000
15001 * nsterm.h (ns_get_defaults_value): Declare.
15002
15003 * nsterm.m (ns_default): Call ns_get_defaults_value.
15004
15005 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15006
15007 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15008 (Bug#10170)
15009
15010 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15011
15012 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15013 that where the value of an _OBJC_* symbol points to is in the .bss
15014 section (Bug#10240).
15015
15016 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15017
15018 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15019 after the loop to call ccl_driver at least once (Bug#8619).
15020
15021 2011-12-08 Kenichi Handa <handa@m17n.org>
15022
15023 * ftfont.c (get_adstyle_property): Fix previous change
15024 (Bug#10233).
15025
15026 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15027
15028 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15029 dirs from the default value of EMACSLOADPATH (bug#10208).
15030
15031 2011-12-07 Glenn Morris <rgm@gnu.org>
15032
15033 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15034 installation and source directories as well. (Bug#10208)
15035
15036 2011-12-06 Chong Yidong <cyd@gnu.org>
15037
15038 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15039
15040 2011-12-06 Glenn Morris <rgm@gnu.org>
15041
15042 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15043 as an error, not just -1. (Bug#10217)
15044
15045 2011-12-05 Chong Yidong <cyd@gnu.org>
15046
15047 * keyboard.c (process_special_events): New function.
15048 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15049
15050 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15051
15052 * coding.c (encode_designation_at_bol): Don't use uninitialized
15053 local variable (Bug#9318).
15054
15055 2011-12-05 Kenichi Handa <handa@m17n.org>
15056
15057 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15058 return Qnil (Bug#8046, Bug#10193).
15059
15060 2011-12-05 Kenichi Handa <handa@m17n.org>
15061
15062 * coding.c (encode_designation_at_bol): New args charbuf_end and
15063 dst. Return the number of produced bytes. Callers changed.
15064 (coding_set_source): Return how many bytes coding->source was
15065 relocated.
15066 (coding_set_destination): Return how many bytes
15067 coding->destination was relocated.
15068 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15069 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15070
15071 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15072
15073 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15074 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15075 macro (Bug#9318).
15076
15077 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15078
15079 The following changes are to fix Bug#9318.
15080
15081 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15082 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15083 (encode_coding_iso_2022, encode_coding_sjis)
15084 (encode_coding_big5, encode_coding_charset): Use the above macros.
15085
15086 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15087
15088 * lisp.h (process_quit_flag): Fix external declaration.
15089
15090 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15091
15092 Don't macro-inline non-performance-critical code.
15093 * eval.c (process_quit_flag): New function.
15094 * lisp.h (QUIT): Use it.
15095
15096 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15097
15098 * nsfns.m (get_geometry_from_preferences): New function.
15099 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15100
15101 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15102
15103 * emacs.c (Qkill_emacs): Define.
15104 (syms_of_emacs): Initialize it.
15105 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15106 Qquit_flag to `kill-emacs' instead.
15107 (quit_throw_to_read_char): Add parameter `from_signal'.
15108 All callers changed. Call Fkill_emacs if requested and safe.
15109 * lisp.h (QUIT): Call Fkill_emacs if requested.
15110
15111 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15112
15113 * widget.c (update_wm_hints): Return if wmshell is null.
15114 (widget_update_wm_size_hints): New function.
15115
15116 * widget.h (widget_update_wm_size_hints): Declare.
15117
15118 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15119 widget_update_wm_size_hints (Bug#10104).
15120
15121 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15122
15123 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15124 before a newline, prepare the bidi iterator for consuming the
15125 newline, and keep the current paragraph direction. (Bug#10183)
15126 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15127
15128 2011-12-02 Juri Linkov <juri@jurta.org>
15129
15130 * search.c (Fword_search_regexp): New Lisp function created from
15131 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15132 (Fword_search_backward, Fword_search_forward)
15133 (Fword_search_backward_lax, Fword_search_forward_lax):
15134 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15135 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15136
15137 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15138
15139 * fileio.c (Finsert_file_contents): Move after-change-function call
15140 to before the "handled:" label, since all "goto handled" appear in
15141 cases where the *-change-functions have already been properly called
15142 (bug#10117).
15143
15144 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15145
15146 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15147 waiting for input. (Bug#10169)
15148
15149 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15150
15151 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15152 verifies glyph row's hash code--we have just reallocated the
15153 glyphs, so their contents can be complete garbage. (Bug#10164)
15154
15155 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15156
15157 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15158
15159 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15160
15161 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15162 attributes are tested _before_ calling verify_row_hash, to protect
15163 against GCC re-ordering of the tests. (Bug#10164)
15164
15165 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15166
15167 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15168
15169 * xterm.c (handle_one_xevent): Only set async_visible and friends
15170 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15171 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15172 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15173
15174 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15175
15176 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15177 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15178 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15179 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15180 All uses changed to use GCPRO1 etc.
15181 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15182 Revert to old implementation (i.e., before 2011-03-11).
15183
15184 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15185
15186 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15187 of scroll runs so as to avoid assigning disabled bogus rows and
15188 unnecessary graphics copy operations.
15189
15190 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15191
15192 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15193 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15194 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15195 (malloc, free, realloc, calloc): Redirect to e_* only when
15196 compiling Emacs.
15197
15198 * lisp.h (GCTYPEBITS): Move before first use.
15199 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15200 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15201 this macro definition.
15202
15203 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15204 _MSC_VER.
15205
15206 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15207
15208 * gtkutil.c (xg_create_frame_widgets):
15209 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15210 present with Gtk+ 2.0.
15211
15212 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15213
15214 * fileio.c (Finsert_file_contents): Undo previous change; see
15215 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15216
15217 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15218
15219 Rename locals to avoid shadowing.
15220 * fileio.c (Finsert_file_contents):
15221 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15222 * process.c (wait_reading_process_output):
15223 Rename inner 'proc' to 'p' to avoid shadowing.
15224 Indent for consistency with usual Emacs style.
15225
15226 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15227
15228 * xdisp.c (redisplay_window): If cursor row is not fully visible
15229 after recentering, and scroll-conservatively is set to a large
15230 number, scroll window by a few more lines to make the cursor fully
15231 visible and out of scroll-margin. (Bug#10105)
15232 (start_display): Don't move to the next line if the display should
15233 start at a newline that is part of a display vector or an overlay
15234 string. (Bug#10119)
15235
15236 2011-11-24 Juri Linkov <juri@jurta.org>
15237
15238 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15239 after the `MagickPingImage' call. (Bug#10112)
15240
15241 2011-11-23 Chong Yidong <cyd@gnu.org>
15242
15243 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15244
15245 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15246
15247 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15248 making another buffer current. (Bug#10114)
15249
15250 2011-11-23 Glenn Morris <rgm@gnu.org>
15251
15252 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15253
15254 2011-11-23 Chong Yidong <cyd@gnu.org>
15255
15256 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15257 using it (Bug#5984).
15258
15259 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15260
15261 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15262 and header-lines, as they don't have one computed for them.
15263 (Bug#10098)
15264
15265 * .gdbinit (prow): Make displayed values more self-explaining.
15266 Add row's hash code.
15267
15268 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15269
15270 * process.c (wait_reading_process_output): Fix asynchrounous
15271 GnuTLS socket handling on some versions of the GnuTLS library.
15272 (wait_reading_process_output): Add comment and URL.
15273
15274 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15275
15276 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15277
15278 2011-11-21 Chong Yidong <cyd@gnu.org>
15279
15280 * window.c (Fnext_window, Fprevious_window): Doc fix.
15281
15282 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15283
15284 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15285
15286 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15287
15288 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15289
15290 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15291
15292 * window.c (Fset_window_combination_limit): Rename argument
15293 STATUS to LIMIT.
15294 (Vwindow_combination_limit): Remove "status" from doc-string.
15295
15296 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15297
15298 * m/ibms390.h: Remove.
15299 * m/ibms390x.h: Don't include "ibms390.h".
15300
15301 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15302
15303 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15304 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15305
15306 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15307
15308 * casetab.c (Fset_case_table):
15309 * charset.c (Fcharset_after): Fix typos.
15310
15311 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15312
15313 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15314 Otherwise, valgrind does not work on some platforms.
15315 Problem reported by Andreas Schwab in
15316 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15317 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15318 is set, removing the need for VIRT_ADDRESS_VARIES.
15319 (PURE_P): Use a more-efficient implementation that needs just one
15320 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15321 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15322 to 4 (xorl, subq, cmpq, setbe).
15323 * alloc.c (pure): Always extern now, since that's the
15324 VIRT_ADDR_VARIES behavior.
15325 (PURE_POINTER_P): Use a single comparison, not two, for
15326 consistency with the new puresize.h.
15327 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15328 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15329 Remove VIRT_ADDR_VARIES no longer needed.
15330
15331 2011-11-19 Eli Zaretskii <eliz@gnu.org>
15332
15333 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15334 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15335 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15336 behave as if the cursor position were at the window margin.
15337
15338 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15339 and the cursor position is out of bounds, behave as if the cursor
15340 position were at the window margin. (Bug#10075)
15341
15342 2011-11-18 Chong Yidong <cyd@gnu.org>
15343
15344 * window.c (Fwindow_combination_limit): Make first argument
15345 non-optional, since it is meaningless for live windows like the
15346 selected window.
15347
15348 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15349
15350 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15351
15352 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15353
15354 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15355 (graft_intervals_into_buffer): Simplify.
15356
15357 2011-11-18 Eli Zaretskii <eliz@gnu.org>
15358
15359 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15360 hash values of the two rows.
15361 (copy_row_except_pointers): Preserve the used[] arrays and the
15362 hash values of the two rows. (Bug#10035)
15363 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
15364
15365 * xdisp.c (row_hash): New function, body extracted from
15366 compute_line_metrics.
15367 (compute_line_metrics): Call row_hash, instead of computing the
15368 hash code inline.
15369
15370 * dispnew.c (verify_row_hash): Call row_hash for computing the
15371 hash code of a row, instead of duplicating code from xdisp.c.
15372
15373 * dispextern.h (row_hash): Add prototype.
15374
15375 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15376
15377 * frame.c (delete_frame): Don't delete the terminal when the last
15378 X frame is closed if emacs is built with GTK toolkit.
15379
15380 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
15381
15382 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15383
15384 2011-11-17 Martin Rudalics <rudalics@gmx.at>
15385
15386 * window.c (Vwindow_splits): Rename to
15387 Vwindow_combination_resize. Suggested by Juri Linkov.
15388 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15389 of Vwindow_splits.
15390
15391 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
15392
15393 * nsfns.m (Fns_font_name):
15394 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
15395
15396 2011-11-16 Martin Rudalics <rudalics@gmx.at>
15397
15398 * window.h (window): Rename slot "nest" to "combination_limit".
15399 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15400 (Fset_window_nest): Rename to Fset_window_combination_limit.
15401 (Vwindow_nest): Rename to Vwindow_combination_limit.
15402 (recombine_windows, make_parent_window, make_window)
15403 (Fsplit_window_internal, saved_window)
15404 (Fset_window_configuration, save_window_save): Rename all
15405 occurrences of window_nest to window_combination_limit.
15406
15407 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
15408
15409 * image.c (imagemagick_load_image): Fix typo.
15410
15411 2011-11-14 Eli Zaretskii <eliz@gnu.org>
15412
15413 * xdisp.c (display_line): Move the call to
15414 highlight_trailing_whitespace before the call to
15415 compute_line_metrics, since the latter needs to see the final
15416 faces of all the glyphs to compute ROW's hash value.
15417 Fixes assertion violations in row_equal_p. (Bug#10035)
15418
15419 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
15420
15421 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15422 just return (bug#10044).
15423
15424 2011-11-12 Eli Zaretskii <eliz@gnu.org>
15425
15426 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15427 with user-defined heap size. Bump the default size of the temacs
15428 heap to 27MB, to avoid memory warning when running temacs.
15429 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15430
15431 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15432 current_matrix and desired_matrix. (Bug#9990)
15433 (verify_row_hash) [XASSERTS]: New function.
15434 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15435 that the hash value of glyph rows is correct.
15436
15437 2011-11-12 Martin Rudalics <rudalics@gmx.at>
15438
15439 * window.h (window): Remove splits slot.
15440 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15441 (Fdelete_other_windows_internal, make_parent_window)
15442 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15443 (Fset_window_configuration, save_window_save): Don't deal with
15444 split status of windows.
15445 (saved_window): Remove splits slot.
15446 (Vwindow_splits): Rewrite doc-string.
15447
15448 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15449
15450 * xfns.c (unwind_create_frame):
15451 * nsfns.m (unwind_create_frame):
15452 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15453 Vframe_list (Bug#9999).
15454
15455 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15456
15457 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
15458
15459 2011-11-11 Kenichi Handa <handa@m17n.org>
15460
15461 * callproc.c (Fcall_process): Set the member dst_multibyte of
15462 process_coding.
15463
15464 2011-11-11 Johan Bockgård <bojohan@gnu.org>
15465
15466 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15467 avoid a crash (bug#9496).
15468
15469 2011-11-09 Chong Yidong <cyd@gnu.org>
15470
15471 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15472 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15473
15474 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15475
15476 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15477
15478 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15479
15480 Avoid some portability problems by eschewing 'extern inline' functions.
15481 The trivial performance wins aren't worth the portability hassles; see
15482 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15483 et seq.
15484 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15485 (window_box_width, window_box_left, window_box_left_offset)
15486 (window_box_right, window_box_right_offset): Undo previous change,
15487 by removing the "extern"s.
15488 * intervals.c (adjust_intervals_for_insertion)
15489 (adjust_intervals_for_deletion): Undo previous change,
15490 making these static again.
15491 (offset_intervals, temp_set_point_both, temp_set_point)
15492 (copy_intervals_to_string): No longer inline.
15493 * xdisp.c (window_text_bottom_y, window_box_width)
15494 (window_box_height, window_box_left_offset)
15495 (window_box_right_offset, window_box_left, window_box_right)
15496 (window_box): No longer inline.
15497
15498 2011-11-08 Chong Yidong <cyd@gnu.org>
15499
15500 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
15501 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15502 Signal an error if not a live window.
15503 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15504 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15505
15506 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
15507
15508 * lisp.h (syms_of_abbrev): Remove declaration.
15509 Reported by CHENG Gao <chenggao@royau.me>.
15510
15511 2011-11-07 Eli Zaretskii <eliz@gnu.org>
15512
15513 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15514 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15515 of temacs in GUI mode.
15516
15517 2011-11-07 Martin Rudalics <rudalics@gmx.at>
15518
15519 * window.h: Declare delete_all_child_windows instead of
15520 delete_all_subwindows.
15521 * window.c (Fwindow_nest, Fset_window_nest)
15522 (Fset_window_new_total, Fset_window_new_normal)
15523 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15524 (delete_all_subwindows): Rename to delete_all_child_windows.
15525 (Fdelete_other_windows_internal, Fset_window_configuration):
15526 Call delete_all_child_windows instead of delete_all_subwindows.
15527 * frame.c (delete_frame): Call delete_all_child_windows instead
15528 of delete_all_subwindows.
15529
15530 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15531
15532 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15533 This is also needed for porting to any host where GC_MARK_STACK is
15534 not GC_MAKE_GCPROS_NOOPS.
15535 (which_symbols): Use it.
15536
15537 2011-11-07 Kenichi Handa <handa@m17n.org>
15538
15539 * coding.c (coding_set_destination): Check coding->src_pos only
15540 when coding->src_object is a buffer (bug#9910).
15541
15542 * process.c (send_process): Set the member src_multibyte of coding
15543 to 0 (bug#9911) when sending a unibyte text.
15544
15545 * callproc.c (Fcall_process): Set the member src_multibyte of
15546 process_coding to 0 (bug#9912).
15547
15548 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15549
15550 * xmenu.c (cleanup_widget_value_tree): New function.
15551 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15552 calling free_menubar_widget_value_tree directly (Bug#9830).
15553
15554 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15555
15556 Fix some portability problems with 'inline'.
15557 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15558 (window_box_width, window_box_left, window_box_left_offset)
15559 (window_box_right, window_box_right_offset): Declare extern.
15560 Otherwise, these inline functions do not conform to C99 and
15561 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15562 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15563 * intervals.c (adjust_intervals_for_insertion)
15564 (adjust_intervals_for_deletion): Now extern, because otherwise the
15565 extern inline functions 'offset_intervals' couldn't refer to it.
15566 (static_offset_intervals): Remove.
15567 (offset_intervals): Rewrite using the old contents of
15568 static_offset_intervals. The old version didn't conform to C99
15569 because an extern inline function contained a reference to an
15570 identifier with static linkage.
15571
15572 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15573
15574 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15575 GC.
15576
15577 2011-11-06 Eli Zaretskii <eliz@gnu.org>
15578
15579 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15580 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15581 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15582 return Qleft_to_right.
15583
15584 2011-11-06 Chong Yidong <cyd@gnu.org>
15585
15586 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15587 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15588 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15589 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15590 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15591 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15592 (Fwindow_vscroll): Doc fix.
15593 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15594 argument, since it makes no sense to pass a live window and for
15595 consistency with window-child.
15596
15597 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15598
15599 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15600 support MSVC.
15601
15602 2011-11-05 Jason Rumney <jasonr@gnu.org>
15603
15604 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15605 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15606 fonts (Bug#6029).
15607 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15608 bitwise arithmetic preventing use of unicode-sip and non-truetype
15609 opentype fonts.
15610
15611 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15612
15613 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15614 "emacs"-only part.
15615
15616 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15617 initialization code to keep similarity to xfns.c after changes
15618 from 2011-11-05.
15619
15620 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15621
15622 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15623 (unwind_create_frame): New function (Bug#9943).
15624 (Fx_create_frame): Restructure code to be more similar to the one in
15625 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15626 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15627 Move terminal->reference_count++ just before making the frame official
15628 (Bug#9943).
15629
15630 * nsterm.m (x_free_frame_resources): New function.
15631 (x_destroy_window): Move code to x_free_frame_resources.
15632
15633 * xfns.c (unwind_create_frame): Fix comment.
15634 (Fx_create_frame, x_create_tip_frame):
15635 Move terminal->reference_count++ just before making the frame
15636 official. Move initialization of image_cache_refcount and
15637 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15638
15639 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15640
15641 Support MSVC build with newer versions of Visual Studio.
15642 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15643 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15644 nt/gmake.defs.
15645
15646 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15647 which are not supported by MSVC.
15648 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15649 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15650 bitfields.
15651 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15652 types in bitfields.
15653 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15654
15655 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15656
15657 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
15658
15659 Support MSVC build with newer versions of Visual Studio.
15660 * w32.c: Don't include w32api.h for MSVC.
15661 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15662
15663 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15664 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15665 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15666 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15667 e_* cousins.
15668 (alloca) [_MSC_VER]: Define to _alloca.
15669
15670 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15671
15672 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15673
15674 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15675
15676 * xdisp.c (note_mouse_highlight): If either of
15677 previous/next-single-property-change returns nil, treat that as
15678 the beginning or the end of the buffer. (Bug#9955)
15679
15680 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15681
15682 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
15683 label is not null (Bug#9951).
15684 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15685 may be NULL.
15686
15687 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15688
15689 * window.c (Fwindow_body_size): Mention in the doc string that the
15690 return value is in frame's canonical units. (Bug#9949)
15691
15692 2011-11-03 Eli Zaretskii <eliz@gnu.org>
15693
15694 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15695
15696 * w32fns.c (unwind_create_frame): If needed, free the glyph
15697 matrices of the partially constructed frame. (Bug#9943)
15698 * xfns.c (unwind_create_frame): Likewise.
15699
15700 2011-11-01 Eli Zaretskii <eliz@gnu.org>
15701
15702 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15703 Don't stop backward scan on the continuation glyph, even though
15704 its CHARPOS is positive.
15705 (mouse_face_from_buffer_pos, note_mouse_highlight):
15706 Rename cover_string to disp_string.
15707
15708 2011-11-01 Martin Rudalics <rudalics@gmx.at>
15709
15710 * window.c (temp_output_buffer_show): Don't use
15711 Vtemp_buffer_show_specifiers.
15712 (Vtemp_buffer_show_specifiers): Remove unused variable.
15713
15714 2011-10-30 Eli Zaretskii <eliz@gnu.org>
15715
15716 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15717 past the beginning of the current glyph matrix.
15718
15719 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
15720
15721 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15722 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15723 HAVE_GTK3 (Bug#9869).
15724
15725 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15726 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15727
15728 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15729
15730 * xterm.c: Declare x_handle_net_wm_state to return int.
15731 (handle_one_xevent): Check if we are iconified but don't have
15732 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15733 (get_current_wm_state): Return non-zero if not hidden,
15734 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15735 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15736 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15737 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15738
15739 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15740
15741 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15742 so that this new function doesn't get optimized away by a
15743 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15744
15745 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15746
15747 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15748
15749 2011-10-29 Eli Zaretskii <eliz@gnu.org>
15750
15751 Fix the `xbytecode' command.
15752 * .gdbinit (xprintbytestr): New command.
15753 (xwhichsymbols): Rename from `which'; all callers changed.
15754 (xbytecode): Print the byte-code string as well.
15755
15756 2011-10-29 Kim Storm <storm@cua.dk>
15757
15758 * alloc.c (which_symbols): New function.
15759
15760 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15761
15762 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15763 line. (Bug#9903)
15764
15765 2011-10-29 Glenn Morris <rgm@gnu.org>
15766
15767 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15768 Not clear what it was for, and it causes various bugs. (Bug#9839)
15769
15770 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15771
15772 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15773 possible random value that matches one of those tested as
15774 condition to clear the mouse face.
15775
15776 2011-10-28 Chong Yidong <cyd@gnu.org>
15777
15778 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15779
15780 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15781
15782 * window.c (make_window): Initialize phys_cursor_on_p.
15783
15784 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15785
15786 * lisp.h (struct Lisp_Symbol): Update comments.
15787
15788 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
15789
15790 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15791
15792 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15793
15794 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15795 <oslsachem@gmail.com> for helping to debug this.
15796
15797 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15798 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15799 (g_b_init_get_glyph_outline_w): New static variables.
15800 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15801 (GetGlyphOutlineW_Proc): New typedefs.
15802 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
15803 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15804 New functions.
15805 (w32font_open_internal, compute_metrics):
15806 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
15807 instead of calling the "wide" APIs directly.
15808
15809 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15810
15811 * w32.h (syms_of_w32font): Add prototype.
15812
15813 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15814
15815 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15816 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15817 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15818 (Fmove_to_window_line): Doc fix.
15819
15820 2011-10-27 Chong Yidong <cyd@gnu.org>
15821
15822 * process.c (make_process): Set gnutls_state to NULL.
15823
15824 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15825 non-NULL, regardless of GNUTLS_INITSTAGE.
15826 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15827 an error. Set process slots as soon as we allocate them.
15828
15829 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15830
15831 2011-10-27 Chong Yidong <cyd@gnu.org>
15832
15833 * gnutls.c (emacs_gnutls_deinit): New function.
15834 Deallocate credentials structures as well as calling gnutls_deinit.
15835 (Fgnutls_deinit, Fgnutls_boot): Use it.
15836
15837 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15838 (deactivate_process): Call emacs_gnutls_deinit.
15839
15840 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15841
15842 * image.c (x_create_x_image_and_pixmap):
15843 * w32.c (sys_rename, w32_delayed_load):
15844 * w32font.c (fill_in_logfont):
15845 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15846
15847 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
15848
15849 * w32fns.c (w32_default_color_map): New function,
15850 extracted from Fw32_default_color_map.
15851 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
15852
15853 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15854
15855 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15856
15857 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15858
15859 * keyboard.c (test_undefined): New function (bug#9751).
15860 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15861
15862 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15863
15864 * sysdep.c (init_sys_modes): Fix the check for the controlling
15865 terminal (Bug#6649).
15866
15867 2011-10-20 Eli Zaretskii <eliz@gnu.org>
15868
15869 * dispextern.h (struct bidi_it): New member next_en_type.
15870
15871 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15872 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15873 current character, check also for next_en_type being WEAK_EN.
15874 (bidi_resolve_weak): Don't enter the expensive loop if the current
15875 position is before next_en_pos. Record the bidi type of the first
15876 non-ET, non-BN character we find, in addition to its position.
15877 (bidi_level_of_next_char): Invalidate next_en_type when
15878 next_en_pos is over-stepped.
15879
15880 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15881
15882 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15883 * editfns.c: Rewrite current-time-zone so that it invokes
15884 the equivalent of (format-time-string "%Z") to get the time zone name.
15885 This fixes a bug when the time zone name contains characters that
15886 need converting from the system time locale to Emacs internal format.
15887 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15888 that patch fixed format-time-string to do the conversion, but
15889 I forgot to fix current-time-zone.
15890 (format_time_string): New function, containing most of
15891 what Fformat_time_string used to contain.
15892 (Fformat_time_string): Rewrite in terms of format_time_string.
15893 This doesn't change this function's behavior.
15894 (current-time-zone): Rewrite to use format_time_string.
15895 This fixes the bug reported by Michael Schierl in
15896 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15897 Jason Rumney's 2007-06-07 change worked around this bug, but
15898 didn't fix it.
15899 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15900
15901 2011-10-19 Eli Zaretskii <eliz@gnu.org>
15902
15903 * xdisp.c (start_display): If the character at POS is displayed
15904 via a display vector, reset IT->current.dpvec_index to zero.
15905 (try_window_reusing_current_matrix): If a line ends in a display
15906 vector or the next line starts in a display vector, continue
15907 redrawing the window even though the character position of
15908 start_row was reached.
15909 (Bug#9771, part 2)
15910
15911 2011-10-18 Chong Yidong <cyd@gnu.org>
15912
15913 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15914 with nobreak-char-display too.
15915
15916 2011-10-18 Eli Zaretskii <eliz@gnu.org>
15917
15918 Fix part 3 of bug#9771.
15919 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15920 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15921 non-neutral characters if the current character is a paragraph
15922 separator (a.k.a. Newline). This avoids running the same
15923 expensive loop twice, once when we consume the preceding newline
15924 and the other time when the line actually needs to be displayed.
15925 Avoid the loop when we see neutrals on the base embedding level
15926 following a character whose directionality is the same as the
15927 paragraph's. This avoids running the expensive loop when a line
15928 ends in a long sequence of neutrals, like control characters.
15929 Add assertion against STRONG_AL type. Slightly rearrange code
15930 that determines the type of a neutral given the first non-neutral
15931 that follows it.
15932 (bidi_level_of_next_char): Set next_en_pos to zero when
15933 invalidating its info.
15934
15935 2011-10-17 Eli Zaretskii <eliz@gnu.org>
15936
15937 * xdisp.c (push_display_prop): Determine whether to record string
15938 or buffer position by IT->string, not by IT->method. Allow
15939 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
15940 (move_it_vertically_backward): Don't look for character position
15941 immediately after the newline when in a continuation line.
15942 (Bug#9771, part 1)
15943
15944 2011-10-15 Martin Rudalics <rudalics@gmx.at>
15945
15946 * window.c (coordinates_in_window): Rewrite and delabelize
15947 vertical border check. (Bug#5357) (Bug#9618)
15948
15949 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15950
15951 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15952 errors in XSetWindowBorder (bug#9310).
15953
15954 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15955
15956 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15957 avoid crash when xmalloc overrun checking is enabled.
15958
15959 2011-10-13 Eli Zaretskii <eliz@gnu.org>
15960
15961 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15962 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15963 cursor motion with <left> and <right> arrow keys.
15964
15965 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15966 some callers set that themselves.
15967
15968 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15969
15970 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15971 display string and the previous row comes from the same string and
15972 is empty. (Bug#9739) (Bug#9738)
15973
15974 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15975
15976 * doc.c (get_doc_string): Encode file name (bug#9735).
15977
15978 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15979
15980 * bidi.c (bidi_level_of_next_char):
15981 * xdisp.c (get_visually_first_element): Remove old incorrect
15982 comments regarding the Unicode Line Separator character.
15983
15984 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15985
15986 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15987
15988 * alloc.c (Fgc_status): Do not access beyond zombies array
15989 boundary if nzombies > MAX_ZOMBIES.
15990 * alloc.c (dump_zombies): Add missing format specifier.
15991
15992 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15993
15994 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15995 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15996
15997 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15998 Some packages use them to denote characters with modifiers.
15999
16000 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16001
16002 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16003 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16004 matching a pp-number. Rename parameter var to var1.
16005
16006 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16007
16008 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16009
16010 2011-10-08 Glenn Morris <rgm@gnu.org>
16011
16012 * callint.c (Fcall_interactively): Give a more explicit error for the
16013 'c' case with a non-character input. (Bug#8479)
16014
16015 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16016
16017 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16018 lines.
16019 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16020 lines that are hscrolled on the left.
16021
16022 * dispnew.c (buffer_posn_from_coords): Account for a possible
16023 presence of header-line. (Bug#4426)
16024
16025 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16026
16027 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16028 Don't advertise functionality which we discourage or doesn't work.
16029
16030 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16031
16032 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16033 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16034 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16035 this makes Emacs dump core during garbage collection on rare
16036 occasions. sizeof is obviously inferior to offsetof here, so
16037 stick with offsetof.
16038 (GC_POINTER_ALIGNMENT): New macro.
16039 (mark_memory): Omit 3rd (offset) arg; caller changed.
16040 Don't assume EMACS_INT alignment is the same as pointer alignment.
16041
16042 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16043
16044 * keyboard.c (read_key_sequence_remapped): New var.
16045 (read_key_sequence): Compute remapping in the right buffer.
16046 (command_loop_1): Use read_key_sequence's remapping directly.
16047
16048 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16049
16050 * dired.c (file_name_completion): Don't expand file name.
16051 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16052 before checking file name handler.
16053
16054 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16055 they've been requested explicitly (bug#9591).
16056
16057 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16058
16059 * keymap.c (Fsingle_key_description): Use make_specified_string
16060 instead of build_string to build string from push_key_description.
16061 (Bug#5193)
16062
16063 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16064
16065 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16066 This fixes a Y2038 bug on 64-bit hosts.
16067 * buffer.c (reset_buffer):
16068 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16069 (Fclear_buffer_auto_save_failure):
16070 Use 0, not -1, to represent an unset failure time, since time_t
16071 might not be signed.
16072
16073 Remove dependency on glibc malloc internals.
16074 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16075 Move back here from lisp.h, but with their new implementations.
16076 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16077 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16078 * charset.c (charset_table_init): New static var.
16079 (syms_of_charset): Use it instead of xmalloc. This removes a
16080 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16081 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16082 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16083 Move back to alloc.c.
16084 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16085 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16086
16087 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16088
16089 * nsterm.m (windowDidResize): Call x_set_window_size only when
16090 ns_in_resize is true. Otherwise set pixelwidth/height and
16091 call change_frame_size (Bug#9628).
16092
16093 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16094
16095 Port --enable-checking=all to Fedora 14 x86-64.
16096 * charset.c (syms_of_charset): Also account for glibc malloc's
16097 internal overhead when calculating the initial malloc maximum.
16098
16099 Port --enable-checking=all to Fedora 14 x86.
16100 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16101 Move to lisp.h.
16102 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16103 (overrun_check_realloc, overrun_check_free):
16104 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16105 That way, xmalloc returns a properly-aligned pointer even if
16106 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16107 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16108 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16109 into account when calculating the initial malloc maximum.
16110 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16111 Move here from alloc.c, so that charset.c can use it too.
16112 Properly align; the old code wasn't right for common 32-bit hosts
16113 when configured with --enable-checking=all.
16114 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16115 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16116
16117 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16118
16119 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16120 use EDOM.
16121
16122 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16123
16124 * xdisp.c (compute_display_string_end): If there's no display
16125 string at CHARPOS, return -1.
16126
16127 * bidi.c (bidi_fetch_char): When compute_display_string_end
16128 returns a negative value, treat the character as a normal
16129 character not covered by a display string. (Bug#9624)
16130
16131 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16132
16133 * lread.c (Fread_from_string): Fix typo in docstring.
16134
16135 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16136
16137 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16138 newline, reseat the iterator instead of bidi-iterating there one
16139 character at a time. (Bug#9610)
16140 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16141 TO_CHARPOS if the bidi iterator is at base embedding level.
16142
16143 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16144
16145 * lread.c (readevalloop): Use correct code for NBSP.
16146 (read1): Likewise. (Bug#9608)
16147
16148 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16149
16150 * dbusbind.c (Fdbus_register_signal): When service is not
16151 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16152
16153 2011-09-25 Glenn Morris <rgm@gnu.org>
16154
16155 * buffer.c (truncate-lines): Doc fix.
16156
16157 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16158
16159 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16160 (Fset_window_next_buffers): Doc fix.
16161
16162 2011-09-24 Glenn Morris <rgm@gnu.org>
16163
16164 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16165
16166 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16167
16168 Fix minor problems found by static checking.
16169 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16170 * indent.c (Fvertical_motion): Fix == vs = typo.
16171
16172 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16173
16174 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16175 Default value is now t. Doc fix.
16176
16177 * indent.c (Fvertical_motion): Compute and apply the overshoot
16178 logic when moving up, not only when moving down. Fix the
16179 confusing name and values of the it_overshoot_expected variable;
16180 logic changes accordingly. (Bug#9254) (Bug#9549)
16181
16182 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16183 CHARPOS is covered by a display string which includes newlines.
16184 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16185 is covered by a display string with embedded newlines.
16186
16187 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16188
16189 * dbusbind.c (Fdbus_register_signal): Add match rule to
16190 Vdbus_registered_objects_table. (Bug#9581)
16191 (Fdbus_register_method, Vdbus_registered_objects_table):
16192 Fix docstring.
16193
16194 2011-09-24 Jim Meyering <meyering@redhat.com>
16195
16196 do not ignore write error for any output size
16197 The previous change was incomplete.
16198 While it makes emacs --batch detect the vast majority of stdout
16199 write failures, errors were still ignored whenever the output size is
16200 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16201 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16202 && echo FAIL: ignored write error
16203 FAIL: ignored write error
16204 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16205 && echo FAIL: ignored write error
16206 FAIL: ignored write error
16207 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16208
16209 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16210
16211 * emacs.c (Fkill_emacs): In noninteractive mode exit
16212 non-successfully if a write error occurred on stdout. (Bug#9574)
16213
16214 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16215
16216 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16217 the xassert test.
16218
16219 * dispextern.h (struct it): Update the comment documenting what
16220 can it->OBJECT be.
16221
16222 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16223
16224 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16225 a display string, extend search for cursor position to end of row.
16226 (find_row_edges): If the row ends in a newline from a display
16227 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16228 Handle the case of a display string with multiple newlines.
16229 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16230 non-empty line. Fixes confusing cursor motion with arrow keys at
16231 the beginning of a line that starts with whitespace.
16232
16233 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16234
16235 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16236 (bug#9493).
16237
16238 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16239
16240 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16241 boolean (Bug#9154).
16242
16243 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16244
16245 * xdisp.c (display_line): Record maximum and minimum buffer
16246 positions even if no glyphs were produced (e.g., by a zero-width
16247 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16248 buffer positions that will be removed from the glyph row because
16249 they don't fit.
16250 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16251 column is beyond frame width: don't subtract 1 "pixel" when
16252 computing width of the stretch.
16253 (reseat_at_next_visible_line_start): Undo the change made on
16254 2011-09-17 that saved paragraph information and restored it after
16255 the call to `reseat'. (Bug#9545)
16256
16257 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16258
16259 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16260 and turn window cursor on if cleared (Bug#9415).
16261
16262 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16263
16264 * search.c (boyer_moore): Take unibyte characters from pattern
16265 literally. (Bug#9458)
16266
16267 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16268
16269 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16270
16271 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16272
16273 Fix minor problem found by static checking.
16274 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16275 initialized, to pacify gcc -Wuninitialized.
16276
16277 * fileio.c: Report proper errno when syscall falls.
16278 (Finsert_file_contents): Save and restore errno,
16279 so that report_file_error outputs the correct diagnostic.
16280 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16281
16282 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16283
16284 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16285
16286 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16287
16288 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16289 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16290
16291 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16292
16293 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16294 about the current paragraph and restore it after the call to reseat.
16295
16296 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16297 (bidi_find_paragraph_start): Search back for paragraph beginning
16298 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16299 (bidi_move_to_visually_next): Only trigger paragraph-related
16300 computations when the last character is a newline or at EOB, not
16301 just any NEUTRAL_B. (Bug#9470)
16302
16303 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16304 truncated lines if point is covered by a display string. (Bug#9524)
16305
16306 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16307
16308 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16309 (cons_to_x_long): New function.
16310 (lisp_data_to_selection_data): Use it. Correct the test for
16311 short-versus-long data; it was negated. Break out of vector
16312 loop, for efficiency, when a long datum is discovered.
16313
16314 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16315
16316 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16317
16318 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16319
16320 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16321 GCC PR/17406) by declaring this function with external scope.
16322
16323 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16324
16325 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16326 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16327
16328 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16329
16330 * editfns.c (Fformat): Correctly handle text properties on "%%".
16331
16332 2011-09-15 Eli Zaretskii <eliz@gnu.org>
16333
16334 * xterm.c (x_draw_composite_glyph_string_foreground):
16335 * w32term.c (x_draw_composite_glyph_string_foreground):
16336 * term.c (encode_terminal_code):
16337 * composite.c (composition_update_it, get_composition_id):
16338 * xdisp.c (get_next_display_element)
16339 (fill_composite_glyph_string): Add comments about special meaning
16340 of TAB characters in a composition.
16341
16342 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16343
16344 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
16345 This occurs when processing a multibyte format.
16346 Problem reported by Wolfgang Jenker.
16347
16348 2011-09-15 Johan Bockgård <bojohan@gnu.org>
16349
16350 * xdisp.c (try_cursor_movement): Only check for exact match if
16351 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16352
16353 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16354
16355 Remove unused external symbols.
16356 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16357 * xdisp.c (calc_pixel_width_or_height): Now static.
16358 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16359 * indent.c (check_display_width):
16360 * w32term.c: Fix comment to match code.
16361 * xterm.c, xterm.h (x_catching_errors): Remove.
16362
16363 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16364
16365 * xselect.c: Use signed conversions more consistently (Bug#9498).
16366 (selection_data_to_lisp_data): Assume incoming selection data are
16367 signed integers, not unsigned. This is to be consistent with
16368 outgoing selection data, which was modified to use signed integers
16369 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16370 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16371 expects long, not unsigned long.
16372
16373 2011-09-14 Eli Zaretskii <eliz@gnu.org>
16374
16375 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16376 computation of loop end. Reported by Johan Bockgård
16377 <bojohan@gnu.org>.
16378
16379 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
16380
16381 * frame.c (Fother_visible_frames_p): Function deleted.
16382
16383 2011-09-12 Eli Zaretskii <eliz@gnu.org>
16384
16385 * indent.c (compute_motion): Process display vector front to back
16386 rather than the other way around. (Bug#2496)
16387
16388 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16389
16390 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16391
16392 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
16393
16394 * minibuf.c (Fread_from_minibuffer): Doc fix.
16395
16396 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16397
16398 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16399 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16400
16401 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16402
16403 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16404 value for non-existent files.
16405
16406 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16407
16408 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16409 set its "size" to -1. This will set the modtime_size field of
16410 the corresponding buffer to -1, which is what
16411 verify-visited-file-modtime expects for files that do not exist.
16412 (Bug#9139)
16413
16414 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16415
16416 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16417 here ...
16418 * lisp.h: ... from here. push_key_description is no longer
16419 defined in keyboard.c, so its declaration should not be in
16420 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16421 logically belongs with push_key_description.
16422
16423 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16424
16425 * buffer.h: Include <sys/types.h> instead of <time.h>.
16426 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16427 Problem reported by Herbert J. Skuhra.
16428
16429 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16430
16431 * xml.c (parse_region): Make the parsing work for
16432 non-comment-starting XML files again (bug#9144).
16433
16434 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16435
16436 * image.c (gif_load): Fix calculation of bottom and right corner.
16437 (Bug#9468)
16438
16439 2011-09-10 Eli Zaretskii <eliz@gnu.org>
16440
16441 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16442 redisplay in small windows.
16443
16444 2011-09-09 Eli Zaretskii <eliz@gnu.org>
16445
16446 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16447
16448 2011-09-08 Martin Rudalics <rudalics@gmx.at>
16449
16450 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16451 Operate on live windows only.
16452
16453 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
16454
16455 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16456
16457 2011-09-07 Eli Zaretskii <eliz@gnu.org>
16458
16459 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16460 only under bidi iteration.
16461
16462 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16463
16464 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16465
16466 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16467
16468 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16469 Without this fix, the command to link temacs failed due to an
16470 undefined symbol __builtin_isnan. This is because
16471 /usr/include/iso/math_c99.h #defines isnan(x) to
16472 __builtin_isnan(x), but the bundled gcc, which identifies itself
16473 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16474 a __builtin_isnan.
16475 * floatfns.c (isnan): #undef, and then #define to a clone of
16476 what's in data.c.
16477 (Fisnan): Always define, since it's always available now.
16478 (syms_of_floatfns): Always define isnan at the Lisp level.
16479
16480 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16481
16482 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16483
16484 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16485
16486 * fileio.c: Fix bugs with large file offsets (Bug#9428).
16487 The previous code assumed that file offsets (off_t values) fit in
16488 EMACS_INT variables, which is not true on typical 32-bit hosts.
16489 The code messed up by falsely reporting buffer overflow in cases
16490 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16491 when "big" contains more than 2**29 bytes, even though this
16492 inserts just one byte and does not overflow the buffer.
16493 (Finsert_file_contents): Store file offsets as off_t
16494 values, not as EMACS_INT values. Check for overflow when
16495 converting between EMACS_INT and off_t. When checking for
16496 buffer overflow or for overlap, take the offsets into account.
16497 Don't use EMACS_INT for small values where int suffices.
16498 When checking for overlap, fix a typo: ZV was used where
16499 ZV_BYTE was intended.
16500 (Fwrite_region): Don't assume off_t fits into 'long'.
16501 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16502
16503 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
16504
16505 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16506
16507 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16508
16509 sprintf-related integer and memory overflow issues (Bug#9412).
16510
16511 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
16512 (esprintf, exprintf, evxprintf): New functions.
16513 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
16514 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
16515 (modify_event_symbol): Do not assume that the length of
16516 name_alist_or_stem is safe to alloca and fits in int.
16517 (Fexecute_extended_command): Likewise for function name and binding.
16518 (Frecursion_depth): Wrap around reliably on integer overflow.
16519 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16520 since some callers pass EMACS_INT values.
16521 (Fsingle_key_description): Don't crash if symbol name contains more
16522 than MAX_ALLOCA bytes.
16523 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16524 (get_minibuffer): Arg is now EMACS_INT, not int.
16525 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
16526 (esprintf, exprintf, evxprintf): New decls.
16527 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16528
16529 * dbusbind.c (signature_cat): New function.
16530 (xd_signature, Fdbus_register_signal):
16531 Do not overrun buffer; instead, report string overflow.
16532
16533 * dispnew.c (add_window_display_history): Don't overrun buffer.
16534 Truncate instead; this is OK since it's just a log.
16535
16536 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16537 even if the time zone offset is outlandishly large.
16538 Don't mishandle offset == INT_MIN.
16539
16540 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16541 when creating daemon; the previous buffer-overflow check was incorrect.
16542
16543 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16544 which has the guts of the old verror function.
16545
16546 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16547 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16548
16549 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16550 (font_unparse_xlfd): Don't blindly alloca long strings.
16551 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
16552 fits in int, when using sprintf. Use single snprintf to count
16553 length of string rather than counting it via multiple sprintfs;
16554 that's simpler and more reliable.
16555 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16556 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16557 sprintf, in case result does not fit in int.
16558
16559 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16560 (fontset_from_font): Print it.
16561
16562 * frame.c (tty_frame_count): Now printmax_t, not int.
16563 (make_terminal_frame, set_term_frame_name): Print it.
16564 (x_report_frame_params): In X, window IDs are unsigned long,
16565 not signed long, so print them as unsigned.
16566 (validate_x_resource_name): Check for implausibly long names,
16567 and don't assume name length fits in 'int'.
16568 (x_get_resource_string): Don't blindly alloca invocation name;
16569 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16570 not fit in int.
16571
16572 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16573 (xg_check_special_colors, xg_set_geometry):
16574 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16575
16576 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16577 Use esprintf, not sprintf, in case result does not fit in int.
16578
16579 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16580 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16581 it as a large positive number.
16582 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16583 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16584
16585 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16586 in case result does not fit in int.
16587
16588 * print.c (float_to_string): Detect width overflow more reliably.
16589 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16590 buffer overrun. Don't assume list length fits in 'int'. Treat
16591 print length of 0 as 0, not as infinity; to be consistent with other
16592 uses of print length in this function. Don't overflow print length
16593 index. Don't assume hash table size fits in 'long', or that
16594 vectorlike size fits in 'unsigned long'.
16595
16596 * process.c (make_process): Use printmax_t, not int, to format
16597 process-name gensyms.
16598
16599 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16600
16601 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16602 to avoid potential buffer overrun.
16603
16604 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16605 if X resource line is longer than 512 bytes.
16606
16607 * xfns.c (x_window): Make sprintf buffer a bit bigger
16608 to avoid potential buffer overrun.
16609
16610 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16611
16612 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16613
16614 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16615
16616 Integer overflow fixes for scrolling, etc.
16617 Without these, Emacs silently mishandles large integers sometimes.
16618 For example, "C-u 4294967297 M-x recenter" was treated as if
16619 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16620
16621 * xdisp.c (try_window_id): Check Emacs fixnum range before
16622 converting to 'int'.
16623
16624 * window.c (window_scroll_line_based, Frecenter):
16625 Check that an Emacs fixnum is in range before assigning it to 'int'.
16626 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16627 values converted from Emacs fixnums.
16628 (Frecenter): Don't wrap around a line count if it is out of 'int'
16629 range; instead, treat it as an extreme value.
16630 (Fset_window_configuration, compare_window_configurations):
16631 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16632
16633 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16634 that can exceed INT_MAX. Check that EMACS_INT value is in range
16635 before assigning it to the (possibly-narrower) index.
16636 (match_limit): Don't assume that a fixnum can fit in 'int'.
16637
16638 * print.c (print_object): Use ptrdiff_t, not int, for index that can
16639 exceed INT_MAX.
16640
16641 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
16642 (Fvertical_motion): Don't wrap around LINES values that don't fit
16643 in 'int'. Instead, treat them as extreme values. This is good
16644 enough for windows, which can't have more than INT_MAX lines anyway.
16645
16646 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16647
16648 * Require libxml/parser.h to avoid compilation warning.
16649
16650 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16651
16652 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16653 since this reportedly can destroy thread storage.
16654
16655 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
16656
16657 * syntax.c (find_defun_start): Update all cache variables if
16658 exiting early (Bug#9401).
16659
16660 2011-08-30 Eli Zaretskii <eliz@gnu.org>
16661
16662 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16663
16664 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16665 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16666 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16667
16668 * term.c (tty_append_glyph): New function.
16669 (produce_stretch_glyph): Static function and its prototype deleted.
16670
16671 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16672 Add prototypes.
16673
16674 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16675
16676 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16677 when checking :margin (Bug#9390).
16678 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
16679 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
16680 so that the name doesn't mislead. All uses changed.
16681
16682 2011-08-28 Johan Bockgård <bojohan@gnu.org>
16683
16684 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16685 set_tty_hooks.
16686
16687 2011-08-27 Eli Zaretskii <eliz@gnu.org>
16688
16689 * xdisp.c (move_it_to): Don't bail out early when reaching
16690 position beyond to_charpos, if we are scanning backwards.
16691 (move_it_vertically_backward): When DY == 0, make sure we get to
16692 the first character in the line after the newline.
16693
16694 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16695
16696 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16697 (ccl_driver): Do not generate an out-of-range pointer.
16698 (Fccl_execute_on_string): Remove unnecessary check for
16699 integer overflow, noted by Stefan Monnier in
16700 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16701 Remove a FIXME that didn't need fixing.
16702 Simplify the newly-introduced buffer reallocation code.
16703
16704 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
16705
16706 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16707
16708 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
16709
16710 Integer and memory overflow issues (Bug#9196).
16711
16712 * doc.c (get_doc_string): Rework so that
16713 get_doc_string_buffer_size is the actual buffer size, rather than
16714 being 1 less than the actual buffer size; this makes xpalloc more
16715 convenient.
16716
16717 * image.c (x_allocate_bitmap_record, cache_image):
16718 * xselect.c (Fx_register_dnd_atom):
16719 Simplify previous changes by using xpalloc.
16720
16721 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16722 since either will do and ptrdiff_t is convenient with xpalloc.
16723
16724 * charset.c (charset_table_size)
16725 (struct charset_sort_data.priority): Now ptrdiff_t.
16726 (charset_compare): Don't overflow if priorities differ greatly.
16727 (Fsort_charsets): Don't assume list length fits in int.
16728 Check for size-calculation overflow when allocating sort data.
16729 (syms_of_charset): Allocate an initial charset table that is
16730 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16731
16732 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16733
16734 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16735 The actual value is always <= INT_MAX, and leaving it unsigned made
16736 overflow checking harder.
16737
16738 * dispextern.h (struct glyph_matrix.rows_allocated)
16739 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16740 with xpalloc. The values are still always <= INT_MAX.
16741
16742 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16743
16744 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16745 (SAFE_NALLOCA): New macro.
16746
16747 * region-cache.c (struct boundary.pos, find_cache_boundary)
16748 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16749 (set_cache_region, invalidate_region_cache)
16750 (revalidate_region_cache, know_region_cache, region_cache_forward)
16751 (region_cache_backward, pp_cache):
16752 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16753 so that ptrdiff_t * can be passed to xpalloc.
16754 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16755 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16756 (pp_cache): Don't assume cache_len fits in int.
16757 * region-cache.h: Adjust extern decls to match.
16758
16759 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16760 EMACS_INT, since either will do, for xpalloc.
16761
16762 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16763 (xnmalloc, xnrealloc, xpalloc): New functions.
16764
16765 * bidi.c (bidi_shelve_header_size): New constant.
16766 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16767 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16768
16769 * bidi.c (bidi_cache_shrink):
16770 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16771 (overlay_strings):
16772 Don't update size of array until after memory allocation succeeds,
16773 because xmalloc/xrealloc may not return.
16774 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16775 now that we have proper integer overflow checking.
16776 (record_overlay_string, overlay_strings): Catch overflows when
16777 calculating size of overlay_str_buf.
16778
16779 * callproc.c (Fcall_process): Check for size overflow when
16780 calculating size of args2.
16781 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16782 Normally we prefer signed values, but sticking with ptrdiff_t would
16783 require adding more-complicated checks.
16784
16785 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16786 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16787 Redo buffer-overflow calculations to avoid integer overflow.
16788 Add a FIXME comment where memory seems to be over-allocated.
16789
16790 * character.c (Fstring): Check for size-calculation overflow.
16791
16792 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16793 unnecessary integer overflow. Check for size overflow.
16794 (encode_coding_object): Don't update size until xmalloc succeeds.
16795
16796 * composite.c (get_composition_id): Check for overflow in glyph
16797 length calculations.
16798
16799 Integer and memory overflow fixes for display code.
16800 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16801 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16802 (scrolling_window): Check for overflow in size calculations.
16803 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16804 Don't assume glyph table len fits in int.
16805 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16806 (row_table_size): Now ptrdiff_t, not int.
16807 (scrolling_window): Avoid overflow in size calculations.
16808 Don't update size until allocation succeeds.
16809 * fns.c (concat): Check for overflow in size calculations.
16810 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16811 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16812 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16813
16814 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16815 (get_doc_string): Check for size calculation overflow.
16816 Don't update size until allocation succeeds.
16817 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16818 EMACS_INT, where ptrdiff_t will do.
16819 (Fsubstitute_command_keys): Check for string overflow.
16820
16821 * editfns.c (set_time_zone_rule): Don't assume environment length
16822 fits in int.
16823 (message_length): Now ptrdiff_t, not int.
16824 (Fmessage_box): Don't update size until allocation succeeds.
16825 Don't assume message length fits in int.
16826 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16827
16828 * emacs.c (main): Do not reallocate argv, since there is a null at
16829 the end that can be overwritten, and this way there's no need to
16830 worry about size-calculation overflow.
16831 (sort_args): Check for size-calculation overflow.
16832
16833 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16834 alloc succeeds.
16835 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16836
16837 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16838 (x_set_scroll_bar_width, x_figure_window_size):
16839 Check for integer overflow.
16840 (x_set_alpha): Do not assume XINT fits in int.
16841
16842 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16843 This is for the members text_lines, text_cols, total_lines, total_cols,
16844 where the system imposes an 'int' limit.
16845
16846 * fringe.c (Fdefine_fringe_bitmap):
16847 Don't update size until alloc works.
16848
16849 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16850 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16851
16852 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16853 Check for size-calculation overflow.
16854 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16855 do, as we prefer signed integers.
16856 (id_to_widget.max_size, id_to_widget.used)
16857 (xg_store_widget_in_map, xg_remove_widget_from_map)
16858 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16859 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16860 Use and return ptrdiff_t, not int.
16861 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16862 * gtkutil.h: Change prototypes to match the above.
16863
16864 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16865 are duplicate now that they've been promoted to lisp.h.
16866 (x_allocate_bitmap_record, x_alloc_image_color)
16867 (make_image_cache, cache_image, xpm_load):
16868 Don't update size until alloc is done.
16869 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16870 (x_detect_edges):
16871 Check for size calculation overflow.
16872 (ct_colors_allocated_max): New constant.
16873 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16874 overflow.
16875
16876 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16877 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16878 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16879 Use ptrdiff_t, not int, to count maps.
16880 (read_char_minibuf_menu_prompt): Check for overflow in size
16881 calculations. Don't update size until allocation succeeds.
16882 Redo calculations to avoid overflow.
16883 * keyboard.h: Change prototypes to match the above.
16884
16885 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16886 to count maps.
16887 (current_minor_maps): Check for size calculation overflow.
16888 * keymap.h: Change prototypes to match the above.
16889
16890 * lread.c (read1, init_obarray): Don't update size until alloc done.
16891
16892 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16893 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16894
16895 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16896 Now ptrdiff_t, not int.
16897 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16898 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16899
16900 * process.c (Fnetwork_interface_list): Check for overflow
16901 in size calculation.
16902
16903 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16904
16905 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16906 overflow. Don't bother calling xmalloc when xrealloc will do.
16907
16908 * search.c (Freplace_match): Check for size calculation overflow.
16909 (Fset_match_data): Don't assume list lengths fit in 'int'.
16910
16911 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16912 for command line length. Do not attempt to address one before the
16913 beginning of an array, as that's not portable.
16914
16915 * term.c (max_frame_lines): Remove; unused.
16916 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16917 not int.
16918 (encode_terminal_code, calculate_costs): Check for size
16919 calculation overflow.
16920 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16921 table lengths and related sizes. Don't update size until alloc
16922 done. Redo calculations to avoid overflow.
16923 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16924
16925 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16926 subtracting pointers.
16927 (gobble_line): Check for overflow more carefully. Don't update size
16928 until alloc done.
16929
16930 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16931 Don't update size until alloc done.
16932 Redo size calculations to avoid overflow.
16933 Check for size calculation overflow.
16934 (main) [DEBUG]: Fix typo in invoking tparam1.
16935
16936 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16937 Use ptrdiff_t, not int, for sizes.
16938 (store_mode_line_noprop_char): Don't update size until alloc done.
16939
16940 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16941 Use ptrdiff_t, not int, for sizes.
16942 (Finternal_make_lisp_face, cache_face):
16943 Check for size calculation overflow.
16944 (cache_face): Treat size calculation overflows as if they were
16945 memory exhaustion (the usual treatment), rather than aborting.
16946
16947 * xfns.c (x_encode_text, x_set_name_internal)
16948 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16949 sizes, since they can exceed INT_MAX in size. Check for size
16950 calculation overflow.
16951
16952 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16953 (xg_select): Check for size calculation overflow.
16954 Don't update size until alloc done.
16955
16956 * xrdb.c (get_environ_db): Don't assume path length fits in int,
16957 as sprintf is limited to int lengths.
16958
16959 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16960 (X_LONG_MIN): New macros.
16961 Use them to make the following changes clearer.
16962 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16963 This change doesn't affect the value now, but it may help remind
16964 future maintainers not to raise the value too much later.
16965 (SELECTION_QUANTUM): Remove, replacing with ...
16966 (selection_quantum): ... new function, which avoids overflow.
16967 All uses changed.
16968 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16969 assumption that selection length fits in 'int'.
16970 (x_reply_selection_request, x_handle_selection_request)
16971 (x_get_window_property, receive_incremental_selection)
16972 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16973 (lisp_data_to_selection_data, clean_local_selection_data):
16974 Use ptrdiff_t, not int, to record length of selection.
16975 (x_reply_selection_request, x_get_window_property)
16976 (receive_incremental_selection, x_property_data_to_lisp):
16977 Redo calculations to avoid overflow.
16978 (x_reply_selection_request): When sending hint, ceiling it at
16979 X_LONG_MAX rather than relying on wraparound overflow to send
16980 something.
16981 (x_get_window_property, receive_incremental_selection)
16982 (lisp_data_to_selection_data, x_property_data_to_lisp):
16983 Check for size-calculation overflow.
16984 (x_get_window_property, receive_incremental_selection)
16985 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16986 Don't store size until memory allocation succeeds.
16987 (x_get_window_property): Plug memory leak on memory exhaustion.
16988 Don't double-block input; malloc is safe here. Don't assume 2**34
16989 - 4 fits in unsigned long. Add an xassert to check
16990 XGetWindowProperty overflow. Be more careful about overflow
16991 calculations, and distinguish size from memory overflow better.
16992 (receive_incremental_selection): When tracing, don't assume
16993 unsigned int is less than INT_MAX.
16994 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16995 harmful) conversions of unsigned short to int.
16996 (lisp_data_to_selection_data): Don't assume that integers
16997 in the range -65535 through -1 fit in an X unsigned short.
16998 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16999 result parameters unless successful. Rely on cons_to_unsigned
17000 to report problems with elements; the old code wasn't right anyway.
17001 (x_check_property_data): Check for int overflow; we cannot use
17002 a wider type due to X limits.
17003 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17004
17005 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17006
17007 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17008 (x_term_init): Check for size calculation overflow.
17009 (x_color_cells): Don't store size until memory allocation succeeds.
17010 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17011 Don't assume alloca size is less than MAX_ALLOCA.
17012 (x_term_init): Don't assume length fits in int (sprintf is limited
17013 to int size).
17014
17015 Use ptrdiff_t for composition IDs.
17016 * character.c (lisp_string_width):
17017 * composite.c (composition_table_size, n_compositions)
17018 (get_composition_id, composition_gstring_from_id):
17019 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17020 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17021 * window.c (Frecenter):
17022 Use ptrdiff_t, not int, for composition IDs.
17023 * composite.c (get_composition_id): Check for integer overflow.
17024 * composite.h: Adjust prototypes to match the above changes.
17025
17026 Use ptrdiff_t for hash table indexes.
17027 * category.c (hash_get_category_set):
17028 * ccl.c (ccl_driver):
17029 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17030 * coding.c (coding_system_charset_list, detect_coding_system):
17031 * coding.h (struct coding_system.id):
17032 * composite.c (get_composition_id, gstring_lookup_cache):
17033 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17034 * image.c (xpm_get_color_table_h):
17035 * lisp.h (hash_lookup, hash_put):
17036 * minibuf.c (Ftest_completion):
17037 Use ptrdiff_t for hash table indexes, not int (which is too
17038 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17039 32-bit --with-wide-int hosts).
17040
17041 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17042 Add a FIXME comment about memory leaks.
17043 (syms_of_charset): Don't assume xmalloc returns.
17044
17045 Don't assume that stated character widths fit in int.
17046 * character.c (Fchar_width, c_string_width, lisp_string_width):
17047 * character.h (CHAR_WIDTH):
17048 * indent.c (MULTIBYTE_BYTES_WIDTH):
17049 Use sanitize_char_width to avoid undefined and/or bad behavior
17050 with outlandish widths.
17051 * character.h (sanitize_tab_width): Rename from sanitize_width,
17052 now that we have two such functions. All uses changed.
17053 (sanitize_char_width): New inline function.
17054
17055 Don't assume that tab-width fits in int.
17056 * character.h (sanitize_width): New inline function.
17057 (SANE_TAB_WIDTH): New macro.
17058 (ASCII_CHAR_WIDTH): Use it.
17059 * indent.c (sane_tab_width): Remove. All uses replaced by
17060 SANE_TAB_WIDTH (current_buffer).
17061 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17062
17063 * fileio.c: Integer overflow issues with file modes.
17064 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17065
17066 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17067 Remove unreachable code.
17068 (read_hex, load_charset_map_from_file): Check for integer overflow.
17069
17070 * xterm.c: Don't go over XClientMessageEvent limit.
17071 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17072 (x_send_scroll_bar_event): Likewise. Check that the size does not
17073 exceed limits imposed by XClientMessageEvent, as well as the usual
17074 ptrdiff_t and size_t limits.
17075
17076 * keyboard.c: Overflow, signedness and related fixes.
17077 (make_lispy_movement): Use same integer type in forward decl
17078 that is used in the definition.
17079 (read_key_sequence, keyremap_step):
17080 Change bufsize argument back to int, undoing my 2011-03-30 change.
17081 We prefer signed types, and int is wide enough here.
17082 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17083 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17084 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17085 length, not size_t. Use ptrdiff_t for index, not int.
17086 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17087 possibility of integer overflow.
17088
17089 Overflow, signedness and related fixes for images.
17090
17091 * dispextern.h (struct it.stack[0].u.image.image_id)
17092 (struct_it.image_id, struct image.id, struct image_cache.size)
17093 (struct image_cache.used, struct image_cache.ref_count):
17094 * gtkutil.c (update_frame_tool_bar):
17095 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17096 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17097 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17098 * nsmenu.m (update_frame_tool_bar):
17099 * xdisp.c (calc_pixel_width_or_height):
17100 * xfns.c (image_cache_refcount):
17101 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17102 on typical 64-bit hosts.
17103
17104 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17105 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17106 Omit unnecessary casts to int.
17107 (parse_image_spec): Check that integers fall into 'int' range
17108 when the callers expect that.
17109 (image_ascent): Redo ascent calculation to avoid int overflow.
17110 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17111 (lookup_image): Remove unnecessary tests.
17112 (xbm_image_p): Locals are now of int, not EMACS_INT,
17113 since parse_image_check makes sure they fit into int.
17114 (png_load, gif_load, svg_load_image):
17115 Prefer int to unsigned where either will do.
17116 (tiff_handler): New function, combining the cores of the
17117 old tiff_error_handler and tiff_warning_handler.
17118 This function is rewritten to use vsnprintf and thereby avoid
17119 stack buffer overflows. It uses only the features of vsnprintf
17120 that are common to both POSIX and native Microsoft.
17121 (tiff_error_handler, tiff_warning_handler): Use it.
17122 (tiff_load, gif_load, imagemagick_load_image):
17123 Don't assume :index value fits in 'int'.
17124 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17125 (imagemagick_load_image): Check that crop parameters fit into
17126 the integer types that MagickCropImage accepts. Don't assume
17127 Vimagemagick_render_type has a nonnegative value. Don't assume
17128 size_t fits in 'long'.
17129 (gs_load): Use printmax_t to print the widest integers possible.
17130 Check for integer overflow when computing image height and width.
17131
17132 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17133
17134 * xdisp.c (redisplay_window): Don't force window start if point
17135 will be invisible in the resulting window. (Bug#9324)
17136
17137 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17138
17139 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17140 the display spec is of the form `(space ...)'.
17141 (handle_display_spec): Return the value returned by
17142 handle_single_display_spec, not just 1 or zero.
17143 (handle_single_display_spec): If the display spec is of the form
17144 `(space ...)', and specifies display in the text area, return 2
17145 rather than 1.
17146 (try_cursor_movement): Check for the need to scroll more
17147 accurately, and prefer exact match for point under bidi.
17148 Don't advance `row' beyond the last row of the window.
17149
17150 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17151 into disp_prop; all users changed.
17152
17153 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17154 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17155 for the text covered by the display property.
17156
17157 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17158
17159 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17160 Change return value to nil.
17161 (Frecord_buffer): Delete unused function.
17162
17163 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17164
17165 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17166 buffers, return left-to-right.
17167 (set_cursor_from_row): Consider candidate row a win if its glyph
17168 represents a newline and point is on that newline. Fixes cursor
17169 positioning on the newline at EOL of R2L text within L2R
17170 paragraph, and vice versa.
17171 (try_cursor_movement): Check continued rows, in addition to
17172 continuation rows. Fixes unwarranted scroll when point enters a
17173 continued line of R2L text within an L2R paragraph, or vice versa.
17174 (cursor_row_p): Consider the case of point being equal to
17175 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17176 from the end of a short line to the beginning of a continued line
17177 of R2L text within L2R paragraph.
17178 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17179 composed characters.
17180
17181 * bidi.c (bidi_check_type): Use xassert.
17182 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17183 members.
17184
17185 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17186
17187 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17188 a character.
17189
17190 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17191
17192 * nsfont.m (ns_otf_to_script): Fix typo.
17193
17194 2011-08-22 Kenichi Handa <handa@m17n.org>
17195
17196 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17197 extra slot even if the purpose is char-code-property-table.
17198
17199 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17200
17201 * xdisp.c (redisplay_window): When computing centering_position,
17202 account for the height of the header line. (Bug#8874)
17203
17204 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17205 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17206 candidate is selected by the mouse, and that candidate has a
17207 composed character under the mouse.
17208
17209 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17210 coordinates reported by pos-visible-in-window-p for a composed
17211 character in column zero.
17212
17213 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17214
17215 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17216
17217 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17218
17219 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17220 consider it a hit if to_charpos is anywhere in the range of the
17221 composed buffer positions.
17222
17223 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17224
17225 * image.c (gif_load): Don't assume that each subimage has the same
17226 dimensions as the base image. Handle disposal method that is
17227 "undefined" by the gif spec (Bug#9335).
17228
17229 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17230
17231 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17232 (Fcondition_case): Document `debug' symbol in error handler.
17233
17234 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17235
17236 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17237 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17238 from an Org mode buffer to a Speedbar frame.
17239
17240 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17241 a composition, take its buffer position from IT->cmp_it.charpos.
17242 Fixes cursor positioning at the beginning of a line that begins
17243 with a composed character.
17244
17245 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17246
17247 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17248 character bidirectional type, use STRONG_L instead. Fixes crashes
17249 in a buffer produced by `describe-categories'.
17250
17251 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17252 members before the level stack, so they would be saved and
17253 restored when copying iterator state. Fixes incorrect reordering
17254 around TABs covered by display properties.
17255
17256 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17257
17258 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17259
17260 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17261
17262 * eval.c (internal_condition_case, internal_condition_case_1)
17263 (internal_condition_case_2, internal_condition_case_n):
17264 Remove unnecessary aborts (Bug#9081).
17265
17266 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17267
17268 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17269 has no `load' handler, try opening the file locally. (Bug#9311)
17270
17271 2011-08-16 Ken Brown <kbrown@cornell.edu>
17272
17273 * gmalloc.c: Expand comment.
17274
17275 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17276
17277 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17278 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17279
17280 2011-08-16 Ken Brown <kbrown@cornell.edu>
17281
17282 Fix memory allocation problems in Cygwin build (Bug#9273).
17283
17284 * unexcw.c ( __malloc_initialized): Declare external variable.
17285 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17286
17287 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17288 New variables.
17289 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17290 dumped emacs.
17291 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17292 in the static heap.
17293 [CYGWIN] (special_realloc): New function.
17294 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17295 requests to realloc storage in the static heap.
17296
17297 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17298
17299 * bidi.c (bidi_initialize): Remove unused local.
17300
17301 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17302
17303 * bidimirror.h:
17304 * biditype.h: Remove file.
17305 * makefile.w32-in ($(BLD)/bidi.$(O)):
17306 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17307
17308 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17309
17310 * chartab.c: Improve commentary for the uniprop_table API.
17311
17312 * bidi.c (bidi_paragraph_init): Support zero value of
17313 bidi_ignore_explicit_marks_for_paragraph_level.
17314 (bidi_initialize): Use uniprop_table instead of including
17315 biditype.h and bidimirror.h.
17316
17317 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17318 coordinates of the iterator when restoring from ppos_it.
17319 (Bug#9296)
17320
17321 2011-08-14 Kenichi Handa <handa@m17n.org>
17322
17323 * process.c (create_process): Call setup_process_coding_systems
17324 after the pid of the process is set to -1 (Bug#8162).
17325
17326 2011-08-14 Eli Zaretskii <eliz@gnu.org>
17327
17328 * xdisp.c (move_it_in_display_line_to): Don't invoke
17329 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17330 ppos_it. Fixes vertical cursor motion when line beginning is
17331 covered by an image. (Bug#9296)
17332
17333 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17334
17335 * nsterm.h (ns_run_ascript): Declare.
17336 (NSAPP_DATA2_RUNASSCRIPT): Define.
17337
17338 * nsfns.m (as_script, as_result, as_status): New static variables.
17339 (ns_run_ascript): New function.
17340 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
17341 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17342 the event loop. Get status from as_status (Bug#7276).
17343
17344 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17345 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17346 the event loop (Bug#7276).
17347
17348 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17349
17350 * gnutls.c (QCgnutls_bootprop_priority)
17351 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17352 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17353 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17354 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17355 (QCgnutls_bootprop_verify_hostname_error)
17356 (QCgnutls_bootprop_callbacks_verify): Rename from
17357 Qgnutls_bootprop_..., all uses changed.
17358
17359 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17360 uses changed.
17361
17362 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17363
17364 * xfaces.c (Qframe_set_background_mode): Now static.
17365 * dispextern.h (Qframe_set_background_mode): Remove decl.
17366
17367 * process.c (Fnetwork_interface_info): Declare local only if needed.
17368
17369 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17370
17371 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17372 (Fnetwork_interface_list): Allocate in increments of bytes instead
17373 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17374 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17375 sockaddr.
17376 (struct ifflag_def): notrailers is smart on OSX.
17377 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17378 Get hardware address with getifaddrs if available.
17379
17380 2011-08-12 Eli Zaretskii <eliz@gnu.org>
17381
17382 * xdisp.c (iterate_out_of_display_property): xassert that
17383 IT->position is set to within IT->object's boundaries. Break from
17384 the loop as soon as EOB is reached; avoids infloops in redisplay
17385 when IT->position is set up wrongly due to some bug.
17386 Set IT->current to match the bidi iterator unconditionally.
17387 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17388 entry. Force push_it to save on the stack the current
17389 buffer/string position, to be restored by pop_it. Fix flags in
17390 the iterator structure wrt the object coming from a display
17391 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17392 properties. (Bug#9284)
17393
17394 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
17395
17396 * fontset.c (fontset_get_font_group): Add proper type checks.
17397 (Bug#9172)
17398
17399 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17400
17401 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17402 and LC_VERSION_MIN_MACOSX.
17403 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17404 (dump_it) [LC_FUNCTION_STARTS]: Use it.
17405
17406 2011-08-08 Eli Zaretskii <eliz@gnu.org>
17407
17408 * xdisp.c (forward_to_next_line_start): Allow to use the
17409 no-display-properties-and-no-overlays under bidi display.
17410 Set disp_pos in the bidi iterator to avoid searches for display
17411 properties and overlays.
17412
17413 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
17414
17415 * editfns.c (Fset_time_zone_rule): Document relationship with the
17416 setenv function.
17417
17418 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17419 the font entity extracted from the cache (Bug#8109).
17420
17421 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
17422
17423 * composite.c (autocmp_chars): Don't reset point. That is done by
17424 restore_point_unwind (Bug#5984).
17425
17426 2011-08-07 Juri Linkov <juri@jurta.org>
17427
17428 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17429 to show the arg `TIME' instead of `TIMEVAL'.
17430
17431 2011-08-06 Eli Zaretskii <eliz@gnu.org>
17432
17433 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17434 display property strides EOL and includes a newline, as in
17435 longlines-mode. (Bug#9254)
17436 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17437 word-wrap under bidirectional display. (Bug#9224)
17438
17439 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17440 is non-zero, even if the data buffer is NULL. Fixes a crash in
17441 vertical-motion with longlines-mode. (Bug#9254)
17442
17443 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17444
17445 * bidi.c <bidi_cache_total_alloc>: Now static.
17446 (bidi_initialize): Initialize bidi_cache_total_alloc.
17447
17448 * xdisp.c (display_line): Release buffer allocated for shelved bidi
17449 cache. (Bug#9221)
17450
17451 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17452 amount allocated this far in `bidi_cache_total_alloc'.
17453 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17454 non-zero, only free the data buffer without restoring the cache
17455 contents. All callers changed.
17456
17457 * dispextern.h (bidi_unshelve_cache): Update prototype.
17458
17459 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17460 (move_it_in_display_line, move_it_to)
17461 (move_it_vertically_backward, move_it_by_lines): Replace the call
17462 to xfree to an equivalent call to bidi_unshelve_cache.
17463 (move_it_in_display_line_to): Fix logic of returning
17464 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
17465
17466 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17467
17468 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17469 came from a string character with a `cursor' property. (Bug#9229)
17470
17471 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17472
17473 * Makefile.in (LIB_PTHREAD): New variable.
17474 (LIBES): Add LIB_PTHREAD (Bug#9216).
17475
17476 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17477 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17478
17479 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17480
17481 * regex.c (re_iswctype): Remove some redundant boolean conversions.
17482
17483 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17484
17485 * xterm.c (x_find_topmost_parent): New function.
17486 (x_set_frame_alpha): Find topmost parent window with
17487 x_find_topmost_parent and set the property there also (bug#9181).
17488 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17489
17490 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17491
17492 * callproc.c (Fcall_process): Avoid vfork clobbering
17493 the local vars buffer, coding_systems, current_dir.
17494
17495 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17496
17497 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17498
17499 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17500
17501 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17502 so that it is not optimized away.
17503
17504 * xdisp.c (compute_display_string_pos): Remove unused local.
17505
17506 2011-08-02 Eli Zaretskii <eliz@gnu.org>
17507
17508 Fix slow cursor motion and scrolling in large buffers with
17509 selective display, like Org Mode buffers. (Bug#9218)
17510
17511 * dispextern.h (struct bidi_it): New member disp_prop_p.
17512
17513 * xdisp.c: Remove one-slot cache of display string positions.
17514 (compute_display_string_pos): Accept an additional argument
17515 DISP_PROP_P; callers changed. Scan at most 5K characters forward
17516 for a display string or property. If found, set DISP_PROP_P
17517 non-zero.
17518
17519 * bidi.c (bidi_fetch_char): Accept an additional argument
17520 DISP_PROP_P, and pass it to compute_display_string_pos.
17521 Only handle text covered by a display string if DISP_PROP_P is returned
17522 non-zero. All callers of bidi_fetch_char changed.
17523
17524 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17525
17526 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17527
17528 2010-12-03 Don March <don@ohspite.net>
17529
17530 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17531 last character M-[char] is translated to ESC [char] (bug#7541).
17532
17533 2011-08-02 Kenichi Handa <handa@m17n.org>
17534
17535 * lisp.h (uniprop_table): Extern it.
17536
17537 * chartab.c (uniprop_table): Make it non-static.
17538
17539 2011-08-01 Eli Zaretskii <eliz@gnu.org>
17540
17541 * xdisp.c (forward_to_next_line_start): Accept additional argument
17542 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17543 on the newline.
17544 (reseat_at_next_visible_line_start): Use the bidi iterator state
17545 returned by forward_to_next_line_start to restore the state of
17546 it->bidi_it after backing up to previous newline. (Bug#9212)
17547
17548 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17549
17550 * regex.c (re_comp): Protoize.
17551 (re_exec): Fix return type.
17552 (regexec): Fix type of `ret'. (Bug#9203)
17553
17554 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17555
17556 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17557 This is needed if max-image-size is a floating-point number.
17558
17559 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17560
17561 * print.c (print_object): Print empty symbol as ##.
17562
17563 * lread.c (read1): Read ## as empty symbol.
17564
17565 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17566
17567 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17568 setting frame foreground color (Bug#9175).
17569 (x_set_background_color): Likewise.
17570
17571 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17572 contents (Bug#9176).
17573 (EmacsTooltip -init): Remove bezels and add shadows to
17574 tooltip windows.
17575
17576 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17577 or scroll bar (Bug#8470).
17578
17579 * nsfont.m (nsfont_open): Remove assignment to voffset and
17580 unnecessary vars hshink, expand, hd, full_height, min_height.
17581 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17582
17583 * nsterm.h (nsfont_info): Remove voffset field.
17584
17585 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17586
17587 Implement strike-through and overline on NextStep (Bug#8863).
17588
17589 * nsfont.m (nsfont_open): Use underline position provided by font,
17590 instead of hard-coded value of 2.
17591 (nsfont_draw): Call ns_draw_text_decoration instead.
17592
17593 * nsterm.h: Add declaration for ns_draw_text_decoration.
17594
17595 * nsterm.m (ns_draw_text_decoration): New function for drawing
17596 underline, overline, and strike-through.
17597 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17598 ns_draw_text_decoration. Change treatment of cursor drawing to
17599 accommodate underlining, etc.
17600
17601 2011-07-28 Eli Zaretskii <eliz@gnu.org>
17602
17603 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17604 default.
17605
17606 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17607
17608 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17609 Without this fix, if a signal arrives just after memory fills up,
17610 'malloc' might be invoked reentrantly.
17611
17612 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17613 In other words, assume that every image size is allowed, on non-X
17614 hosts. This assumption is probably wrong, but it lets Emacs compile.
17615
17616 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17617
17618 * regex.c (re_iswctype): Convert return values to boolean.
17619
17620 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17621
17622 * xdisp.c (compute_display_string_pos): Don't use cached display
17623 string position if the buffer had its restriction changed.
17624 (Bug#9184)
17625
17626 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17627
17628 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17629
17630 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17631
17632 Integer signedness and overflow and related fixes. (Bug#9079)
17633
17634 * bidi.c: Integer size and overflow fixes.
17635 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17636 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17637 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17638 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17639 (bidi_find_other_level_edge):
17640 Use ptrdiff_t instead of EMACS_INT where either will do.
17641 This works better on 32-bit hosts configured --with-wide-int.
17642 (bidi_cache_ensure_space): Check for size-calculation overflow.
17643 Use % rather than repeated addition, for better worst-case speed.
17644 Don't set bidi_cache_size until after xrealloc returns, because it
17645 might not return.
17646 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
17647 (bidi_cache_ensure_space): Also check that the bidi cache size
17648 does not exceed that of the largest Lisp string or buffer. See Eli
17649 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
17650
17651 * alloc.c (__malloc_size_t): Remove.
17652 All uses replaced by size_t. See Andreas Schwab's note
17653 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17654
17655 * image.c: Improve checking for integer overflow.
17656 (check_image_size): Assume that f is nonnull, since
17657 it is always nonnull in practice. This is one less thing to
17658 worry about when checking for integer overflow later.
17659 (x_check_image_size): New function, which checks for integer
17660 overflow issues inside X.
17661 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17662 This removes the need for a memory_full check.
17663 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17664 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17665 (xbm_read_bitmap_data): Change locals back to 'int', since
17666 their values must fit in 'int'.
17667 (xpm_load_image, png_load, tiff_load):
17668 Invoke x_create_x_image_and_pixmap earlier,
17669 to avoid much needless work if the image is too large.
17670 (tiff_load): Treat overly large images as if
17671 x_create_x_image_and_pixmap failed, not as malloc failures.
17672 (gs_load): Use x_check_image_size.
17673
17674 * gtkutil.c: Omit integer casts.
17675 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17676 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17677
17678 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17679
17680 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17681 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17682 would wrongly return t on a 64-bit host.
17683
17684 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17685 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17686 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17687 and therefore cause GCC to emit a bogus diagnostic in some cases.
17688
17689 * image.c: Integer signedness and overflow and related fixes.
17690 This is not an exhaustive set of fixes, but it's time to
17691 record what I've got.
17692 (lookup_pixel_color, check_image_size): Remove redundant decls.
17693 (check_image_size): Don't assume that arbitrary EMACS_INT values
17694 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17695 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17696 (tiff_load, imagemagick_load_image):
17697 Check for overflow in size calculations.
17698 (x_create_x_image_and_pixmap): Remove unnecessary test for
17699 xmalloc returning NULL; that can't happen.
17700 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17701 (xpm_color_bucket): Use better integer hashing function.
17702 (xpm_cache_color): Don't possibly over-allocate memory.
17703 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17704 (gif_memory_source):
17705 Use ptrdiff_t, not int or size_t, to record sizes.
17706 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17707 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17708 either works, as we prefer signed integers.
17709 (tiff_read_from_memory, tiff_write_from_memory):
17710 Return tsize_t, not size_t, since that's what the TIFF API wants.
17711 (tiff_read_from_memory): Don't fail simply because the read would
17712 go past EOF; instead, return a short read.
17713 (tiff_load): Omit no-longer-needed casts.
17714 (Fimagemagick_types): Don't assume size fits into 'int'.
17715
17716 Improve hashing quality when configured --with-wide-int.
17717 * fns.c (hash_string): New function, taken from sxhash_string.
17718 Do not discard information about ASCII character case; this
17719 discarding is no longer needed.
17720 (sxhash-string): Use it. Change sig to match it. Caller changed.
17721 * lisp.h: Declare it.
17722 * lread.c (hash_string): Remove, since we now use fns.c's version.
17723 The fns.c version returns a wider integer if --with-wide-int is
17724 specified, so this should help the quality of the hashing a bit.
17725
17726 * emacs.c: Integer overflow minor fix.
17727 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17728 Define only if GNU_LINUX.
17729 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17730
17731 * dispnew.c: Integer signedness and overflow fixes.
17732 Remove unnecessary forward decls, that were a maintenance hassle.
17733 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17734 All uses changed.
17735 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17736 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17737 (prepare_desired_row, line_draw_cost):
17738 Use int, not unsigned, where either works.
17739 (save_current_matrix, restore_current_matrix):
17740 Use ptrdiff_t, not size_t, where either works.
17741 (init_display): Check for overflow more accurately, and without
17742 relying on undefined behavior.
17743
17744 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17745 Remove, replacing with the new symbols in lisp.h. All uses changed.
17746 * fileio.c (make_temp_name):
17747 * filelock.c (lock_file_1, lock_file):
17748 * xdisp.c (message_dolog):
17749 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17750 Use pMd etc. instead.
17751 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17752 replacing the pWIDE etc. symbols removed from editfns.c.
17753
17754 * keyboard.h (num_input_events): Now uintmax_t.
17755 This is (very slightly) less likely to mess up due to wraparound.
17756 All uses changed.
17757
17758 * buffer.c: Integer signedness fixes.
17759 (alloc_buffer_text, enlarge_buffer_text):
17760 Use ptrdiff_t rather than size_t when either will do, as we prefer
17761 signed integers.
17762
17763 * alloc.c: Integer signedness and overflow fixes.
17764 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17765 (__malloc_size_t): Default to size_t, not to int.
17766 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17767 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17768 Prefer ptrdiff_t to size_t when either would do, as we prefer
17769 signed integers.
17770 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17771 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17772 Now const. Initialize with values that are in range even if char
17773 is signed.
17774 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17775 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17776 These functions do the right thing with sizes > 2**32.
17777 (check_depth): Now ptrdiff_t, not int.
17778 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17779 Adjust to new way of storing sizes. Check for size overflow bugs
17780 in rest of code.
17781 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17782 slightly wrong anyway, as it missed one instance of
17783 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17784 (refill_memory_reserve): Omit needless cast to size_t.
17785 (mark_object_loop_halt): Mark as externally visible.
17786
17787 * xselect.c: Integer signedness and overflow fixes.
17788 (Fx_register_dnd_atom, x_handle_dnd_message):
17789 Use ptrdiff_t, not size_t, since we prefer signed.
17790 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17791 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17792 x_dnd_atoms_size and x_dnd_atoms_length.
17793
17794 * doprnt.c: Prefer signed to unsigned when either works.
17795 * eval.c (verror):
17796 * doprnt.c (doprnt):
17797 * lisp.h (doprnt):
17798 * xdisp.c (vmessage):
17799 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17800 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17801 prefer signed arithmetic to avoid comparison confusion.
17802 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17803 but is a bit tricky.
17804
17805 Assume freestanding C89 headers, string.h, stdlib.h.
17806 * data.c, doprnt.c, floatfns.c, print.c:
17807 Include float.h unconditionally.
17808 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17809 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17810 * regex.c: Likewise for stddef.h, string.h.
17811 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17812 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17813 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17814 (STDC_HEADERS): Remove obsolete defines.
17815 * sysdep.c: Include limits.h unconditionally.
17816
17817 Assume support for memcmp, memcpy, memmove, memset.
17818 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17819 * regex.c (memcmp, memcpy):
17820 Remove; we assume C89 now.
17821
17822 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17823 (__malloc_safe_bcopy): Remove; no longer needed.
17824
17825 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
17826 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17827 well either way, and we prefer signed to unsigned.
17828
17829 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17830
17831 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17832 closes the connection while we're reading (bug#9182).
17833
17834 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
17835
17836 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17837 are specified (Bug#9168).
17838
17839 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17840
17841 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17842 Found by GCC static checking and --with-wide-int on a 32-bit host.
17843
17844 2011-07-25 Eli Zaretskii <eliz@gnu.org>
17845
17846 * xdisp.c (compute_display_string_pos): Fix logic of caching
17847 previous display string position. Initialize cached_prev_pos to
17848 -1. Fixes slow-down at the beginning of a buffer.
17849
17850 2011-07-24 Eli Zaretskii <eliz@gnu.org>
17851
17852 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17853 for attrs[LFACE_FONTSET_INDEX].
17854
17855 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17856
17857 * xml.c (parse_region): Remove unused local
17858 that was recently introduced.
17859
17860 2011-07-23 Eli Zaretskii <eliz@gnu.org>
17861
17862 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17863 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17864
17865 * xdisp.c (move_it_in_display_line_to): Record the best matching
17866 position for TO_CHARPOS while scanning the line, and restore it on
17867 exit if none of the characters scanned was an exact match.
17868 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
17869 when exact match is impossible due to invisible text, and the
17870 lines are truncated.
17871
17872 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17873
17874 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17875 for OSX >= 10.7.
17876
17877 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17878
17879 Fix a significant slow-down of cursor motion with C-n, C-p,
17880 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17881 auto-repeat under bidi redisplay in fontified buffers.
17882 * xdisp.c (compute_stop_pos_backwards): New function.
17883 (next_element_from_buffer): Call compute_stop_pos_backwards to
17884 find a suitable prev_stop when we find ourselves before
17885 base_level_stop.
17886 (reseat): Don't look for prev_stop, as that could mean a very long
17887 run.
17888 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17889 <cached_disp_overlay_modiff>: Cache for last found display string
17890 position.
17891 (compute_display_string_pos): Return the cached position if asked
17892 about the same buffer in the same area of character positions, and
17893 the buffer wasn't changed since the time the display string
17894 position was cached.
17895
17896 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17897
17898 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17899 is an integer, which is important for empty lines. (Bug#9149)
17900
17901 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
17902
17903 * frame.c (Fmodify_frame_parameters): In tty case, update the
17904 default face if necessary (Bug#4238).
17905
17906 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
17907
17908 * editfns.c (Fstring_to_char): No need to explain what a character
17909 is in the docstring (Bug#6576).
17910
17911 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17912
17913 * xml.c (parse_region): Make sure we always return a tree.
17914
17915 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17916
17917 * xml.c (parse_region): If a document contains only comments,
17918 return that, too.
17919
17920 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17921
17922 * xml.c (make_dom): Return comments, too.
17923
17924 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17925
17926 Port to OpenBSD.
17927 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17928 and the surrounding thread.
17929 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17930 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17931 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17932 timer goes off.
17933 * s/openbsd.h (BROKEN_SIGIO): Define.
17934 * unexelf.c (unexec) [__OpenBSD__]:
17935 Don't update the .mdebug section of the Alpha COFF symbol table.
17936
17937 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17938
17939 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17940 (bug#8460).
17941
17942 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17943
17944 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17945 This fixes some race conditions on the permissions of any newly
17946 created file.
17947
17948 * alloc.c (valid_pointer_p): Use pipe, not open.
17949 This fixes some permissions issues when debugging.
17950
17951 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17952 If fchown fails to set both uid and gid, try to set just gid,
17953 as that is sometimes allowed. Adjust the file's mode to eliminate
17954 setuid or setgid bits that are inappropriate if fchown fails.
17955
17956 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17957
17958 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17959 to compare Lisp_Objects.
17960 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17961 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17962 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17963
17964 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17965
17966 * lread.c (read_integer): Unread even EOF character.
17967 (read1): Likewise. Properly record start position of symbol.
17968
17969 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17970 symbol character follows.
17971
17972 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17973
17974 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17975 This works around a problem with the previous change to Fcopy_file.
17976 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17977 and without this change, GCC might complain about discarding
17978 fchown's return value.
17979
17980 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
17981
17982 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17983
17984 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17985
17986 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17987
17988 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17989
17990 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17991 it's used from the C level.
17992
17993 * process.c: Use the same condition for POLL_FOR_INPUT in both
17994 keyboard.c and process.c (bug#1858).
17995
17996 2011-07-09 Lawrence Mitchell <wence@gmx.li>
17997
17998 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17999 (Fgnutls_boot): Use it.
18000
18001 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18002
18003 * doc.c (Fsubstitute_command_keys): Revert last change.
18004
18005 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18006
18007 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18008 quotes the next character, and doesn't affect other longer
18009 sequences (bug#8935).
18010
18011 * lread.c (syms_of_lread): Clarify that is isn't only
18012 `eval-buffer' and `eval-defun' that's affected by
18013 `lexical-binding' (bug#8460).
18014
18015 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18016
18017 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18018 bidi redisplay when a line includes both an image and is truncated.
18019
18020 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18021
18022 Fix minor problems found by static checking.
18023 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18024 (elsz): Now a signed constant, not a size_t var. We prefer signed
18025 types to unsigned, to avoid integer comparison confusion. Without
18026 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18027 "cannot optimize loop, the loop counter may overflow", a symptom
18028 of the confusion.
18029 * indent.c (Fvertical_motion): Mark locals as initialized.
18030 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18031
18032 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18033
18034 * search.c (Fre_search_backward): Mention `case-fold-search' in
18035 all the re_search_* functions (bug#8138).
18036
18037 * keyboard.c (Fopen_dribble_file): Document when the file is
18038 closed (bug#8056).
18039
18040 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18041
18042 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18043 bidi_cache_idx.
18044
18045 Support bidi reordering of display and overlay strings.
18046 * xdisp.c (compute_display_string_pos)
18047 (compute_display_string_end): Accept additional argument STRING.
18048 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18049 (reseat_to_string): Initialize bidi_it->string.s and
18050 bidi_it->string.schars.
18051 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18052 NULL (avoids a crash in bidi_paragraph_init).
18053 Initialize itb.string.lstring.
18054 (init_iterator): Call bidi_init_it only of a valid
18055 buffer position was specified. Initialize paragraph_embedding to
18056 L2R.
18057 (reseat_to_string): Initialize the bidi iterator.
18058 (display_string): If we need to ignore text properties of
18059 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18060 original value of -1 will not work with bidi.)
18061 (compute_display_string_pos): First arg is now struct
18062 `text_pos *'; all callers changed. Support display properties on
18063 Lisp strings.
18064 (compute_display_string_end): Support display properties on Lisp
18065 strings.
18066 (init_iterator, reseat_1, reseat_to_string): Initialize the
18067 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18068 when iterating on a string not from display properties).
18069 (compute_display_string_pos, compute_display_string_end):
18070 Fix calculation of the object to scan. Fixes an error when using
18071 arrow keys.
18072 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18073 base_level_stop; instead, set base_level_stop to BEGV.
18074 Fixes crashes in vertical-motion.
18075 (next_element_from_buffer): Improve commentary for when
18076 the iterator is before prev_stop.
18077 (init_iterator): Initialize bidi_p from the default value of
18078 bidi-display-reordering, not from buffer-local value. Use the
18079 buffer-local value only if initializing for buffer iteration.
18080 (handle_invisible_prop): Support invisible properties on strings
18081 that are being bidi-reordered.
18082 (set_iterator_to_next): Support bidi reordering of C strings and
18083 Lisp strings.
18084 (next_element_from_string): Support bidi reordering of Lisp
18085 strings.
18086 (handle_stop_backwards): Support Lisp strings as well.
18087 (display_string): Support display of R2L glyph rows.
18088 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18089 (init_iterator): Don't initialize it->bidi_p for strings
18090 here.
18091 (reseat_to_string): Initialize it->bidi_p for strings here.
18092 (next_element_from_string, next_element_from_c_string)
18093 (next_element_from_buffer): Add xassert's for correspondence
18094 between IT's object being iterated and it->bidi_it.string
18095 structure.
18096 (face_before_or_after_it_pos): Support bidi iteration.
18097 (next_element_from_c_string): Handle the case of the first string
18098 character that is not the first one in the visual order.
18099 (get_visually_first_element): New function, refactored from common
18100 parts of next_element_from_buffer, next_element_from_string, and
18101 next_element_from_c_string.
18102 (tool_bar_lines_needed, redisplay_tool_bar)
18103 (display_menu_bar): Force left-to-right direction. Add a FIXME
18104 comment for making that be controlled by a user option.
18105 (push_it, pop_it): Save and restore the state of the
18106 bidi iterator. Save and restore the bidi_p flag.
18107 (pop_it): Iterate out of display property for string iteration as
18108 well.
18109 (iterate_out_of_display_property): Support iteration over strings.
18110 (handle_single_display_spec): Set up it->bidi_it for iteration
18111 over a display string, and call bidi_init_it.
18112 (handle_single_display_spec, next_overlay_string)
18113 (get_overlay_strings_1, push_display_prop): Set up the bidi
18114 iterator for displaying display or overlay strings.
18115 (forward_to_next_line_start): Don't use the shortcut if
18116 bidi-iterating.
18117 (back_to_previous_visible_line_start): If handle_display_prop
18118 pushed the iterator stack, restore the internal state of the bidi
18119 iterator by calling bidi_pop_it same number of times.
18120 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18121 and we are bidi-iterating, don't decrement the iterator position;
18122 instead, set the first_elt flag in the bidi iterator, to produce
18123 the same effect.
18124 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18125 (push_display_prop): xassert that we are iterating a buffer.
18126 (push_it, pop_it): Save and restore paragraph_embedding member.
18127 (handle_single_display_spec, next_overlay_string)
18128 (get_overlay_strings_1, reseat_1, reseat_to_string)
18129 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18130 correctly. Don't assume unibyte strings are not bidi-reordered.
18131 (compute_display_string_pos)
18132 (compute_display_string_end): Fix handling the case of C string.
18133 (push_it, pop_it): Save and restore from_disp_prop_p.
18134 (handle_single_display_spec, push_display_prop): Set the
18135 from_disp_prop_p flag.
18136 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18137 (pop_it): Call iterate_out_of_display_property only if we are
18138 popping after iteration over a string that came from a display
18139 property. Fix a typo in popping stretch info. Add an assertion
18140 for verifying that the iterator position is in sync with the bidi
18141 iterator.
18142 (handle_single_display_spec, get_overlay_strings_1)
18143 (push_display_prop): Fix initialization of paragraph direction for
18144 string when that of the parent object is not yet determined.
18145 (reseat_1): Call bidi_init_it to resync the bidi
18146 iterator with IT's position. (Bug#7616)
18147 (find_row_edges): If ROW->start.pos gives position
18148 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18149 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18150 Reset the from_disp_prop_p flag.
18151 (SAVE_IT, RESTORE_IT): New macros.
18152 (pos_visible_p, face_before_or_after_it_pos)
18153 (back_to_previous_visible_line_start)
18154 (move_it_in_display_line_to, move_it_in_display_line)
18155 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18156 (try_scrolling, redisplay_window, display_line): Use them when
18157 saving a temporary copy of the iterator and restoring it back.
18158 (back_to_previous_visible_line_start, reseat_1)
18159 (init_iterator): Empty the bidi cache "stack".
18160 (move_it_in_display_line_to): If iterator ended up at
18161 EOL, but we never saw any buffer positions smaller than
18162 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18163 motion in bidi-reordered lines.
18164 (move_it_in_display_line_to): Record prev_method and prev_pos
18165 immediately before the call to set_iterator_to_next. Fixes cursor
18166 motion in bidi-reordered lines with stretch glyphs and strings
18167 displayed in margins. (Bug#8133) (Bug#8867)
18168 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18169 TO_CHARPOS.
18170 (pos_visible_p): Support positions in bidi-reordered lines.
18171 Save and restore bidi cache.
18172
18173 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18174 (bidi_paragraph_info): Delete unused struct.
18175 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18176 (bidi_cache_start): New variable.
18177 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18178 to zero.
18179 (bidi_cache_fetch_state, bidi_cache_search)
18180 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18181 (bidi_cache_find, bidi_peek_at_next_level)
18182 (bidi_level_of_next_char, bidi_find_other_level_edge)
18183 (bidi_move_to_visually_next): Compare cache index with
18184 bidi_cache_start rather than with zero.
18185 (bidi_fetch_char): Accept new argument STRING; all callers
18186 changed. Support iteration over a string. Support strings with
18187 display properties. Support unibyte strings. Fix the type of
18188 `len' according to what STRING_CHAR_AND_LENGTH expects.
18189 (bidi_paragraph_init, bidi_resolve_explicit_1)
18190 (bidi_resolve_explicit, bidi_resolve_weak)
18191 (bidi_level_of_next_char, bidi_move_to_visually_next):
18192 Support iteration over a string.
18193 (bidi_set_sor_type, bidi_resolve_explicit_1)
18194 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18195 can now be zero (for strings); special values 0 and -1 were
18196 changed to -1 and -2, respectively.
18197 (bidi_char_at_pos): New function.
18198 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18199 Call it instead of FETCH_MULTIBYTE_CHAR.
18200 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18201 initialized to valid values.
18202 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18203 values.
18204 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18205 the test for valid cached positions. Fix the logic for looking up
18206 the sentinel state in the cache. GCPRO the Lisp string we are
18207 iterating.
18208 (bidi_push_it, bidi_pop_it): New functions.
18209 (bidi_initialize): Initialize the bidi cache start stack pointer.
18210 (bidi_cache_ensure_space): New function, refactored from part of
18211 bidi_cache_iterator_state. Don't assume the required size is just
18212 one BIDI_CACHE_CHUNK away.
18213 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18214 (bidi_count_bytes, bidi_char_at_pos): New functions.
18215 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18216 always valid if bidi_cache_idx is valid.
18217 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18218 is valid if it's going to be used.
18219 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18220 (bidi_cache_fetch_state, bidi_cache_search)
18221 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18222 (bidi_cache_iterator_state, bidi_cache_find)
18223 (bidi_find_other_level_edge, bidi_cache_start_stack):
18224 All variables related to cache indices are now EMACS_INT.
18225
18226 * dispextern.h (struct bidi_string_data): New structure.
18227 (struct bidi_it): New member `string'. Make flag members be 1-bit
18228 fields, and put them last in the struct.
18229 (compute_display_string_pos, compute_display_string_end):
18230 Update prototypes.
18231 (bidi_push_it, bidi_pop_it): Add prototypes.
18232 (struct iterator_stack_entry): New members bidi_p,
18233 paragraph_embedding, and from_disp_prop_p.
18234 (struct it): Member bidi_p is now a bit field 1 bit wide.
18235 (bidi_shelve_cache, bidi_unshelve_cache):
18236 Declare prototypes.
18237
18238 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18239 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18240 and vector-like objects.
18241
18242 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18243 cache around display iteration.
18244
18245 * window.c (Fwindow_end, window_scroll_pixel_based)
18246 (displayed_window_lines, Frecenter): Save and restore the bidi
18247 cache around display iteration.
18248
18249 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18250
18251 * editfns.c (Fdelete_region): Clarify the use of the named
18252 parameters (bug#6788).
18253
18254 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18255
18256 * indent.c (Fvertical_motion): Set and restore w->pointm when
18257 saving and restoring the window's buffer (Bug#9006).
18258
18259 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18260
18261 * editfns.c (Fstring_to_char): Clarify just what is returned
18262 (bug#6576). Text by Eli Zaretskii.
18263
18264 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18265
18266 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18267
18268 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18269
18270 * buffer.c (mmap_find): Fix a typo.
18271
18272 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18273
18274 Fix execution of x selection hooks.
18275 * xselect.c (Qx_lost_selection_functions)
18276 (Qx_sent_selection_functions): New vars.
18277 (syms_of_xselect): DEFSYM them.
18278 (x_handle_selection_request): Pass Qx_sent_selection_functions
18279 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18280 (x_handle_selection_clear,x_clear_frame_selections):
18281 Pass Qx_lost_selection_functions rather than
18282 Vx_lost_selection_functions to Frun_hook_with_args.
18283
18284 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18285
18286 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18287 The old code sometimes used this field without initializing it.
18288
18289 * alloc.c (gc_sweep): Don't read past end of array.
18290 In theory, the old code could also have corrupted Emacs internals,
18291 though it'd be very unlikely.
18292
18293 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18294
18295 * character.c (Fcharacterp): Don't advertise optional ignored
18296 argument. (Bug#4026)
18297
18298 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18299
18300 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18301 key" (bug#4257).
18302
18303 * window.c (Fset_window_start): Doc fix (bug#4199).
18304 (Fset_window_hscroll): Ditto.
18305
18306 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18307
18308 Fix minor new problems caught by GCC 4.6.1.
18309 * term.c (init_tty): Remove unused local.
18310 * xsettings.c (store_monospaced_changed): Define this function only
18311 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18312 not used otherwise.
18313
18314 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18315
18316 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18317
18318 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18319
18320 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18321 are the mini-buffer and the echo area (bug#3320).
18322
18323 * term.c (init_tty): Remove support for supdup, c10 and perq
18324 terminals, which are no longer supported (bug#1482).
18325
18326 2011-07-10 Johan Bockgård <bojohan@gnu.org>
18327
18328 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18329
18330 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18331
18332 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18333 for non-popups (Bug#3642).
18334
18335 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18336
18337 * alloc.c (reset_malloc_hooks): Protoize.
18338 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
18339 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18340 * cm.c (losecursor): Likewise.
18341 * data.c (fmod): Likewise.
18342 * dispnew.c (swap_glyphs_in_rows): Likewise.
18343 * emacs.c (memory_warning_signal): Likewise.
18344 * floatfns.c (float_error): Likewise.
18345 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18346 (otf_open, font_otf_capability, generate_otf_features)
18347 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18348 Likewise.
18349 * image.c (pbm_read_file): Likewise.
18350 * indent.c (string_display_width): Likewise.
18351 * intervals.c (check_for_interval, search_for_interval)
18352 (inc_interval_count, count_intervals, root_interval)
18353 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18354 * lread.c (defalias): Likewise.
18355 * ralloc.c (r_alloc_check): Likewise.
18356 * regex.c (set_image_of_range_1, set_image_of_range)
18357 (regex_grow_registers): Likewise.
18358 * sysdep.c (strerror): Likewise.
18359 * termcap.c (valid_filename_p, tprint, main): Likewise.
18360 * tparam.c (main): Likewise.
18361 * unexhp9k800.c (run_time_remap, save_data_space)
18362 (update_file_ptrs, read_header, write_header, calculate_checksum)
18363 (copy_file, copy_rest, display_header): Likewise.
18364 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18365 Likewise.
18366 * xdisp.c (check_it): Likewise.
18367 * xfaces.c (register_color, unregister_color, unregister_colors):
18368 Likewise.
18369 * xfns.c (print_fontset_result): Likewise.
18370 * xrdb.c (member, fatal, main): Likewise.
18371
18372 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18373
18374 Fix minor problems found by static checking (Bug#9031).
18375 * chartab.c (char_table_set_range, map_sub_char_table):
18376 Remove unused locals.
18377 (uniprop_table): Now static.
18378 * composite.c (_work_char): Remove unused static var.
18379
18380 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
18381
18382 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18383
18384 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18385
18386 * gtkutil.c (qttip_cb): Remove code without function.
18387
18388 2011-07-09 Eli Zaretskii <eliz@gnu.org>
18389
18390 * w32.c (pthread_sigmask): New stub.
18391
18392 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
18393
18394 Use pthread_sigmask, not sigprocmask (Bug#9010).
18395 sigprocmask is portable only for single-threaded applications, and
18396 Emacs can be multi-threaded when it uses GTK.
18397 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18398 (LIBES): Use it.
18399 * callproc.c (Fcall_process):
18400 * process.c (create_process):
18401 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18402 Use pthread_sigmask, not sigprocmask.
18403
18404 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18405
18406 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18407 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18408 wrong (Bug#8591).
18409
18410 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18411
18412 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18413 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18414 (xg_hide_tooltip): Fix comment.
18415
18416 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18417 in registerServicesMenuSendTypes.
18418 (validRequestorForSendType): Don't check ns_return_types.
18419
18420 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18421 ns_return_type.
18422
18423 2011-07-08 Jason Rumney <jasonr@gnu.org>
18424
18425 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18426 SH_SHOW for hidden windows (Bug#5482).
18427
18428 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18429 frame struct members of non-existent frames (Bug#6284).
18430
18431 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18432
18433 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18434 variable firstTime not needed on OSX >= 10.6.
18435 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18436 >= 10.5. Use setKnobProportion, setDoubleValue.
18437
18438 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18439 (MAC_OS_X_VERSION_10_5): Define if not defined.
18440 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18441 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18442 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18443
18444 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
18445 cString and lossyCString on OSX >= 10.4.
18446
18447 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
18448 sizeToFit on OSX >= 10.2.
18449
18450 * nsimage.m (allocInitFromFile): Don't use deprecated method
18451 bestRepresentationForDevice on OSX >= 10.6.
18452
18453 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18454 to avoid warning.
18455
18456 * emacs.c: Declare unexec_init_emacs_zone.
18457
18458 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18459
18460 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18461
18462 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18463 on svcsMenu (Bug#8842).
18464
18465 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18466 ns_return_types.
18467 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18468
18469 * nsterm.m (QUTF8_STRING): Declare.
18470 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18471 (validRequestorForSendType): Return type is (id).
18472 Change indexOfObjectIdenticalTo to indexOfObject.
18473 Check if we have local selection before returning self (Bug#8842).
18474 (writeSelectionToPasteboard): Put local selection into paste board
18475 if we have a local selection (Bug#8842).
18476 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18477
18478 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18479 (ns_get_local_selection): Declare.
18480
18481 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18482
18483 * keymap.c (describe_map_tree): Don't insert a double newline at
18484 the end of the buffer (bug#1169) and return whether we inserted
18485 something.
18486
18487 * callint.c (Fcall_interactively): Change "reading args" to
18488 "providing args" to try to clarify what it does (bug#1010).
18489
18490 2011-07-07 Kenichi Handa <handa@m17n.org>
18491
18492 * composite.c (composition_compute_stop_pos): Ignore a static
18493 composition starting before CHARPOS (Bug#8915).
18494
18495 * xdisp.c (handle_composition_prop): Likewise.
18496
18497 2011-07-07 Eli Zaretskii <eliz@gnu.org>
18498
18499 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18500 (Bug#9015)
18501
18502 2011-07-07 Kenichi Handa <handa@m17n.org>
18503
18504 * character.h (unicode_category_t): New enum type.
18505
18506 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18507 (Qchar_code_property_table): New variable.
18508 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18509 (UNIPROP_COMPRESSED_FORM_P): New macros.
18510 (char_table_ascii): Uncompress the compressed values.
18511 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18512 Uncompress the compressed values.
18513 (sub_char_table_ref_and_range): Likewise.
18514 (char_table_ref_and_range): Uncompress the compressed values.
18515 (sub_char_table_set): New arg is_uniprop. Callers changed.
18516 Uncompress the compressed values.
18517 (sub_char_table_set_range): Args changed. Callers changed.
18518 (char_table_set_range): Adjuted for the above change.
18519 (map_sub_char_table): Delete args default_val and parent. Add arg
18520 top. Give decoded values to a Lisp function.
18521 (map_char_table): Adjust for the above change. Give decoded
18522 values to a Lisp function. Gcpro more variables.
18523 (uniprop_table_uncompress)
18524 (uniprop_decode_value_run_length): New functions.
18525 (uniprop_decoder, uniprop_decoder_count): New variables.
18526 (uniprop_get_decoder, uniprop_encode_value_character)
18527 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18528 New functions.
18529 (uniprop_encoder, uniprop_encoder_count): New variables.
18530 (uniprop_get_encoder, uniprop_table)
18531 (Funicode_property_table_internal, Fget_unicode_property_internal)
18532 (Fput_unicode_property_internal): New functions.
18533 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18534 Sunicode_property_table_internal, Sget_unicode_property_internal,
18535 and Sput_unicode_property_internal. Defvar_lisp
18536 char-code-property-alist.
18537
18538 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
18539 Vunicode_category_table.
18540
18541 * font.c (font_range): Adjust for the change of
18542 Vunicode_category_table.
18543
18544 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18545
18546 * m/iris4d.h: Remove file, move contents ...
18547 * s/irix6-5.h: ... here.
18548
18549 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18550
18551 Remove unportable assumption about struct layout (Bug#8884).
18552 * alloc.c (mark_buffer):
18553 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18554 (clone_per_buffer_values): Don't assume that
18555 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18556 This isn't true in general, and it's particularly not true
18557 if Emacs is configured with --with-wide-int.
18558 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18559 New macros, used in the buffer.c change.
18560
18561 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18562
18563 * xsettings.c: Use both GConf and GSettings if both are available.
18564 (store_config_changed_event): Add comment.
18565 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18566 (store_tool_bar_style_changed): New functions.
18567 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
18568 (struct xsettings): Move font inside HAVE_XFT.
18569 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
18570 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
18571 Move inside HAVE_XFT.
18572 (something_changed_gsettingsCB): Rename from something_changedCB.
18573 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18574 also.
18575 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
18576 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
18577 (something_changed_gconfCB): Rename from something_changedCB.
18578 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18579 (parse_settings): Move check for font inside HAVE_XFT.
18580 (read_settings, apply_xft_settings): Add comment.
18581 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18582 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18583 call store_font_name_changed.
18584 (xft_settings_event): Add comment.
18585 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18586 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18587 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18588 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18589 (xsettings_initialize): Call init_gsettings last.
18590 (xsettings_get_system_font, xsettings_get_system_normal_font):
18591 Add comment.
18592
18593 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18594
18595 Random fixes. E.g., (random) never returned negative values.
18596 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18597 subseconds part to the entropy, as that's a bit more random.
18598 Prefer signed to unsigned, since the signedness doesn't matter and
18599 in general we prefer signed. When given a limit, use a
18600 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18601 latter isn't right if USE_2_TAGS_FOR_INTS.
18602 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18603 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18604
18605 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18606
18607 * textprop.c (text_property_stickiness):
18608 Obey Vtext_property_default_nonsticky.
18609 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18610 * w32fns.c (syms_of_w32fns):
18611 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18612
18613 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18614
18615 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18616 This is more efficient than Ffile_directory_p and avoids a minor race.
18617
18618 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18619
18620 * buffer.c (Foverlay_put): Say what the return value is
18621 (bug#7835).
18622
18623 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18624 is a directory before asking whether to use the file name
18625 (bug#7564).
18626 (barf_or_query_if_file_exists): Make the "File is a directory"
18627 error be more correct.
18628
18629 * fns.c (Frequire): Remove the mention of the .gz files, since
18630 that's installation-specific, but keep the mention of
18631 `get-load-suffixes'.
18632
18633 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18634
18635 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18636 Report string overflow if the output is too long.
18637
18638 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
18639
18640 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18641 (syms_of_gnutls): Remove duplicate DEFSYM for
18642 Qgnutls_bootprop_verify_hostname_error, an error for
18643 Qgnutls_bootprop_verify_error (which is no longer used).
18644
18645 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18646 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18647 Also (re)move comments that are misplaced or no longer relevant.
18648
18649 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18650
18651 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18652
18653 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
18654
18655 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18656 and background color parameters if they have been changed.
18657
18658 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18659
18660 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18661
18662 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18663
18664 * xsettings.c (SYSTEM_FONT): Define only when used.
18665 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18666
18667 * keymap.c (access_keymap_1): Now static.
18668
18669 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
18670
18671 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18672 leave any prefix arg for the up event (Bug#1586).
18673
18674 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18675
18676 * lread.c (syms_of_lread): Mention single symbols defined by
18677 `defvar' or `defconst' (bug#7154).
18678
18679 * fns.c (Frequire): Mention .el.gz files (bug#7314).
18680 (Frequire): Mention get-load-suffixes.
18681
18682 2011-07-02 Martin Rudalics <rudalics@gmx.at>
18683
18684 * window.h (window): Remove clone_number slot.
18685 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18686 Remove.
18687 (make_parent_window, make_window, saved_window)
18688 (Fset_window_configuration, save_window_save): Don't deal with
18689 clone numbers.
18690 * buffer.c (Qclone_number): Remove declaration.
18691 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18692
18693 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18694
18695 Add multiple inheritance to keymaps.
18696 * keymap.c (Fmake_composed_keymap): New function.
18697 (Fset_keymap_parent): Simplify.
18698 (fix_submap_inheritance): Remove.
18699 (access_keymap_1): New function extracted from access_keymap to handle
18700 embedded parents and handle lists of maps.
18701 (access_keymap): Use it.
18702 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18703 (Fcopy_keymap): Handle embedded parents.
18704 (Fcommand_remapping, define_as_prefix): Simplify.
18705 (Fkey_binding): Simplify.
18706 (syms_of_keymap): Move minibuffer-local-completion-map,
18707 minibuffer-local-filename-completion-map,
18708 minibuffer-local-must-match-map, and
18709 minibuffer-local-filename-must-match-map to Elisp.
18710 (syms_of_keymap): Defsubr make-composed-keymap.
18711 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18712 (parse_menu_item): Trivial simplification.
18713
18714 2011-07-01 Glenn Morris <rgm@gnu.org>
18715
18716 * Makefile.in (SETTINGS_LIBS): Fix typo.
18717
18718 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
18719
18720 * coding.c (Fencode_coding_string): Record the last coding system
18721 used, as the function doc string says (bug#8738).
18722
18723 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18724
18725 * xsettings.c (store_monospaced_changed): Take new font as arg and
18726 check for change against current_mono_font.
18727 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18728 (emacs_settings_constructor, emacs_settings_get_property)
18729 (emacs_settings_set_property, emacs_settings_class_init)
18730 (emacs_settings_init, gsettings_obj): Remove.
18731 (something_changedCB): New function for HAVE_GSETTINGS.
18732 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18733 with value as argument.
18734 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18735 g_settings_new (Bug#8967). Do not create gsettings_obj.
18736 Remove calls to g_settings_bind. Connect something_changedCB to
18737 "changed".
18738
18739 * xgselect.c: Add defined (HAVE_GSETTINGS).
18740 (xgselect_initialize): Ditto.
18741
18742 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18743 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18744 xg_select.
18745
18746 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18747
18748 * eval.c (struct backtrace): Simplify and port the data structure.
18749 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18750 signed bit field, as this assumption is not portable and it makes
18751 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18752 "char debug_on_exit : 1" as this is not portable either; instead,
18753 use the portable "unsigned int debug_on_exit : 1". Remove unused
18754 member evalargs. Remove obsolete comments about cc bombing out.
18755
18756 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18757
18758 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
18759 Let HAVE_GSETTINGS override HAVE_GCONF.
18760 (store_monospaced_changed): New function.
18761 (EMACS_SETTINGS): A new type derived from GObject to handle
18762 GSettings notifications.
18763 (emacs_settings_constructor, emacs_settings_get_property)
18764 (emacs_settings_set_property, emacs_settings_class_init):
18765 New functions.
18766 (gsettings_client, gsettings_obj): New variables.
18767 (GSETTINGS_SCHEMA): New define.
18768 (something_changedCB): Call store_monospaced_changed.
18769 (init_gsettings): New function.
18770 (xsettings_initialize): Call init_gsettings.
18771 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18772 to NULL.
18773
18774 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
18775 GCONF_CFLAGS/LIBS.
18776
18777 2011-06-29 Martin Rudalics <rudalics@gmx.at>
18778
18779 * window.c (resize_root_window, grow_mini_window)
18780 (shrink_mini_window): Rename Qresize_root_window to
18781 Qwindow_resize_root_window and Qresize_root_window_vertically to
18782 Qwindow_resize_root_window_vertically.
18783
18784 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18785
18786 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18787
18788 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
18789
18790 * makefile.w32-in: Redesign dependencies so they reflect more
18791 clearly which files are directly included by each source file,
18792 and not through other includes.
18793
18794 2011-06-27 Martin Rudalics <rudalics@gmx.at>
18795
18796 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18797 (sort_overlays, overlay_strings): When an overlay's clone number
18798 matches the window's clone number process the overlay even if
18799 the overlay's window property doesn't match the current window.
18800
18801 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18802 (Fwindow_hchild): Rename to Fwindow_left_child.
18803 (Fwindow_next): Rename to Fwindow_next_sibling.
18804 (Fwindow_prev): Rename to Fwindow_prev_sibling.
18805 (resize_window_check): Rename to window_resize_check.
18806 (resize_window_apply): Rename to window_resize_apply.
18807 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18808 (Fdelete_other_windows_internal, resize_frame_windows)
18809 (Fsplit_window_internal, Fdelete_window_internal)
18810 (grow_mini_window, shrink_mini_window)
18811 (Fresize_mini_window_internal): Fix callers accordingly.
18812
18813 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18814
18815 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18816 (emacs_fixed_set_min_size): Remove.
18817 (emacs_fixed_new): Take frame as argument.
18818
18819 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18820 (_EmacsFixedPrivate): Remove minwidth/height.
18821 Add struct frame *f.
18822 (emacs_fixed_init): Initialize priv->f.
18823 (get_parent_class, emacs_fixed_set_min_size): Remove.
18824 (emacs_fixed_new): Set priv->f to argument.
18825 (emacs_fixed_get_preferred_width)
18826 (emacs_fixed_get_preferred_height): Use min_width/height from
18827 frames size_hint to set minimum and natural (Bug#8919).
18828 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18829 and use min_width/height from frames size_hint to set
18830 min_width/height (Bug#8919).
18831
18832 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
18833 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18834 Fix indentation.
18835
18836 2011-06-26 Eli Zaretskii <eliz@gnu.org>
18837
18838 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18839 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18840 called at ZV.
18841
18842 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
18843
18844 * process.c (wait_reading_process_output): Bypass select if
18845 waiting for a cell while ignoring keyboard input, and input is
18846 pending. Suggested by Jan Djärv (Bug#8869).
18847
18848 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18849
18850 Use gnulib's dup2 module instead of rolling our own.
18851 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18852
18853 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18854
18855 * dispnew.c (scrolling_window): Before scrolling, turn off a
18856 mouse-highlight in the window being scrolled.
18857
18858 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
18859
18860 Move DEFSYM to lisp.h and use everywhere.
18861
18862 * character.h (DEFSYM): Move declaration...
18863 * lisp.h (DEFSYM): ...here.
18864
18865 * gnutls.c:
18866 * minibuf.c:
18867 * w32menu.c:
18868 * w32proc.c:
18869 * w32select.c: Don't include character.h.
18870
18871 * alloc.c (syms_of_alloc):
18872 * buffer.c (syms_of_buffer):
18873 * bytecode.c (syms_of_bytecode):
18874 * callint.c (syms_of_callint):
18875 * casefiddle.c (syms_of_casefiddle):
18876 * casetab.c (init_casetab_once):
18877 * category.c (init_category_once, syms_of_category):
18878 * ccl.c (syms_of_ccl):
18879 * cmds.c (syms_of_cmds):
18880 * composite.c (syms_of_composite):
18881 * dbusbind.c (syms_of_dbusbind):
18882 * dired.c (syms_of_dired):
18883 * dispnew.c (syms_of_display):
18884 * doc.c (syms_of_doc):
18885 * editfns.c (syms_of_editfns):
18886 * emacs.c (syms_of_emacs):
18887 * eval.c (syms_of_eval):
18888 * fileio.c (syms_of_fileio):
18889 * fns.c (syms_of_fns):
18890 * frame.c (syms_of_frame):
18891 * fringe.c (syms_of_fringe):
18892 * insdel.c (syms_of_insdel):
18893 * keymap.c (syms_of_keymap):
18894 * lread.c (init_obarray, syms_of_lread):
18895 * macros.c (syms_of_macros):
18896 * msdos.c (syms_of_msdos):
18897 * print.c (syms_of_print):
18898 * process.c (syms_of_process):
18899 * search.c (syms_of_search):
18900 * sound.c (syms_of_sound):
18901 * syntax.c (init_syntax_once, syms_of_syntax):
18902 * terminal.c (syms_of_terminal):
18903 * textprop.c (syms_of_textprop):
18904 * undo.c (syms_of_undo):
18905 * w32.c (globals_of_w32):
18906 * window.c (syms_of_window):
18907 * xdisp.c (syms_of_xdisp):
18908 * xfaces.c (syms_of_xfaces):
18909 * xfns.c (syms_of_xfns):
18910 * xmenu.c (syms_of_xmenu):
18911 * xsettings.c (syms_of_xsettings):
18912 * xterm.c (syms_of_xterm): Use DEFSYM.
18913
18914 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18915
18916 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
18917
18918 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18919
18920 Integer and buffer overflow fixes (Bug#8873).
18921
18922 * print.c (printchar, strout): Check for string overflow.
18923 (PRINTPREPARE, printchar, strout):
18924 Don't set size unless allocation succeeds.
18925
18926 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18927 for sizes. Check for string overflow more accurately.
18928 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18929
18930 * macros.c: Integer and buffer overflow fixes.
18931 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18932 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18933 Use ptrdiff_t, not int, for sizes.
18934 Don't increment bufsize until after realloc succeeds.
18935 Check for size-calculation overflow.
18936 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18937
18938 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18939
18940 * lread.c: Integer overflow fixes.
18941 (read_integer): Radix is now EMACS_INT, not int,
18942 to improve quality of diagnostics for out-of-range radices.
18943 Calculate buffer size correctly for out-of-range radices.
18944 (read1): Check for integer overflow in radices, and in
18945 read-circle numbers.
18946 (read_escape): Avoid int overflow.
18947 (Fload, openp, read_buffer_size, read1)
18948 (substitute_object_recurse, read_vector, read_list, map_obarray):
18949 Use ptrdiff_t, not int, for sizes.
18950 (read1): Use EMACS_INT, not int, for sizes.
18951 Check for size overflow.
18952
18953 * image.c (cache_image): Check for size arithmetic overflow.
18954
18955 * lread.c: Integer overflow issues.
18956 (saved_doc_string_size, saved_doc_string_length)
18957 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18958 Now ptrdiff_t, not int.
18959 (read1): Don't assume doc string length fits in int. Check for
18960 out-of-range doc string lengths.
18961 (read_list): Don't assume file position fits in int.
18962 (read_escape): Check for hex character overflow.
18963
18964 2011-06-22 Leo Liu <sdl.web@gmail.com>
18965
18966 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18967 Move to minibuffer.el.
18968
18969 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18970
18971 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
18972 The following patches are for when GLYPH_DEBUG && !XASSERT.
18973 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18974 * dispnew.c (flush_stdout):
18975 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18976 Mark as externally visible.
18977 * dispnew.c (check_window_matrix_pointers): Now static.
18978 * dispnew.c (window_to_frame_vpos):
18979 * xfns.c (unwind_create_frame):
18980 * xterm.c (x_check_font): Remove unused local.
18981 * scroll.c (CHECK_BOUNDS):
18982 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18983 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18984 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18985 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18986 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18987 Now static.
18988 (debug_method_add): Use va_list and vsprintf rather than relying
18989 on undefined behavior with wrong number of arguments.
18990 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18991 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18992 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18993 since we're not interested in debugging glyphs with old libraries.
18994 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18995 GCC 4.6.0's static checking.
18996
18997 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18998
18999 Integer overflow and signedness fixes (Bug#8873).
19000 A few related buffer overrun fixes, too.
19001
19002 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19003
19004 * dispextern.h (struct face.stipple):
19005 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19006 (x_bitmap_mask, x_allocate_bitmap_record)
19007 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19008 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19009 (x_create_bitmap_from_xpm_data):
19010 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19011 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19012 (.bitmaps_last):
19013 * xfaces.c (load_pixmap):
19014 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19015 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19016 (.bitmaps_last, struct x_output.icon_bitmap):
19017 Use ptrdiff_t, not int, for bitmap indexes.
19018 (x_allocate_bitmap_record): Check for size overflow.
19019 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19020
19021 Use ptrdiff_t, not int, for overlay counts.
19022 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19023 * editfns.c (overlays_around, get_pos_property):
19024 * textprop.c (get_char_property_and_overlay):
19025 * xdisp.c (next_overlay_change, note_mouse_highlight):
19026 * xfaces.c (face_at_buffer_position):
19027 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19028 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19029 (Fnext_overlay_change, Fprevious_overlay_change)
19030 (mouse_face_overlay_overlaps, Foverlays_in):
19031 Use ptrdiff_t, not int, for sizes.
19032 (overlays_at, overlays_in): Check for size-calculation overflow.
19033
19034 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19035
19036 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19037 (x_session_initialize): Do not assume string length fits in int.
19038
19039 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19040 This is unlikely, but can occur if DPI is outlandish.
19041
19042 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19043 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19044
19045 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19046 * xrdb.c (magic_file_p, search_magic_path):
19047 Omit last arg SUFFIX; it was always 0. All callers changed.
19048 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19049
19050 * xfont.c (xfont_match): Avoid need for strlen.
19051
19052 * xfns.c: Don't assume strlen fits in int.
19053 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19054
19055 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19056 not unsigned long, as we prefer signed integers. All callers changed.
19057 Detect integer overflow in repeat count.
19058 (message_dolog): Don't assume print length fits in 39 bytes.
19059 (display_mode_element): Don't assume strlen fits in int.
19060
19061 * termcap.c: Don't assume sizes fit in int and never overflow.
19062 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19063 (gobble_line): Check for size-calculation overflow.
19064
19065 * minibuf.c (Fread_buffer):
19066 * lread.c (intern, intern_c_string):
19067 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19068 Don't assume string length fits in int.
19069
19070 * keyboard.c (parse_tool_bar_item):
19071 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19072
19073 * font.c: Don't assume string length fits in int.
19074 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19075 Use ptrdiff_t, not int.
19076 (font_intern_prop): Don't assume string length fits in int.
19077 Don't assume integer property fits in fixnum.
19078 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19079
19080 * filelock.c: Fix some buffer overrun and integer overflow issues.
19081 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19082 Reformulate so as not to need the command string.
19083 Invoke gzip -cd rather than gunzip, as it's more portable.
19084 (lock_info_type, lock_file_1, lock_file):
19085 Don't assume pid_t and time_t fit in unsigned long.
19086 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19087 (current_lock_owner): Prefer signed type for sizes.
19088 Use memcpy, not strncpy, where memcpy is what is really wanted.
19089 Don't assume (via atoi) that time_t and pid_t fit in int.
19090 Check for time_t and/or pid_t out of range, e.g., via a network share.
19091 Don't alloca where an auto var works fine.
19092
19093 * fileio.c: Fix some integer overflow issues.
19094 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19095 Don't assume string length fits in int.
19096 (directory_file_name): Don't assume string length fits in long.
19097 (make_temp_name): Don't assume pid fits in int, or that its print
19098 length is less than 20.
19099
19100 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19101
19102 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19103
19104 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19105
19106 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19107 We prefer signed integers, even for size calculations.
19108
19109 * emacs.c: Don't assume string length fits in 'int'.
19110 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19111 (main): Don't invoke strlen when not needed.
19112
19113 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19114 (XD_DEBUG_MESSAGE): Don't waste a byte.
19115
19116 * callproc.c (getenv_internal_1, getenv_internal)
19117 (Fgetenv_internal):
19118 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19119
19120 * lread.c (invalid_syntax): Omit length argument.
19121 All uses changed. This doesn't fix a bug, but it simplifies the
19122 code away from its former Hollerith-constant appearance, and it's
19123 one less 'int' to worry about when looking at integer-overflow issues.
19124 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19125
19126 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19127 This didn't break anything, but it didn't help either.
19128 It's confusing to put a bogus integer in a place where the actual
19129 value does not matter.
19130 (LIST_END_P): Remove unused macro and its bogus comment.
19131 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19132
19133 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19134 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19135 implementation.
19136 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19137 We prefer signed types, and the value cannot exceed the EMACS_INT
19138 range anyway (because otherwise the length would not be representable).
19139 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19140 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19141 This avoids a GCC warning when WIDE_EMACS_INT.
19142
19143 * indent.c (sane_tab_width): New function.
19144 (current_column, scan_for_column, Findent_to, position_indentation)
19145 (compute_motion): Use it. This is just for clarity.
19146 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19147
19148 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19149
19150 * lisp.h (lint_assume): New macro.
19151 * composite.c (composition_gstring_put_cache):
19152 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19153
19154 * editfns.c, insdel.c:
19155 Omit unnecessary forward decls, to simplify future changes.
19156
19157 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19158
19159 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19160
19161 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19162 Use much-faster test for byte-length change.
19163 Don't assume string byte-length fits in 'int'.
19164 Check that character arg fits in 'int'.
19165 (mapcar1): Declare byte as byte, for clarity.
19166
19167 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19168
19169 * fns.c (concat): Catch string overflow earlier.
19170 Do not rely on integer wraparound.
19171
19172 * dispextern.h (struct it.overlay_strings_charpos)
19173 (struct it.selective): Now EMACS_INT, not int.
19174 * xdisp.c (forward_to_next_line_start)
19175 (back_to_previous_visible_line_start)
19176 (reseat_at_next_visible_line_start, next_element_from_buffer):
19177 Don't arbitrarily truncate the value of 'selective' to int.
19178
19179 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19180
19181 * composite.c: Don't truncate sizes to 'int'.
19182 (composition_gstring_p, composition_reseat_it)
19183 (composition_adjust_point): Use EMACS_INT, not int.
19184 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19185 not EMACS_UINT, for indexes.
19186
19187 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19188
19189 * buffer.c: Include <verify.h>.
19190 (struct sortvec.priority, struct sortstr.priority):
19191 Now EMACS_INT, not int.
19192 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19193 (struct sortstr.size, record_overlay_string)
19194 (struct sortstrlist.size, struct sortlist.used):
19195 Don't truncate size to int.
19196 (record_overlay_string): Check for size-calculation overflow.
19197 (init_buffer_once): Check at compile-time, not run-time.
19198
19199 2011-06-22 Jim Meyering <meyering@redhat.com>
19200
19201 Don't leak an XBM-image-sized buffer
19202 * image.c (xbm_load): Free the image buffer after using it.
19203
19204 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19205
19206 Port to Sun C.
19207 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19208 that Sun C diagnosed.
19209 * fns.c (secure_hash): Fix pointer signedness issue.
19210 * intervals.c (static_offset_intervals): New function.
19211 (offset_intervals): Use it.
19212
19213 2011-06-21 Leo Liu <sdl.web@gmail.com>
19214
19215 * deps.mk (fns.o):
19216 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19217 sha512.h.
19218
19219 * fns.c (secure_hash): Rename from crypto_hash_function and change
19220 the first arg to accept symbols.
19221 (Fsecure_hash): New primitive.
19222 (syms_of_fns): New symbols.
19223
19224 2011-06-20 Deniz Dogan <deniz@dogan.se>
19225
19226 * process.c (Fset_process_buffer): Clarify return value in
19227 docstring.
19228
19229 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19230
19231 * dispnew.c (add_window_display_history): Use BVAR.
19232
19233 * xdisp.c (debug_method_add): Use BVAR.
19234 (check_window_end, dump_glyph_matrix, dump_glyph)
19235 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19236
19237 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19238 Likewise.
19239
19240 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19241 check till after the cache is created in init_frame_faces.
19242
19243 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19244
19245 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19246
19247 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19248
19249 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19250 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19251 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19252
19253 Improve buffer-overflow checking (Bug#8873).
19254 * fileio.c (Finsert_file_contents):
19255 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19256 Remove the old (too-loose) buffer overflow checks.
19257 They weren't needed, since make_gap checks for buffer overflow.
19258 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19259 The old code merely checked for Emacs fixnum overflow, and relied
19260 on undefined (wraparound) behavior. The new code avoids undefined
19261 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19262
19263 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19264 Tune. Don't use wider integers than needed. Don't use alloca.
19265 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19266
19267 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19268
19269 * insdel.c, lisp.h (buffer_overflow): New function.
19270 (insert_from_buffer_1, replace_range, replace_range_2):
19271 * insdel.c (make_gap_larger):
19272 * editfns.c (Finsert_char):
19273 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19274
19275 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19276
19277 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19278
19279 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19280
19281 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19282 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19283
19284 * fileio.c: Don't assume EMACS_INT fits in off_t.
19285 (emacs_lseek): New static function.
19286 (Finsert_file_contents, Fwrite_region): Use it.
19287 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19288
19289 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19290
19291 * fns.c: Don't overflow int when computing a list length.
19292 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19293 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19294 truncation on 64-bit hosts. Check for QUIT every
19295 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19296 faster and is responsive enough.
19297 (Flength): Report an error instead of overflowing an integer.
19298 (Fsafe_length): Return a float if the value is not representable
19299 as a fixnum. This shouldn't happen except in contrived situations.
19300 (Fnthcdr, Fsort): Don't assume list length fits in int.
19301 (Fcopy_sequence): Don't assume vector length fits in int.
19302
19303 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19304 (header_size, word_size): New constants.
19305 (allocate_vectorlike): Don't check size overflow here.
19306 (allocate_vector): Check it here instead, since this is the only
19307 caller of allocate_vectorlike that could cause overflow.
19308 Check that the new vector's length is representable as a fixnum.
19309
19310 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19311 The previous code was bogus. For example, next_almost_prime (32)
19312 returned 39, which is undesirable as it is a multiple of 3; and
19313 next_almost_prime (24) returned 25, which is a multiple of 5 so
19314 why was the code bothering to check for multiples of 7?
19315
19316 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19317
19318 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19319
19320 Variadic C functions now count arguments with ptrdiff_t.
19321 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19322 Back then I didn't know that the Emacs coding style prefers signed int.
19323 Also, in the meantime I found a few more instances where arguments
19324 were being counted with int, which may truncate counts on 64-bit
19325 machines, or EMACS_INT, which may be unnecessarily wide.
19326 * lisp.h (struct Lisp_Subr.function.aMANY)
19327 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19328 Arg counts are now ptrdiff_t, not size_t.
19329 All variadic functions and their callers changed accordingly.
19330 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19331 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19332 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19333 * callint.c (Fcall_interactively): Check arg count for overflow,
19334 to avoid potential buffer overrun. Use signed char, not 'int',
19335 for 'varies' array, so that we needn't bother to check its size
19336 calculation for overflow.
19337 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19338 * eval.c (apply_lambda):
19339 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19340 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19341 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19342
19343 * callint.c (Fcall_interactively): Don't use index var as event count.
19344
19345 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19346 * mem-limits.h (SIZE): Remove; no longer used.
19347
19348 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
19349
19350 Remove unnecessary casts.
19351 * xterm.c (x_term_init):
19352 * xfns.c (x_set_border_pixel):
19353 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19354 These aren't needed now that we assume ANSI C.
19355
19356 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19357 It's more likely to cause problems (due to unsigned overflow)
19358 than to cure them.
19359
19360 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19361
19362 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19363
19364 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19365
19366 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19367
19368 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19369
19370 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19371
19372 GLYPH_CODE_FACE returns EMACS_INT, not int.
19373 * dispextern.h (merge_faces):
19374 * xfaces.c (merge_faces):
19375 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19376 Don't assume EMACS_INT fits in int.
19377
19378 * character.h (CHAR_VALID_P): Remove unused parameter.
19379 * fontset.c, lisp.h, xdisp.c: All uses changed.
19380
19381 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19382
19383 * fns.c (concat): Minor tuning based on overflow analysis.
19384 This doesn't fix any bugs. Use int to hold character, instead
19385 of constantly refetching from Emacs object. Use XFASTINT, not
19386 XINT, for value known to be a character. Don't bother comparing
19387 a single byte to 0400, as it's always less.
19388
19389 * floatfns.c (Fexpt):
19390 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19391
19392 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19393 for characters.
19394
19395 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19396
19397 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19398 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19399 incorrectly succeed when S was a string, because 4294967386 was
19400 truncated before it was used.
19401
19402 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19403 Otherwise, an out-of-range integer could cause undefined behavior
19404 on a 64-bit host.
19405
19406 * composite.c: Use int, not EMACS_INT, for characters.
19407 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19408 EMACS_INT, for values that are known to be in character range.
19409 This doesn't fix any bugs but is the usual style inside Emacs and
19410 may generate better code on 32-bit machines.
19411
19412 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19413 This is for reasons similar to the recent CHAR_STRING fix.
19414 * charset.c (Fencode_char): Check that character arg is actually
19415 a character. Pass an int to ENCODE_CHAR.
19416 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19417 wider than 'int', as a compile-time check to prevent future regressions
19418 in this area.
19419
19420 * character.c (char_string): Remove unnecessary casts.
19421
19422 Make sure a 64-bit char is never passed to CHAR_STRING.
19423 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19424 by silently ignoring the top 32 bits, allowing some values
19425 that were far too large to be valid characters.
19426 * character.h: Include <verify.h>.
19427 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19428 arguments are no wider than unsigned, as a compile-time check
19429 to prevent future regressions in this area.
19430 * data.c (Faset):
19431 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
19432 (Fsubst_char_in_region):
19433 * fns.c (concat):
19434 * xdisp.c (decode_mode_spec_coding):
19435 Adjust to CHAR_STRING's new requirement.
19436 * editfns.c (Finsert_char, Fsubst_char_in_region):
19437 * fns.c (concat): Check that character args are actually
19438 characters. Without this test, these functions did the wrong
19439 thing with wildly out-of-range values on 64-bit hosts.
19440
19441 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19442 These casts should not be needed on 32-bit hosts, either.
19443 * keyboard.c (read_char):
19444 * lread.c (Fload): Remove casts to unsigned.
19445
19446 * lisp.h (UNSIGNED_CMP): New macro.
19447 This fixes comparison bugs on 64-bit hosts.
19448 (ASCII_CHAR_P): Use it.
19449 * casefiddle.c (casify_object):
19450 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
19451 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19452 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19453 * dispextern.h (FACE_FROM_ID):
19454 * keyboard.c (read_char): Use UNSIGNED_CMP.
19455
19456 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19457 not to EMACS_INT, to avoid GCC warning.
19458
19459 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19460
19461 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19462 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19463 isn't needed on 32-bit machines.
19464
19465 * buffer.c (Fgenerate_new_buffer_name):
19466 Use EMACS_INT for count, not int.
19467 (advance_to_char_boundary): Return EMACS_INT, not int.
19468
19469 * data.c (Qcompiled_function): Now static.
19470
19471 * window.c (window_body_lines): Now static.
19472
19473 * image.c (gif_load): Rename local to avoid shadowing.
19474
19475 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19476 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19477 * alloc.c (make_save_value): Integer argument is now of type
19478 ptrdiff_t, not int.
19479 (mark_object): Use ptrdiff_t, not int.
19480 * lisp.h (pD): New macro.
19481 * print.c (print_object): Use it.
19482
19483 * alloc.c: Use EMACS_INT, not int, to count objects.
19484 (total_conses, total_markers, total_symbols, total_vector_size)
19485 (total_free_conses, total_free_markers, total_free_symbols)
19486 (total_free_floats, total_floats, total_free_intervals)
19487 (total_intervals, total_strings, total_free_strings):
19488 Now EMACS_INT, not int. All uses changed.
19489 (Fgarbage_collect): Compute overall total using a double, so that
19490 integer overflow is less likely to be a problem. Check for overflow
19491 when converting back to an integer.
19492 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19493 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19494 These were 'int' variables that could overflow on 64-bit hosts;
19495 they were never used, so remove them instead of repairing them.
19496 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
19497 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19498 Previously, this ceilinged at INT_MAX, but that doesn't work on
19499 64-bit machines.
19500 (allocate_pseudovector): Don't use EMACS_INT when int would do.
19501
19502 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
19503 (allocate_vectorlike): Check for ptrdiff_t overflow.
19504 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19505 when a (possibly-narrower) signed value would do just as well.
19506 We prefer using signed arithmetic, to avoid comparison confusion.
19507
19508 * alloc.c: Catch some string size overflows that we were missing.
19509 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19510 for convenience in STRING_BYTES_MAX.
19511 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19512 The definition here is exact; the one in lisp.h was approximate.
19513 (allocate_string_data): Check for string overflow. This catches
19514 some instances we weren't catching before. Also, it catches
19515 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19516 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19517 and ptrdiff_t and EMACS_INT are both 64 bits.
19518
19519 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19520 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
19521 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
19522
19523 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19524
19525 * alloc.c (Fmake_string): Check for out-of-range init.
19526
19527 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19528
19529 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19530
19531 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19532
19533 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19534 xg_get_default_scrollbar_width.
19535
19536 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19537 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19538 (style_changed_cb): Call update_theme_scrollbar_width and call
19539 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19540 all frames (Bug#8505).
19541 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19542 Call gtk_window_set_resizable if HAVE_GTK3.
19543 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19544 and height if HAVE_GTK3 (Bug#8505).
19545 (scroll_bar_width_for_theme): New variable.
19546 (update_theme_scrollbar_width): New function.
19547 (xg_get_default_scrollbar_width): Move code to
19548 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19549 (xg_initialize): Call update_theme_scrollbar_width.
19550
19551 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19552
19553 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19554
19555 2011-06-12 Martin Rudalics <rudalics@gmx.at>
19556
19557 * frame.c (make_frame): Call other_buffer_safely instead of
19558 other_buffer.
19559
19560 * window.c (temp_output_buffer_show): Call display_buffer with
19561 second argument Vtemp_buffer_show_specifiers and reset latter
19562 immediately after the call.
19563 (Vtemp_buffer_show_specifiers): New variable.
19564 (auto_window_vscroll_p, next_screen_context_lines)
19565 (Vscroll_preserve_screen_position): Remove leading asterisks from
19566 doc-strings.
19567
19568 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
19569
19570 Fix minor problems found by GCC 4.6.0 static checking.
19571 * buffer.c (Qclone_number): Remove for now, as it's unused.
19572 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19573 (record_buffer): Remove unused local.
19574 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19575 (set_frame_buffer_list): Remove; unused.
19576 * frame.h (other_visible_frames): Remove decl.
19577 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19578 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19579 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19580 if HAVE_GPM.
19581 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19582 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19583 Define only if HAVE_GPM.
19584 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19585 (update_hints_inhibit): Remove; never set. All uses removed.
19586 * widgetprv.h (emacsFrameClassRec): Remove decl.
19587 * window.c (delete_deletable_window): Now returns void, since it
19588 wasn't returning anything.
19589 (compare_window_configurations): Remove unused locals.
19590 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19591 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
19592 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19593 the same widths as pointers. This follows up on the 2011-05-06 patch.
19594 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19595 * xterm.h: Likewise.
19596 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19597
19598 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
19599
19600 * makefile.w32-in: Update dependencies.
19601 (LISP_H): Add lib/intprops.h.
19602
19603 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19604
19605 * image.c (gif_load): Add animation frame delay to the metadata.
19606 (syms_of_image): Use DEFSYM. New symbol `delay'.
19607
19608 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19609
19610 * window.c (delete_deletable_window): Re-add.
19611 (Fset_window_configuration): Rewrite to handle dead buffers and
19612 consequently deletable windows.
19613 (window_tree, Fwindow_tree): Remove. Supply functionality in
19614 window.el.
19615 (compare_window_configurations): Simplify code.
19616
19617 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19618
19619 * image.c (imagemagick_load_image): Fix type mismatch.
19620 (Fimagemagick_types): Likewise.
19621
19622 * window.h (replace_buffer_in_windows): Declare.
19623
19624 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19625
19626 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19627 Qclone_number. Remove external declaration of Qdelete_window.
19628 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19629 code.
19630 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19631 Run Qbuffer_list_update_hook if allowed.
19632 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19633 buffer list implementation.
19634 (other_buffer_safely): New function.
19635 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19636 calls to replace_buffer_in_windows and
19637 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19638 if allowed.
19639 (record_buffer): Inhibit quitting and rewrite using quittable
19640 functions. Run Qbuffer_list_update_hook if allowed.
19641 (Frecord_buffer, Funrecord_buffer): New functions.
19642 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19643 Move switch-to-buffer to window.el.
19644 (bury-buffer): Move to window.el.
19645 (Vbuffer_list_update_hook): New variable.
19646
19647 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19648 section.
19649
19650 * window.h (resize_frame_windows): Move up in code.
19651 (Fwindow_frame): Remove EXFUN.
19652 (replace_buffer_in_all_windows): Remove prototype.
19653 (replace_buffer_in_windows_safely): Add prototype.
19654
19655 * window.c: Declare Qdelete_window static again. Move down
19656 declaration of select_count.
19657 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19658 (Fother_window): Move to window.el.
19659 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19660 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19661 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19662 window.el.
19663 (replace_buffer_in_windows): Implement by calling
19664 Qreplace_buffer_in_windows.
19665 (replace_buffer_in_all_windows): Remove with some functionality
19666 moved into replace_buffer_in_windows_safely.
19667 (replace_buffer_in_windows_safely): New function.
19668 (select_window_norecord, select_frame_norecord): Move in front
19669 of run_window_configuration_change_hook. Remove now obsolete
19670 declarations.
19671 (Fset_window_buffer): Rewrite doc-string.
19672 Call Qrecord_window_buffer.
19673 (keys_of_window): Move binding for other-window to window.el.
19674
19675 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19676
19677 * dispextern.h (struct image): Replace data member, whose int_val
19678 and ptr_val fields were not used by anything, with a single
19679 lisp_val object.
19680
19681 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19682 (gif_clear_image, gif_load, imagemagick_load_image)
19683 (gs_clear_image, gs_load): Callers changed.
19684
19685 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19686
19687 * buffer.h: Include <time.h>, for time_t.
19688 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19689
19690 Fix minor problems found by static checking.
19691
19692 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19693
19694 Make identifiers static if they are not used in other modules.
19695 * data.c (Qcompiled_function, Qframe, Qvector):
19696 * image.c (QimageMagick, Qsvg):
19697 * minibuf.c (Qmetadata):
19698 * window.c (resize_window_check, resize_root_window): Now static.
19699 * window.h (resize_window_check, resize_root_window): Remove decls.
19700
19701 * window.c (window_deletion_count, delete_deletable_window):
19702 Remove; unused.
19703 (window_body_lines): Now static.
19704 (Fdelete_other_windows_internal): Mark vars as initialized.
19705 Make sure 'resize_failed' is initialized.
19706 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19707 (resize_window_apply): Remove unused local.
19708 * window.h (delete_deletable_window): Remove decl.
19709
19710 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
19711 (imagemagick_load_image): Fix pointer signedness problem by changing
19712 last arg from unsigned char * to char *. All uses changed.
19713 Also, fix a local for similar reasons.
19714 Remove unused locals. Remove locals to avoid shadowing.
19715 (fn_rsvg_handle_free): Remove; unused.
19716 (svg_load, svg_load_image): Fix pointer signedness problem.
19717 (imagemagick_load_image): Don't use garbage pointer image_wand.
19718
19719 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19720
19721 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
19722
19723 * image.c (gif_load): Fix omitted cast error introduced by
19724 2011-06-06 change.
19725
19726 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19727
19728 * window.h (resize_proportionally, orig_total_lines)
19729 (orig_top_line): Remove from window structure.
19730 (set_window_height, set_window_width, change_window_heights)
19731 (Fdelete_window): Remove prototypes.
19732 (resize_frame_windows): Remove duplicate declaration.
19733
19734 2011-06-10 Eli Zaretskii <eliz@gnu.org>
19735
19736 * window.h (resize_frame_windows, resize_window_check)
19737 (delete_deletable_window, resize_root_window)
19738 (resize_frame_windows): Declare prototypes.
19739
19740 * window.c (resize_window_apply): Make definition be "static" to
19741 match the prototype.
19742
19743 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19744
19745 * window.c: Remove declarations of Qwindow_size_fixed,
19746 window_min_size_1, window_min_size_2, window_min_size,
19747 size_window, window_fixed_size_p, enlarge_window, delete_window.
19748 Remove static from declaration of Qdelete_window, it's
19749 temporarily needed by Fbury_buffer.
19750 (replace_window): Don't assign orig_top_line and
19751 orig_total_lines.
19752 (Fdelete_window, delete_window): Remove. Window deletion is
19753 handled by window.el.
19754 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19755 Replace Fdelete_window calls with calls to Qdelete_window.
19756 (Fdelete_other_windows): Remove. Deleting other windows is
19757 handled by window.el.
19758 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19759 handled in window.el.
19760 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19761 Window minimum sizes are handled in window.el.
19762 (shrink_windows, size_window, set_window_height)
19763 (set_window_width, change_window_heights, window_height)
19764 (window_width, CURBEG, CURSIZE, enlarge_window)
19765 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19766 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19767 handled in window.el.
19768 (make_dummy_parent): Rename to make_parent_window and give it a
19769 second argument horflag.
19770 (make_window): Don't set resize_proportionally any more.
19771 (Fsplit_window): Remove. Windows are split in window.el.
19772 (save_restore_action, save_restore_orig_size)
19773 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19774 Resize mini windows in window.el.
19775 (grow_mini_window, shrink_mini_window): Implement by calling
19776 Qresize_root_window_vertically, resize_window_check and
19777 resize_window_apply.
19778 (saved_window, Fset_window_configuration, save_window_save):
19779 Do not handle orig_top_line, orig_total_lines, and
19780 resize_proportionally.
19781 (window_min_height, window_min_width): Move to window.el.
19782 (keys_of_window): Move bindings for delete-other-windows,
19783 split-window, delete-window and enlarge-window to window.el.
19784
19785 * buffer.c: Temporarily extern Qdelete_window.
19786 (Fbury_buffer): Temporarily call Qdelete_window instead of
19787 Fdelete_window (Fbury_buffer will move to window.el soon).
19788
19789 * frame.c (set_menu_bar_lines_1): Remove code handling
19790 orig_top_line and orig_total_lines.
19791
19792 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19793 set_window_height but set heights directly.
19794 (change_frame_size_1): Use resize_frame_windows.
19795
19796 * xdisp.c (init_xdisp): Don't use set_window_height but set
19797 heights directly.
19798
19799 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19800 Use resize_frame_windows instead of change_window_heights and run
19801 run_window_configuration_change_hook.
19802
19803 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19804 instead of change_window_heights and run
19805 run_window_configuration_change_hook.
19806
19807 2011-06-09 Martin Rudalics <rudalics@gmx.at>
19808
19809 * window.c (replace_window): Rename second argument REPLACEMENT to
19810 NEW. New third argument SETFLAG. Rewrite.
19811 (delete_window, make_dummy_parent): Call replace_window with
19812 third argument 1.
19813 (window_list_1): Move down in code.
19814 (run_window_configuration_change_hook): Move set_buffer part
19815 before select_frame_norecord part in order to unwind correctly.
19816 Rename count1 to count.
19817 (recombine_windows, delete_deletable_window, resize_root_window)
19818 (Fdelete_other_windows_internal)
19819 (Frun_window_configuration_change_hook, make_parent_window)
19820 (resize_window_check, resize_window_apply, Fresize_window_apply)
19821 (resize_frame_windows, Fsplit_window_internal)
19822 (Fdelete_window_internal, Fresize_mini_window_internal):
19823 New functions.
19824 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19825
19826 2011-06-08 Martin Rudalics <rudalics@gmx.at>
19827
19828 * window.h (window): Add some new members to window structure -
19829 normal_lines, normal_cols, new_total, new_normal, clone_number,
19830 splits, nest, prev_buffers, next_buffers.
19831 (WINDOW_TOTAL_SIZE): Move here from window.c.
19832 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
19833
19834 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19835 Remove.
19836 (make_dummy_parent): Set new members of windows structure.
19837 (make_window): Move down in code. Handle new members of window
19838 structure.
19839 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19840 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19841 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19842 (Fset_window_prev_buffers, Fwindow_next_buffers)
19843 (Fset_window_next_buffers, Fset_window_clone_number):
19844 New functions.
19845 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19846 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19847 Doc-string fixes.
19848 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19849 Argument WINDOW can be now internal window too.
19850 (Fwindow_use_time): Move up in code.
19851 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19852 Rewrite doc-string.
19853 (Fset_window_configuration, saved_window)
19854 (Fcurrent_window_configuration, save_window_save): Handle new
19855 members of window structure.
19856 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19857 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19858 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19859 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19860 Qget_mru_window, Qresize_root_window,
19861 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19862 Qauto_buffer_name; staticpro them.
19863
19864 2011-06-07 Martin Rudalics <rudalics@gmx.at>
19865
19866 * window.c (Fwindow_total_size, Fwindow_left_column)
19867 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19868 (Fwindow_list_1): New functions.
19869 (window_box_text_cols): Replace with window_body_cols.
19870 (Fwindow_width, Fscroll_left, Fscroll_right):
19871 Use window_body_cols instead of window_box_text_cols.
19872 (delete_window, Fset_window_configuration):
19873 Call delete_all_subwindows with window as argument.
19874 (delete_all_subwindows): Take a window as argument and not a
19875 structure. Rewrite.
19876 (window_loop): Remove handling of GET_LRU_WINDOW and
19877 GET_LARGEST_WINDOW.
19878 (Fget_lru_window, Fget_largest_window): Move to window.el.
19879
19880 * window.h: Extern window_body_cols instead of
19881 window_box_text_cols. delete_all_subwindows now takes a
19882 Lisp_Object as argument.
19883
19884 * indent.c (compute_motion, Fcompute_motion):
19885 Use window_body_cols instead of window_box_text_cols.
19886
19887 * frame.c (delete_frame): Call delete_all_subwindows with root
19888 window as argument.
19889
19890 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19891
19892 * fns.c (Fputhash): Document return value.
19893
19894 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
19895
19896 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19897
19898 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19899
19900 Cons<->int and similar integer overflow fixes (Bug#8794).
19901
19902 Check for overflow when converting integer to cons and back.
19903 * charset.c (Fdefine_charset_internal, Fdecode_char):
19904 Use cons_to_unsigned to catch overflow.
19905 (Fencode_char): Use INTEGER_TO_CONS.
19906 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19907 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19908 * data.c (long_to_cons, cons_to_long): Remove.
19909 (cons_to_unsigned, cons_to_signed): New functions.
19910 These signal an error for invalid or out-of-range values.
19911 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19912 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19913 * font.c (Ffont_variation_glyphs):
19914 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19915 * lisp.h: Include <intprops.h>.
19916 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19917 (cons_to_signed, cons_to_unsigned): New decls.
19918 (long_to_cons, cons_to_long): Remove decls.
19919 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19920 (Fprimitive_undo): Use CONS_TO_INTEGER.
19921 * xfns.c (Fx_window_property): Likewise.
19922 * xselect.c: Include <limits.h>.
19923 (x_own_selection, selection_data_to_lisp_data):
19924 Use INTEGER_TO_CONS.
19925 (x_handle_selection_request, x_handle_selection_clear)
19926 (x_get_foreign_selection, Fx_disown_selection_internal)
19927 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19928 (lisp_data_to_selection_data): Use cons_to_unsigned.
19929 (x_fill_property_data): Use cons_to_signed.
19930 Report values out of range.
19931
19932 Check for buffer and string overflow more precisely.
19933 * buffer.h (BUF_BYTES_MAX): New macro.
19934 * lisp.h (STRING_BYTES_MAX): New macro.
19935 * alloc.c (Fmake_string):
19936 * character.c (string_escape_byte8):
19937 * coding.c (coding_alloc_by_realloc):
19938 * doprnt.c (doprnt):
19939 * editfns.c (Fformat):
19940 * eval.c (verror):
19941 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19942 since they may not be the same number.
19943 * editfns.c (Finsert_char):
19944 * fileio.c (Finsert_file_contents):
19945 Likewise for BUF_BYTES_MAX.
19946
19947 * image.c: Use ptrdiff_t, not int, for sizes.
19948 (slurp_file): Switch from int to ptrdiff_t.
19949 All uses changed.
19950 (slurp_file): Check that file size fits in both size_t (for
19951 malloc) and ptrdiff_t (for sanity and safety).
19952
19953 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19954 if b->modtime has its maximal value.
19955
19956 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19957
19958 Don't assume time_t can fit into int.
19959 * buffer.h (struct buffer.modtime): Now time_t, not int.
19960 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19961 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19962
19963 Minor fixes for signed vs unsigned integers.
19964 * character.h (MAYBE_UNIFY_CHAR):
19965 * charset.c (maybe_unify_char):
19966 * keyboard.c (read_char, reorder_modifiers):
19967 XINT -> XFASTINT, since the integer must be nonnegative.
19968 * ftfont.c (ftfont_spec_pattern):
19969 * keymap.c (access_keymap, silly_event_symbol_error):
19970 XUINT -> XFASTINT, since the integer must be nonnegative.
19971 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19972 since it makes no difference and we prefer signed.
19973 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19974 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19975 nonnegative.
19976
19977 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19978
19979 * window.h (Fwindow_frame): Declare.
19980
19981 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19982
19983 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19984 (SPARE_MEMORY): Always define.
19985 (LARGE_REQUEST): Remove.
19986 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19987
19988 2011-06-06 Martin Rudalics <rudalics@gmx.at>
19989
19990 * lisp.h: Move EXFUNS for Fframe_root_window,
19991 Fframe_first_window and Fset_frame_selected_window to window.h.
19992
19993 * window.h: Move EXFUNS for Fframe_root_window,
19994 Fframe_first_window and Fset_frame_selected_window here from
19995 lisp.h.
19996
19997 * frame.c (Fwindow_frame, Fframe_first_window)
19998 (Fframe_root_window, Fframe_selected_window)
19999 (Fset_frame_selected_window): Move to window.c.
20000 (Factive_minibuffer_window): Move to minibuf.c.
20001 (Fother_visible_frames_p): New function.
20002
20003 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20004
20005 * window.c (decode_window, decode_any_window): Move up in code.
20006 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20007 (inhibit_frame_unsplittable): Remove unused variable.
20008 (Fwindow_buffer): Move up and rewrite doc-string.
20009 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20010 (Fwindow_prev): New functions.
20011 (Fwindow_frame): Move here from frame.c. Accept any window as
20012 argument.
20013 (Fframe_root_window, Fframe_first_window)
20014 (Fframe_selected_window): Move here from frame.c. Accept frame
20015 or arbitrary window as argument. Update doc-strings.
20016 (Fminibuffer_window): Move up in code.
20017 (Fwindow_minibuffer_p): Move up in code and simplify.
20018 (Fset_frame_selected_window): Move here from frame.c.
20019 Marginal rewrite.
20020 (Fselected_window, select_window, Fselect_window): Move up in
20021 code. Minor doc-string fixes.
20022
20023 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20024
20025 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20026 Do not assume that spare memory exists; that assumption is valid
20027 only if SYSTEM_MALLOC.
20028 (LARGE_REQUEST): New macro, so that the issue of large requests
20029 is separated from the issue of spare memory.
20030
20031 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20032
20033 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20034 format. (Bug#8806)
20035
20036 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20037
20038 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20039 before statements.
20040
20041 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20042
20043 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20044
20045 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20046
20047 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20048 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20049
20050 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20051
20052 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20053
20054 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20055
20056 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20057 (x_clipboard_manager_save): Add return value.
20058 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20059 New error handlers.
20060 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20061 Obey Vx_select_enable_clipboard_manager. Catch errors in
20062 x_clipboard_manager_save (Bug#8779).
20063 (Vx_select_enable_clipboard_manager): New variable.
20064 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20065
20066 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20067
20068 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20069
20070 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20071
20072 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20073 in the current matrix if keep_current_p is non-zero.
20074
20075 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20076
20077 * bidi.c (bidi_level_of_next_char): Fix last change.
20078
20079 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20080
20081 Support bidi reordering of text covered by display properties.
20082
20083 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20084 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20085 (bidi_cache_search, bidi_cache_iterator_state)
20086 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20087 (bidi_level_of_next_char, bidi_move_to_visually_next):
20088 Support character positions inside a run of characters covered by a
20089 display string.
20090 (bidi_paragraph_init, bidi_resolve_explicit_1)
20091 (bidi_level_of_next_char): Call bidi_fetch_char and
20092 bidi_fetch_char_advance instead of FETCH_CHAR and
20093 FETCH_CHAR_ADVANCE.
20094 (bidi_init_it): Initialize new members.
20095 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20096 definitions.
20097 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20098 instead of using explicit *_CHAR codes.
20099 (bidi_resolve_explicit, bidi_resolve_weak):
20100 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20101 bidirectional text is supported only in multibyte buffers.
20102 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20103 it to initialize the frame_window_p member of struct bidi_it.
20104 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20105 (bidi_resolve_explicit, bidi_resolve_weak)
20106 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20107 bidi_it->nchars is non-positive.
20108 (bidi_level_of_next_char): Don't try to lookup the cache for the
20109 next/previous character if nothing is cached there yet, or if we
20110 were just reseat()'ed to a new position.
20111
20112 * xdisp.c (set_cursor_from_row): Set start and stop points
20113 according to the row's direction when priming the loop that looks
20114 for the glyph on which to display cursor.
20115 (single_display_spec_intangible_p): Function deleted.
20116 (display_prop_intangible_p): Reimplement to call
20117 handle_display_spec instead of single_display_spec_intangible_p.
20118 Accept 3 additional arguments needed by handle_display_spec.
20119 This fixes incorrect cursor motion across display property with complex
20120 values: lists, `(when COND...)' forms, etc.
20121 (single_display_spec_string_p): Support property values that are
20122 lists with the argument STRING its top-level element.
20123 (display_prop_string_p): Fix the condition for processing a
20124 property that is a list to be consistent with handle_display_spec.
20125 (handle_display_spec): New function, refactored from the
20126 last portion of handle_display_prop.
20127 (compute_display_string_pos): Accept additional argument
20128 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20129 value of a `display' property is a "replacing spec".
20130 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20131 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20132 the display property, but just return a value indicating whether
20133 the display property will replace the characters it covers.
20134 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20135 frame_window_p members of struct bidi_it.
20136 (compute_display_string_pos, compute_display_string_end):
20137 New functions.
20138 (push_it): Accept second argument POSITION, where pop_it should
20139 jump to continue iteration.
20140 (reseat_1): Initialize bidi_it.disp_pos.
20141
20142 * keyboard.c (adjust_point_for_property): Adjust the call to
20143 display_prop_intangible_p to its new signature.
20144
20145 * dispextern.h (struct bidi_it): New member frame_window_p.
20146 (bidi_init_it): Update prototypes.
20147 (display_prop_intangible_p): Update prototype.
20148 (compute_display_string_pos, compute_display_string_end):
20149 Declare prototypes.
20150 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20151 EMACS_INT.
20152
20153 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20154
20155 Malloc failure behavior now depends on size of allocation.
20156 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20157 * lisp.h: Change signatures accordingly.
20158 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20159 All callers changed. (Bug#8762)
20160
20161 * gnutls.c: Use Emacs's memory allocators.
20162 Without this change, the gnutls library would invoke malloc etc.
20163 directly, which causes problems on non-SYNC_INPUT hosts, and which
20164 runs afoul of improving memory_full behavior. (Bug#8761)
20165 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20166 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20167 xfree instead of the default malloc, realloc, free.
20168 (Fgnutls_boot): No need to check for memory allocation failure,
20169 since xmalloc does that for us.
20170
20171 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20172 * category.c (hash_get_category_set):
20173 * ccl.c (ccl_driver):
20174 * charset.c (Fdefine_charset_internal):
20175 * charset.h (struct charset.hash_index):
20176 * composite.c (get_composition_id, gstring_lookup_cache)
20177 (composition_gstring_put_cache):
20178 * composite.h (struct composition.hash_index):
20179 * dispextern.h (struct image.hash):
20180 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20181 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20182 (hashfn_equal, hashfn_user_defined, make_hash_table)
20183 (maybe_resize_hash_table, hash_lookup, hash_put)
20184 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20185 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20186 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20187 * image.c (make_image, search_image_cache, lookup_image)
20188 (xpm_put_color_table_h):
20189 * lisp.h (struct Lisp_Hash_Table):
20190 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20191 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20192 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20193 * alloc.c (allocate_vectorlike):
20194 Check for overflow in vector size calculations.
20195 * ccl.c (ccl_driver):
20196 Check for overflow when converting EMACS_INT to int.
20197 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20198 need to be updated by these changes.
20199 * fns.c (make_hash_table, maybe_resize_hash_table):
20200 Check for integer overflow with large hash tables.
20201 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20202 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20203 (SXHASH_REDUCE): New macro.
20204 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20205 Use it instead of discarding useful hash info with large hash values.
20206 (sxhash_float): New function.
20207 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20208 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20209 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20210 Rewrite to use FIXNUM_BITS, as this simplifies things.
20211 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20212 Adjust signatures to match updated version of code.
20213 (consing_since_gc): Now EMACS_INT, since a single hash table can
20214 use more than INT_MAX bytes.
20215
20216 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20217
20218 Make it possible to build with GCC-4.6+ -O2 -flto.
20219
20220 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20221
20222 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20223
20224 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20225 Call minibuffer-inactive-mode.
20226
20227 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20228
20229 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20230 Update dependencies.
20231
20232 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20233
20234 * data.c (init_data): Remove code for UTS, this system is not
20235 supported anymore.
20236
20237 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20238
20239 Don't force ./temacs to start in terminal mode.
20240
20241 * frame.c (make_initial_frame): Initialize faces in all cases, not
20242 only when CANNOT_DUMP is defined.
20243 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20244
20245 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20246
20247 * dispnew.c (add_window_display_history): Use const for the string
20248 pointer. Remove declaration, not needed.
20249
20250 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20251
20252 Use 'inline', not 'INLINE'.
20253 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20254 * alloc.c, fontset.c (INLINE): Remove.
20255 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20256 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20257 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20258 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20259 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20260
20261 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20262
20263 Make it possible to run ./temacs.
20264
20265 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20266 syms_of_callproc does the same thing. Remove test for
20267 "initialized", do it in the caller.
20268 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20269
20270 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20271
20272 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20273 (read_minibuf): Use get_minibuffer.
20274 (syms_of_minibuf): Use DEFSYM.
20275 (Qmetadata): New var.
20276 * data.c (Qbuffer): Don't make it static.
20277 (syms_of_data): Use DEFSYM.
20278
20279 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20280
20281 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20282 (CCL_CODE_MIN): New macro.
20283
20284 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20285
20286 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20287
20288 * eval.c (Qdebug): Now static.
20289 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20290 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20291 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20292
20293 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20294
20295 * image.c: Various fixes to ImageMagick code comments.
20296 (Fimagemagick_types): Doc fix.
20297
20298 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20299
20300 Minor fixes prompted by GCC 4.6.0 warnings.
20301
20302 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20303
20304 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20305 (x_clipboard_manager_save_all): Move extern decl to ...
20306 * xterm.h: ... here, so that it can be checked for consistency.
20307
20308 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20309
20310 * xselect.c (x_clipboard_manager_save_frame)
20311 (x_clipboard_manager_save_all): New functions.
20312 (Fx_clipboard_manager_save): Lisp function deleted.
20313
20314 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20315 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20316
20317 * xterm.h: Update prototype.
20318
20319 2011-05-28 William Xu <william.xwl@gmail.com>
20320
20321 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20322 exiting (Bug#8239).
20323
20324 2011-05-28 Jim Meyering <meyering@redhat.com>
20325
20326 Avoid a sign-extension bug in crypto_hash_function.
20327 * fns.c (to_uchar): Define.
20328 (crypto_hash_function): Use it to convert some newly-signed
20329 variables to unsigned, to avoid sign-extension bugs. For example,
20330 without this change, (md5 "truc") would evaluate to
20331 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20332 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
20333 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
20334
20335 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20336
20337 Integer overflow fixes.
20338
20339 * dbusbind.c: Serial number integer overflow fixes.
20340 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
20341 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20342 to hold a serial number that is too large for a fixnum.
20343 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20344 Check for serial numbers out of range. Decode any serial number
20345 that was so large that it became a float. (Bug#8722)
20346
20347 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20348 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20349 Use XFASTINT rather than XUINT when numbers are nonnegative.
20350 (xd_append_arg, Fdbus_method_return_internal):
20351 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20352 arguments, check that Lisp number is nonnegative, rather than
20353 silently wrapping negative numbers around. (Bug#8722)
20354 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
20355 (Bug#8722)
20356
20357 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20358
20359 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20360
20361 ccl: Add integer overflow checks.
20362 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20363 (IN_INT_RANGE): New macros.
20364 (ccl_driver): Use them to check for integer overflow when
20365 decoding a CCL program. Many of the new checks are whether XINT (x)
20366 fits in int; it doesn't always, on 64-bit hosts. The new version
20367 doesn't catch all possible integer overflows, but it's an
20368 improvement. (Bug#8719)
20369
20370 * alloc.c (make_event_array): Use XINT, not XUINT.
20371 There's no need for unsigned here.
20372
20373 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20374 This follows up to the 2011-05-06 change that substituted uintptr_t
20375 for EMACS_INT. This case wasn't caught back then.
20376
20377 Rework Fformat to avoid integer overflow issues.
20378 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20379 now (part of C89). Include <verify.h>.
20380 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20381 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20382 (Fformat): Avoid the prepass trying to compute sizes; it was only
20383 approximate and thus did not catch overflow reliably. Instead, walk
20384 through the format just once, formatting and computing sizes as we go,
20385 checking for integer overflow at every step, and allocating a larger
20386 buffer as needed. Keep track separately whether the format is
20387 multibyte. Keep only the most-recently calculated precision, rather
20388 than them all. Record whether each argument has been converted to
20389 string. Use EMACS_INT, not int, for byte and char and arg counts.
20390 Support field widths and precisions larger than INT_MAX. Avoid
20391 sprintf's undefined behavior with conversion specifications such as %#d
20392 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20393 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20394 formatting out-of-range floating point numbers with int
20395 formats. (Bug#8668)
20396
20397 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20398
20399 * data.c: Avoid integer truncation in expressions involving floats.
20400 * data.c: Include <intprops.h>.
20401 (arith_driver): When there's an integer overflow in an expression
20402 involving floating point, convert the integers to floating point
20403 so that the resulting value does not suffer from catastrophic
20404 integer truncation. For example, on a 64-bit host (* 4
20405 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20406 Do not rely on undefined behavior after integer overflow.
20407
20408 merge count_size_as_multibyte, parse_str_to_multibyte
20409 * character.c, character.h (count_size_as_multibyte):
20410 Rename from parse_str_to_multibyte; all uses changed.
20411 Check for integer overflow.
20412 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20413 since it's now a duplicate of the other. This is more of
20414 a character than a buffer op, so better that it's in character.c.
20415 * fns.c, print.c: Adjust to above changes.
20416
20417 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20418
20419 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20420
20421 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20422
20423 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20424 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20425 (x_clipboard_manager_save): Now static.
20426 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20427
20428 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20429 (crypto_hash_function): Now static.
20430 Fix pointer signedness problems. Avoid unnecessary initializations.
20431
20432 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
20433
20434 * termhooks.h (Vselection_alist): Make it terminal-local.
20435
20436 * terminal.c (create_terminal): Initialize it.
20437
20438 * xselect.c: Support for clipboard managers.
20439 (Vselection_alist): Move to termhooks.h as terminal-local var.
20440 (LOCAL_SELECTION): New macro.
20441 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20442 (symbol_to_x_atom): Remove gratuitous arg.
20443 (x_handle_selection_request, lisp_data_to_selection_data)
20444 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
20445 (x_own_selection, x_get_local_selection, x_convert_selection):
20446 New arg, specifying work frame. Use terminal-local Vselection_alist.
20447 (some_frame_on_display): Delete unused function.
20448 (Fx_own_selection_internal, Fx_get_selection_internal)
20449 (Fx_disown_selection_internal, Fx_selection_owner_p)
20450 (Fx_selection_exists_p): New optional frame arg.
20451 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20452 (x_handle_selection_clear): Don't treat other terminals with the
20453 same keyboard specially. Use the terminal-local Vselection_alist.
20454 (x_clear_frame_selections): Use Frun_hook_with_args.
20455
20456 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20457
20458 * xterm.h: Add support for those atoms.
20459
20460 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
20461
20462 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20463 (converted_selections, conversion_fail_tag): New global variables.
20464 (x_selection_request_lisp_error): Free the above.
20465 (x_get_local_selection): Remove unnecessary code.
20466 (x_reply_selection_request): Args changed; handle arbitrary array
20467 of converted selections stored in converted_selections.
20468 Separate the XChangeProperty and SelectionNotify steps.
20469 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20470 (x_convert_selection): New function.
20471 (x_handle_selection_event): Simplify.
20472 (x_get_foreign_selection): Don't ignore incoming requests while
20473 waiting for an answer; this will fail when we implement
20474 SAVE_TARGETS, and seems unnecessary anyway.
20475 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20476 (Vx_sent_selection_functions): Doc fix.
20477
20478 2011-05-26 Leo Liu <sdl.web@gmail.com>
20479
20480 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20481
20482 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20483
20484 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20485
20486 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20487 for fringe update if it has periodic bitmap.
20488 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
20489 and fringe_bitmap_periodic_p.
20490
20491 * fringe.c (get_fringe_bitmap_data): New function.
20492 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20493 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20494 row. Mark glyph row for fringe update if periodicity changed.
20495
20496 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20497 for fringe update unless it has periodic bitmap.
20498
20499 2011-05-25 Kenichi Handa <handa@m17n.org>
20500
20501 * xdisp.c (get_next_display_element): Set correct it->face_id for
20502 a static composition.
20503
20504 2011-05-24 Leo Liu <sdl.web@gmail.com>
20505
20506 * deps.mk (fns.o):
20507 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20508
20509 * fns.c (crypto_hash_function, Fsha1): New function.
20510 (Fmd5): Use crypto_hash_function.
20511 (syms_of_fns): Add Ssha1.
20512
20513 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20514
20515 * gnutls.c: Remove unused macros.
20516 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20517 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20518 Remove macros that are defined and never used.
20519 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20520
20521 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20522
20523 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20524 (Fx_get_selection_internal): Minor cleanup.
20525 (Fx_own_selection_internal): Rename arguments for consistency with
20526 select.el.
20527
20528 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20529
20530 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20531
20532 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20533
20534 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20535
20536 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20537
20538 * dispnew.c (scrolling_window): Don't exclude the case that the
20539 last enabled row in the desired matrix touches the bottom boundary.
20540
20541 2011-05-21 Glenn Morris <rgm@gnu.org>
20542
20543 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
20544 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20545 and add some more files.
20546
20547 2011-05-20 Eli Zaretskii <eliz@gnu.org>
20548
20549 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20550 report_file_error introduced by the change from 2011-05-07.
20551
20552 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20553
20554 * systime.h (Time): Define only if emacs is defined.
20555 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20556 where the include path doesn't have X11/X.h by default. See
20557 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20558
20559 2011-05-20 Kenichi Handa <handa@m17n.org>
20560
20561 * composite.c (find_automatic_composition): Fix previous change.
20562
20563 2011-05-20 Glenn Morris <rgm@gnu.org>
20564
20565 * lisp.mk: New file, split from Makefile.in.
20566 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20567 (shortlisp): Remove.
20568 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20569
20570 2011-05-19 Glenn Morris <rgm@gnu.org>
20571
20572 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20573 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20574 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20575 (lisp): Set the order to that of loadup.el.
20576 (shortlisp): Make it a copy of $lisp.
20577 (SOME_MACHINE_LISP): Remove.
20578 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20579 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20580
20581 2011-05-18 Kenichi Handa <handa@m17n.org>
20582
20583 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20584 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20585 (find_automatic_composition): Mostly rewrite for efficiency.
20586
20587 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
20588
20589 * makefile.w32-in: Update dependencies.
20590
20591 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20592
20593 * menu.c: Include limits.h (fixes the MS-Windows build broken by
20594 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
20595
20596 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
20597
20598 Fix some integer overflow issues, such as string length overflow.
20599
20600 * insdel.c (count_size_as_multibyte): Check for string overflow.
20601
20602 * character.c (lisp_string_width): Check for string overflow.
20603 Use EMACS_INT, not int, for string indexes and lengths; in
20604 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20605 the resulting string length overflows an EMACS_INT; instead,
20606 report a string overflow if no precision given. When checking for
20607 precision exhaustion, use a check that cannot possibly have
20608 integer overflow. (Bug#8675)
20609 * character.h (lisp_string_width): Adjust to new signature.
20610
20611 * alloc.c (string_overflow): New function.
20612 (Fmake_string): Use it. This doesn't change behavior, but saves
20613 a few bytes and will simplify future changes.
20614 * character.c (string_escape_byte8): Likewise.
20615 * lisp.h (string_overflow): New decl.
20616
20617 Fixups, following up to the user-interface timestamp change.
20618 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20619 for UI timestamps, instead of unsigned long.
20620 * msdos.c (mouse_get_pos): Likewise.
20621 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
20622 * w32gui.h (Time): Define by including "systime.h" rather than by
20623 declaring it ourselves. (Bug#8664)
20624
20625 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20626 * image.c (clear_image_cache): Likewise.
20627
20628 * term.c (term_mouse_position): Don't assume time_t wraparound.
20629
20630 Be more systematic about user-interface timestamps.
20631 Before, the code sometimes used 'Time', sometimes 'unsigned long',
20632 and sometimes 'EMACS_UINT', to represent these timestamps.
20633 This change causes it to use 'Time' uniformly, as that's what X uses.
20634 This makes the code easier to follow, and makes it easier to catch
20635 integer overflow bugs such as Bug#8664.
20636 * frame.c (Fmouse_position, Fmouse_pixel_position):
20637 Use Time, not unsigned long, for user-interface timestamps.
20638 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20639 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20640 * keyboard.h (last_event_timestamp): Likewise.
20641 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20642 * menu.h (xmenu_show): Likewise.
20643 * term.c (term_mouse_position): Likewise.
20644 * termhooks.h (struct input_event.timestamp): Likewise.
20645 (struct terminal.mouse_position_hook): Likewise.
20646 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20647 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20648 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20649 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20650 what it was before.
20651 * menu.h, termhooks.h: Include "systime.h", for Time.
20652
20653 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20654 Don't assume that the difference between two unsigned long values
20655 can fit into an integer. At this point, we know button_down_time
20656 <= event->timestamp, so the difference must be nonnegative, so
20657 there's no need to cast the result if double-click-time is
20658 nonnegative, as it should be; check that it's nonnegative, just in
20659 case. This bug is triggered when events are more than 2**31 ms
20660 apart (about 25 days). (Bug#8664)
20661
20662 * xselect.c (last_event_timestamp): Remove duplicate decl.
20663 (x_own_selection): Remove needless cast to unsigned long.
20664
20665 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20666 that always fit in int. Use a sentinel instead of a counter, to
20667 avoid a temp and to allay GCC's concerns about possible int overflow.
20668 * frame.h (struct frame): Use int for menu_bar_items_used
20669 instead of EMACS_INT, since it always fits in int.
20670
20671 * menu.c (grow_menu_items): Check for int overflow.
20672
20673 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20674
20675 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20676 Before, the code was not consistent. These values cannot exceed
20677 2**31 - 1 so there's no need to make them unsigned.
20678 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20679 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20680 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20681 as modifiers.
20682 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20683
20684 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20685 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20686 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20687 presumably because the widths might not match.
20688
20689 * window.c (size_window): Avoid needless test at loop start.
20690
20691 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20692
20693 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20694
20695 2011-05-12 Drew Adams <drew.adams@oracle.com>
20696
20697 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20698
20699 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20700
20701 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20702 `width' to `bar_area_x' and `bar_area_width', respectively.
20703 (x_scroll_run): Take account of fringe background extension.
20704
20705 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20706 Rename local vars `left' and `width' to `bar_area_x' and
20707 `bar_area_width', respectively.
20708 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20709 background extension.
20710
20711 2011-05-10 Jim Meyering <meyering@redhat.com>
20712
20713 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20714
20715 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
20716
20717 * image.c (Finit_image_library): Return t for built-in image types,
20718 like pbm and xbm. (Bug#8640)
20719
20720 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20721
20722 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20723
20724 2011-05-07 Eli Zaretskii <eliz@gnu.org>
20725
20726 * w32console.c (Fset_screen_color): Doc fix.
20727 (Fget_screen_color): New function.
20728 (syms_of_ntterm): Defsubr it.
20729
20730 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20731 unlink the temporary file if Fcall_process didn't create it in the
20732 first place.
20733 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20734 child process will be redirected to a file specified with `:file'.
20735 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20736 cue to call_process_cleanup not to close that handle.
20737
20738 2011-05-07 Ben Key <bkey76@gmail.com>
20739
20740 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20741 one of two shell specific rules, either bootstrap-temacs-CMD or
20742 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20743 to the previous implementation of the bootstrap-temacs rule.
20744 The bootstrap-temacs-CMD rule is similar to the previous
20745 implementation of the bootstrap-temacs rule except that it
20746 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20747 variable.
20748
20749 These changes, along with some changes to nt/configure.bat,
20750 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20751 earlier fix to add support for --cflags and --ldflags options
20752 that include quotes so that it works whether make uses cmd or
20753 sh as the shell.
20754
20755 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
20756
20757 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20758 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20759 is a constant.
20760 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20761 a string. Handle both cases.
20762 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20763 (Fdbus_register_method): Use Qinvalid_function.
20764
20765 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20766
20767 * makefile.w32-in: Update dependencies.
20768 (LISP_H): Add inttypes.h and stdin.h.
20769 (PROCESS_H): Add unistd.h.
20770
20771 2011-05-06 Eli Zaretskii <eliz@gnu.org>
20772
20773 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20774 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20775
20776 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
20777
20778 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20779
20780 * term.c (vfatal): Remove stray call to va_end.
20781 It's not needed and the C Standard doesn't allow it here anyway.
20782
20783 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20784 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20785
20786 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20787 bytes.
20788
20789 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20790
20791 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20792
20793 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20794
20795 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20796
20797 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20798
20799 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20800 * charset.c (Fdefine_charset_internal): Don't initialize
20801 charset.code_space[15]. The value was garbage, on hosts with
20802 32-bit int (Bug#8600).
20803
20804 * lread.c (read_integer): Be more consistent with string-to-number.
20805 Use string_to_number to do the actual conversion; this avoids
20806 rounding errors and fixes some other screwups. Without this fix,
20807 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20808 (digit_to_number): Move earlier, for benefit of read_integer.
20809 Return -1 if the digit is out of range for the base, -2 if it is
20810 not a digit in any supported base. (Bug#8602)
20811
20812 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20813
20814 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20815 to match comment at start of function. This also removes a
20816 GCC warning about overflow in a 32+64-bit port.
20817
20818 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20819
20820 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20821 Reported by Stefan Monnier in
20822 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
20823 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20824 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
20825
20826 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20827 (EMACS_UINTPTR): Likewise, with uintptr_t.
20828
20829 * lisp.h: Prefer 64-bit EMACS_INT if available.
20830 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20831 on 32-bit hosts that have 64-bit int, so that they can access
20832 large files.
20833 However, temporarily disable this change unless the temporary
20834 symbol WIDE_EMACS_INT is defined.
20835
20836 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20837
20838 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20839 This removes an assumption that EMACS_INT and long are the same
20840 width as pointers. The assumption is true for Emacs porting targets
20841 now, but we want to make other targets possible.
20842 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20843 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20844 In the rest of the code, change types of integers that hold casted
20845 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20846 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20847 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20848 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20849 No need to cast type when ORing.
20850 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20851 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20852 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20853 assume EMACS_INT is the same width as char *.
20854 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20855 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20856 Remove no-longer-needed casts.
20857 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20858 (xg_tool_bar_help_callback, xg_make_tool_item):
20859 Use EMACS_INTPTR to hold an integer
20860 that will be cast to void *; this can avoid a GCC warning
20861 if EMACS_INT is not the same width as void *.
20862 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20863 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20864 (current_message_1, set_message_1):
20865 Use a local to convert to proper width without a cast.
20866 * xmenu.c (dialog_selection_callback): Likewise.
20867
20868 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20869 Also, don't assume VALBITS / RAND_BITS is less than 5,
20870 and don't rely on undefined behavior when shifting a 1 left into
20871 the sign bit.
20872 * lisp.h (get_random): Change signature to match.
20873
20874 * lread.c (hash_string): Use size_t, not int, for hash computation.
20875 Normally we prefer signed values; but hashing is special, because
20876 it's better to use unsigned division on hash table sizes so that
20877 the remainder is nonnegative. Also, size_t is the natural width
20878 for hashing into memory. The previous code used 'int', which doesn't
20879 retain enough info to hash well into very large tables.
20880 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20881
20882 * dbusbind.c: Don't possibly lose pointer info when converting.
20883 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20884 Use XPNTR rather than XHASH, so that the high-order bits of
20885 the pointer aren't lost when converting through void *.
20886
20887 * eval.c (Fautoload): Don't double-shift a pointer.
20888
20889 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20890
20891 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20892
20893 * gnutls.c (DEF_GNUTLS_FN):
20894 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20895
20896 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20897
20898 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20899 marker. (Bug#8610)
20900
20901 2011-05-05 Eli Zaretskii <eliz@gnu.org>
20902
20903 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20904 New version that can reserve upto 2GB of heap space.
20905
20906 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
20907
20908 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20909
20910 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20911
20912 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20913 `gnutls_certificate_set_x509_key_file'.
20914
20915 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
20916
20917 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20918 Update dependencies.
20919
20920 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20921
20922 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20923 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20924 Remove unused parameter `fildes'.
20925 * process.c (read_process_output, send_process): Don't pass it.
20926
20927 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20928
20929 Fix previous change: the library cache is defined in w32.c.
20930 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20931 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20932
20933 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20934
20935 Implement dynamic loading of GnuTLS on Windows.
20936
20937 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20938 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20939 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20940 Declare.
20941
20942 * gnutls.c (Qgnutls_dll): Define.
20943 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20944 (gnutls_*): Declare function pointers.
20945 (init_gnutls_functions): New function to initialize function pointers.
20946 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20947 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20948 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20949 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20950 (emacs_gnutls_write, emacs_gnutls_read)
20951 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20952 (Fgnutls_available_p): New function.
20953 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20954 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20955 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20956
20957 * image.c: Include w32.h.
20958 (Vimage_type_cache): Delete.
20959 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20960 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20961 (w32_delayed_load): Move to w32.c.
20962
20963 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20964
20965 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20966 (w32_delayed_load): Move from image.c. When loading a library, record
20967 its filename in the :loaded-from property of the library id.
20968 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20969 Initialize and staticpro them.
20970 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20971
20972 * process.c: Include lisp.h before w32.h, not after.
20973 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20974 instead of gnutls_record_check_pending.
20975
20976 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20977
20978 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20979
20980 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20981 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20982 as passed in.
20983
20984 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20985
20986 * xterm.c (x_set_frame_alpha): Do not set property on anything
20987 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20988
20989 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20990
20991 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20992
20993 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20994
20995 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20996 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20997 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20998 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20999 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21000 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21001 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21002 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21003 (Qgnutls_bootprop_callbacks_verify): Make static.
21004
21005 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21006
21007 * callproc.c: Indentation fixup.
21008
21009 * sysdep.c (wait_for_termination_1): Make static.
21010 (wait_for_termination, interruptible_wait_for_termination):
21011 Move after wait_for_termination_1.
21012
21013 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21014
21015 * sysdep.c (interruptible_wait_for_termination): New function
21016 which is like wait_for_termination, but allows keyboard
21017 interruptions.
21018
21019 * callproc.c (Fcall_process): Add (:file "file") as an option for
21020 the STDOUT buffer.
21021 (Fcall_process_region): Ditto.
21022
21023 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21024
21025 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21026 rather than `XVECTOR (FOO)->size'.
21027
21028 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21029 inttypes.h, as a gnulib replacement is used if it not available in
21030 system headers.
21031
21032 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21033
21034 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21035 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21036 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21037
21038 * coding.c (coding_alloc_by_realloc): Error out if destination
21039 will grow beyond MOST_POSITIVE_FIXNUM.
21040 (decode_coding_emacs_mule): Abort if there isn't enough place in
21041 charbuf for the composition carryover bytes. Reserve an extra
21042 space for up to 2 characters produced in a loop.
21043 (decode_coding_iso_2022): Abort if there isn't enough place in
21044 charbuf for the composition carryover bytes.
21045
21046 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21047
21048 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21049 aborting when %lld or %lll format is passed.
21050 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21051 %llo or %llx format is passed. (Bug#8545)
21052
21053 * window.c (window_scroll_line_based): Use a marker instead of
21054 simple variables to record original value of point. (Bug#7952)
21055
21056 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21057 produced by %s or %c overflows available buffer space. (Bug#8545)
21058
21059 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21060
21061 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21062 (SIZE_MAX): Move defn after all includes, as they might #define it.
21063
21064 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21065
21066 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21067
21068 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21069
21070 * keyboard.c (Qdelayed_warnings_hook): Define.
21071 (command_loop_1): Run `delayed-warnings-hook'
21072 if Vdelayed_warnings_list is non-nil.
21073 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21074 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21075
21076 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21077
21078 * doprnt.c (doprnt): Don't return value smaller than the buffer
21079 size if the message was truncated. (Bug#8545).
21080
21081 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21082
21083 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21084 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21085
21086 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21087
21088 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21089
21090 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21091
21092 * makefile.w32-in: Update dependencies.
21093
21094 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21095
21096 Improve `doprnt' and its usage. (Bug#8545)
21097 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21098 `format_end'. Remove support for %l as a conversion specifier.
21099 Don't use xrealloc. Improve diagnostics when the %l size modifier
21100 is used. Update the commentary.
21101
21102 * eval.c (verror): Simplify calculation of size_t.
21103
21104 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21105 messages.
21106
21107 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21108
21109 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21110 change.
21111
21112 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21113
21114 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21115 This makes this file independent of the recent pseudovector change.
21116
21117 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21118
21119 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21120
21121 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21122 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21123 Remove unused local.
21124 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21125
21126 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21127 GCC 4.6.0 optimizes based on type-based alias analysis.
21128 For example, if b is of type struct buffer * and v of type struct
21129 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21130 != &v->size, and therefore "v->size = 1; b->size = 2; return
21131 v->size;" must therefore return 1. This assumption is incorrect
21132 for Emacs, since it type-puns struct Lisp_Vector * with many other
21133 types. To fix this problem, this patch adds a new type struct
21134 vectorlike_header that documents the constraints on layout of vectors
21135 and pseudovectors, and helps optimizing compilers not get fooled
21136 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21137 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21138 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21139 the size member.
21140 (XSETPVECTYPE): Rewrite in terms of new macro.
21141 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21142 This is a bit clearer, and further avoids the possibility of
21143 undesirable aliasing.
21144 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21145 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21146 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21147 since Lisp_Subr is a special case (no "next" field).
21148 (ASIZE): Now uses header.size rather than size.
21149 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21150 to avoid the hassle of writing XVECTOR (foo)->header.size.
21151 (struct vectorlike_header): New type.
21152 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21153 object, to help avoid aliasing.
21154 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21155 (SUBRP): Likewise, since Lisp_Subr is a special case.
21156 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21157 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21158 (struct Lisp_Hash_Table): Combine first two members into a single
21159 struct vectorlike_header member. All uses of "size" and "next" members
21160 changed to be "header.size" and "header.next".
21161 * buffer.h (struct buffer): Likewise.
21162 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21163 * frame.h (struct frame): Likewise.
21164 * process.h (struct Lisp_Process): Likewise.
21165 * termhooks.h (struct terminal): Likewise.
21166 * window.c (struct save_window_data, struct saved_window): Likewise.
21167 * window.h (struct window): Likewise.
21168 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21169 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21170 * buffer.c (init_buffer_once): Likewise.
21171 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21172 special case.
21173 * process.c (Fformat_network_address): Use local var for size,
21174 for brevity.
21175
21176 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21177
21178 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21179 * data.c (atof): Remove decl; no longer used or needed.
21180 (digit_to_number): Move to lread.c.
21181 (Fstring_to_number): Use new string_to_number function, to be
21182 consistent with how the Lisp reader treats infinities and NaNs.
21183 Do not assume that floating-point numbers represent EMACS_INT
21184 without losing information; this is not true on most 64-bit hosts.
21185 Avoid double-rounding errors, by insisting on integers when
21186 parsing non-base-10 numbers, as the documentation specifies.
21187 * lisp.h (string_to_number): New decl, replacing ...
21188 (isfloat_string): Remove.
21189 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21190 (read1): Do not accept +. and -. as integers; this
21191 appears to have been a coding error. Similarly, do not accept
21192 strings like +-1e0 as floating point numbers. Do not report
21193 overflow for integer overflows unless the base is not 10 which
21194 means we have no simple and reliable way to continue.
21195 Break out the floating-point parsing into a new
21196 function string_to_number, so that Fstring_to_number parses
21197 floating point numbers consistently with the Lisp reader.
21198 (digit_to_number): Move here from data.c. Make it static inline.
21199 (E_CHAR, EXP_INT): Remove, replacing with ...
21200 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21201 (string_to_number): New function, replacing isfloat_string.
21202 This function checks for valid syntax and produces the resulting
21203 Lisp float number too. Rework it so that string-to-number
21204 no longer mishandles examples like "1.0e+". Use strtoumax,
21205 so that overflow for non-base-10 numbers is reported only when
21206 there's no portable and simple way to convert to floating point.
21207
21208 * textprop.c (set_text_properties_1): Rewrite for clarity,
21209 and to avoid GCC warning about integer overflow.
21210
21211 * intervals.h (struct interval): Use EMACS_INT for members
21212 where EMACS_UINT might cause problems. See
21213 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21214 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21215 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21216 All uses changed.
21217 (offset_intervals): Tell GCC not to worry about length overflow
21218 when negating a negative length.
21219
21220 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21221 (overrun_check_free): Likewise.
21222
21223 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21224 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21225 word size.
21226
21227 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21228 (gnutls_make_error): Rename local to avoid shadowing.
21229 (gnutls_emacs_global_deinit): ifdef out; not used.
21230 (Fgnutls_boot): Use const for pointer to readonly storage.
21231 Comment out unused local. Fix pointer signedness problems.
21232
21233 * lread.c (openp): Don't stuff size_t into an 'int'.
21234 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21235 about possible signed overflow.
21236
21237 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21238 (GDK_KEY_g): Don't define if already defined.
21239 (xg_prepare_tooltip): Avoid pointer signedness problem.
21240 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21241
21242 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21243 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21244
21245 * xfns.c (Fx_window_property): Simplify a bit,
21246 to make a bit faster and to avoid GCC 4.6.0 warning.
21247 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21248
21249 * fns.c (internal_equal): Don't assume size_t fits in int.
21250
21251 * alloc.c (compact_small_strings): Tighten assertion a little.
21252
21253 Replace pEd with more-general pI, and fix some printf arg casts.
21254 * lisp.h (pI): New macro, generalizing old pEd macro to other
21255 conversion specifiers. For example, use "...%"pI"d..." rather
21256 than "...%"pEd"...".
21257 (pEd): Remove. All uses replaced with similar uses of pI.
21258 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21259 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21260 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21261 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21262 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21263 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21264 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21265 64-bit hosts.
21266 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21267 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21268 * print.c (safe_debug_print, print_object): Likewise.
21269 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21270 to int.
21271 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21272 avoiding the 0 flag, which is not portable.
21273 * process.c (Fmake_network_process): Use pI to avoid cast.
21274 * region-cache.c (pp_cache): Likewise.
21275 * xdisp.c (decode_mode_spec): Likewise.
21276 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21277 behavior on 64-bit hosts with printf arg.
21278 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21279 (x_stop_queuing_selection_requests): Likewise.
21280 (x_get_window_property): Don't truncate byte count to an 'int'
21281 when tracing.
21282
21283 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21284 here, since it parses constructs like leading '-' and spaces,
21285 which are not wanted; and it overflows with large numbers.
21286 Instead, simply match F[0-9]+, which is what is wanted anyway.
21287
21288 * alloc.c: Remove unportable assumptions about struct layout.
21289 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21290 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21291 (allocate_vectorlike, make_pure_vector): Use the new macros,
21292 plus offsetof, to remove unportable assumptions about struct layout.
21293 These assumptions hold on all porting targets that I know of, but
21294 they are not guaranteed, they're easy to remove, and removing them
21295 makes further changes easier.
21296
21297 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21298 This doesn't fix a bug but makes the code clearer.
21299 (string_overrun_cookie): Now const. Use initializers that
21300 don't formally overflow signed char, to avoid warnings.
21301 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21302 can cause Emacs to crash when string overrun checking is enabled.
21303 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21304 multiple of sizeof (EMACS_INT); it need not be, if
21305 alignof(EMACS_INT) < sizeof (EMACS_INT).
21306 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21307
21308 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21309
21310 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21311
21312 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21313
21314 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21315 supposed to be handshaking. (Bug#8556)
21316 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21317
21318 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21319
21320 * lisp.h (Qdebug): List symbol.
21321 * eval.c (Qdebug): Restore global linkage.
21322 * keyboard.c (debug-on-event): New variable.
21323 (handle_user_signal): Break into debugger when debug-on-event
21324 matches the current signal symbol.
21325
21326 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21327
21328 * alloc.c (check_sblock, check_string_bytes)
21329 (check_string_free_list): Convert to standard C.
21330
21331 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21332
21333 * w32.c (emacs_gnutls_push): Fix typo.
21334
21335 2011-04-25 Eli Zaretskii <eliz@gnu.org>
21336
21337 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21338 "cast to pointer from integer of different size".
21339
21340 Improve doprnt and its use in verror. (Bug#8545)
21341 * doprnt.c (doprnt): Document the set of format control sequences
21342 supported by the function. Use SAFE_ALLOCA instead of always
21343 using `alloca'.
21344
21345 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21346 is one byte too soon. Don't use xrealloc; instead xfree and
21347 xmalloc anew.
21348
21349 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21350
21351 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21352 callbacks stage.
21353
21354 * gnutls.c: Renamed global_initialized to
21355 gnutls_global_initialized. Added internals for the
21356 :verify-hostname-error, :verify-error, and :verify-flags
21357 parameters of `gnutls-boot' and documented those parameters in the
21358 docstring. Start callback support.
21359 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21360 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21361 on error. Return error code.
21362 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21363 (emacs_gnutls_read): Likewise.
21364 (Fgnutls_boot): Return handshake error code.
21365 (emacs_gnutls_handle_error): New function.
21366 (wsaerror_to_errno): Likewise.
21367
21368 * w32.h (emacs_gnutls_pull): Add prototype.
21369 (emacs_gnutls_push): Likewise.
21370
21371 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21372 (emacs_gnutls_push): Likewise.
21373
21374 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21375
21376 * process.c (wait_reading_process_output): Check if GnuTLS
21377 buffered some data internally if no FDs are set for TLS
21378 connections.
21379
21380 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21381 (LIBS): Link to USER_LIBS.
21382 ($(BLD)/gnutls.$(0)): New target.
21383
21384 2011-04-24 Eli Zaretskii <eliz@gnu.org>
21385
21386 * xdisp.c (handle_single_display_spec): Rename the
21387 display_replaced_before_p argument into display_replaced_p, to
21388 make it consistent with the commentary. Fix typos in the
21389 commentary.
21390
21391 * textprop.c (syms_of_textprop): Remove dead code.
21392 (copy_text_properties): Delete obsolete commentary about an
21393 interface that was deleted long ago. Fix typos in the description
21394 of arguments.
21395
21396 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21397 to changes in oldXMenu/XMenu.h from 2011-04-16.
21398 <menu_help_message, prev_menu_help_message>: Constify.
21399 (IT_menu_make_room): menu->help_text is now `const char **';
21400 adjust.
21401
21402 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21403 to changes in oldXMenu/XMenu.h from 2011-04-16.
21404 (struct XMenu): Declare `help_text' `const char **'.
21405
21406 * xfaces.c <Qunspecified>: Make extern again.
21407
21408 * syntax.c: Include sys/types.h before including regex.h, as
21409 required by POSIX.
21410
21411 * doc.c (get_doc_string): Improve the format passed to `error'.
21412
21413 * doprnt.c (doprnt): Improve commentary.
21414
21415 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21416
21417 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21418 them with etags.
21419
21420 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21421 changes in globals.h immediately force recompilation.
21422 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21423 $(CURDIR)/s/ms-w32.h.
21424 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
21425
21426 * character.c (Fchar_direction): Function deleted.
21427 (syms_of_character): Don't defsubr it.
21428 <char-direction-table>: Deleted.
21429
21430 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21431
21432 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21433 * doprnt.c: Include limits.h.
21434 (SIZE_MAX): New macro.
21435 (doprnt): Return a size_t value. 2nd arg is now size_t.
21436 Many local variables are now size_t instead of int or unsigned.
21437 Improve overflow protection. Support `l' modifier for integer
21438 conversions. Support %l conversion. Don't assume an EMACS_INT
21439 argument for integer conversions and for %c.
21440
21441 * lisp.h (doprnt): Restore prototype.
21442
21443 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21444 $(SRC)/character.h.
21445
21446 * Makefile.in (base_obj): Add back doprnt.o.
21447
21448 * deps.mk (doprnt.o): Add back prerequisites.
21449 (callint.o): Depend on character.h.
21450
21451 * eval.c (internal_lisp_condition_case): Include the handler
21452 representation in the error message.
21453 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21454 when breaking from the loop.
21455
21456 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21457
21458 * callint.c (Fcall_interactively): When displaying error message
21459 about invalid control letter, pass the character's codepoint, not
21460 a pointer to its multibyte form. Improve display of the character
21461 in octal and display also its hex code.
21462
21463 * character.c (char_string): Use %x to display the (unsigned)
21464 codepoint of an invalid character, to avoid displaying a bogus
21465 negative value.
21466
21467 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21468 `error', not SYMBOL_NAME itself.
21469
21470 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21471 character arguments to `error'.
21472
21473 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21474 to `error' in error message about FINAL_CHAR argument. Make sure
21475 FINAL_CHAR is a character, and use %c when it is passed as
21476 argument to `error'.
21477
21478 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21479
21480 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21481
21482 * w32.c: Include <time.h>.
21483 (sys_localtime): New function.
21484
21485 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
21486
21487 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21488
21489 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
21490
21491 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
21492
21493 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21494 zombies (Bug#8467).
21495
21496 2011-04-19 Eli Zaretskii <eliz@gnu.org>
21497
21498 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21499 gl_state.e_property when gl_state.object is Qt.
21500
21501 * insdel.c (make_gap_larger): Remove limitation of buffer size
21502 to <= INT_MAX.
21503
21504 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
21505
21506 * xdisp.c (lookup_glyphless_char_display)
21507 (produce_glyphless_glyph): Handle cons cell entry in
21508 glyphless-char-display.
21509 (Vglyphless_char_display): Document it.
21510
21511 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21512 glyphless-char-display.
21513
21514 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
21515
21516 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21517
21518 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21519
21520 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21521 definition for no-X builds.
21522
21523 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
21524
21525 Static checks with GCC 4.6.0 and non-default toolkits.
21526
21527 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21528
21529 * process.c (keyboard_bit_set): Define only if SIGIO.
21530 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21531 (send_process): Repair possible setjmp clobbering.
21532
21533 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21534
21535 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21536
21537 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21538
21539 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21540 Define only if needed.
21541
21542 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21543 by pacifying GCC about it. Maybe it's time to retire it?
21544 * xfaces.c (USG, __TIMEVAL__): Likewise.
21545
21546 * dispextern.h (struct redisplay_interface): Rename param
21547 to avoid shadowing.
21548 * termhooks.h (struct terminal): Likewise.
21549 * xterm.c (xembed_send_message): Likewise.
21550
21551 * insdel.c (make_gap_smaller): Define only if
21552 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21553
21554 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21555 it.
21556
21557 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21558 so that we aren't warned about unused symbols.
21559
21560 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21561
21562 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
21563
21564 * xfns.c (x_real_positions): Mark locals as initialized.
21565
21566 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21567
21568 * xterm.c: Fix problems found by static analysis with other toolkits.
21569 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
21570 (x_dispatch_event): Declare static if USE_GTK, and
21571 define if USE_GTK || USE_X_TOOLKIT.
21572 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
21573 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
21574 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21575 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
21576
21577 * xmenu.c (menu_help_callback): Pointer type fixes.
21578 Use const pointers when pointing at readonly data. Avoid pointer
21579 signedness clashes.
21580 (FALSE): Remove unused macro.
21581 (update_frame_menubar): Remove unused decl.
21582
21583 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21584
21585 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21586 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21587 (single_menu_item): Rename local to avoid shadowing.
21588
21589 * keyboard.c (make_lispy_event): Remove unused local var.
21590
21591 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21592 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21593
21594 * bitmaps: Change bitmaps from unsigned char back to the X11
21595 compatible char. Avoid the old compiler warnings about
21596 out-of-range initializers by using, for example, '\xab' rather
21597 than 0xab.
21598
21599 * xgselect.c (xgselect_initialize): Check vs interface
21600 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21601
21602 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21603
21604 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21605 to read-only memory.
21606
21607 * fns.c (vector): Remove; this old hack is no longer needed.
21608
21609 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
21610 Remove unused var.
21611 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
21612
21613 * xrdb.c (x_load_resources): Omit unused local.
21614
21615 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
21616 (x_window): Rename locals to avoid shadowing.
21617 (USG): Use the kludged USG macro, to pacify gcc.
21618
21619 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
21620 (x_term_init): Remove local to avoid shadowing.
21621
21622 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
21623
21624 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21625 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21626
21627 2011-04-16 Eli Zaretskii <eliz@gnu.org>
21628
21629 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21630
21631 Fix regex.c, syntax.c and friends for buffers > 2GB.
21632 * syntax.h (struct gl_state_s): Declare character position members
21633 EMACS_INT.
21634
21635 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21636
21637 * textprop.c (verify_interval_modification, interval_of):
21638 Declare arguments EMACS_INT.
21639
21640 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21641 EMACS_INT.
21642
21643 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21644
21645 * indent.c (Fvertical_motion): Local variable it_start is now
21646 EMACS_INT.
21647
21648 * regex.c (re_match, re_match_2, re_match_2_internal)
21649 (bcmp_translate, regcomp, regexec, print_double_string)
21650 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21651 (re_compile_pattern, re_exec): Declare arguments and local
21652 variables `size_t' and `ssize_t' and return values `regoff_t', as
21653 appropriate.
21654 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21655 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21656 <compile_stack_type>: `size' and `avail' are now `size_t'.
21657
21658 * regex.h <regoff_t>: Use ssize_t, not int.
21659 (re_search, re_search_2, re_match, re_match_2): Arguments that
21660 specify buffer/string position and length are now ssize_t and
21661 size_t. Return type is regoff_t.
21662
21663 2011-04-16 Ben Key <bkey76@gmail.com>
21664
21665 * nsfont.m: Fixed bugs in ns_get_family and
21666 ns_descriptor_to_entity that were caused by using free to
21667 deallocate memory blocks that were allocated by xmalloc (via
21668 xstrdup). This caused Emacs to crash when compiled with
21669 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21670 --enable-checking=xmallocoverrun). xfree is now used to
21671 deallocate these memory blocks.
21672
21673 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
21674
21675 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21676
21677 emacs_write: Accept and return EMACS_INT for sizes.
21678 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21679 et seq.
21680 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21681 Accept and return EMACS_INT.
21682 (emacs_gnutls_write): Return the number of bytes written on
21683 partial writes.
21684 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
21685 (emacs_read, emacs_write): Remove check for negative size, as the
21686 Emacs source code has been audited now.
21687 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21688 (emacs_read, emacs_write): Use it.
21689 * process.c (send_process): Adjust to the new signatures of
21690 emacs_write and emacs_gnutls_write. Do not attempt to store
21691 a byte offset into an 'int'; it might overflow.
21692 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
21693
21694 * sound.c: Don't assume sizes fit in 'int'.
21695 (struct sound_device.period_size, alsa_period_size):
21696 Return EMACS_INT, not int.
21697 (struct sound_device.write, vox_write, alsa_write):
21698 Accept EMACS_INT, not int.
21699 (wav_play, au_play): Use EMACS_INT to store sizes and to
21700 record read return values.
21701
21702 2011-04-15 Ben Key <bkey76@gmail.com>
21703
21704 * keyboard.c (Qundefined): Don't declare static since it is used
21705 in nsfns.m.
21706 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21707 static since they are used in nsfont.m.
21708
21709 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21710
21711 * process.c (Qprocessp): Don't declare static.
21712 * lisp.h (Qprocessp): Declare again.
21713
21714 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
21715
21716 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21717
21718 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21719
21720 Improve C-level modularity by making more things 'static'.
21721
21722 Don't publish debugger-only interfaces to other modules.
21723 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21724 (verify_bytepos, count_markers): Move decls to the only modules
21725 that need them.
21726 * region-cache.h (pp_cache): Likewise.
21727 * window.h (check_all_windows): Likewise.
21728 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21729
21730 * sysdep.c (croak): Now static, if
21731 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21732 * syssignal.h (croak): Declare only if not static.
21733
21734 * alloc.c (refill_memory_reserve): Now static if
21735 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21736 * lisp.h (refill_memory_reserve): Declare only if not static.
21737
21738 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21739 Define only if USE_LUCID.
21740
21741 * xrdb.c (x_customization_string, x_rm_string): Now static.
21742
21743 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21744 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21745
21746 * xdisp.c (draw_row_with_mouse_face): Now static.
21747 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21748
21749 * window.h (check_all_windows): Mark externally visible.
21750
21751 * window.c (window_deletion_count): Now static.
21752
21753 * undo.c: Make symbols static if they're not exported.
21754 (last_undo_buffer, last_boundary_position, pending_boundary):
21755 Now static.
21756
21757 * textprop.c (interval_insert_behind_hooks): Now static.
21758 (interval_insert_in_front_hooks): Likewise.
21759
21760 * term.c: Make symbols static if they're not exported.
21761 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21762 (max_frame_lines, tty_set_terminal_modes):
21763 (tty_reset_terminal_modes, tty_turn_off_highlight):
21764 (get_tty_terminal): Now static.
21765 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21766 * termhooks.h (term_mouse_moveto): Do not declare if
21767 HAVE_WINDOW_SYSTEM.
21768 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21769 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21770
21771 * sysdep.c: Make symbols static if they're not exported.
21772 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21773 Now static.
21774 (sigprocmask_set, full_mask): Remove; unused.
21775 (wait_debugging): Mark as visible.
21776 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21777 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21778
21779 * syntax.c (syntax_temp): Define only if !__GNUC__.
21780
21781 * sound.c (current_sound_device, current_sound): Now static.
21782
21783 * search.c (searchbufs, searchbuf_head): Now static.
21784
21785 * scroll.c (scroll_cost): Remove; unused.
21786 * dispextern.h (scroll_cost): Remove decl.
21787
21788 * region-cache.h (pp_cache): Mark as externally visible.
21789
21790 * process.c: Make symbols static if they're not exported.
21791 (process_tick, update_tick, create_process, chan_process):
21792 (Vprocess_alist, proc_buffered_char, datagram_access):
21793 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21794 (deactivate_process): Mark defn as static, as well as decl.
21795 * lisp.h (create_process): Remove decl.
21796 * process.h (chan_process, Vprocess_alist): Remove decls.
21797
21798 * print.c: Make symbols static if they're not exported.
21799 (print_depth, new_backquote_output, being_printed, print_buffer):
21800 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21801 (print_interval, print_number_index, initial_stderr_stream):
21802 Now static.
21803 * lisp.h (Fprinc): Remove decl.
21804 (debug_output_compilation_hack): Mark as externally visible.
21805
21806 * sysdep.c (croak): Move decl from here to syssignal.h.
21807 * syssignal.h (croak): Put it here, so the API can be checked when
21808 'croak' is called from dissociate_if_controlling_tty.
21809
21810 * minibuf.c: Make symbols static if they're not exported.
21811 (minibuf_save_list, choose_minibuf_frame): Now static.
21812 * lisp.h (choose_minibuf_frame): Remove decl.
21813
21814 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21815
21816 * lread.c: Make symbols static if they're not exported.
21817 (read_objects, initial_obarray, oblookup_last_bucket_number):
21818 Now static.
21819 (make_symbol): Remove; unused.
21820 * lisp.h (initial_obarray, make_symbol): Remove decls.
21821
21822 * keyboard.c: Make symbols static if they're not exported.
21823 (single_kboard, recent_keys_index, total_keys, recent_keys):
21824 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21825 (this_single_command_key_start, echoing, last_auto_save):
21826 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21827 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21828 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21829 (Vlispy_mouse_stem, double_click_count):
21830 Now static.
21831 (force_auto_save_soon): Define only if SIGDANGER.
21832 (ignore_mouse_drag_p): Now static if
21833 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21834 (print_help): Remove; unused.
21835 (stop_character, last_timer_event): Mark as externally visible.
21836 * keyboard.h (ignore_mouse_drag_p): Declare only if
21837 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21838 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21839 * lisp.h (echoing): Remove decl.
21840 (force_auto_save_soon): Declare only if SIGDANGER.
21841 * xdisp.c (redisplay_window): Simplify code, to make it more
21842 obvious that ignore_mouse_drag_p is not accessed if !defined
21843 USE_GTK && !defined HAVE_NS.
21844
21845 * intervals.c: Make symbols static if they're not exported.
21846 (merge_properties_sticky, merge_interval_right, delete_interval):
21847 Now static.
21848 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21849
21850 * insdel.c: Make symbols static if they're not exported.
21851 However, leave prepare_to_modify_buffer alone. It's never
21852 called from outside this function, but that appears to be a bug.
21853 (combine_after_change_list, combine_after_change_buffer):
21854 (adjust_after_replace, signal_before_change): Now static.
21855 (adjust_after_replace_noundo): Remove; unused.
21856 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
21857 (signal_before_change): Remove decls.
21858
21859 * indent.c (val_compute_motion, val_vmotion): Now static.
21860
21861 * image.c: Make symbols static if they're not exported.
21862 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21863 if USE_GTK.
21864 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21865 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21866
21867 * fringe.c (standard_bitmaps): Now static.
21868 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21869
21870 * frame.c: Make symbols static if they're not exported.
21871 (x_report_frame_params, make_terminal_frame): Now static.
21872 (get_frame_param): Now static, unless HAVE_NS.
21873 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21874 (x_get_resource_string): Remove; not used.
21875 * frame.h (make_terminal_frame, x_report_frame_params):
21876 (x_get_resource_string); Remove decls.
21877 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21878 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21879
21880 * font.c, fontset.c: Make symbols static if they're not exported.
21881 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21882 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21883 * font.c (font_close_object): Now static.
21884 * font.h (font_close_object): Remove.
21885 * fontset.c (FONTSET_OBJLIST): Remove.
21886 (free_realized_fontset) #if-0 the body, which does nothing.
21887 (face_suitable_for_char_p): #if-0, as it's never called.
21888 * fontset.h (face_suitable_for_char_p): Remove decl.
21889 * xfaces.c (face_at_string_position):
21890 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
21891 since 0 is always ASCII.
21892
21893 * fns.c (weak_hash_tables): Now static.
21894
21895 * fileio.c: Make symbols static if they're not exported.
21896 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21897 (Vwrite_region_annotation_buffers): Now static.
21898
21899 * eval.c: Make symbols static if they're not exported.
21900 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21901 * lisp.h (backtrace_list): Remove decl.
21902
21903 * emacs.c: Make symbols static if they're not exported.
21904 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21905 (fatal_error_code, fatal_error_signal_hook, standard_args):
21906 Now static.
21907 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21908 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21909 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21910 * lisp.h (fatal_error_signal_hook): Remove decl.
21911 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21912
21913 * editfns.c: Move a (normally-unused) function to its only use.
21914 * editfns.c, lisp.h (get_operating_system_release): Remove.
21915 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21916 worth the hassle of breaking this out.
21917
21918 * xterm.c: Make symbols static if they're not exported.
21919 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21920 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21921 (x_destroy_window, x_delete_display):
21922 Now static.
21923 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21924 (x_mouse_leave): Remove; unused.
21925 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21926 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21927 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21928 Remove decls.
21929 (x_mouse_leave): Declare only if WINDOWSNT.
21930 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21931 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21932 USE_X_TOOLKIT.
21933
21934 * ftxfont.c: Make symbols static if they're not exported.
21935 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21936 HAVE_FREETYPE.
21937 * font.h (ftxfont_driver): Likewise.
21938
21939 * xfns.c: Make symbols static if they're not exported.
21940 (x_last_font_name, x_display_info_for_name):
21941 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21942 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21943 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21944 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21945 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21946 (last_show_tip_args): Now static.
21947 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21948 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21949 (x_screen_planes): Remove; unused.
21950 * dispextern.h (x_screen_planes): Remove decl.
21951
21952 * dispnew.c: Make symbols static if they're not exported.
21953 * dispextern.h (redraw_garbaged_frames, scrolling):
21954 (increment_row_positions): Remove.
21955 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21956 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21957 Now static.
21958 (redraw_garbaged_frames): Remove; unused.
21959
21960 * xfaces.c: Make symbols static if they're not exported.
21961 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21962 Remove decls.
21963 * xterm.h (defined_color): Remove decls.
21964 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21965 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21966 (menu_face_changed_default, defined_color, free_realized_face):
21967 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21968 (ascii_face_of_lisp_face): Remove; unused.
21969
21970 * xdisp.c: Make symbols static if they're not exported.
21971 * dispextern.h (scratch_glyph_row, window_box_edges):
21972 (glyph_to_pixel_coords, set_cursor_from_row):
21973 (get_next_display_element, set_iterator_to_next):
21974 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21975 (show_mouse_face): Remove decls
21976 * frame.h (message_buf_print): Likewise.
21977 * lisp.h (pop_message, set_message, check_point_in_composition):
21978 Likewise.
21979 * xterm.h (set_vertical_scroll_bar): Likewise.
21980 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21981 (message_buf_print, scratch_glyph_row, displayed_buffer):
21982 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21983 (get_next_display_element, show_mouse_face, window_box_edges):
21984 (frame_to_window_pixel_xy, check_point_in_composition):
21985 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21986 (glyph_to_pixel_coords): Remove; unused.
21987
21988 * dired.c (file_name_completion): Now static.
21989
21990 * dbusbind.c (xd_in_read_queued_messages): Now static.
21991
21992 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21993 * data.c (circular_list_error): Remove.
21994
21995 * commands.h (last_point_position, last_point_position_buffer):
21996 (last_point_position_window): Remove decls.
21997 * keyboard.c: Make these variables static.
21998
21999 * coding.h (coding, code_convert_region, encode_coding_gap):
22000 Remove decls.
22001 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22002 (iso_code_class, detect_coding, code_convert_region): Now static.
22003 (encode_coding_gap): Remove; unused.
22004
22005 * chartab.c (chartab_chars, chartab_bits): Now static.
22006
22007 * charset.h (charset_iso_8859_1): Remove decl.
22008 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22009 Now static.
22010
22011 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22012 * ccl.c (Vccl_program_table): Now static.
22013 (check_ccl_update): Remove; unused.
22014
22015 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22016 * category.h: ... from here.
22017 * category.c (check_category_table, set_category_set): Now static.
22018
22019 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22020 * lisp.h: Remove these decls.
22021
22022 * buffer.c (buffer_count): Remove unused var.
22023
22024 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22025 so that it's not optimized away.
22026 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22027 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22028 exported only to the debugger.
22029
22030 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22031 * atimer.h (run_all_atimers): Remove; not exported.
22032
22033 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22034 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22035 was inaccessible from Lisp.
22036 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22037 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22038
22039 alloc.c: Import and export fewer symbols, and remove unused items.
22040 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22041 is defined.
22042 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22043 it's not optimized away by whole-program optimization.
22044 (message_enable_multibyte, free_misc): Remove.
22045 (catchlist, handlerlist, mark_backtrace):
22046 Declare only if BYTE_MARK_STACK.
22047 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22048 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22049 (message_enable_multibyte): Remove decl.
22050 (free_misc, interval_free_list, float_block, float_block_index):
22051 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22052 (cons_free_list, last_marked_index):
22053 Now static.
22054 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22055 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22056 (mark_backtrace): Define only if BYTE_MARK_STACK.
22057 * xdisp.c (message_enable_multibyte): Now static.
22058
22059 Declare Lisp_Object Q* variables to be 'static' if not exported.
22060 This makes it easier for human readers (and static analyzers)
22061 to see whether these variables are used from other modules.
22062 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22063 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22064 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22065 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22066 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22067 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22068 * xmenu.c, xselect.c:
22069 Declare Q* vars static if they are not used in other modules.
22070 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22071 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22072 Remove decls of unexported vars.
22073 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22074
22075 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22076
22077 Make Emacs functions such as Fatom 'static' by default.
22078 This makes it easier for human readers (and static analyzers)
22079 to see whether these functions can be called from other modules.
22080 DEFUN now defines a static function. To make the function external
22081 so that it can be used in other C modules, use the new macro DEFUE.
22082 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22083 (Finit_image_library):
22084 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22085 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22086 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22087 Remove decls, since these functions are now static.
22088 (Funintern, Fget_internal_run_time): New decls, since these functions
22089 were already external.
22090
22091 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22092 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22093 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22094 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22095 * keyboard.c, keymap.c, lread.c:
22096 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22097 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22098 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22099 Mark functions with DEFUE instead of DEFUN,
22100 if they are used in other modules.
22101 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22102 decls for now-static functions.
22103 * buffer.h (Fdelete_overlay): Remove decl.
22104 * callproc.c (Fgetenv_internal): Mark as internal.
22105 * composite.c (Fremove_list_of_text_properties): Remove decl.
22106 (Fcomposition_get_gstring): New forward static decl.
22107 * composite.h (Fcomposite_get_gstring): Remove decl.
22108 * dired.c (Ffile_attributes): New forward static decl.
22109 * doc.c (Fdocumntation_property): New forward static decl.
22110 * eval.c (Ffetch_bytecode): New forward static decl.
22111 (Funintern): Remove extern decl; now in .h file where it belongs.
22112 * fileio.c (Fmake_symbolic_link): New forward static decl.
22113 * image.c (Finit_image_library): New forward static decl.
22114 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22115 * intervals.h (Fprevious_property_change):
22116 (Fremove_list_of_text_properties): Remove decls.
22117 * keyboard.c (Fthis_command_keys): Remove decl.
22118 (Fcommand_execute): New forward static decl.
22119 * keymap.c (Flookup_key): New forward static decl.
22120 (Fcopy_keymap): Now static.
22121 * keymap.h (Flookup_key): Remove decl.
22122 * process.c (Fget_process): New forward static decl.
22123 (Fprocess_datagram_address): Mark as internal.
22124 * syntax.c (Fsyntax_table_p): New forward static decl.
22125 (skip_chars): Remove duplicate decl.
22126 * textprop.c (Fprevious_property_change): New forward static decl.
22127 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22128 Now internal.
22129 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22130 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22131
22132 * editfns.c (Fformat): Remove unreachable code.
22133
22134 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22135
22136 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22137 change. (Bug#8496)
22138
22139 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22140
22141 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22142 when at ZV. (Bug#8487)
22143
22144 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22145
22146 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22147 (Bug#8437)
22148 * keyboard.c (parse_tool_bar_item): Likewise.
22149 * sound.c (sound_cleanup, alsa_close): Likewise.
22150 * termcap.c (tgetent): Likewise.
22151 * xfns.c (x_default_font_parameter): Likewise.
22152 * xsettings.c (read_and_apply_settings): Likewise.
22153
22154 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22155 (overrun_check_free): Protoize.
22156
22157 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22158
22159 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22160 since callers should never pass a negative size.
22161 Change the signature to match that of plain 'read' and 'write'; see
22162 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22163 * lisp.h: Update prototypes of emacs_write and emacs_read.
22164
22165 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22166
22167 * xdisp.c (redisplay_window): Don't try to determine the character
22168 position of the scroll margin if the window start point w->startp
22169 is outside the buffer's accessible region. (Bug#8468)
22170
22171 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22172
22173 Fix write-region and its subroutines for buffers > 2GB.
22174 * fileio.c (a_write, e_write): Modify declaration of arguments and
22175 local variables to support buffers larger than 2GB.
22176 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22177
22178 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22179 argument, local variables, and return value.
22180
22181 * lisp.h: Update prototypes of emacs_write and emacs_read.
22182
22183 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22184
22185 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22186
22187 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22188
22189 Fix more problems found by GCC 4.6.0's static checks.
22190
22191 * xdisp.c (vmessage): Use a better test for character truncation.
22192
22193 * charset.c (load_charset_map): <, not <=, for optimization,
22194 and to avoid potential problems with integer overflow.
22195 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22196 * casetab.c (set_identity, shuffle): Likewise.
22197 * editfns.c (Fformat): Likewise.
22198 * syntax.c (skip_chars): Likewise.
22199
22200 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22201 This also lets GCC 4.6.0 generate slightly better loop code.
22202
22203 * callint.c (Fcall_interactively): <, not <=, for optimization.
22204 (Fcall_interactively): Count the number of arguments produced,
22205 not the number of arguments given. This is simpler and lets GCC
22206 4.6.0 generate slightly better code.
22207
22208 * ftfont.c: Distingish more carefully between FcChar8 and char.
22209 The previous code passed unsigned char * to a functions like
22210 strlen and xstrcasecmp that expect char *, which does not
22211 conform to the C standard.
22212 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22213 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22214 char * when the C standard requires it.
22215
22216 * keyboard.c (read_char): Remove unused var.
22217
22218 * eval.c: Port to Windows vsnprintf (Bug#8435).
22219 Include <limits.h>.
22220 (SIZE_MAX): Define if the headers do not.
22221 (verror): Do not give up if vsnprintf returns a negative count.
22222 Instead, grow the buffer. This ports to Windows vsnprintf, which
22223 does not conform to C99. Problem reported by Eli Zaretskii.
22224 Also, simplify the allocation scheme, by avoiding the need for
22225 calling realloc, and removing the ALLOCATED variable.
22226
22227 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22228
22229 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22230 But keep the doprint source code for now, as we might revamp it
22231 and use it again (Bug#8435).
22232 * lisp.h (doprnt): Remove.
22233 * Makefile.in (base_obj): Remove doprnt.o.
22234 * deps.mk (doprnt.o): Remove.
22235
22236 error: Print 32- and 64-bit integers portably (Bug#8435).
22237 Without this change, on typical 64-bit hosts error ("...%d...", N)
22238 was used to print both 32- and 64-bit integers N, which relied on
22239 undefined behavior.
22240 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22241 * lisp.h (error, verror): Mark as printf-like functions.
22242 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22243 Report overflow in size calculations when allocating printf buffer.
22244 Do not truncate output string at its first null byte.
22245 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22246 Truncate the output at a character boundary, since vsnprintf does not
22247 do that.
22248 * charset.c (check_iso_charset_parameter): Convert internal
22249 character to string before calling 'error', since %c now has the
22250 printf meaning.
22251 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22252 overflow when computing char to be passed to 'error'. Do not
22253 pass Lisp_Object to 'error'; pass the integer instead.
22254 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22255 formatted with plain %d.
22256
22257 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22258
22259 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22260
22261 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22262
22263 * xterm.c (x_catch_errors): Remove duplicate declaration.
22264
22265 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22266
22267 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22268
22269 2011-04-10 Jim Meyering <meyering@redhat.com>
22270
22271 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22272 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22273 return ssize_t not "int", and use size_t as the buffer length.
22274 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22275 * gnutls.h: Update declarations.
22276 * process.c (read_process_output): Use ssize_t, to match.
22277 (send_process): Likewise.
22278
22279 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22280
22281 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22282
22283 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22284
22285 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22286 Use unsigned char, to match FcChar8 type definition.
22287
22288 * xterm.c (handle_one_xevent):
22289 * xmenu.c (create_and_show_popup_menu):
22290 * xselect.c (x_decline_selection_request)
22291 (x_reply_selection_request): Avoid type-punned deref of X events.
22292
22293 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22294
22295 Fix some uses of `int' instead of EMACS_INT.
22296 * search.c (string_match_1, fast_string_match)
22297 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22298 (scan_buffer, find_next_newline_no_quit)
22299 (find_before_next_newline, search_command, Freplace_match)
22300 (Fmatch_data): Make some `int' variables be EMACS_INT.
22301
22302 * xdisp.c (display_count_lines): 3rd argument and return value now
22303 EMACS_INT. All callers changed.
22304 (pint2hrstr): Last argument is now EMACS_INT.
22305
22306 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22307 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22308 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22309 (decode_coding_utf_16, decode_coding_emacs_mule)
22310 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22311 (decode_coding_ccl, decode_coding_charset)
22312 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22313 (decode_coding_iso_2022, decode_coding_emacs_mule)
22314 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22315 <char_offset, last_offset>: Declare EMACS_INT.
22316 (encode_coding_utf_8, encode_coding_utf_16)
22317 (encode_coding_emacs_mule, encode_invocation_designation)
22318 (encode_designation_at_bol, encode_coding_iso_2022)
22319 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22320 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22321 Declare EMACS_INT.
22322 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22323 (encode_invocation_designation): Last argument P_NCHARS is now
22324 EMACS_INT.
22325 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22326 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22327
22328 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22329 All users changed.
22330
22331 * ccl.c (Fccl_execute_on_string): Declare some variables
22332 EMACS_INT.
22333
22334 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
22335
22336 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22337
22338 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22339
22340 * process.c (Fformat_network_address): Doc fix.
22341
22342 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22343
22344 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
22345
22346 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
22347
22348 * keyboard.c (read_char): Call Lisp function help-form-show,
22349 instead of using internal_with_output_to_temp_buffer.
22350 (Qhelp_form_show): New var.
22351 (syms_of_keyboard): Use DEFSYM macro.
22352
22353 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22354
22355 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22356
22357 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
22358
22359 * process.c (Flist_processes): Remove to Lisp.
22360 (list_processes_1): Delete.
22361
22362 2011-04-06 Eli Zaretskii <eliz@gnu.org>
22363
22364 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22365
22366 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22367
22368 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
22369
22370 Fix more problems found by GCC 4.6.0's static checks.
22371
22372 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22373
22374 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22375
22376 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
22377
22378 * xdisp.c (vmessage): Mark as a printf-like function.
22379
22380 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22381
22382 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22383
22384 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22385 printf-like functions.
22386 (tiff_load): Add casts to remove these marks before passing them
22387 to system-supplied API.
22388
22389 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22390
22391 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22392 This avoids several warnings with gcc -Wstrict-overflow.
22393 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22394 directly, rather than having caller test rule sign. This avoids
22395 some unnecessary tests.
22396 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22397 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22398 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
22399
22400 * xfont.c (xfont_text_extents): Remove var that was set but not used.
22401 (xfont_open): Avoid unnecessary tests.
22402
22403 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22404
22405 * composite.h, composite.c (composition_gstring_put_cache):
22406 Use EMACS_INT, not int, for length.
22407
22408 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22409 breaking out part of COMPOSITION_DECODE_RULE.
22410 (COMPOSITION_DECODE_RULE): Use it.
22411 * composite.c (get_composition_id): Remove unused local vars,
22412 by using the new macro.
22413
22414 * textprop.c (set_text_properties_1): Change while to do-while,
22415 since the condition is always true at first.
22416
22417 * intervals.c (graft_intervals_into_buffer): Mark var as used.
22418 (interval_deletion_adjustment): Return unsigned value.
22419 All uses changed.
22420
22421 * process.c (list_processes_1, create_pty, read_process_output):
22422 (exec_sentinel): Remove vars that were set but not used.
22423 (create_pty): Remove unnecessary "volatile"s.
22424 (Fnetwork_interface_info): Avoid possibility of int overflow.
22425 (read_process_output): Do adaptive read buffering even if carryover.
22426 (read_process_output): Simplify nbytes computation if buffered.
22427
22428 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22429
22430 * syntax.c (scan_words): Remove var that was set but not used.
22431 (update_syntax_table): Use unsigned instead of int.
22432
22433 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
22434 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
22435 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
22436
22437 * print.c (print_error_message): Avoid int overflow.
22438
22439 * font.c (font_list_entities): Redo for clarity,
22440 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22441
22442 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
22443 (font_score): Avoid potential overflow in diff calculation.
22444
22445 * fns.c (substring_both): Remove var that is set but not used.
22446 (sxhash): Redo loop for clarity and to avoid wraparound warning.
22447
22448 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22449
22450 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22451 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22452 can always succeed if overflow has undefined behavior.
22453
22454 * search.c (boyer_moore, wordify): Remove vars set but not used.
22455 (wordify): Omit three unnecessary tests.
22456
22457 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22458 All callers changed. This avoids the need for an unused var.
22459
22460 * casefiddle.c (casify_region): Remove var that is set but not used.
22461
22462 * dired.c (file_name_completion): Remove var that is set but not used.
22463
22464 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22465
22466 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
22467 (Finsert_file_contents): Remove unnecessary code checking fd.
22468
22469 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22470 Check for integer overflow on size calculations.
22471
22472 * buffer.c (Fprevious_overlay_change): Remove var that is set
22473 but not used.
22474
22475 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22476 Remove vars that are set but not used.
22477 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
22478 (timer_check_2): Mark vars as initialized.
22479
22480 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22481
22482 * image.c (lookup_image): Remove var that is set but not used.
22483 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
22484
22485 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22486 that are set but not used.
22487
22488 * xfns.c (make_invisible_cursor): Don't return garbage
22489 if XCreateBitmapFromData fails (Bug#8410).
22490
22491 * xselect.c (x_get_local_selection, x_handle_property_notify):
22492 Remove vars that are set but not used.
22493
22494 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
22495 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
22496
22497 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22498 Remove var that is set but not used.
22499 (scroll_bar_windows_size): Now size_t, not int.
22500 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22501 Check for overflow.
22502
22503 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22504 (map_tty_color) [!defined MSDOS]: Likewise.
22505
22506 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22507
22508 * coding.c: Remove vars that are set but not used.
22509 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22510 All callers changed.
22511 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22512 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22513 (decode_coding_charset): Remove vars that are set but not used.
22514
22515 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22516 that is set but not used.
22517
22518 * print.c (print_object): Remove var that is set but not used.
22519
22520 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
22521 The gnulib version avoids calling malloc in the usual case,
22522 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22523 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22524 * filelock.c (current_lock_owner): Likewise.
22525 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22526 * sysdep.c: Include allocator.h, careadlinkat.h.
22527 (emacs_no_realloc_allocator): New static constant.
22528 (emacs_readlink): New function.
22529 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22530 ../lib/careadlinkat.h.
22531
22532 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22533
22534 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22535 first non-nil return value).
22536
22537 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22538
22539 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22540 if not defined (Bug#8403).
22541
22542 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22543
22544 * xdisp.c (display_count_lines): Remove parameter `start',
22545 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22546 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22547 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22548 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22549 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22550 and thereabouts. All callers changed.
22551 (get_per_char_metric): Remove parameter `f', unused since
22552 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22553
22554 2011-04-02 Jim Meyering <meyering@redhat.com>
22555
22556 do not dereference NULL upon failed strdup
22557 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22558 (ns_get_family): Likewise.
22559
22560 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22561
22562 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22563
22564 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22565
22566 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22567 later (Bug#8403).
22568
22569 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22570
22571 Add lexical binding.
22572
22573 * window.c (Ftemp_output_buffer_show): New fun.
22574 (Fsave_window_excursion):
22575 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22576
22577 * lread.c (lisp_file_lexically_bound_p): New function.
22578 (Fload): Bind Qlexical_binding.
22579 (readevalloop): Remove `evalfun' arg.
22580 Bind Qinternal_interpreter_environment.
22581 (Feval_buffer): Bind Qlexical_binding.
22582 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22583 Mark as dynamic.
22584 (syms_of_lread): Declare `lexical-binding'.
22585
22586 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22587
22588 * keyboard.c (eval_dyn): New fun.
22589 (menu_item_eval_property): Use it.
22590
22591 * image.c (parse_image_spec): Use Ffunctionp.
22592
22593 * fns.c (concat, mapcar1): Accept byte-code-functions.
22594
22595 * eval.c (Fsetq): Handle lexical vars.
22596 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22597 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22598 (FletX, Flet): Obey lexical binding.
22599 (Fcommandp): Handle closures.
22600 (Feval): New `lexical' arg.
22601 (eval_sub): New function extracted from Feval. Use it almost
22602 everywhere where Feval was used. Look up vars in lexical env.
22603 Handle closures.
22604 (Ffunctionp): Move from subr.el.
22605 (Ffuncall): Handle closures.
22606 (apply_lambda): Remove `eval_flags'.
22607 (funcall_lambda): Handle closures and new byte-code-functions.
22608 (Fspecial_variable_p): New function.
22609 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22610 but without exporting it to Lisp.
22611
22612 * doc.c (Fdocumentation, store_function_docstring):
22613 * data.c (Finteractive_form): Handle closures.
22614
22615 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22616 interactive spec.
22617
22618 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22619 New byte-codes.
22620 (exec_byte_code): New function extracted from Fbyte_code to handle new
22621 calling convention for byte-code-functions. Add new byte-codes.
22622
22623 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
22624
22625 * alloc.c (Fmake_symbol): Init new `declared_special' field.
22626
22627 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22628
22629 * xdisp.c (redisplay_internal): Fix prototype.
22630
22631 2011-03-31 Eli Zaretskii <eliz@gnu.org>
22632
22633 * xdisp.c (SCROLL_LIMIT): New macro.
22634 (try_scrolling): Use it when setting scroll_limit.
22635 Limit scrolling to 100 screen lines.
22636 (redisplay_window): Even when falling back on "recentering",
22637 position point in the window according to scroll-conservatively,
22638 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22639
22640 (try_scrolling): When point is above the window, allow searching
22641 as far as scroll_max, or one screenful, to compute vertical
22642 distance from PT to the scroll margin position. This prevents
22643 try_scrolling from unnecessarily failing when
22644 scroll-conservatively is set to a value slightly larger than the
22645 window height. Clean up the case of PT below the margin at bottom
22646 of window: scroll_max can no longer be INT_MAX. When aggressive
22647 scrolling is in use, don't let point enter the opposite scroll
22648 margin as result of the scroll.
22649 (syms_of_xdisp) <scroll-conservatively>: Document the
22650 threshold of 100 lines for never-recentering scrolling.
22651
22652 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22653
22654 * dispextern.h (move_it_by_lines):
22655 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22656 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22657 (message_log_check_duplicate): Remove parameters `prev_bol' and
22658 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22659 (redisplay_internal): Remove parameter `preserve_echo_area',
22660 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22661
22662 * indent.c (Fvertical_motion):
22663 * window.c (window_scroll_pixel_based, Frecenter):
22664 Don't pass `need_y_p' to `move_it_by_lines'.
22665
22666 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22667
22668 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22669 steal a few bits to be more compact.
22670 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22671 Remove unneeded casts.
22672
22673 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22674
22675 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22676
22677 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22678 binding" message (bug#7967).
22679
22680 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22681
22682 Fix more problems found by GCC 4.6.0's static checks.
22683
22684 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22685 Remove unused local var.
22686
22687 * editfns.c (Fmessage_box): Remove unused local var.
22688
22689 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22690 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22691 Omit unused local vars.
22692 * window.c (shrink_windows): Omit unused local var.
22693 * menu.c (digest_single_submenu): Omit unused local var.
22694 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22695 Omit unused local var.
22696
22697 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22698 Don't assume string length fits in int.
22699 (keyremap_step, read_key_sequence): Use size_t for sizes.
22700 (read_key_sequence): Don't check last_real_key_start redundantly.
22701
22702 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22703 instead of alloca (Bug#8344).
22704
22705 * eval.c (Fbacktrace): Don't assume nargs fits in int.
22706 (Fbacktrace_frame): Don't assume nframes fits in int.
22707
22708 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22709
22710 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22711 concerns.
22712
22713 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22714
22715 * cm.c (calccost): Turn while-do into do-while, for clarity.
22716
22717 * keyboard.c (syms_of_keyboard): Use the same style as later
22718 in this function when indexing through an array. This also
22719 works around GCC bug 48267.
22720
22721 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22722
22723 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22724
22725 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22726 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22727
22728 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22729 This avoids undefined behavior on integer overflow, and is a bit
22730 more convenient anyway since it is compared to a size_t variable.
22731
22732 Variadic C functions now count arguments with size_t, not int.
22733 This avoids an unnecessary limitation on 64-bit machines, which
22734 caused (substring ...) to crash on large vectors (Bug#8344).
22735 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22736 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
22737 All variadic functions and their callers changed accordingly.
22738 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22739 * data.c (arith_driver, float_arith_driver): Likewise.
22740 * editfns.c (general_insert_function): Likewise.
22741 * eval.c (struct backtrace.nargs, interactive_p)
22742 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22743 (funcall_lambda, mark_backtrace): Likewise.
22744 * fns.c (concat): Likewise.
22745 * frame.c (x_set_frame_parameters): Likewise.
22746 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22747 0 if not found, not -1. All callers changed.
22748
22749 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22750 (stack_copy_size): Now size_t, not int.
22751 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22752
22753 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22754
22755 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22756 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22757 All callers changed.
22758
22759 * lisp.h (multibyte_char_to_unibyte):
22760 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22761 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22762 * character.h (CHAR_TO_BYTE8):
22763 * cmds.c (internal_self_insert):
22764 * editfns.c (general_insert_function):
22765 * keymap.c (push_key_description):
22766 * search.c (Freplace_match):
22767 * xdisp.c (message_dolog, set_message_1): All callers changed.
22768
22769 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22770
22771 * keyboard.c (safe_run_hook_funcall): New function.
22772 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22773 don't set the hook to nil, but remove the offending function instead.
22774 (Qcommand_hook_internal): Remove, unused.
22775 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22776 Vcommand_hook_internal.
22777
22778 * eval.c (enum run_hooks_condition): Remove.
22779 (funcall_nil, funcall_not): New functions.
22780 (run_hook_with_args): Call each function through a `funcall' argument.
22781 Remove `cond' argument, now redundant.
22782 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22783 (Frun_hook_with_args_until_failure): Adjust accordingly.
22784 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22785
22786 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22787
22788 * dispextern.h (string_buffer_position): Remove declaration.
22789
22790 * print.c (strout): Remove parameter `multibyte', unused since
22791 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22792
22793 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22794 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22795 All callers changed.
22796
22797 * w32.c (_wsa_errlist): Use braces for struct initializers.
22798
22799 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22800 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22801 All callers changed.
22802 (string_buffer_position): Likewise. Also, make static (it's never
22803 used outside xdisp.c).
22804 (cursor_row_p): Remove parameter `w', unused since
22805 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22806 (decode_mode_spec): Remove parameter `precision', introduced during
22807 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22808 All callers changed.
22809
22810 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22811
22812 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22813
22814 2011-03-27 Anders Lindgren <andlind@gmail.com>
22815
22816 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22817 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22818 (ns_update_auto_hide_menu_bar): New functions.
22819 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22820 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22821 ns_constrain_all_frames.
22822 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22823 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22824
22825 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22826
22827 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22828
22829 2011-03-27 Glenn Morris <rgm@gnu.org>
22830
22831 * syssignal.h: Replace RETSIGTYPE with void.
22832 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22833 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22834 Replace SIGTYPE with void everywhere.
22835 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22836 * s/template.h (SIGTYPE): Remove commented out definition.
22837
22838 2011-03-26 Eli Zaretskii <eliz@gnu.org>
22839
22840 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22841 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22842
22843 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
22844
22845 * w32.c (read_unc_volume): Use parameter `henum', instead of
22846 global variable `wget_enum_handle'.
22847
22848 * keymap.c (describe_vector): Remove parameters `indices' and
22849 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22850 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22851
22852 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22853
22854 * keyboard.c (timer_check): Remove parameter `do_it_now',
22855 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22856 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22857 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22858
22859 * keyboard.c (read_char):
22860 * w32menu.c (w32_menu_display_help):
22861 * xmenu.c (show_help_event, menu_help_callback):
22862 Adjust calls to `show_help_echo'.
22863
22864 * gtkutil.c (xg_maybe_add_timer):
22865 * keyboard.c (readable_events):
22866 * process.c (wait_reading_process_output):
22867 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22868
22869 * insdel.c (adjust_markers_gap_motion):
22870 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22871 (gap_left, gap_right): Don't call it.
22872
22873 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
22874
22875 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22876 incurred during fontification.
22877
22878 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22879
22880 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22881 (DEFVAR_PER_BUFFER): Don't pass it.
22882
22883 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22884 (scrolling_window): Don't pass it.
22885
22886 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22887
22888 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22889
22890 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22891 and `suffix'.
22892 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22893 of variables specific to SELinux and computation of `encoded_absname'.
22894
22895 * image.c (XPutPixel): Remove unused variable `height'.
22896
22897 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22898
22899 * unexw32.c (get_section_info): Remove unused variable `section'.
22900
22901 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22902 (system_process_attributes): Remove unused variable `sess'.
22903 (sys_read): Remove unused variable `err'.
22904
22905 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22906 (w32_wnd_proc): Remove unused variable `isdead'.
22907 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22908 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22909 (x_create_tip_frame): Remove unused variable `tem'.
22910
22911 * w32inevt.c (w32_console_read_socket):
22912 Remove unused variable `no_events'.
22913
22914 * w32term.c (x_draw_composite_glyph_string_foreground):
22915 Remove unused variable `width'.
22916
22917 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
22918
22919 * w32term.c (x_set_glyph_string_clipping):
22920 Don't pass uninitialized region to CombineRgn.
22921
22922 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
22923
22924 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22925 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22926 (Fx_close_connection): Remove unused variable `i'.
22927
22928 * w32font.c (w32font_draw): Return number of glyphs.
22929 (w32font_open_internal): Remove unused variable `i'.
22930 (w32font_driver): Add missing initializer.
22931
22932 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22933 (fill_in_menu): Remove unused variable `items_added'.
22934
22935 * w32term.c (last_mouse_press_frame): Remove static global variable.
22936 (w32_clip_to_row): Remove unused variable `f'.
22937 (x_delete_terminal): Remove unused variable `i'.
22938
22939 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22940 (NOTHING): Remove unused static global variable.
22941 (uniscribe_check_otf): Remove unused variable `table'.
22942 (uniscribe_font_driver): Add missing initializers.
22943
22944 2011-03-23 Julien Danjou <julien@danjou.info>
22945
22946 * term.c (Fsuspend_tty, Fresume_tty):
22947 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22948 * window.c (temp_output_buffer_show):
22949 * insdel.c (signal_before_change):
22950 * frame.c (Fhandle_switch_frame):
22951 * fileio.c (Fdo_auto_save):
22952 * emacs.c (Fkill_emacs):
22953 * editfns.c (save_excursion_restore):
22954 * cmds.c (internal_self_insert):
22955 * callint.c (Fcall_interactively):
22956 * buffer.c (Fkill_all_local_variables):
22957 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22958 Use Frun_hooks.
22959 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
22960 unconditionally since it does the check itself.
22961
22962 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
22963
22964 Fix more problems found by GCC 4.5.2's static checks.
22965
22966 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22967 the first time through the loop, since we know p0 < p1 then.
22968 This also avoids a gcc -Wstrict-overflow warning.
22969
22970 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22971 leading to a memory leak, possible in functions like
22972 load_charset_map_from_file that can allocate an unbounded number
22973 of objects (Bug#8318).
22974
22975 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22976 that could (at least in theory) be that large.
22977
22978 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22979 This is less likely to overflow, and avoids undefined behavior if
22980 overflow does occur. All callers changed. Use strtoul to scan
22981 for the unsigned long integer.
22982 (pint2hrstr): Simplify and tune code slightly.
22983 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
22984
22985 * scroll.c (do_scrolling): Work around GCC bug 48228.
22986 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22987
22988 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22989 This also avoids a warning with gcc -Wstrict-overflow.
22990 (validate_x_resource_name): Simplify count usage.
22991 This also avoids a warning with gcc -Wstrict-overflow.
22992
22993 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22994 fail (Bug#8306).
22995
22996 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
22997
22998 * process.c (Fmake_network_process): Use socklen_t, not int,
22999 where POSIX says socklen_t is required in portable programs.
23000 This fixes a porting bug on hosts like 64-bit HP-UX, where
23001 socklen_t is wider than int (Bug#8277).
23002 (Fmake_network_process, server_accept_connection):
23003 (wait_reading_process_output, read_process_output):
23004 Likewise.
23005
23006 * process.c: Rename or move locals to avoid shadowing.
23007 (list_processes_1, Fmake_network_process):
23008 (read_process_output_error_handler, exec_sentinel_error_handler):
23009 Rename or move locals.
23010 (Fmake_network_process): Define label "retry_connect" only if needed.
23011 (Fnetwork_interface_info): Fix pointer signedness.
23012 (process_send_signal): Add cast to avoid pointer signedness problem.
23013 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23014 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23015
23016 Make tparam.h and terminfo.c consistent.
23017 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23018 Include tparam.h instead, since it declares them.
23019 * cm.h (PC): Remove extern decl; tparam.h now does this.
23020 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23021 * terminfo.c: Include tparam.h, to check interfaces.
23022 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23023 (tparam): Adjust signature to match interface in tparam.h;
23024 this removes some undefined behavior. Check that outstring and len
23025 are zero, which they always are with Emacs.
23026 * tparam.h (PC, BC, UP): New extern decls.
23027
23028 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23029 (xftfont_open): Rename locals to avoid shadowing.
23030
23031 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23032 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23033 (OTF_TAG_SYM): Omit macro if not needed.
23034 (ftfont_list): Remove unused local.
23035 (get_adstyle_property, ftfont_pattern_entity):
23036 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23037 Rename locals to avoid shadowing.
23038
23039 * xfont.c (xfont_list_family): Mark var as initialized.
23040
23041 * xml.c (make_dom): Now static.
23042
23043 * composite.c (composition_compute_stop_pos): Rename local to
23044 avoid shadowing.
23045 (composition_reseat_it): Remove unused locals.
23046 (find_automatic_composition, composition_adjust_point): Likewise.
23047 (composition_update_it): Mark var as initialized.
23048 (find_automatic_composition): Mark vars as initialized,
23049 with a FIXME (Bug#8290).
23050
23051 character.h: Rename locals to avoid shadowing.
23052 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23053 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23054 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23055 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23056 to avoid shadowing.
23057
23058 * textprop.c (property_change_between_p): Remove; unused.
23059
23060 * intervals.c (interval_start_pos): Now static.
23061
23062 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23063
23064 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23065 Rename locals to avoid shadowing.
23066
23067 * sound.c (wav_play, au_play, Fplay_sound_internal):
23068 Fix pointer signedness.
23069 (alsa_choose_format): Remove unused local var.
23070 (wav_play): Initialize a variable to 0, to prevent undefined
23071 behavior (Bug#8278).
23072
23073 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23074
23075 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23076
23077 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23078 clobbering (Bug#8298).
23079 * sysdep.c (sys_subshell): Likewise.
23080 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23081
23082 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23083 This should get cleaned up, so that child_setup has the
23084 same signature on all platforms.
23085
23086 * callproc.c (call_process_cleanup): Now static.
23087 (relocate_fd): Rename locals to avoid shadowing.
23088
23089 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23090
23091 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23092 not to be necessary, and produces flickering.
23093
23094 2011-03-20 Glenn Morris <rgm@gnu.org>
23095
23096 * config.in: Remove file.
23097
23098 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23099
23100 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23101 are now in src/globals.h.
23102 (syms_of_minibuf): Remove spurious & from previous change.
23103
23104 2011-03-20 Leo Liu <sdl.web@gmail.com>
23105
23106 * minibuf.c (completing-read-function): New variable.
23107 (completing-read-default): Rename from completing-read.
23108 (completing-read): Call completing-read-function.
23109
23110 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23111
23112 * xfaces.c (Fx_load_color_file):
23113 Read color file from absolute filename (bug#8250).
23114
23115 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23116
23117 * makefile.w32-in: Update dependencies.
23118
23119 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23120
23121 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23122
23123 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23124
23125 Fix more problems found by GCC 4.5.2's static checks.
23126
23127 * process.c (make_serial_process_unwind, send_process_trap):
23128 (sigchld_handler): Now static.
23129
23130 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23131 That way, the code declares only the vars that it needs.
23132 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23133 * s/cygwin.h (PTY_ITERATION): Likewise.
23134 * s/darwin.h (PTY_ITERATION): Likewise.
23135 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23136
23137 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23138 * process.c (allocate_pty): Don't declare stb unless it's needed.
23139
23140 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23141 (CONSTANTLIM): Remove; unused.
23142 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23143 Define only if needed.
23144
23145 * unexelf.c (unexec): Name an expression,
23146 to avoid gcc -Wbad-function-cast warning.
23147 Use a different way to cause a compilation error if anyone uses
23148 n rather than nn, a way that does not involve shadowing.
23149 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23150
23151 * deps.mk (unexalpha.o): Remove; unused.
23152
23153 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23154 * unexec.h: New file.
23155 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23156 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23157 Depend on unexec.h.
23158 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23159 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23160 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23161 Change as necessary to match prototype in unexec.h.
23162
23163 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23164 shadowing.
23165 (back_comment, skip_chars): Mark vars as initialized.
23166
23167 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23168 Rename locals to avoid shadowing.
23169
23170 * lread.c (read1): Rewrite so as not to use empty "else".
23171 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23172
23173 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23174
23175 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23176 warning when compiling print.c.
23177
23178 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23179 instead of using an uninitialized var.
23180 (font_sort_entities): Mark var as initialized.
23181
23182 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23183
23184 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23185 pointers to constants.
23186 (font_parse_fcname): Remove unused vars.
23187 (font_delete_unmatched): Now static.
23188 (font_get_spec): Remove; unused.
23189 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23190 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23191 Rename or move locals to avoid shadowing.
23192
23193 * fns.c (require_nesting_list, require_unwind): Now static.
23194 (Ffillarray): Rename locals to avoid shadowing.
23195
23196 * floatfns.c (domain_error2): Define only if needed.
23197 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23198
23199 * alloc.c (mark_backtrace): Move decl from here ...
23200 * lisp.h: ... to here, so that it can be checked.
23201
23202 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23203 (Fdefvar): Rewrite so as not to use empty "else".
23204 (lisp_indirect_variable): Name an expression,
23205 to avoid gcc -Wbad-function-cast warning.
23206 (Fdefvar): Rename locals to avoid shadowing.
23207
23208 * callint.c (quotify_arg, quotify_args): Now static.
23209 (Fcall_interactively): Rename locals to avoid shadowing.
23210 Use const pointer when appropriate.
23211
23212 * lisp.h (get_system_name, get_operating_system_release):
23213 Move decls here, to check interfaces.
23214 * process.c (get_operating_system_release): Move decl to lisp.h.
23215 * xrdb.c (get_system_name): Likewise.
23216 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23217 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23218 some of which prompt warnings from gcc -Wbad-function-cast.
23219 (Fformat_time_string, Fencode_time, Finsert_char):
23220 (Ftranslate_region_internal, Fformat):
23221 Rename or remove local vars to avoid shadowing.
23222 (Ftranslate_region_internal): Mark var as initialized.
23223
23224 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23225 avoid shadowing.
23226
23227 * lisp.h (eassert): Check that the argument compiles, even if
23228 ENABLE_CHECKING is not defined.
23229
23230 * data.c (Findirect_variable): Name an expression, to avoid
23231 gcc -Wbad-function-cast warning.
23232 (default_value, arithcompare, arith_driver, arith_error): Now static.
23233 (store_symval_forwarding): Rename local to avoid shadowing.
23234 (Fmake_variable_buffer_local, Fmake_local_variable):
23235 Mark variables as initialized.
23236 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23237
23238 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23239 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23240 Rename locals to avoid shadowing.
23241 (mark_stack): Move local variables into the #ifdef region where
23242 they're used.
23243 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23244 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23245 needed otherwise.
23246 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23247 (GC_STRING_CHARS): Remove; not used.
23248 (Fmemory_limit): Cast sbrk's returned value to char *.
23249
23250 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23251 avoids undefined behavior in theory.
23252
23253 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23254
23255 Use functions, not macros, for up- and down-casing (Bug#8254).
23256 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23257 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23258 to use the following functions instead of these macros.
23259 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23260 EMACS_INT, since callers assume the returned value fits in int.
23261 (upcase1): Likewise, for UPCASE_TABLE.
23262 (uppercasep, lowercasep, upcase): New static inline functions.
23263 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23264 the race-condition problem in the old DOWNCASE.
23265
23266 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23267 Rename locals to avoid shadowing.
23268 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23269 (regex_compile, re_search_2, re_match_2_internal):
23270 Remove unused local vars.
23271 (FREE_VAR): Rewrite so as not to use empty "else",
23272 which gcc can warn about.
23273 (regex_compile, re_match_2_internal): Mark locals as initialized.
23274 (RETALLOC_IF): Define only if needed.
23275 (WORDCHAR_P): Likewise. This one is never needed, but is used
23276 only in a comment talking about a compiler bug, so put inside
23277 the #if 0 of that comment.
23278 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23279 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23280 Remove; unused.
23281
23282 * search.c (boyer_moore): Rename locals to avoid shadowing.
23283 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23284 (PREV_CHAR_BOUNDARY): Likewise.
23285
23286 * search.c (simple_search): Remove unused var.
23287
23288 * dired.c (compile_pattern): Move decl from here ...
23289 * lisp.h: ... to here, so that it can be checked.
23290 (struct re_registers): New forward decl.
23291
23292 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23293
23294 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23295 All uses changed.
23296 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23297 Rename locals to avoid shadowing.
23298 (Fvertical_motion): Mark locals as initialized.
23299
23300 * casefiddle.c (casify_object, casify_region): Now static.
23301 (casify_region): Mark local as initialized.
23302
23303 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23304
23305 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23306 New macros, so that the caller can use some names other than
23307 gcpro1, gcpro2, etc.
23308 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23309 of the new macros.
23310 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23311 argument, for consistency with GCPRO2_VAR, etc: it is now the
23312 prefix of the variable, not the variable itself. All uses
23313 changed.
23314 * dired.c (directory_files_internal, file_name_completion):
23315 Rename locals to avoid shadowing.
23316
23317 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23318 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23319 dired.c's scmp function, had undefined behavior.
23320 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23321 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23322 * buffer.h: ... to here, because these macros use current_buffer,
23323 and the new implementation with inline functions needs to have
23324 current_buffer in scope now, rather than later when the macros
23325 are used.
23326 (downcase, upcase1): New static inline functions.
23327 (DOWNCASE, UPCASE1): Reimplement using these functions.
23328 This avoids undefined behavior in expressions like
23329 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23330 from race conditions in accessing the global variables
23331 case_temp1 and case_temp2.
23332 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23333 * lisp.h (case_temp1, case_temp2): Remove their decls.
23334 * character.h (ASCII_CHAR_P): Move from here ...
23335 * lisp.h: ... to here, so that the inline functions mentioned
23336 above can use them.
23337
23338 * dired.c (directory_files_internal_unwind): Now static.
23339
23340 * fileio.c (file_name_as_directory, directory_file_name):
23341 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23342 Now static.
23343 (file_name_as_directory): Use const pointers when appropriate.
23344 (Fexpand_file_name): Likewise. In particular, newdir might
23345 point at constant storage, so make it a const pointer.
23346 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
23347 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23348 signedness issues.
23349 (Fset_file_times, Finsert_file_contents, auto_save_error):
23350 Rename locals to avoid shadowing.
23351
23352 * minibuf.c (choose_minibuf_frame_1): Now static.
23353 (Ftry_completion, Fall_completions): Rename or remove locals
23354 to avoid shadowing.
23355
23356 * marker.c (bytepos_to_charpos): Remove; unused.
23357
23358 * lisp.h (verify_bytepos, count_markers): New decls,
23359 so that gcc does not warn that these functions aren't declared.
23360
23361 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23362 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
23363 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
23364 (copy_text): Remove unused local var.
23365
23366 * filelock.c (within_one_second): Now static.
23367 (lock_file_1): Rename local to avoid shadowing.
23368
23369 * buffer.c (fix_overlays_before): Mark locals as initialized.
23370 (fix_start_end_in_overlays): Likewise. This function should be
23371 simplified by using pointers-to-pointers, but that's a different
23372 matter.
23373 (switch_to_buffer_1): Now static.
23374 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23375 (report_overlay_modification): Rename locals to avoid shadowing.
23376
23377 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
23378 Fix pointer signedness issue.
23379 (sys_subshell): Mark local as volatile if checking for lint,
23380 to suppress a gcc -Wclobbered warning that does not seem to be right.
23381 (MAXPATHLEN): Define only if needed.
23382
23383 * process.c (serial_open, serial_configure): Move decls from here ...
23384 * systty.h: ... to here, so that they can be checked.
23385
23386 * fns.c (get_random, seed_random): Move extern decls from here ...
23387 * lisp.h: ... to here, so that they can be checked.
23388
23389 * sysdep.c (reset_io): Now static.
23390 (wait_for_termination_signal): Remove; unused.
23391
23392 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23393 (copy_keymap_item, append_key, push_text_char_description):
23394 Now static.
23395 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
23396 (DENSE_TABLE_SIZE): Remove; unused.
23397 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23398 (describe_map_tree):
23399 Rename locals to avoid shadowing.
23400
23401 * keyboard.c: Declare functions static if they are not used elsewhere.
23402 (echo_char, echo_dash, cmd_error, top_level_2):
23403 (poll_for_input, handle_async_input): Now static.
23404 (read_char, kbd_buffer_get_event, make_lispy_position):
23405 (make_lispy_event, make_lispy_movement, apply_modifiers):
23406 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23407 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23408 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
23409 (read_key_sequence, read_char): Mark locals as initialized.
23410 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
23411
23412 * keyboard.h (make_ctrl_char): New decl.
23413 (mark_kboards): Move decl here ...
23414 * alloc.c (mark_kboards): ... from here.
23415
23416 * lisp.h (force_auto_save_soon): New decl.
23417
23418 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
23419 (DEFINE_DUMMY_FUNCTION): New macro.
23420 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23421 Use it.
23422 (main): Add casts to avoid warnings
23423 if GCC considers string literals to be constants.
23424
23425 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23426
23427 * dbusbind.c: Pointer signedness fixes.
23428 (xd_signature, xd_append_arg, xd_initialize):
23429 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23430 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23431 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23432 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23433
23434 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23435 if GCC considers string literals to be constants.
23436 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
23437
23438 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23439
23440 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23441 (print_preprocess, print_object): New macro to fix last change.
23442
23443 * print.c (print_preprocess): Don't forget font objects.
23444
23445 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
23446
23447 * emacs.c (USAGE3): Doc fixes.
23448
23449 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23450
23451 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23452 structure.
23453
23454 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
23455
23456 * lisp.h (VWindow_system, Qfile_name_history):
23457 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23458 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23459 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23460
23461 * w32select.c: Don't #include "keyboard.h".
23462 (run_protected): Add extern declaration for waiting_for_input.
23463
23464 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23465 * w32console.c (detect_input_pending, read_input_pending)
23466 (encode_terminal_code):
23467 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23468 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23469 (w32_system_caret_y, Qfile_name_history):
23470 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23471 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23472 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23473 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23474 * w32proc.c (Qlocal, report_file_error):
23475 * w32term.c (Vwindow_system, updating_frame):
23476 * w32uniscribe.c (initialized, uniscribe_font_driver):
23477 Remove unneeded extern declarations.
23478
23479 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
23480
23481 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
23482
23483 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
23484
23485 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23486 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23487 These macros can no longer be used for assignment.
23488
23489 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23490 Assign struct members directly, instead of using BUF_BEGV etc.
23491 (record_buffer_markers, fetch_buffer_markers): New functions for
23492 recording and fetching special buffer markers.
23493 (set_buffer_internal_1, set_buffer_temp): Use them.
23494
23495 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23496
23497 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23498
23499 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23500 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23501
23502 * xdisp.c (hscroll_window_tree):
23503 (reconsider_clip_changes): Use PT instead of BUF_PT.
23504
23505 2011-03-13 Eli Zaretskii <eliz@gnu.org>
23506
23507 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23508 $(EMACS_ROOT)/lib/intprops.h.
23509
23510 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23511
23512 Fix more problems found by GCC 4.5.2's static checks.
23513
23514 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23515 to unsigned char * to avoid compiler diagnostic.
23516 (xg_free_frame_widgets): Make it clear that a local variable is
23517 needed only if USE_GTK_TOOLTIP.
23518 (gdk_window_get_screen): Make it clear that this macro is needed
23519 only if USE_GTK_TOOLTIP.
23520 (int_gtk_range_get_value): New function, which avoids a diagnostic
23521 from gcc -Wbad-function-cast.
23522 (xg_set_toolkit_scroll_bar_thumb): Use it.
23523 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23524 diagnostic from gcc -Wbad-function-cast.
23525 (get_utf8_string, xg_get_file_with_chooser):
23526 Rename locals to avoid shadowing.
23527 (create_dialog): Move locals to avoid shadowing.
23528
23529 * xgselect.c (xg_select): Remove unused var.
23530
23531 * image.c (four_corners_best): Mark locals as initialized.
23532 (gif_load): Initialize transparent_p to zero (Bug#8238).
23533 Mark another local as initialized.
23534 (my_png_error, my_error_exit): Mark with NO_RETURN.
23535
23536 * image.c (clear_image_cache): Now static.
23537 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
23538 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
23539 (x_edge_detection): Remove unnecessary cast that
23540 gcc -Wbad-function-cast diagnoses.
23541 (gif_load): Fix pointer signedness.
23542 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23543 (jpeg_load, gif_load): Rename locals to avoid shadowing.
23544
23545 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
23546
23547 Improve quality of tests for time stamp overflow.
23548 For example, without this patch (encode-time 0 0 0 1 1
23549 1152921504606846976) returns the obviously-bogus value (-948597
23550 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23551 reports time overflow. See
23552 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
23553 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23554 * editfns.c: Include limits.h and intprops.h.
23555 (TIME_T_MIN, TIME_T_MAX): New macros.
23556 (time_overflow): Move earlier, to before first use.
23557 (hi_time, lo_time): New functions, for an accurate test for
23558 out-of-range times.
23559 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23560 (Fget_internal_run_time): Don't assume time_t fits in int.
23561 (make_time): Use list2 instead of Fcons twice.
23562 (Fdecode_time): More accurate test for out-of-range times.
23563 (check_tm_member): New function.
23564 (Fencode_time): Use it, to test for out-of-range times.
23565 (lisp_time_argument): Don't rely on undefined left-shift and
23566 right-shift behavior when checking for time stamp overflow.
23567
23568 * editfns.c (time_overflow): New function, refactoring common code.
23569 (Fformat_time_string, Fdecode_time, Fencode_time):
23570 (Fcurrent_time_string): Use it.
23571
23572 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23573 * dired.c (make_time): Move to ...
23574 * editfns.c (make_time): ... here.
23575 * systime.h: Note the move.
23576
23577 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23578
23579 * fringe.c (update_window_fringes): Remove unused variables.
23580
23581 * unexmacosx.c (copy_data_segment): Also copy __got section.
23582 (Bug#8223)
23583
23584 2011-03-12 Eli Zaretskii <eliz@gnu.org>
23585
23586 * termcap.c [MSDOS]: Include "msdos.h".
23587 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23588 Constify `char *' arguments and their references according to
23589 prototypes in tparam.h.
23590
23591 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
23592
23593 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23594 Adapt all references accordingly.
23595
23596 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23597
23598 2011-03-11 Tom Tromey <tromey@redhat.com>
23599
23600 * buffer.c (syms_of_buffer): Remove obsolete comment.
23601
23602 2011-03-11 Eli Zaretskii <eliz@gnu.org>
23603
23604 * termhooks.h (encode_terminal_code): Declare prototype.
23605
23606 * msdos.c (encode_terminal_code): Don't declare prototype.
23607
23608 * term.c (encode_terminal_code): Now external again, used by
23609 w32console.c and msdos.c.
23610
23611 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23612 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
23613
23614 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
23615
23616 Fix some minor problems found by GCC 4.5.2's static checks.
23617
23618 * fringe.c (update_window_fringes): Mark locals as initialized
23619 (Bug#8227).
23620 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
23621
23622 * alloc.c (mark_fringe_data): Move decl from here ...
23623 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23624 to check its interface.
23625 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23626
23627 * fontset.c (free_realized_fontset): Now static.
23628 (Fset_fontset_font): Rename local to avoid shadowing.
23629 (fontset_font): Mark local as initialized.
23630 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
23631
23632 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23633
23634 * xselect.c (x_disown_buffer_selections): Remove; not used.
23635 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
23636 (x_own_selection, Fx_disown_selection_internal): Rename locals
23637 to avoid shadowing.
23638 (x_handle_dnd_message): Remove local to avoid shadowing.
23639
23640 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23641 so that the caller can use some name other than gcpro1.
23642 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
23643 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23644 (Fx_backspace_delete_keys_p):
23645 Use them to avoid shadowing, and rename vars to avoid shadowing.
23646 (x_decode_color, x_set_name, x_window): Now static.
23647 (Fx_create_frame): Add braces to silence GCC warning.
23648 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
23649 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23650 Remove unused locals.
23651 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23652 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23653 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23654 macros.
23655
23656 * xterm.h (x_mouse_leave): New decl.
23657
23658 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23659 Remove unused functions.
23660 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23661 (x_calc_absolute_position): Now static.
23662 (XTread_socket): Don't define label "out" unless it's used.
23663 Don't declare local "event" unless it's used.
23664 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23665 unless they are used.
23666 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23667 (x_fatal_error_signal): Remove; not used.
23668 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23669 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23670 (x_error_catcher, x_connection_closed, x_error_handler):
23671 (x_error_quitter, xembed_send_message, x_iconify_frame):
23672 (my_log_handler): Rename locals to avoid shadowing.
23673 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
23674 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
23675
23676 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23677 Rename or move locals to avoid shadowing.
23678 (tty_defined_color, merge_face_heights): Now static.
23679 (free_realized_faces_for_fontset): Remove; not used.
23680 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23681 does not deduce is never used uninitialized.
23682 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23683 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
23684
23685 * terminal.c (store_terminal_param): Now static.
23686
23687 * xmenu.c (menu_highlight_callback): Now static.
23688 (set_frame_menubar): Remove unused local.
23689 (xmenu_show): Rename parameter to avoid shadowing.
23690 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23691 since they might point to immutable storage.
23692 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23693 since it's unused otherwise.
23694
23695 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
23696 Add a FIXME, since the code still doesn't look right. (Bug#8215)
23697 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23698 avoids a gcc -Wuninitialized diagnostic.
23699 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
23700 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23701 does not deduce are never used uninitialized.
23702
23703 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23704
23705 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
23706 * window.c (window_loop, size_window):
23707 (run_window_configuration_change_hook, enlarge_window): Likewise.
23708
23709 * window.c (display_buffer): Now static.
23710 (size_window): Mark variables that gcc -Wuninitialized
23711 does not deduce are never used uninitialized.
23712 * window.h (check_all_windows): New decl, to forestall
23713 gcc -Wmissing-prototypes diagnostic.
23714 * dispextern.h (bidi_dump_cached_states): Likewise.
23715
23716 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23717 shadowing.
23718 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
23719 Include <limits.h>.
23720 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23721 and to avoid gcc -Wuninitialized warning.
23722 (load_charset_map): Mark variables that gcc -Wuninitialized
23723 does not deduce are never used uninitialized.
23724 (load_charset): Abort instead of using uninitialized var (Bug#8229).
23725
23726 * coding.c (coding_set_source, coding_set_destination):
23727 Use "else { /* comment */ }" rather than "else /* comment */;"
23728 for clarity, and to avoid gcc -Wempty-body warning.
23729 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23730 a block, when the outer 'i' will do.
23731 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23732 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23733 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23734 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23735 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23736 Rename locals to avoid shadowing.
23737 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
23738 * coding.c (emacs_mule_char, encode_invocation_designation):
23739 Now static, since they're not used elsewhere.
23740 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
23741 (decode_coding_object, encode_coding_object, detect_coding_system):
23742 (decode_coding_emacs_mule): Mark variables that gcc
23743 -Wuninitialized does not deduce are never used uninitialized.
23744 (detect_coding_iso_2022): Initialize a local variable that might
23745 be used uninitialized. Leave a FIXME because it's not clear that
23746 this initialization is needed. (Bug#8211)
23747 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23748 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23749 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23750 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23751 Remove unused macros.
23752
23753 * category.c (hash_get_category_set): Remove unused local var.
23754 (copy_category_table): Now static, since it's not used elsewhere.
23755 * character.c (string_count_byte8): Likewise.
23756
23757 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23758 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23759
23760 * chartab.c (copy_sub_char_table): Now static, since it's not used
23761 elsewhere.
23762 (sub_char_table_ref_and_range, char_table_ref_and_range):
23763 Rename locals to avoid shadowing.
23764 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
23765
23766 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
23767 (BIDI_BOB): Remove unused macro.
23768
23769 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23770 deduce are never used uninitialized.
23771 * term.c (encode_terminal_code): Likewise.
23772
23773 * term.c (encode_terminal_code): Now static. Remove unused local.
23774
23775 * tparam.h: New file.
23776 * term.c, tparam.h: Include it.
23777 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23778 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23779 Move these decls to tparam.h, and make them agree with what
23780 is actually in tparam.c. The previous trick of using incompatible
23781 decls in different modules does not conform to the C standard.
23782 All callers of tparam changed to use tparam's actual API.
23783 * tparam.c (tparam1, tparam, tgoto):
23784 Use const pointers where appropriate.
23785
23786 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23787 * cm.h (struct cm): Likewise.
23788 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23789 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23790 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23791 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23792 (turn_on_face, init_tty): Likewise.
23793 * termchar.h (struct tty_display_info): Likewise.
23794
23795 * term.c (term_mouse_position): Rename local to avoid shadowing.
23796
23797 * alloc.c (mark_ttys): Move decl from here ...
23798 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23799
23800 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23801
23802 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23803
23804 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
23805
23806 * search.c (compile_pattern_1): Remove argument regp, unused since
23807 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23808 (compile_pattern): Don't pass it.
23809
23810 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23811
23812 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23813 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23814 for ! HAVE_GTK3.
23815 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23816
23817 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23818
23819 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23820 gdk_window_get_screen, gdk_window_get_geometry,
23821 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23822 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23823 (xg_get_pixbuf_from_pixmap): New function.
23824 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23825 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23826 Call xg_get_pixbuf_from_pixmap instead of
23827 gdk_pixbuf_get_from_drawable.
23828 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23829 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23830 (xg_check_special_colors): Use GtkStyleContext and its functions
23831 for HAVE_GTK3.
23832 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23833 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23834 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
23835 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23836 Call gtk_widget_get_preferred_size.
23837 (xg_frame_resized): gdk_window_get_geometry only takes 5
23838 parameters.
23839 (xg_win_to_widget, xg_event_is_for_menubar):
23840 Call gdk_x11_window_lookup_for_display.
23841 (xg_set_widget_bg): New function.
23842 (delete_cb): New function.
23843 (xg_create_frame_widgets): Connect delete-event to delete_cb.
23844 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
23845 (xg_set_background_color): Call xg_set_widget_bg.
23846 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23847 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23848 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23849 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23850 if ! HAVE_GTK3.
23851 (update_frame_tool_bar): Call gtk_widget_hide.
23852 (xg_initialize): Use GDK_KEY_g.
23853
23854 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23855 if ! HAVE_GTK3
23856 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23857
23858 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23859 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23860 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23861
23862 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
23863
23864 * w32xfns.c (select_palette): Check success of RealizePalette against
23865 GDI_ERROR, not zero.
23866
23867 See ChangeLog.11 for earlier changes.
23868
23869 ;; Local Variables:
23870 ;; coding: utf-8
23871 ;; End:
23872
23873 Copyright (C) 2011-2013 Free Software Foundation, Inc.
23874
23875 This file is part of GNU Emacs.
23876
23877 GNU Emacs is free software: you can redistribute it and/or modify
23878 it under the terms of the GNU General Public License as published by
23879 the Free Software Foundation, either version 3 of the License, or
23880 (at your option) any later version.
23881
23882 GNU Emacs is distributed in the hope that it will be useful,
23883 but WITHOUT ANY WARRANTY; without even the implied warranty of
23884 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23885 GNU General Public License for more details.
23886
23887 You should have received a copy of the GNU General Public License
23888 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.