coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention to the buffer relocati...
[bpt/emacs.git] / src / ChangeLog
1 2012-09-30 Kenichi Handa <handa@gnu.org>
2
3 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4 to the buffer relocation which may be caused by ccl_driver.
5
6 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7
8 * .gdbinit: Just stop at fatal_error_backtrace.
9 See Stefan Monnier's request in
10 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
11 Remove no-longer-used query of system type.
12
13 2012-09-22 Chong Yidong <cyd@gnu.org>
14
15 * search.c (Freplace_match): Doc fix (Bug#12325).
16
17 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
18
19 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
20 (Fline_end_position): Doc fix.
21
22 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
23
24 2012-09-22 Chong Yidong <cyd@gnu.org>
25
26 * dispextern.h (struct image_type): Add new slot, storing a type
27 initialization function.
28
29 * image.c (define_image_type): Call the image initializer function
30 if it is defined. Arguments and return value changed.
31 (valid_image_p, make_image): Callers changed.
32 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
33 (gif_type, imagemagick_type, svg_type, gs_type): Add
34 initialization functions.
35 (Finit_image_library): Call lookup_image_type.
36 (CHECK_LIB_AVAILABLE): Macro deleted.
37 (lookup_image_type): Call define_image_type here, rather than via
38 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
39 (syms_of_image): Move define_image_type calls for xbm_type and
40 pbm_type to lookup_image_type.
41
42 2012-09-22 Eli Zaretskii <eliz@gnu.org>
43
44 * keyboard.c (timer_check_2): Move calculation of 'timers' and
45 'idle_timers' from here ...
46 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
47 lists, to avoid infloops when the timer does something stupid,
48 like reinvoke itself with the same or smaller time-out.
49 (Bug#12447)
50
51 2012-09-22 Martin Rudalics <rudalics@gmx.at>
52
53 * window.c (Fsplit_window_internal): Handle only Qt value of
54 Vwindow_combination_limit separately.
55 (Qtemp_buffer_resize): New symbol.
56 (Vwindow_combination_limit): New default value. Rewrite
57 doc-string.
58
59 2012-09-22 Eli Zaretskii <eliz@gnu.org>
60
61 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
62 the new overlay string. (Bug#10159)
63
64 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
65
66 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
67 or that fprintf is async-signal-safe. POSIX doesn't require
68 either assumption.
69
70 2012-09-22 Chong Yidong <cyd@gnu.org>
71
72 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
73 (Bug#8207).
74
75 2012-09-22 Kenichi Handa <handa@gnu.org>
76
77 * composite.c (composition_reseat_it): Handle the case that a
78 grapheme cluster is not covered by a single font (Bug#12352).
79
80 2012-09-21 Chong Yidong <cyd@gnu.org>
81
82 * image.c (define_image_type): Avoid adding duplicate types to
83 image_types (Bug#12463). Suggested by Jörg Walter.
84
85 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
86
87 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
88 (print_load_command_name): Add case LC_DATA_IN_CODE.
89 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
90
91 2012-09-21 Glenn Morris <rgm@gnu.org>
92
93 * eval.c (Frun_hook_with_args_until_success)
94 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
95
96 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
97
98 * fileio.c (Ffile_selinux_context): Only call freecon when
99 lgetfilecon succeeded.
100 (Fset_file_selinux_context): Likewise. (Bug#12444)
101
102 2012-09-21 Eli Zaretskii <eliz@gnu.org>
103
104 * xdisp.c (try_window_reusing_current_matrix): Under bidi
105 reordering, locate the cursor by calling set_cursor_from_row; if
106 that fails, clear the desired glyph matrix before returning a
107 failure indication to the caller. Fixes leaving garbled display
108 when fast scrolling with a down-key. (Bug#12403)
109 (compute_stop_pos_backwards): Fix a typo that caused crashes while
110 scrolling through multibyte text.
111
112 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
113
114 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
115 calling mark_vectorlike since that's the one that marks the window.
116 (mark_discard_killed_buffers): Mark the final cdr.
117 * window.h (struct window): Move prev/next_buffers to the
118 non-standard fields.
119 * window.c (make_window): Initialize prev/next_buffers manually.
120
121 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
122
123 Omit unused arg EXPECTED from socket hooks.
124 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
125 * nsterm.m (ns_term_init):
126 * termhooks.h (struct terminal.read_socket_hook):
127 * w32inevt.c (w32_console_read_socket):
128 * w32term.c (w32_read_socket):
129 * xterm.c (XTread_socket):
130 Omit unused arg EXPECTED. All callers changed.
131 (store_user_signal_events): Return void, not int, since callers no
132 longer care about the return value. All uses changed.
133
134 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
135
136 * w32gui.h (XParseGeometry): Do not declare.
137
138 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
139
140 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
141 Ignore 'expected'. See Eli Zaretskii in
142 <http://bugs.gnu.org/12471#8> (last line).
143
144 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
145 (XParseGeometry): Now static. Substitute extremal values for
146 values that are out of range.
147
148 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
149
150 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
151
152 * nsfns.m (XParseGeometry): Remove.
153 (Fx_create_frame): Call x_set_offset to correctly interpret
154 top_pos in geometry.
155
156 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
157 (Fx_parse_geometry): If there is a space in string, call
158 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
159
160 2012-09-17 Eli Zaretskii <eliz@gnu.org>
161
162 * search.c (scan_buffer): Use character positions in calls to
163 region_cache_forward and region_cache_backward, not byte
164 positions. (Bug#12196)
165
166 * w32term.c (w32_read_socket): Set pending_signals to 1, like
167 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
168
169 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
170 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
171 emacs_blocked_malloc, now deleted.
172
173 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
174
175 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
176 The workaround was for improving performance on Solaris 2.4, but
177 is getting in the way now. Emacs will still work if someone is
178 still running Solaris 2.4 in a museum somewhere; Sun dropped
179 support for Solaris 2.4 in 2003.
180 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
181 * process.c (create_process) [HAVE_WORKING_VFORK]:
182 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
183 since Emacs no longer uses vfork on that platform.
184
185 2012-09-17 Glenn Morris <rgm@gnu.org>
186
187 * emacs.c: Use COPYRIGHT.
188
189 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
190
191 Remove configure's --without-sync-input option (Bug#12450).
192 When auditing signal-handling in preparation for cleaning it up,
193 I found that SYNC_INPUT has race conditions and would be a real
194 pain to fix. Since it's an undocumented and deprecated
195 configure-time option, now seems like a good time to remove it.
196 Also see <http://bugs.gnu.org/11080#16>.
197 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
198 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
199 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
200 (malloc_hysteresis):
201 (check_depth) [XMALLOC_OVERRUN_CHECK]:
202 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
203 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
204 (dont_register_blocks, bytes_used_when_reconsidered)
205 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
206 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
207 [!SYSTEM_MALLOC && !SYNC_INPUT]:
208 Remove. All uses removed.
209 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
210 implementation, one that depends on whether the new macro
211 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
212 is defined.
213 * atimer.c (run_timers, handle_alarm_signal):
214 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
215 (handle_async_input, process_pending_signals)
216 (handle_input_available_signal, init_keyboard):
217 * nsterm.m (ns_read_socket):
218 * process.c (wait_reading_process_output):
219 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
220 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
221 (emacs_write):
222 * xterm.c (XTread_socket):
223 Assume SYNC_INPUT.
224 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
225 * eval.c (handling_signal): Remove. All uses removed.
226 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
227 All uses replaced with the SYNC_INPUT version.
228 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
229 Remove decls.
230 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
231 Now static.
232
233 * font.c (Ffont_shape_gstring): Remove unused local.
234
235 2012-09-16 Glenn Morris <rgm@gnu.org>
236
237 * Makefile.in (clean): No longer run nextstep's clean.
238
239 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
240 (ns_frag): Remove.
241 (ns-app): Move here from ns.mk, and simplify.
242 (clean): Simplify nextstep entry.
243 * ns.mk: Remove file.
244
245 2012-09-17 Kenichi Handa <handa@gnu.org>
246
247 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
248 not covert the last few charactes.
249
250 2012-09-16 Kenichi Handa <handa@gnu.org>
251
252 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
253 here, but just check the validity of glyphs in the glyph-string.
254
255 2012-09-16 Martin Rudalics <rudalics@gmx.at>
256
257 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
258 any window as argument (Bug#12452).
259
260 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
261
262 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
263 to ns_term_init to avoid memory leak.
264
265 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
266 explicit retain/release.
267 (ns_term_init): Only allow one display. Initialize outerpool and
268 ns_*_types.
269
270 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
271
272 Port _setjmp fix to POSIXish hosts as well as Microsoft.
273 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
274 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
275 the Microsoft problem in a different way, by altering ../nt/config.nt.
276
277 2012-09-15 Eli Zaretskii <eliz@gnu.org>
278
279 * w32xfns.c:
280 * w32uniscribe.c:
281 * w32term.c:
282 * w32select.c:
283 * w32reg.c:
284 * w32proc.c:
285 * w32menu.c:
286 * w32inevt.c:
287 * w32heap.c:
288 * w32font.c:
289 * w32fns.c:
290 * w32console.c:
291 * w32.c:
292 * w16select.c: Remove inclusion of setjmp.h, as it is now included
293 by lisp.h. This completes removal of setjmp.h inclusion
294 erroneously announced in the previous commit. (Bug#12446)
295
296 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
297 more accurate.
298
299 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
300 not defined as a macro. The latter happens on MS-Windows.
301 (Bug#12446)
302
303 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
304
305 Port better to POSIX hosts lacking _setjmp (Bug#12446).
306 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
307 Some instances of '#include <setjmp.h>' removed, if the
308 only reason for the instance was because "lisp.h" was included.
309 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
310 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
311 and _longjmp with the new symbols. Emacs already uses _setjmp if
312 available, so this change affects only POSIXish hosts that have
313 sigsetjmp but not _setjmp, such as some versions of Solaris and
314 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
315 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
316 (png_load_body) [HAVE_PNG]:
317 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
318 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
319 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
320 since PNG requires jmp_buf. This is the only exception to the
321 general rule that we now use sys_setjmp and sys_longjmp.
322 This exception is OK since this code does not change the signal
323 mask or longjmp out of a signal handler.
324
325 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
326
327 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
328 Include "syssignal.h", for 'main_thread'.
329
330 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
331
332 Avoid out-of-range marker position (Bug#12426).
333 * insdel.c (replace_range, replace_range_2): Adjust
334 markers before overlays, as suggested by comments.
335 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
336 Remove redundant check before calling offset_intervals.
337
338 2012-09-14 Martin Rudalics <rudalics@gmx.at>
339
340 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
341 current buffer (Bug#12387).
342
343 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
344
345 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
346
347 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
348
349 Use a more backwards-compatible timer format (Bug#12430).
350 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
351 vector element, not from the 4th, since PSECS is now at the end.
352 (Fcurrent_idle_time): Doc fix.
353
354 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
355
356 Function to mark objects and remove killed buffers at once.
357 * alloc.c (discard_killed_buffers): Rename to ...
358 (mark_discard_killed buffers) ... new name. Add marking
359 of remaining objects. Fix comment. Adjust users.
360 (mark_object): Do not touch frame buffer lists here.
361 * frame.c (delete_frame): Reset frame buffer lists here.
362
363 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
364
365 Better workaround for GNOME bug when --enable-gcc-warnings.
366 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
367 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
368 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
369
370 Simplify SIGIO usage (Bug#12408).
371 The code that dealt with SIGIO was crufty and confusing, e.g., it
372 played tricks like "#undef SIGIO" but these tricks were not used
373 consistently. Simplify mostly by not #undeffing standard symbols,
374 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
375 or not as we please) rather than "defined SIGIO" (standard symbol
376 that we probably shouldn't #undef).
377 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
378 Modules that need it can include it.
379 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
380 * dispextern.h (ignore_sigio): New decl.
381 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
382 unconditionally, since it's now a no-op if !USABLE_SIGIO.
383 * emacs.c (shut_down_emacs):
384 * keyboard.c (kbd_buffer_store_event_hold):
385 Use ignore_sigio rather than invoking 'signal' directly.
386 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
387 for FIONREAD.
388 (FIONREAD, SIGIO): Do not #undef.
389 (tty_read_avail_input): Use #error rather than a syntax error.
390 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
391 for I_PIPE, used by SETUP_SLAVE_PTY.
392 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
393 * sysdep.c (croak): Remove; no longer needed. This bit of
394 temporary code, with Fred N. Fish's comment that it's temporary,
395 has been in Emacs since at least 1992!
396 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
397 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
398 * syssignal.h (croak): Remove decl.
399 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
400 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
401 now that we're termios-only.
402 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
403 * term.c (dissociate_if_controlling_tty): Use #error rather than
404 a run-time error.
405
406 Work around GCC and GNOME bugs when --enable-gcc-warnings.
407 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
408 to work around GNOME bug 683906.
409 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
410 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
411 This works around GCC bug 54561.
412
413 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
414
415 More fixes for 'volatile' and setjmp/longjmp.
416 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
417 * image.c (struct png_load_context) [HAVE_PNG]: New type.
418 (png_load_body) [HAVE_PNG]:
419 (jpeg_load_body) [HAVE_JPEG]:
420 New function, with most of the old parent function's body.
421 (png_load) [HAVE_PNG]:
422 (jpeg_load) [HAVE_JPEG]:
423 Invoke the new function, to avoid longjmp munging our locals.
424 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
425 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
426 longjmp is passed 2, as the C standard doesn't guarantee this.
427 Instead, store the failure code into mgr->failure_code.
428
429 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
430
431 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
432 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
433 (syms_of_keyboard): Remove support for unread-command-char.
434
435 2012-09-12 Eli Zaretskii <eliz@gnu.org>
436
437 * w32proc.c (sys_kill): If PID is our process ID and the signal is
438 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
439 violation. (Bug#12426)
440
441 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
442
443 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
444
445 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
446
447 * eval.c: Add `inhibit-debugger'.
448 (Qinhibit_debugger): New symbol.
449 (call_debugger): Bind it instead of Qdebug_on_error.
450 (maybe_call_debugger): Test Vinhibit_debugger.
451 (syms_of_eval): Define inhibit-debugger.
452 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
453 (syms_of_xdisp): Remove inhibit-debug-on-message.
454
455 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
456
457 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
458 If a nonvolatile local variable is written before a _longjmp to
459 the frame containing the variable, and is read after the _longjmp,
460 the value read is indeterminate. Some local variables of type
461 'struct handler' and 'struct catchtag' are used in this way, so
462 mark each of their slots as volatile if the slot can be set before
463 _longjmp and read afterwards.
464 * lisp.h (struct handler): var and chosen_clause are now volatile.
465 (struct catchtag): val, next, and pdlcount are now volatile.
466
467 * bidi.c (bidi_push_it, bidi_pop_it):
468 * fns.c (copy_hash_table):
469 * image.c (define_image_type):
470 * keyboard.c (kbd_buffer_store_event_hold):
471 * process.c (Fprocess_send_eof):
472 * xfaces.c (x_create_gc) [HAVE_NS]:
473 * xgselect.c (xg_select):
474 Prefer assignment to memcpy when either will do.
475
476 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
477 Use pointer-to-a-pointer to simplify and avoid a NILP check each
478 time an item is removed. No need to mark this function 'inline';
479 the compiler knows better than we do.
480
481 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
482
483 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
484 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
485 to change_frame_size (Bug#12388).
486 (windowDidResize:): Pass YES to updateFrameSize.
487
488 * nsterm.h: Add delay parameter to updateFrameSize.
489
490 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
491
492 Discard killed buffers from deleted window and frame objects.
493 This reduces an amount of references to killed buffers and
494 helps GC to reclaim them faster.
495 * alloc.c (discard_killed_buffers): New function.
496 (mark_object): Use it for deleted windows and frames.
497 (mark_object): If symbol's value is set up for a killed buffer
498 or deleted frame, restore it's global binding.
499 * data.c (swap_in_global_binding): Add GC notice.
500 (swap_in_symval_forwarding): Use convenient set_blv_where.
501 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
502 * window.h: ... to here.
503
504 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
505
506 Convenient macro to check whether the buffer is live.
507 * buffer.h (BUFFER_LIVE_P): New macro.
508 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
509 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
510
511 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
512
513 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
514 composition cases (Bug#12364).
515
516 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
517 overhang of succeeding glyphs overlapping box cursor.
518
519 * w32term.c (x_draw_glyph_string): Likewise.
520
521 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
522
523 Simplify, document, and port floating-point (Bug#12381).
524 The porting part of this patch fixes bugs on non-IEEE platforms
525 with frexp, ldexp, logb.
526 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
527 Now static.
528 * floatfns.c: Simplify discussion of functions that Emacs doesn't
529 support, by removing commented-out code and briefly listing the
530 C89 functions excluded. The commented-out stuff was confusing
531 maintenance, e.g., we thought we needed cbrt but it was commented out.
532 (logb): Remove decl; no longer needed.
533 (isfinite): New macro, if not already supplied.
534 (isnan): Don't replace any existing macro.
535 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
536 are present on all C89 platforms.
537 (Ffrexp): Do not special-case zero, as frexp does the right thing
538 for that case.
539 (Flogb): Do not use logb, as it doesn't have the desired meaning
540 on hosts that use non-base-2 floating point. Instead, stick with
541 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
542 frexp, to avoid getting an unspecified result.
543
544 * xdisp.c (Qinhibit_debug_on_message): Now static.
545
546 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
547
548 * nsterm.m (ns_update_begin): Set clip path to whole view by using
549 NSBezierPath (Bug#12131).
550
551 2012-09-10 Chong Yidong <cyd@gnu.org>
552
553 * fns.c (Fdelq, Fdelete): Doc fix.
554
555 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
556
557 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
558 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
559
560 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
561
562 * lisp.h (make_lisp_ptr): New macro to replace XSET.
563 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
564 Use it.
565
566 2012-09-09 Eli Zaretskii <eliz@gnu.org>
567
568 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
569 left fringe if the window has a left margin. This avoids leaving
570 traces of the cursor because its leftmost pixel is not drawn over.
571
572 * dispnew.c (update_window_line): When the left margin area of a
573 screen line is updated, set the redraw_fringe_bitmaps_p flag of
574 that screen line. (Bug#12277)
575
576 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
577
578 Assume C89 or later for math functions (Bug#12381).
579 This simplifies the code, and makes it a bit smaller and faster,
580 and (most important) makes it easier to clean up signal handling
581 since we can stop worring about floating-point exceptions in
582 library code. That was a problem before C89, but the problem
583 went away many years ago on all practical Emacs targets.
584 * data.c, image.c, lread.c, print.c:
585 Don't include <math.h>; no longer needed.
586 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
587 might be autoconfigured, as that never happens.
588 * data.c (fmod):
589 * doprnt.c (DBL_MAX_10_EXP):
590 * print.c (DBL_DIG):
591 Remove. C89 or later always defines these.
592 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
593 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
594 (arith_error, domain_error, domain_error2):
595 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
596 no longer needed -- we simply return what C returns. All uses removed.
597 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
598 the wrapped code.
599 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
600 Remove. All uses expanded, as these macros are no longer used
601 more than once and are now more trouble than they're worth.
602 (Ftan): Use tan, not sin / cos.
603 (Flogb): Assume C89 frexp.
604 (fmod_float): Assume C89 fmod.
605 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
606 (init_floatfns): Remove. All uses removed.
607
608 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
609
610 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
611 compositeToPoint for OSX < 10.6 (Bug#12390).
612
613 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
614
615 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
616 This produces more-accurate results.
617
618 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
619
620 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
621 changes (Bug#12088).
622
623 2012-09-08 Chong Yidong <cyd@gnu.org>
624
625 * syntax.c (Fstring_to_syntax): Doc fix.
626
627 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
628
629 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
630 in the internal border.
631 (x_set_window_size): Remove static variables and their usage.
632 (ns_redraw_scroll_bars): Fix NSTRACE arg.
633 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
634 fringe/internal border adjustment (Bug#11052).
635 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
636 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
637 (ns_fix_rect_ibw): Remove.
638 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
639 (ns_dumpglyphs_box_or_relief): Ditto.
640 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
641 adjustment.
642 (ns_dumpglyphs_image): Ditto.
643 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
644 border adjustment.
645 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
646 their usage. Add fringe_extended_p and its use as in other terms.
647 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
648 scroll bar was removed.
649 (updateFrameSize): New function.
650 (windowDidResize): Move code to updateFrameSize and call it.
651
652 * nsterm.h (EmacsView): Add updateFrameSize.
653
654 2012-09-07 Chong Yidong <cyd@gnu.org>
655
656 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
657
658 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
659
660 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
661
662 More signal-handler cleanup (Bug#12327).
663 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
664 Problem introduced when merging patches. Noted by Eli Zaretskii in
665 <http://bugs.gnu.org/12327#67>.
666 * floatfns.c: Comment fix.
667 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
668 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
669 and anyway the declaration is harmless even if SIGDANGER is not defined.
670 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
671 defined BROKEN_FIONREAD). systty.h formerly did this, but other
672 source files not surprisingly expected syssignal.h to define, or
673 not define, SIGIO, and it's cleaner to do it that way, for consistency.
674 Include <sys/ioctl.h>, for FIONREAD.
675 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
676 This eliminates a problem whereby other files mysteriously had
677 to include "syssignal.h" before including "systty.h" if they
678 wanted to use "#ifdef SIGIO".
679
680 2012-09-07 Eli Zaretskii <eliz@gnu.org>
681
682 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
683
684 * w32.c (sigemptyset): Empty the set.
685 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
686
687 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
688
689 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
690
691 * alloc.c (mark_buffer): Revert unsafe marking optimization.
692 (mark_object): Likewise for frame objects.
693
694 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
695
696 * syssignal.h (handle_on_main_thread): Always declare,
697 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
698 This ports to platforms without HAVE_PTHREAD.
699
700 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
701
702 Signal-handler cleanup (Bug#12327).
703 Emacs's signal handlers were written in the old 4.2BSD style with
704 sigblock and sigmask and so forth, and this led to some
705 inefficiencies and confusion. Rewrite these to use
706 pthread_sigmask etc. without copying signal sets around. Also,
707 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
708 'signal', and instead use functions that do not attempt to take
709 over the system name space. This patch causes Emacs's text
710 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
711 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
712 Do not include <signal.h> or "syssignal.h", as these
713 modules do not use signals.
714 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
715 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
716 Do not include <signal.h>, as "syssignal.h" does that for us now.
717 * atimer.c (sigmask_atimers): New function.
718 (block_atimers, unblock_atimers): New functions,
719 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
720 All uses replaced.
721 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
722 no longer needed here.
723 * emacs.c (main): Inspect existing signal handler with sigaction,
724 so that there's no need to block and unblock SIGHUP.
725 * sysdep.c (struct save_signal): New member 'action', replacing
726 old member 'handler'.
727 (save_signal_handlers, restore_signal_handlers):
728 Use sigaction instead of 'signal' to save and restore.
729 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
730 New function. All users of 'signal' modified to use set_sighandler
731 if they're writeonly, and to use sys_signal if they're read+write.
732 (emacs_sigaction_init, forwarded_signal): New functions.
733 (sys_signal): Remove. All uses replaced by calls to sigaction
734 and emacs_sigaction_init, or by direct calls to 'signal'.
735 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
736 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
737 all uses replaced by pthread_sigmask etc. calls.
738 * syssignal.h: Include <signal.h>.
739 (emacs_sigaction_init, forwarded_signal): New decls.
740 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
741 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
742 (sigmask, sys_sigmask): Remove; no longer needed.
743 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
744 (sigblock, sigunblock, sigfree):
745 (sigsetmask) [!defined sigsetmask]:
746 Remove. All uses replaced by pthread_sigmask.
747 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
748 no longer need to be replaced, and its typical old uses
749 are now done via emacs_sigaction_init and sigaction.
750 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
751 (sys_sigdel): Remove; unused.
752 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
753
754 2012-09-06 Eli Zaretskii <eliz@gnu.org>
755
756 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
757 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
758
759 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
760
761 Explicitly mark buffer_defaults and buffer_local_symbols.
762 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
763 mark_local_symbols here.
764 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
765 since special buffers aren't marked here any more.
766 (allocate_buffer): Chain new buffer with all_buffers here...
767 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
768 not here.
769 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
770 (syms_of_buffer): Remove staticpro of the above.
771 (init_buffer_once): Set names for buffer_defaults and
772 buffer_local_symbols.
773
774 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
775
776 Use bool for booleans in font-related modules.
777 * font.c (font_intern_prop, font_style_to_value)
778 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
779 (generate_otf_features, font_check_otf_features, font_check_otf)
780 (font_match_p, font_list_entities, font_at):
781 * fontset.c (fontset_id_valid_p, reorder_font_vector
782 (fontset_find_font, Fset_fontset_font)
783 (face_suitable_for_char_p) [0]:
784 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
785 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
786 (m17n_flt_initialized, ftfont_shape_by_flt):
787 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
788 * nsfont.m (nsfont_draw):
789 * w32font.c (w32font_draw):
790 * w32term.c (x_draw_glyphless_glyph_string_foreground):
791 Use bool for booleans.
792 * font.h: Adjust to above API changes.
793 (struct font, struct font_driver, struct font_driver_list):
794 Use bool for booleans.
795 (struct font): Remove useless member encoding_type.
796 All users removed.
797 * fontset.c, xftfont.c: Omit unnecessary static decls.
798
799 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
800
801 * alloc.c (mark_object): Revert window marking code
802 since it's unsafe for the Fset_window_configuration.
803
804 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
805
806 Fix race conditions with signal handlers and errno (Bug#12327).
807 Be more systematic about preserving errno whenever a signal
808 handler returns, even if it's not in the main thread. Do this by
809 renaming signal handlers to distinguish between signal delivery
810 and signal handling. All uses changed.
811 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
812 * data.c (deliver_arith_signal): Rename from arith_error.
813 * dispnew.c (deliver_window_change_signal): Rename from
814 window_change_signal.
815 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
816 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
817 * keyboard.c (deliver_input_available_signal): Rename from
818 input_available_signal.
819 (deliver_user_signal): Rename from handle_user_signal.
820 (deliver_interrupt_signal): Rename from interrupt_signal.
821 * process.c (deliver_pipe_signal): Rename from send_process_trap.
822 (deliver_child_signal): Rename from sigchld_handler.
823 * atimer.c (handle_alarm_signal):
824 * data.c (handle_arith_signal):
825 * dispnew.c (handle_window_change_signal):
826 * emacs.c (handle_fatal_signal, handle_danger_signal):
827 * keyboard.c (handle_input_available_signal):
828 * keyboard.c (handle_user_signal, handle_interrupt_signal):
829 * process.c (handle_pipe_signal, handle_child_signal):
830 New functions, with the actual signal-handling code taken from the
831 original respective signal handlers, sans the sporadic attempts to
832 preserve errno, since that's now done by handle_on_main_thread.
833 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
834 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
835 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
836 Move to sysdep.c.
837 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
838 Move initialization of main_thread to sysdep.c's init_signals.
839 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
840 our usage, and simplifies the mainline code.
841 (record_child_status_change): New static function, as a helper
842 for handle_child_signal, and with most of the old child handler's
843 contents.
844 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
845 (handle_child_signal): Use the above.
846 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
847 Moved here from emacs.c.
848 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
849 code moved here from emacs.c's main function.
850 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
851 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
852 lets callers save and restore errno properly.
853
854 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
855
856 Remove redundant or unused things here and there.
857 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
858 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
859 * editfns.c (Fcompare_buffer_substrings): Likewise.
860 * frame.h (struct terminal, struct font_driver_list):
861 Remove redundant declarations.
862 * window.h (Qleft, Qright): Likewise.
863
864 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
865
866 Do not mark objects from deleted buffers, windows and frames.
867 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
868 (mark_object): Likewise for windows and frames.
869
870 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
871
872 * alloc.c (valid_lisp_object_p): Treat killed buffers,
873 buffer_defaults and buffer_local_symbols as valid objects.
874 Return special value to denote them.
875
876 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
877
878 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
879 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
880 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
881 (file_name_absolute_p, Fsubstitute_in_file_name):
882 (check_executable, check_writable, Ffile_accessible_directory_p)
883 (Fset_file_selinux_context, Fdefault_file_modes)
884 (Finsert_file_contents, choose_write_coding_system)
885 (Fwrite_region, build_annotations, a_write, e_write)
886 (Fdo_auto_save):
887 * filelock.c (boot_time_initialized, get_boot_time)
888 (get_boot_time_1, lock_file_1, within_one_second):
889 * floatfns.c (in_float):
890 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
891 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
892 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
893 * lisp.h (struct Lisp_Hash_Table.cmpfn):
894 * window.c (compare_window_configurations):
895 Use bool for booleans.
896 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
897 (Fdefault_file_modes): Now mode_t, not int, for modes.
898 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
899 (internal_delete_file): Now returns void, not a (boolean) int,
900 since nobody was looking at the return value.
901 * lisp.h, window.h: Adjust to above API changes.
902
903 * xdisp.c (set_message): Simplify and reindent last change.
904
905 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
906
907 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
908
909 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
910
911 * eval.c (call_debugger): Make the function non-static so that we
912 can call it from set_message.
913
914 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
915 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
916
917 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
918
919 Give more-useful info on a fatal error (Bug#12328).
920 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
921 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
922 of doing the work ourselves.
923 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
924 do most of the work.
925 (fatal_error_backtrace): New function, taken from the guts
926 of the old fatal_error_signal, but with a new option to output
927 a backtrace.
928 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
929 info about the signal than just its number.
930 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
931 * sysdep.c: Include <execinfo.h>
932 (emacs_backtrace): New function, taken partly from the previous
933 code of the 'die' function.
934 (emacs_abort): Call fatal_error_backtrace rather than abort.
935
936 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
937
938 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
939 eager (load-time) macro-expansion.
940 * lisp.mk (lisp): Add macroexp.
941
942 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
943
944 Simplify redefinition of 'abort' (Bug#12316).
945 Do not try to redefine the 'abort' function. Instead, redo
946 the code so that it calls 'emacs_abort' rather than 'abort'.
947 This removes the need for the NO_ABORT configure-time macro
948 and makes it easier to change the abort code to do a backtrace.
949 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
950 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
951 Remove; sysdep.c's emacs_abort now takes its place.
952 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
953 'abort' changed to use 'emacs_abort'.
954 * msdos.c (dos_abort) [defined abort]: Remove; not used.
955 (abort) [!defined abort]: Rename to ...
956 (emacs_abort): ... new name.
957 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
958 the place of the old 'abort' in emacs.c.
959 * w32.c, w32fns.c (abort): Do not #undef.
960 * w32.c (emacs_abort): Rename from w32_abort.
961
962 2012-09-04 Eli Zaretskii <eliz@gnu.org>
963
964 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
965 offsets[j].dv, since the y axis of the screen coordinates points
966 down, while the y axis of the font definition coordinates points
967 up. This fixes display of Arabic diacritics such as KASRA and
968 KASRATAN. (Bug#11860)
969
970 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
971
972 Be more systematic about _setjmp vs setjmp.
973 * alloc.c (test_setjmp, mark_stack):
974 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
975 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
976 (png_load, my_error_exit, jpeg_load):
977 * process.c (send_process_trap, send_process):
978 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
979 The underscored versions are up to 30x faster on some hosts.
980 Formerly, the code used setjmp+longjmp sometimes and
981 _setjmp+_longjmp at other times, with no particular reason to
982 prefer setjmp+longjmp.
983
984 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
985
986 Fix minor problem found by static checking.
987 * buffer.c (Fdelete_all_overlays): Return nil.
988
989 2012-09-03 Martin Rudalics <rudalics@gmx.at>
990
991 * buffer.c (Fdelete_all_overlays): New function.
992
993 2012-09-03 Chong Yidong <cyd@gnu.org>
994
995 * gtkutil.c: Add extern decl for Qxft.
996
997 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
998
999 * emacs.c, eval.c: Use bool for boolean.
1000 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1001 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1002 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1003 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1004 (main, decode_env_path, Fdaemon_initialized):
1005 * eval.c (call_debugger, Finteractive_p, interactive_p):
1006 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1007 (maybe_call_debugger, Fbacktrace):
1008 * process.c (read_process_output, exec_sentinel):
1009 Use bool for booleans.
1010 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1011 All callers changed.
1012 * eval.c (interactive_p): Omit always-true boolean argument
1013 EXCLUDE_SUBRS_P. All callers changed.
1014 * dispextern.h, lisp.h: Reflect above API changes.
1015 * firstfile.c (dummy): Use the address of 'main', whose signature
1016 won't change, instead of the address of 'initialize', whose
1017 signature just changed from int to bool.
1018 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1019 * msdos.c (fatal_error_in_progress): ... from here.
1020 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1021 of incrementing it.
1022 (redisplay_internal, unwind_redisplay): Simply clear
1023 REDISPLAYING_P when unwinding, instead of saving its previous,
1024 always-false value and then restoring it.
1025
1026 Clean up some extern decls.
1027 Mostly, this hoists extern decls out of .c files and into .h files.
1028 That way, we're more likely to catch errors if the interfaces change.
1029 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1030 declare xg_mark_data.
1031 * dispextern.h (x_frame_parm_handlers):
1032 * font.h (Qxft):
1033 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1034 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1035 (Qultra_bold, Qoblique, Qitalic):
1036 Move extern decl here from .c file.
1037 * alloc.c (xg_mark_data) [USE_GTK]:
1038 * doc.c (Qclosure):
1039 * eval.c (Qlexical_binding):
1040 * fns.c (time) [!HAVE_UNISTD_H]:
1041 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1042 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1043 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1044 * lread.c (Qinternal_interpreter_environment):
1045 * minibuf.c (Qbuffer):
1046 * process.c (QCfamily, QCfilter):
1047 * widget.c (free_frame_faces):
1048 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1049 * xfont.c (x_clear_errors):
1050 * xterm.c (x_frame_parm_handlers):
1051 Remove now-redundant extern decls.
1052 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1053 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1054 Now static.
1055 * xfaces.c: Remove unnecessary static decls.
1056 * xterm.c (updating_frame): Remove decl of nonexistent object.
1057
1058 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1059 when building globals.h, as the objects that are not built on
1060 this host are not needed to compile C files on this host.
1061
1062 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1063
1064 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1065
1066 * frame.h: Add missing prototype for x_wm_set_size_hint.
1067
1068 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1069
1070 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1071 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1072 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1073 (Fsubstitute_command_keys):
1074 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1075 (save_excursion_save, save_excursion_restore)
1076 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1077 (format_time_string, general_insert_function)
1078 (make_buffer_string, make_buffer_string_both)
1079 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1080 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1081 (copy_text, insert_1, insert_1_both, insert_from_string)
1082 (insert_from_string_before_markers, insert_from_string_1)
1083 (insert_from_buffer, insert_from_buffer_1, replace_range)
1084 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1085 (del_range_2, modify_region):
1086 * intervals.c (intervals_equal, balance_possible_root_interval)
1087 (adjust_intervals_for_insertion, merge_properties_sticky)
1088 (graft_intervals_into_buffer, lookup_char_property)
1089 (adjust_for_invis_intang, set_point_both)
1090 (get_property_and_range, compare_string_intervals)
1091 (set_intervals_multibyte_1, set_intervals_multibyte):
1092 * keyboard.c (decode_timer):
1093 Use bool for boolean.
1094 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1095 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1096
1097 2012-09-02 Chong Yidong <cyd@gnu.org>
1098
1099 * keymap.c (push_key_description): Print M-TAB as C-M-i
1100 (Bug#11758).
1101
1102 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1103
1104 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1105 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1106 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1107 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1108 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1109 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1110 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1111
1112 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1113
1114 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1115 more than one grapheme cluster passed to the shaper: compute the
1116 offset adjustment values separately for each cluster. (Bug#11860)
1117
1118 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1119 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1120 about implicit conversions from integer to pointer.
1121
1122 2012-09-01 Daniel Colascione <dancol@dancol.org>
1123
1124 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1125 system used too early.
1126
1127 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1128
1129 Better seed support for (random).
1130 * emacs.c (main): Call init_random.
1131 * fns.c (Frandom): Set the seed from a string argument, if given.
1132 Remove long-obsolete Gentzel cruft.
1133 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1134 (init_random): New function.
1135
1136 2012-09-01 Daniel Colascione <dancol@dancol.org>
1137
1138 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1139 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1140 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1141 x_wm_set_size_hint, x_query_colors, x_real_positions,
1142 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1143 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1144 all of which have been moved to common code.
1145
1146 * xfaces.c: Include TERM_HEADER instead of listing all possible
1147 window-system headers.
1148
1149 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1150 to match header.
1151
1152 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1153 directly accessing frame internals.
1154
1155 * w32font.h: Include font.h. Define syms_of_w32font and
1156 globals_of_w32font.
1157
1158 * process.c: Include TERM_HEADER instead of listing all possible
1159 window-system headers.
1160
1161 * nsterm.h: Remove declarations now in frame.h. Define
1162 FRAME_X_SCREEN, FRAME_X_VISUAL.
1163
1164 * menu.c: Include TERM_HEADER instead of listing all possible
1165 window-system headers.
1166
1167 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1168 window system.
1169
1170 * keyboard.c: Include TERM_HEADER instead of listing all possible
1171 window-system headers.
1172
1173 * image.c: Include TERM_HEADER instead of listing all possible
1174 window-system headers. Declare Vlibrary_cache when compiling for
1175 Windows.
1176
1177 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1178 window system declarations.
1179
1180 * frame.h: Move common functions here: set_frame_menubar,
1181 x_set_window_size, x_sync, x_get_focus_frame,
1182 x_set_mouse_position, x_set_mouse_pixel_position,
1183 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1184 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1185 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1186 x_activate_menubar, x_real_positions, x_bitmap_icon,
1187 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1188 and x_query_colors.
1189
1190 * frame.c: Include TERM_HEADER instead of listing all possible
1191 window-system headers.
1192
1193 * font.c: Include TERM_HEADER instead of listing all possible
1194 window-system headers.
1195
1196 * emacs.c: Include TERM_HEADER.
1197
1198 * dispnew.c: Include TERM_HEADER instead of listing all possible
1199 window-system headers.
1200
1201 * ccl.h: Include character.h.
1202
1203 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1204 the current window system; include in list of objects to link into
1205 Emacs.
1206
1207 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1208
1209 Remove mark_ttys function and fix tty_display_info initialization.
1210 * lisp.h (mark_ttys): Remove prototype.
1211 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1212 to mark_ttys because all possible values of 'top_frame' slot are
1213 the frames which are reachable from Vframe_list.
1214 * term.c (mark_ttys): Remove.
1215 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1216
1217 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1218
1219 Change struct frame bitfields from unsigned char to unsigned.
1220 * frame.h (struct frame): Change type of 'display_preempted',
1221 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1222 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1223 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1224 bitfields from unsigned char to unsigned.
1225
1226 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1227
1228 Remove unused member of struct x_output and struct w32_output.
1229 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1230 * w32term.h (struct w32_output): Likewise.
1231
1232 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1233
1234 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1235 does not become zero (Bug#12234).
1236
1237 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1238
1239 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1240 for GCC 4.7.1 x86-64.
1241
1242 2012-08-30 Glenn Morris <rgm@gnu.org>
1243
1244 * lread.c (init_lread): For out-of-tree builds, only add the
1245 source directory's site-lisp dir to the load-path if it exists,
1246 consistent with in-tree builds. (Bug#12302)
1247
1248 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1249
1250 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1251 button_values to NULL. Call setStykeMask so dialogs get a close button.
1252 (windowShouldClose:): Set window_closed.
1253 (dealloc): New member, free button_values.
1254 (process_dialog:): Make member function. Remove window argument,
1255 replace window with self. Count buttons and allocate and store values
1256 in button_values.
1257 (addButton:value:row:): value is int with the name tag. Call setTag
1258 with tag. Remove return self, declare return value as void.
1259 (addString:row:): Remove return self, declare return value as void.
1260 (addSplit): Remove return self, declare return value as void.
1261 (clicked:): Remove return self, declare return value as void.
1262 Set dialog_return to button_values[seltag]. Code formatting change.
1263 (initFromContents:isQuestion:): Adjust call to process_dialog.
1264 Code formatting change.
1265 (timeout_handler:): Set timer_fired to YES.
1266 (runDialogAt:): Set timer_fired to NO.
1267 Handle click on close button as quit.
1268
1269 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1270 Add window_closed and button_values. Add void as return value for
1271 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1272 Add process_dialog as new member.
1273
1274 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1275
1276 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1277 is not one of the heaps we manage. (Bug#12242)
1278
1279 2012-08-28 Glenn Morris <rgm@gnu.org>
1280
1281 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1282
1283 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1284
1285 * window.c (Fset_window_configuration): Remove handling of
1286 auto-buffer-name window parameter. Install revision of reverted
1287 fix.
1288
1289 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1290
1291 Do not allow to set major mode for a dead buffer.
1292 * buffer.c (Fset_buffer_major_mode): Signal an error
1293 if the buffer is dead.
1294 (Fother_buffer, other_buffer_safely): Remove redundant
1295 nested declaration.
1296
1297 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1298
1299 Always use set_buffer_if_live to restore original buffer at unwind.
1300 * buffer.h (record_unwind_current_buffer): New function.
1301 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1302 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1303 * undo.c, window.c: Adjust users.
1304 * buffer.c (set_buffer_if_live): Fix comment.
1305
1306 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1307
1308 Fix usage of set_buffer_internal.
1309 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1310 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1311 * coding.c (decode_coding): Omit redundant test.
1312 * fileio.c (decide_coding_unwind): Likewise.
1313 * fns.c (secure_hash): Likewise.
1314 * insdel.c (modify_region): Likewise.
1315 * keyboard.c (command_loop_1): Likewise.
1316 * print.c (PRINTFINISH): Likewise.
1317 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1318
1319 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1320
1321 * dispnew.c: Use bool for boolean.
1322 (frame_garbaged, display_completed, delayed_size_change)
1323 (fonts_changed_p, add_window_display_history)
1324 (add_frame_display_history, verify_row_hash)
1325 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1326 (row_equal_p, realloc_glyph_pool)
1327 (allocate_matrices_for_frame_redisplay)
1328 (showing_window_margins_p)
1329 (adjust_frame_glyphs_for_frame_redisplay)
1330 (build_frame_matrix_from_leaf_window, make_current)
1331 (mirrored_line_dance, mirror_line_dance, update_frame)
1332 (update_window_tree, update_single_window)
1333 (check_current_matrix_flags, update_window, update_text_area)
1334 (update_window_line, set_window_update_flags, scrolling_window)
1335 (update_frame_1, scrolling, buffer_posn_from_coords)
1336 (do_pending_window_change, change_frame_size)
1337 (change_frame_size_1, sit_for):
1338 Use bool for boolean.
1339 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1340 and remove last int (actually boolean) argument, which was always 0.
1341 All callers changed.
1342 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1343 * dispextern.h (struct composition_it): Use bool for boolean.
1344 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1345 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1346 * dired.c (file_name_completion):
1347 Use bool for boolean. (This was missed in an earlier change.)
1348
1349 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1350
1351 * window.c (Fset_window_configuration): Revert first part of
1352 last change.
1353
1354 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1355
1356 * nsterm.h (NSPanel): New class variable dialog_return.
1357
1358 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1359 dialog_return.
1360 (windowShouldClose:): Use stop instead of stopModalWithCode.
1361 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1362 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1363 event.
1364 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1365 modal loop returns.
1366
1367 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1368
1369 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1370 * composite.c (find_composition, composition_gstring_p)
1371 (composition_reseat_it, find_automatic_composition):
1372 * data.c (let_shadows_buffer_binding_p)
1373 (let_shadows_global_binding_p, set_internal, make_blv)
1374 (Fmake_variable_buffer_local, Fmake_local_variable)
1375 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1376 (cons_to_signed, arith_driver):
1377 * dbusbind.c (xd_in_read_queued_messages):
1378 * dired.c (directory_files_internal, file_name_completion):
1379 Use bool for booleans.
1380 * dired.c (file_name_completion):
1381 * process.h (fd_callback):
1382 Omit int (actually boolean) argument. It wasn't being used.
1383 All uses changed.
1384 * composite.h, lisp.h: Reflect above API changes.
1385
1386 * cmds.c, coding.c: Use bool for booleans.
1387 * cmds.c (move_point, Fself_insert_command):
1388 * coding.h (struct composition status, struct coding_system):
1389 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1390 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1391 (emacs_mule_char, decode_coding_emacs_mule)
1392 (encode_coding_emacs_mule, detect_coding_iso_2022)
1393 (decode_coding_iso_2022, encode_invocation_designation)
1394 (encode_designation_at_bol, encode_coding_iso_2022)
1395 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1396 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1397 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1398 (encode_coding_raw_text, detect_coding_charset)
1399 (decode_coding_charset, encode_coding_charset, detect_eol)
1400 (detect_coding, get_translation_table, produce_chars)
1401 (consume_chars, reused_workbuf_in_use)
1402 (make_conversion_work_buffer, code_conversion_save)
1403 (decode_coding_object, encode_coding_object)
1404 (detect_coding_system, char_encodable_p)
1405 (Funencodable_char_position, code_convert_region)
1406 (code_convert_string, code_convert_string_norecord)
1407 (Fset_coding_system_priority):
1408 * fileio.c (Finsert_file_contents):
1409 Use bool for booleans.
1410 * coding.h, lisp.h: Reflect above API changes.
1411 * coding.c: Remove unnecessary static function decls.
1412 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1413 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1414 not a boolean 'int', since callers never look at the return value.
1415 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1416 * coding.h (decoding_buffer_size, encoding_buffer_size)
1417 (emacs_mule_string_char): Remove unused extern decls.
1418 (struct iso_2022_spec, struct coding_system):
1419 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1420 (struct emacs_mule_spec): Remove unused field 'full_support'.
1421 All initializations removed.
1422 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1423
1424 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1425
1426 Fix spare memory change (Bug#12286).
1427 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1428 (valid_lisp_object_p): Likewise.
1429
1430 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1431
1432 * window.c (Fset_window_configuration): Record any window's old
1433 buffer if it's replaced (see Bug#8789). If the new current
1434 buffer doesn't appear in the selected window, go to its old
1435 point (Bug#12208).
1436
1437 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1438
1439 Special MEM_TYPE_SPARE to denote reserved memory.
1440 * alloc.c (enum mem_type): New memory type.
1441 (refill_memory_reserve): Use new type for spare memory.
1442 This prevents live_cons_p and live_string_p from incorrect
1443 detection of uninitialized objects from spare memory as live.
1444
1445 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1446
1447 Spelling fixes.
1448 * Makefile.in (.PHONY): versioclean -> versionclean.
1449
1450 Remove unused external symbols.
1451 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1452 * window.c (Qwindow_valid_p, decode_valid_window):
1453 Now static, not extern.
1454 * data.c (Qinterval): Remove; unused.
1455 (syms_of_data): Do not define 'interval'.
1456 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1457 * window.h (decode_valid_window):
1458 Remove decls.
1459
1460 * character.c, charset.c, chartab.c: Use bool for booleans.
1461 * character.c (lisp_string_width, string_count_byte8)
1462 (string_escape_byte8):
1463 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1464 (load_charset_map_from_file, map_charset_chars)
1465 (Fdefine_charset_internal, define_charset_internal)
1466 (Fdeclare_equiv_charset, find_charsets_in_text)
1467 (Ffind_charset_region, char_charset, Fiso_charset):
1468 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1469 (sub_char_table_set, sub_char_table_set_range)
1470 (char_table_set_range, optimize_sub_char_table)
1471 (map_sub_char_table):
1472 Use bool for boolean.
1473 * character.c (str_to_unibyte): Omit last boolean argument; it was
1474 always 0. All callers changed.
1475 * character.h, charset.h: Adjust to match previous changes.
1476 * character.h (char_printable_p): Remove decl of nonexistent function.
1477 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1478 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1479 are all boolean, so make them single-bit bitfields.
1480
1481 * lisp.h (ASET): Remove attempt to detect side effects.
1482 It was meant to be temporary and it often doesn't work,
1483 because when IDX has side effects the behavior of IDX==IDX
1484 is undefined. See Stefan Monnier in
1485 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1486
1487 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1488
1489 * lisp.h (functionp): New function (extracted from Ffunctionp).
1490 (FUNCTIONP): Use it.
1491 * eval.c (Ffunctionp): Use it.
1492
1493 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1494
1495 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1496 as that's faster and simpler than static storage. Don't bother
1497 with the g_main_context_query overhead if g_main_context_pending
1498 says no events are pending.
1499 (gfds, gfds_size): Remove these static vars.
1500 (xgselect_initialize): Remove; no longer needed.
1501 All uses and decls removed.
1502
1503 * emacs.c (fatal_error_signal_hook): Remove.
1504 All uses removed. This leftover from old code was always 0.
1505
1506 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1507 * casefiddle.c (casify_object, casify_region):
1508 * casetab.c (set_case_table):
1509 * category.c, category.h (word_boundary_p):
1510 * category.h (CHAR_HAS_CATEGORY):
1511 Use bool for booleans, instead of int.
1512
1513 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1514
1515 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1516
1517 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1518
1519 On assertion failure, print backtrace if available.
1520 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1521 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1522 * Makefile.in (LIB_EXECINFO): New macro.
1523 (LIBES): Use it.
1524
1525 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1526 * bytecode.c (exec_byte_code):
1527 * callint.c (check_mark, Fcall_interactively):
1528 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1529 (getenv_internal, sync_process_alive, call_process_exited):
1530 * lisp.h (USE_SAFE_ALLOCA):
1531 Use bool for booleans, instead of int.
1532 * lisp.h, process.h: Adjust prototypes to match above changes.
1533 * callint.c (Fcall_interactively): Don't assume the mark's
1534 offset fits in 'int'.
1535
1536 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1537
1538 * buffer.c, buffer.h: Use bool for boolean.
1539 * buffer.c (reset_buffer_local_variables)
1540 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1541 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1542 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1543 (overlay_touches_p, overlay_strings, Foverlay_put)
1544 (report_overlay_modification, call_overlay_mod_hooks):
1545 (mmap_enlarge, mmap_set_vars):
1546 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1547 Use bool for booleans, instead of int.
1548 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1549 since the 1-or-0 return value is always ignored anyway.
1550 (mmap_initialized_p):
1551 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1552 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1553
1554 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1555
1556 * bidi.c: Use bool for boolean.
1557 This is a bit more readable, and makes the text segment of bidi.o
1558 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1559 Presumably it's faster too.
1560 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1561 Now bool.
1562 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1563 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1564 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1565 (bidi_explicit_dir_char, bidi_level_of_next_char)
1566 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1567 Use bool for booleans, instead of int.
1568 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1569 (bidi_unshelve_cache): Adjust decls to match code.
1570
1571 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1572
1573 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1574 argument.
1575
1576 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1577
1578 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1579 * atimer.h: Include <stdbool.h>.
1580
1581 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1582
1583 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1584 compile time tests instead of run time tests on systems that do
1585 not use them.
1586 (FRAME_MAC_P): Remove leftover from deleted code.
1587 * frame.c (syms_of_frame): Remove leftover from deleted code.
1588
1589 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1590
1591 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1592
1593 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1594
1595 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1596 Otherwise, the compiler complains about (A?B:C) where B is void
1597 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1598 (fontset_add): Return void, for FONTSET_ADD.
1599
1600 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1601
1602 * alloc.c: Use bool for booleans.
1603 (gc_in_progress, abort_on_gc)
1604 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1605 (dont_register_blocks) [GC_MALLOC_CHECK]:
1606 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1607 (check_string_bytes, make_specified_string, memory_full)
1608 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1609 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1610 (mark_stack, valid_pointer_p, make_pure_string)
1611 (Fgarbage_collect, survives_gc_p, gc_sweep):
1612 Use bool for booleans, instead of int.
1613 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1614 Remove unused local.
1615 * alloc.c (PURE_POINTER_P):
1616 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1617 * editfns.c (Fformat):
1618 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1619 (Fdo_auto_save):
1620 * fns.c (sweep_weak_table):
1621 * lisp.h (suppress_checking, push_message, survives_gc_p)
1622 (make_pure_string, gc_in_progress, abort_on_gc):
1623 * lread.c (readchar, read1):
1624 * print.c (Fprin1_to_string):
1625 * xdisp.c (push_message):
1626 Use bool for booleans affected directly or indirectly by
1627 alloc.c's changes.
1628
1629 Make recently-introduced setters macros.
1630 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1631 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1632 (set_fontset_default, set_fontset_fallback): Rename from their
1633 upper-case counterparts, and make them functions rather than macros.
1634 This is more consistent with the other recently-introduced setters.
1635 These don't need to be inline, since they're local.
1636
1637 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1638
1639 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1640 the loop (Bug#12247).
1641
1642 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1643
1644 * lisp.h (vcopy): Use memcpy rather than our own loop.
1645 This fixes a performance regression introduced by the recent
1646 addition of vcopy. This means 'vcopy' will need to be modified
1647 for a copying collector, but that's OK. Also, tighten the
1648 checking in the assertion.
1649
1650 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1651
1652 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1653 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1654 non-base glyph for the width of the base character, according to
1655 what x_draw_composite_glyph_string_foreground expects.
1656 Generate WADJUST value according to composition_gstring_width's
1657 expectations, to produce correct width of the composed character.
1658 Reverse the sign of the DU offset produced by ScriptPlace.
1659
1660 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1661
1662 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1663
1664 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1665
1666 Avoid direct writes to contents member of struct Lisp_Vector.
1667 * lisp.h (vcopy): New function to copy data into vector.
1668 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1669 * fns.c (Ffillarray): Use ASET.
1670 * keyboard.c (timer_check_2): Use AREF and ASET.
1671 (append_tool_bar_item, Frecent_keys): Use vcopy.
1672 * lread.c (read_vector): Use ASET.
1673 * msdos.c (Frecent_doskeys): Use vcopy.
1674 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1675 (Finternal_merge_in_global_face): Use ASET and vcopy.
1676 * xfont.c (xfont_list_pattern): Likewise.
1677
1678 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1679
1680 * window.c (Fwindow_point): For the selected window always return
1681 the position of its buffer's point.
1682 (Fset_window_point): For the selected window always go in its
1683 buffer to the specified position.
1684
1685 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1686
1687 Setter macros for fontsets.
1688 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1689 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1690 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1691 Adjust users.
1692
1693 2012-08-20 Glenn Morris <rgm@gnu.org>
1694
1695 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1696 Don't assume that `ln -f' works.
1697
1698 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1699
1700 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1701 and later about non-assignments with no effect. See discussion at
1702 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1703 details.
1704
1705 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1706
1707 Inline setter functions for Lisp_Objects slots of struct specbinding.
1708 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1709 Adjust users.
1710
1711 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1712
1713 * window.c (select_window): Always make selected window's buffer
1714 current.
1715
1716 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1717
1718 Use AREF and ASET for docstrings of category tables.
1719 * category.h (CATEGORY_DOCSTRING): Use AREF.
1720 (SET_CATEGORY_DOCSTRING): Use ASET.
1721 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1722
1723 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1724
1725 Inline setter functions for hash table members.
1726 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1727 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1728 (set_hash_key_and_value, set_hash_index, set_hash_next)
1729 (set_hash_hash): New functions.
1730 * charset.c, fns.c: Adjust users.
1731
1732 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1733
1734 Inline getter and setter functions for per-buffer values.
1735 * buffer.h (per_buffer_default, set_per_buffer_default)
1736 (per_buffer_value, set_per_buffer_value): New functions.
1737 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1738 * buffer.c, data.c: Adjust users.
1739
1740 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1741
1742 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1743
1744 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1745
1746 Rely on <config.h> + <unistd.h> to declare 'environ',
1747 as gnulib does this if the system doesn't.
1748 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1749 Remove declaration. MS-Windows declares it on stdlib.h which is
1750 included by conf_post.h.
1751 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1752 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1753 * vm-limit.c: Include <unistd.h>, for 'environ'.
1754
1755 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1756 (start_of_data): Remove decl; mem-limits.h provides it.
1757
1758 * xdisp.c (handle_invisible_prop): Make it a bit faster
1759 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1760
1761 2012-08-19 Chong Yidong <cyd@gnu.org>
1762
1763 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1764 ends (Bug#3874).
1765
1766 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1767
1768 * .gdbinit: Use call instead of set when calling a function in the
1769 inferior.
1770
1771 * data.c (set_internal): Don't use set_blv_found.
1772 (Fkill_local_variable): Likewise.
1773
1774 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1775
1776 * nsfont.m (ns_ascii_average_width): Ensure the string
1777 ascii_printable is initialized with a null-terminated character
1778 array. Otherwise, it can contain undesired extra characters.
1779
1780 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1781
1782 port new setting code to Sun C 5.8 2005/10/13
1783 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1784 Return void, not Lisp_Object. Otherwise, the compiler
1785 complains about (A?B:C) where B is void and C is Lisp_Object
1786 when compiling CHAR_TABLE_SET, due to the recent change to
1787 the API of sub_char_table_set_contents.
1788
1789 2012-08-18 Chong Yidong <cyd@gnu.org>
1790
1791 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1792 for the string case (Bug#3874).
1793
1794 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1795
1796 * buffer.h (BSET): Remove (Bug#12215).
1797 Replace all uses with calls to new setter functions.
1798 (bset_bidi_paragraph_direction, bset_case_canon_table)
1799 (bset_case_eqv_table, bset_directory, bset_display_count)
1800 (bset_display_time, bset_downcase_table)
1801 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1802 (bset_last_selected_window, bset_local_var_alist)
1803 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1804 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1805 (bset_width_table):
1806 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1807 (bset_auto_fill_function, bset_auto_save_file_format)
1808 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1809 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1810 (bset_cache_long_line_scans, bset_case_fold_search)
1811 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1812 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1813 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1814 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1815 (bset_header_line_format, bset_indicate_buffer_boundaries)
1816 (bset_indicate_empty_lines, bset_invisibility_spec)
1817 (bset_left_fringe_width, bset_major_mode, bset_mark)
1818 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1819 (bset_name, bset_overwrite_mode, bset_pt_marker)
1820 (bset_right_fringe_width, bset_save_length)
1821 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1822 (bset_scroll_up_aggressively, bset_selective_display)
1823 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1824 (bset_word_wrap, bset_zv_marker):
1825 * category.c (bset_category_table):
1826 * syntax.c (bset_syntax_table):
1827 New setter functions.
1828
1829 * process.h (PSET): Remove (Bug#12215).
1830 Replace all uses with calls to new setter functions.
1831 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1832 (PROCESS_INLINE): New macro.
1833 (pset_childp): New setter function.
1834 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1835 * process.c (PROCESS_INLINE):
1836 Define to EXTERN_INLINE, so that the corresponding functions
1837 are compiled into code.
1838 (pset_buffer, pset_command, pset_decode_coding_system)
1839 (pset_decoding_buf, pset_encode_coding_system)
1840 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1841 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1842 (pset_type, pset_write_queue): New setter functions.
1843
1844 * window.h (WSET): Remove (Bug#12215).
1845 Replace all uses with calls to new setter functions.
1846 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1847 (WINDOW_INLINE): New macro.
1848 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1849 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1850 (wset_total_lines, wset_vertical_scroll_bar)
1851 (wset_window_end_pos, wset_window_end_valid)
1852 (wset_window_end_vpos): New setter functions.
1853 * window.c (WINDOW_INLINE):
1854 Define to EXTERN_INLINE, so that the corresponding functions
1855 are compiled into code.
1856 (wset_combination_limit, wset_dedicated, wset_display_table)
1857 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1858 (wset_new_normal, wset_new_total, wset_next_buffers)
1859 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1860 (wset_prev_buffers, wset_right_fringe_width)
1861 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1862 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1863 (wset_window_parameters):
1864 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1865 (wset_column_number_displayed, wset_region_showing):
1866 New setter functions.
1867
1868 * termhooks.h (TSET): Remove (Bug#12215).
1869 Replace all uses with calls to new setter functions.
1870 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1871 (TERMHOOKS_INLINE): New macro.
1872 (tset_charset_list, tset_selection_alist): New setter functions.
1873 * terminal.c (TERMHOOKS_INLINE):
1874 Define to EXTERN_INLINE, so that the corresponding functions
1875 are compiled into code.
1876 (tset_param_alist): New setter function.
1877
1878 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1879
1880 * keyboard.h (KSET): Remove (Bug#12215).
1881 Replace all uses with calls to new setter functions.
1882 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1883 (KEYBOARD_INLINE): New macro.
1884 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1885 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1886 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1887 New setter functions.
1888 * keyboard.c (KEYBOARD_INLINE):
1889 Define to EXTERN_INLINE, so that the corresponding functions
1890 are compiled into code.
1891 (kset_echo_string, kset_kbd_queue)
1892 (kset_keyboard_translate_table, kset_last_prefix_arg)
1893 (kset_last_repeatable_command, kset_local_function_key_map)
1894 (kset_overriding_terminal_local_map, kset_real_last_command)
1895 (kset_system_key_syms): New setter functions.
1896
1897 * frame.h (FSET): Remove (Bug#12215).
1898 Replace all uses with calls to new setter functions.
1899 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1900 (FRAME_INLINE): New macro.
1901 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1902 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1903 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1904 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1905 (fset_param_alist, fset_root_window, fset_scroll_bars)
1906 (fset_selected_window, fset_title, fset_tool_bar_items)
1907 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1908 * frame.c (FRAME_INLINE):
1909 Define to EXTERN_INLINE, so that the corresponding functions
1910 are compiled into code.
1911 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1912
1913 A few more naming-convention fixes for getters and setters.
1914 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1915 and rename from buffer_overlays_set_before.
1916 (set_buffer_overlays_after): Move here from buffer.h, and rename
1917 from buffer_overlays_set_after.
1918 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1919 All uses changed.
1920 (set_buffer_intervals): Rename from buffer_set_intervals.
1921 * intervals.c (set_interval_object): Move here from intervals.h,
1922 and rename from interval_set_object.
1923 (set_interval_left): Move here from intervals.h, and rename from
1924 interval_set_left.
1925 (set_interval_right): Move here from intervals.h, and rename from
1926 interval_set_right.
1927 (copy_interval_parent): Move here from intervals.h, and rename from
1928 interval_copy_parent.
1929 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1930 (set_interval_plist): Rename from interval_set_plist.
1931 Return void, not Lisp_Object, since no caller uses the result.
1932 * lisp.h (string_intervals): Rename from string_get_intervals.
1933 (set_string_intervals): Rename from string_set_intervals.
1934
1935 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1936 (set_char_table_contents): Rename from char_table_set_contents.
1937 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1938 All uses changed. See the end of
1939 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1940
1941 * lisp.h (CSET): Remove (Bug#12215).
1942 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1943 (set_char_table_purpose): New functions,
1944 replacing CSET. All uses changed. For example, replace
1945 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1946 "set_char_table_parent (char_table, parent);".
1947 The old version was confusing because it used the same name
1948 'parent' for two different things.
1949
1950 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1951
1952 Functions to get and set Lisp_Object fields of buffer-local variables.
1953 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1954 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1955 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1956 * data.c, eval.c, frame.c: Adjust users.
1957
1958 2012-08-17 Chong Yidong <cyd@gnu.org>
1959
1960 * xfaces.c (merge_face_vectors): If the target font specfies a
1961 font spec, make the font's attributes take precedence over
1962 directly-specified attributes.
1963 (merge_face_ref): Recognize :font.
1964
1965 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1966
1967 Do not use memcpy for copying intervals.
1968 * intervals.c (reproduce_interval): New function.
1969 (reproduce_tree, reproduce_tree_obj): Use it.
1970 (reproduce_tree_obj): Remove prototype.
1971
1972 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1973
1974 * lisp.h (duration_to_sec_usec): Remove unused decl.
1975
1976 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1977
1978 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1979 to an allocated instance of NSString, not to the class itself.
1980
1981 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1982
1983 * makefile.w32-in (C_CTYPE_H): New macro.
1984 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1985 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1986 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1987
1988 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1989
1990 Use ASCII tests for character types.
1991 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1992 * xfns.c, xterm.c:
1993 Don't include <ctype.h>; was not needed.
1994 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1995 * sysdep.c, xfaces.c:
1996 Include <c-ctype.h> instead of <ctype.h>.
1997 * nsterm.m: Include <c-ctype.h>.
1998 * charset.c (read_hex):
1999 * doc.c (Fsnarf_documentation):
2000 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2001 (DRIVE_LETTER) [DOS_NT]:
2002 (Ffile_name_directory, Fexpand_file_name)
2003 (Fsubstitute_in_file_name):
2004 * font.c (font_parse_xlfd, font_parse_fcname):
2005 * frame.c (x_set_font_backend):
2006 * gtkutil.c (xg_get_font):
2007 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2008 * nsimage.m (hexchar):
2009 * nsterm.m (ns_xlfd_to_fontname):
2010 * sysdep.c (system_process_attributes):
2011 * xfaces.c (hash_string_case_insensitive):
2012 Use C-locale tests instead of locale-specific tests for character
2013 types, since we want the ASCII interpretation here, not the
2014 interpretation suitable for whatever happens to be the current locale.
2015
2016 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2017
2018 Consistently check windows for validity/liveness
2019 (Bug#11984, Bug#12025, Bug#12026).
2020 * lisp.h (CHECK_VALID_WINDOW): New macro.
2021 * window.c (decode_window): Rename to decode_live_window.
2022 (decode_valid_window, Fwindow_valid_p): New functions.
2023 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2024 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2025 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2026 (Fwindow_prev_sibling, Fwindow_combination_limit)
2027 (Fset_window_combination_limit, Fwindow_use_time)
2028 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2029 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2030 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2031 (Fwindow_hscroll, Fset_window_hscroll)
2032 (Fwindow_redisplay_end_trigger)
2033 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2034 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2035 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2036 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2037 (Fwindow_end, Fset_window_point, Fset_window_start)
2038 (Fpos_visible_in_window_p, Fwindow_line_height)
2039 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2040 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2041 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2042 (Fset_window_parameter, Fwindow_display_table)
2043 (Fset_window_display_table, Fdelete_other_windows_internal)
2044 (Fset_window_buffer, Fset_window_new_total)
2045 (Fset_window_new_normal, Fdelete_window_internal)
2046 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2047 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2048 (Fwindow_scroll_bars): Check whether argument window is a valid or
2049 live window. Update doc-strings.
2050 (syms_of_window): New symbol Qwindow_valid_p.
2051 * keyboard.c (Fposn_at_x_y): Check whether argument
2052 frame_or_window denotes a valid window.
2053
2054 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2055
2056 Fix previous char table change.
2057 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2058 * chartab.c (optimize_sub_char_table): Likewise.
2059
2060 2012-08-16 Chong Yidong <cyd@gnu.org>
2061
2062 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2063
2064 * xfont.c (xfont_open):
2065 * xftfont.c (xftfont_open): Set the font's max_width field.
2066
2067 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2068 min_width to space_width and average_width to the average over
2069 printable ASCII characters.
2070 (ns_char_width): Code cleanup.
2071 (ns_ascii_average_width): New utility function.
2072
2073 * font.h (struct font): Update comments.
2074
2075 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2076
2077 Simple interface to set Lisp_Object fields of character tables.
2078 * lisp.h (CSET): New macro.
2079 (char_table_set_extras, char_table_set_contents)
2080 (sub_char_table_set_contents): New function.
2081 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2082 * syntax.c: Adjust users.
2083
2084 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2085
2086 * eval.c (eval_sub): Bind lexical-binding.
2087 * lread.c (Qlexical_binding): Make non-static.
2088
2089 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2090
2091 * nsmenu.m (popupSession): Remove.
2092 (pop_down_menu): Remove endModalSession.
2093 (timeout_handler:): New method.
2094 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2095 Call runModalForWindow. Check timer_fired when it returns.
2096 If not set, cancel timer and break out of loop.
2097 Otherwise loop again, with a new timeout.
2098
2099 * nsterm.m: Include fcntl.h if present.
2100 (fd_entry, t_readfds, inNsSelect): Remove.
2101 (select_writefds, select_valid, select_timeout, selfds)
2102 (select_mutex, apploopnr): Add.
2103 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2104 Otherwise call kbd_buffer_store_event.
2105 (ns_send_appdefined): Remove release of fd_entry.
2106 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2107 Increment and decrement apploopnr.
2108 (ns_select): If no file descriptors, just do a NSTimer.
2109 Otherwise copy read/write masks and start select thread (fd_handler).
2110 Start main loop and wait for application defined event.
2111 Inform select thread to stop selecting after main loop is exited.
2112 (ns_term_init): Create selfds pipe and set non-blocking.
2113 Initialize select_mutex. Start the select thread (fd_handler).
2114 (fd_handler:): Loop forever, wait for info from the main thread
2115 to either start or stop selecting. When select returns, send
2116 and appdefined event.
2117 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2118 If not call kbd_buffer_store_event.
2119
2120 * nsterm.h (EmacsApp): fd_handler takes id argument.
2121 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2122
2123 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2124
2125 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2126
2127 * region-cache.c (move_cache_gap): Update gap_len using the actual
2128 growth of the boundaries array. Do not change cache_len.
2129 (Bug#12196)
2130
2131 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2132
2133 Generalize and cleanup font subsystem checks.
2134 * font.h (FONT_DEBUG, font_assert): Remove.
2135 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2136 Change font_assert to eassert. Use eassert where appropriate.
2137
2138 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2139
2140 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2141
2142 2012-08-15 Chong Yidong <cyd@gnu.org>
2143
2144 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2145 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2146 extract the font descriptor instead of just the font name.
2147 In that case, return a font spec instead of a string.
2148 (x_last_font_name): Move to this file from xfns.c.
2149
2150 * xfns.c (Fx_select_font): The return value can also be a font
2151 spec. Move x_last_font_name management to gtkutil.c.
2152
2153 * xfaces.c: Make font weight and style symbols non-static.
2154
2155 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2156
2157 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2158 (bug#12117).
2159
2160 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2161
2162 * alloc.c (Fgarbage_collect): Use plural form consistently.
2163
2164 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2165
2166 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2167 iteration through the command loop. Fixes a problem whereby mouse
2168 movements are ignored until the first mouse click.
2169
2170 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2171
2172 Use bool, not int, for Lisp booleans.
2173 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2174 makes Emacs a bit smaller and presumably a bit faster.
2175 * lisp.h: Include <stdbool.h>.
2176 (struct Lisp_Boolfwd, defvar_bool):
2177 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2178 * regex.c [!emacs]: Include <stdbool.h>.
2179 (false, true): Remove; <stdbool.h> does this for us now.
2180
2181 2012-08-14 Chong Yidong <cyd@gnu.org>
2182
2183 * character.c (Fcharacterp): Doc fix (Bug#12076).
2184
2185 * data.c (Findirect_variable): Doc fix (Bug#11040).
2186
2187 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2188
2189 * editfns.c (Fformat): Doc fix (Bug#12059).
2190 (Fsave_current_buffer): Doc fix (Bug#11542).
2191
2192 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2193
2194 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2195 (bug#12022).
2196
2197 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2198
2199 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2200 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2201 * minibuf.c (choose_minibuf_frame, read_minibuf):
2202 * w32fns.c (x_create_tip_frame):
2203 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2204 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2205
2206 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2207
2208 * intervals.c (offset_intervals): Remove obsolete comment.
2209
2210 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2211
2212 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2213
2214 2012-08-14 Gergely Risko <gergely@risko.hu>
2215
2216 * coding.c (decode_coding): Record buffer modification before
2217 disabling undo_list (Bug#11773).
2218
2219 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2220
2221 Revert and cleanup some recent overlay changes.
2222 * buffer.h (enum overlay_type): Remove.
2223 (buffer_get_overlays, buffer_set_overlays): Likewise.
2224 (buffer_set_overlays_before, buffer_set_overlays_after):
2225 New function. Adjust users.
2226 (unchain_both): Add eassert.
2227
2228 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2229
2230 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2231
2232 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2233
2234 * gtkutil.c (xg_mark_data): Don't assume C99.
2235
2236 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2237
2238 * gtkutil.c (xg_frame_tb_info): New struct.
2239 (TB_INFO_KEY): New define.
2240 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2241 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2242 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2243 if not present.
2244 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2245 is up to date. Otherwise store new data.
2246 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2247
2248 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2249
2250 Use KSET for write access to Lisp_Object members of struct kboard.
2251 * keyboard.h (KSET): New macro.
2252 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2253 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2254 * xterm.c: Adjust users.
2255
2256 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2257
2258 Use BSET for write access to Lisp_Object members of struct buffer.
2259 * buffer.h (BSET): New macro.
2260 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2261 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2262 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2263 * window.c, xdisp.c, xfns.c: Adjust users.
2264
2265 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2266
2267 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2268
2269 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2270
2271 * nsterm.m (not_in_argv): New function.
2272 (application:openFile, application:openTempFile:):
2273 (application:openFileWithoutUI:, application:openFiles:): Open file
2274 if not_in_argv returns non-zero (bug#12171).
2275
2276 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2277 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2278 Define for Gtk+ versions less than 3.2.
2279 (xg_get_font_name): Use those functions/macros here.
2280 Reported by Frans Oilinki <moilinki@gmail.com>.
2281
2282 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2283
2284 * unexmacosx.c (copy_data_segment): Copy initialized data in
2285 statically linked libraries from input file rather than memory.
2286
2287 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2288 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2289 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2290
2291 2012-08-10 Glenn Morris <rgm@gnu.org>
2292
2293 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2294 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2295
2296 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2297
2298 Fix last change to allow compilation with low optimization levels.
2299 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2300 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2301
2302 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2303
2304 Use common inline syntax in intervals.h.
2305 * intervals.h (INTERVALS_INLINE): New macro.
2306 Change all users from LISP_INLINE.
2307
2308 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2309
2310 Define Qnone once for all platforms.
2311 * frame.c (Qnone): Define here.
2312 (syms_of_frame): DEFSYM it.
2313 * lisp.h (Qnone): New declaration.
2314 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2315 * xfns.c: Remove duplication. Adjust users.
2316
2317 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2318
2319 Remove unused macros from intervals.h.
2320 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2321 * intervals.c: Adjust comment.
2322
2323 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2324
2325 * w32fns.c <w32_unicode_gui>: New static variable.
2326 (globals_of_w32fns): Initialize it according to os_subtype.
2327 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2328 testing os_subtype.
2329
2330 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2331 Eli Zaretskii <eliz@gnu.org>
2332
2333 Fix bug #10299 with Unicode characters sent by customized
2334 keyboards created by MSKLC.
2335 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2336 (w32_init_class): Use it to initialize the Emacs class with either
2337 ANSI or Unicode API calls.
2338 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2339 later.
2340 (w32_wnd_proc): If the character code sent by WM_CHAR or
2341 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2342 original message. Call DefWindowProcW on NT and later.
2343
2344 2012-08-10 Glenn Morris <rgm@gnu.org>
2345
2346 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2347
2348 * lisp.h (DIRECTORY_SEP): Let configure set it.
2349
2350 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2351
2352 Use TSET for write access to Lisp_Object slots of struct terminal.
2353 * termhooks.h (TSET): New macro.
2354 * coding.c, terminal.c, xselect.c: Adjust users.
2355
2356 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2357
2358 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2359 the failing expression, include them in the error message.
2360 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2361 * lisp.h (internal_condition_case_n): Update declaration.
2362
2363 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2364
2365 Inline functions to examine and change buffer overlays.
2366 * buffer.c (unchain_both): New function.
2367 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2368 (buffer_has_overlays): New function.
2369 (enum overlay_type): New enum.
2370 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2371 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2372
2373 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2374
2375 Inline functions to examine and change buffer intervals.
2376 * alloc.c (mark_interval_tree): Remove.
2377 (MARK_INTERVAL_TREE): Simplify.
2378 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2379 * intervals.c (buffer_balance_intervals): New function.
2380 (graft_intervals_into_buffer): Adjust indentation.
2381 (set_intervals_multibyte): Simplify.
2382 * buffer.h (BUF_INTERVALS): Remove.
2383 (buffer_get_intervals, buffer_set_intervals): New function.
2384 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2385 * intervals.c, textprop.c: Adjust users.
2386
2387 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2388
2389 Inline functions to examine and change string intervals.
2390 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2391 (string_get_intervals, string_set_intervals): New function.
2392 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2393 * lread.c, print.c, textprop.c: Adjust users.
2394
2395 2012-08-08 Glenn Morris <rgm@gnu.org>
2396
2397 * lisp.mk (lisp): Remove language/persian.elc.
2398
2399 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2400
2401 Cleanup intervals.
2402 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2403 (NULL_INTERVAL_P): Likewise. Adjust users.
2404 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2405 Adjust comment. Move under #if 0.
2406 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2407 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2408
2409 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2410
2411 Check total length of intervals with eassert.
2412 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2413 * intervals.c: Change all users to eassert.
2414
2415 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2416
2417 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2418 Rename fields to match removal of FGET and WGET and disuse of
2419 INTERNAL_FIELD in Lisp_Cons.
2420
2421 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2422
2423 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2424 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2425 name since all xname users are fixed long time ago. Do not
2426 use INTERNAL_FIELD.
2427 (set_symbol_name, set_symbol_function, set_symbol_plist):
2428 (set_symbol_next, set_overlay_plist): New function.
2429 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2430 (struct Lisp_Overlay): Likewise.
2431 (CVAR, MVAR, SVAR): Remove.
2432 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2433 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2434 * xterm.c: Adjust users.
2435 * .gdbinit: Change to use name field of struct Lisp_Symbol
2436 where appropriate.
2437
2438 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2439
2440 Basic functions to set Lisp_Object and pointer slots of intervals.
2441 * intervals.h (interval_set_parent, interval_set_object):
2442 (interval_set_left, interval_set_right, interval_set_plist):
2443 (interval_copy_parent): New function.
2444 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2445 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2446 Adjust indentation.
2447 (INTERVAL_SIZE): Remove. Adjust users.
2448 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2449
2450 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2451
2452 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2453 * process.h (PGET): Remove.
2454 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2455 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2456
2457 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2458
2459 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2460 * window.h (WGET): Remove.
2461 (struct window): Do not use INTERNAL_FIELD.
2462 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2463 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2464 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2465 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2466 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2467 Adjust users.
2468
2469 2012-08-07 Chong Yidong <cyd@gnu.org>
2470
2471 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2472 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2473 (Fdelete_window_internal): Signal an error if the window is not on
2474 a live frame (Bug#12025).
2475
2476 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2477
2478 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2479 * frame.h (FGET): Remove.
2480 (struct frame): Do not use INTERNAL_FIELD.
2481 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2482 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2483 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2484 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2485
2486 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2487
2488 * w32.c: Silence compiler warnings.
2489 (map_w32_filename): Remove unused variable `is_fat'.
2490 (chase_symlinks): Add parentheses around expression.
2491
2492 2012-08-06 Glenn Morris <rgm@gnu.org>
2493
2494 * sysdep.c: Respect BROKEN_GETWD.
2495
2496 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2497 Let configure handle it.
2498 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2499
2500 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2501
2502 Use GCALIGNMENT where appropriate.
2503 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2504 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2505 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2506
2507 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2508
2509 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2510 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2511
2512 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2513
2514 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2515 that should be sufficient for everyone.
2516
2517 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2518
2519 * keyboard.c (timer_check_2): Add break so timer_check returns next
2520 timeout.
2521
2522 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2523
2524 Fix Windows build errors introduced after converting to WGET and WSET.
2525 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2526 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2527
2528 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2529
2530 * nsterm.m (ns_frame_rehighlight): Use FSET.
2531
2532 * nsmenu.m (ns_update_menubar): Use FSET.
2533
2534 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2535
2536 Separate read and write access to Lisp_Object slots of Lisp_Process.
2537 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2538 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2539
2540 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2541
2542 Separate read and write access to Lisp_Object slots of struct window.
2543 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2544 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2545 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2546 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2547 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2548 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2549 Adjust users.
2550
2551 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2552
2553 Fix Windows build errors introduced after converting to FGET and FSET.
2554 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2555 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2556 (w32_judge_scroll_bars): Change to use FSET.
2557 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2558
2559 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2560
2561 Fix replacement typo.
2562 * window.c (replace_window): Set root_window instead of
2563 selected_window. This fixes a total window subsystem
2564 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2565
2566 2012-08-06 Glenn Morris <rgm@gnu.org>
2567
2568 * lisp.mk (lisp): Add language/persian.elc.
2569
2570 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2571
2572 Separate read and write access to Lisp_Object slots of struct frame.
2573 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2574 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2575 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2576 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2577 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2578
2579 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2580
2581 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2582
2583 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2584
2585 Generalize common compile-time constants.
2586 * lisp.h (header_size, bool_header_size, word_size): Now here.
2587 (struct Lisp_Vector): Add comment.
2588 (struct Lisp_Bool_Vector): Move up to define handy constants.
2589 (VECSIZE, PSEUDOVECSIZE): Simplify.
2590 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2591 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2592 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2593 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2594 * xfont.c, xmenu.c: Use word_size where appropriate.
2595
2596 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2597
2598 * search.c (Freplace_match): Treat \? in the replacement text
2599 literally (Bug#8161).
2600
2601 2012-08-05 Chong Yidong <cyd@gnu.org>
2602
2603 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2604 * frame.c (Vdelete_frame_functions):
2605 * emacs.c (Vkill_emacs_hook): Doc fix.
2606
2607 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2608
2609 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2610 --with-x-toolkit=no builds.
2611 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2612
2613 2012-08-04 Chong Yidong <cyd@gnu.org>
2614
2615 * syntax.c (Fmodify_syntax_entry): Doc fix.
2616
2617 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2618
2619 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2620 * w32.c (init_environment): Change the default values of many
2621 environment variables in dflt_envvars[] to NULL, to avoid pushing
2622 them into environment when they were not already defined.
2623 Remove the code that deletes site-lisp subdirectories from the default
2624 value of EMACSLOADPATH, as it is no longer needed.
2625 (check_windows_init_file): Now external, not static.
2626 Use Vload_path as is, without adding anything, as this function is now
2627 called when Vload_path is already set up.
2628
2629 * w32.h (check_windows_init_file): Add prototype.
2630
2631 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2632 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2633 compatibility with Posix platforms.
2634 (main): Move the call to check_windows_init_file to here from
2635 w32.c.
2636 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2637 any, in the DEFALT argument into the root of the Emacs build or
2638 installation tree, as appropriate.
2639
2640 * callproc.c (init_callproc_1): Call decode_env_path instead of
2641 doing its equivalent by hand.
2642 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2643 the code that sets Vexec_path run on MS-Windows.
2644
2645 * lread.c (init_lread): Add comments to #ifdef's.
2646
2647 * msdos.c (dos_set_window_size, IT_update_begin)
2648 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2649 instead of direct references.
2650
2651 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2652
2653 Export DEFAULT_REHASH_* to GDB.
2654 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2655 Now constants, not macros.
2656
2657 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2658
2659 Remove unnecessary casts involving pointers.
2660 These casts are no longer needed now that we assume C89 or later,
2661 since they involve casting to or from void *.
2662 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2663 (make_pure_float, make_pure_vector):
2664 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2665 * macros.c (Fstart_kbd_macro):
2666 * menu.c (find_and_return_menu_selection):
2667 * minibuf.c (read_minibuf_noninteractive):
2668 * sysdep.c (closedir):
2669 * xdisp.c (x_produce_glyphs):
2670 * xfaces.c (compare_fonts_by_sort_order):
2671 * xfns.c (x_real_positions, select_visual):
2672 * xselect.c (x_stop_queuing_selection_requests)
2673 (x_get_window_property, x_get_window_property_as_lisp_data):
2674 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2675 Remove unnecessary pointer casts.
2676 * alloc.c (record_xmalloc): New function.
2677 * lisp.h (record_xmalloc): New decl.
2678 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2679 more like a function. This is because the pointer cast is not
2680 needed. All uses changed.
2681 * print.c (print_string, print_error_message): Avoid length recalc.
2682
2683 Improve fix for macroexp crash with debugging (Bug#12118).
2684 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2685 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2686 not supposed to be invoked from the garbage collector.
2687 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2688 (gc_aset): New function, which is like ASET but can be
2689 used in the garbage collector.
2690 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2691 (set_hash_index): Use it instead of ASET.
2692
2693 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2694
2695 Support symlinks on latest versions of MS-Windows.
2696 * w32.c: Include winioctl.h and aclapi.h.
2697 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2698 (revert_to_self): Forward declarations of static functions.
2699 <static BOOL g_b_init_get_security_info>:
2700 <g_b_init_create_symbolic_link>: New static flags.
2701 (globals_of_w32): Initialize them to zero.
2702 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2703 (map_w32_filename): Improve commentary. Simplify switch.
2704 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2705 headers (most versions of MinGW w32api don't).
2706 (get_security_info, create_symbolic_link)
2707 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2708 New functions.
2709 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2710 in the argument file name.
2711 (sys_access): Call unc_volume_file_attributes only if
2712 GetFileAttributes fails with network-related error codes.
2713 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2714 have the required privileges.
2715 (get_file_security_desc_by_name): Rename from
2716 get_file_security_desc.
2717 (stat_worker): New function, with most of the guts of 'stat', and
2718 with addition of handling of symlinks and support for 'lstat'.
2719 If possible, get file's attributes and security information by
2720 handle, not by name. Produce S_IFLNK bit for symlinks, when
2721 called from 'lstat'.
2722 (stat, lstat): New functions, call 'stat_worker'.
2723 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2724 symlinks when the underlying filesystem supports them.
2725
2726 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2727
2728 Fix macroexp crash on Windows with debugging (Bug#12118).
2729 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2730 checking subscripts; problem introduced with the recent
2731 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2732 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2733 since it's used in non-static inline functions now.
2734
2735 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2736 Don't assume buffer size fits in 'int'. Remove unused local.
2737
2738 Use C99-style 'extern inline' if available.
2739 * buffer.h (BUFFER_INLINE):
2740 * category.h (CATEGORY_INLINE):
2741 * character.h (CHARACTER_INLINE):
2742 * charset.h (CHARSET_INLINE):
2743 * composite.h (COMPOSITE_INLINE):
2744 * dispextern.h (DISPEXTERN_INLINE):
2745 * lisp.h (LISP_INLINE):
2746 * systime.h (SYSTIME_INLINE):
2747 New macro, replacing 'static inline' in this header.
2748 * buffer.h, category.h, character.h, charset.h, composite.h:
2749 * dispextern.h, lisp.h, systime.h:
2750 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2751 * alloc.c (LISP_INLINE):
2752 * buffer.c (BUFFER_INLINE):
2753 * category.c (CATEGORY_INLINE):
2754 * character.c (CHARACTER_INLINE):
2755 * charset.c (CHARSET_INLINE):
2756 * composite.c (COMPOSITE_INLINE):
2757 * dispnew.c (DISPEXTERN_INLINE):
2758 * sysdep.c (SYSTIME_INLINE):
2759 Define to EXTERN_INLINE, so that the corresponding functions
2760 are compiled into code.
2761 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2762 (INLINE_HEADER_END): New macros.
2763 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2764 since it's used in non-static inline functions now.
2765 (VALMASK) [!USE_LSB_TAG]: Likewise.
2766
2767 2012-08-02 Glenn Morris <rgm@gnu.org>
2768
2769 * s/: Remove empty directory.
2770
2771 * s/ms-w32.h: Move to ../nt/inc.
2772 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2773 Update for new ms-w32.h location.
2774
2775 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2776
2777 Port to Solaris 8.
2778 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2779
2780 2012-08-02 Glenn Morris <rgm@gnu.org>
2781
2782 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2783 hard-coding the path separator.
2784
2785 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2786
2787 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2788 This how ASET and AREF are supposed to work, and makes
2789 it easier to think about future improvements. See
2790 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2791 * charset.h (set_charset_attr): New function.
2792 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2793 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2794 (aref_addr): New function. All uses of &AREF(...) changed.
2795 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2796 (set_hash_index): New functions. All lvalue-style uses of
2797 HASH_KEY etc. changed.
2798 * keyboard.c (set_prop): New function. All lvalue-style uses
2799 of PROP changed.
2800
2801 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2802
2803 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2804 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2805 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2806 * nsfns.m (ns_set_name_as_filename): Likewise.
2807 * nsmenu.m (ns_update_menubar): Likewise.
2808 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2809
2810 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2811
2812 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2813 Adapt to latest changes in field names of the corresponding Lisp
2814 objects.
2815
2816 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2817
2818 2012-08-01 Glenn Morris <rgm@gnu.org>
2819
2820 * s/msdos.h: Remove file.
2821 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2822 * Makefile.in (S_FILE): Remove.
2823 (config_h): Remove S_FILE.
2824
2825 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2826
2827 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2828 Remove; moved to nt/config.nt.
2829
2830 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2831
2832 Use INTERNAL_FIELD for conses and overlays.
2833 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2834 Remove obsolete comment.
2835 (MVAR): New macro.
2836 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2837 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2838
2839 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2840
2841 Use INTERNAL_FIELD for symbols.
2842 * lisp.h (SVAR): New macro. Adjust users.
2843 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2844 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2845
2846 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2847
2848 Use INTERNAL_FIELD for processes.
2849 * process.h (PVAR): New macro. Adjust style.
2850 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2851 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2852
2853 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2854
2855 Use INTERNAL_FIELD for windows.
2856 * window.h (WVAR): New macro.
2857 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2858 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2859 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2860 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2861 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2862 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2863
2864 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2865
2866 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2867
2868 2012-08-01 Glenn Morris <rgm@gnu.org>
2869
2870 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2871 Move to configure.ac.
2872
2873 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2874
2875 * makefile.w32-in (CONFIG_H): Update dependencies.
2876 (CONF_POST_H): New macro.
2877
2878 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2879
2880 2012-07-31 Glenn Morris <rgm@gnu.org>
2881
2882 * Makefile.in (S_FILE): No longer set by configure.
2883
2884 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2885 is available.
2886 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2887
2888 * process.h (NULL_DEVICE):
2889 * emacs.c (SEPCHAR):
2890 * editfns.c (USER_FULL_NAME): Let configure set them.
2891
2892 * s/README, s/template.h: Remove files.
2893
2894 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2895
2896 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2897 Move to configure.ac.
2898
2899 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2900
2901 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2902 resulting renaming of 'struct frame' members.
2903
2904 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2905
2906 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2907 after introduction of FVAR.
2908
2909 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2910
2911 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2912
2913 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2914 instead of compositeToPoint.
2915 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2916
2917 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2918
2919 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2920
2921 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2922 * lisp.h (INTERNAL_FIELD): New macro.
2923 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2924 (BVAR): Change to use INTERNAL_FIELD.
2925 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2926 (KVAR): Change to use INTERNAL_FIELD.
2927 * frame.h (FVAR): New macro.
2928 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2929 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2930 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2931 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2932 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2933
2934 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2935
2936 Miscellaneous fixes for non-default X toolkits.
2937 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2938 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2939 Move under #ifdef USE_LUCID.
2940 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2941 definition and usage to avoid warnings.
2942
2943 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2944
2945 * nsterm.m (openFiles): Fix previous checkin.
2946
2947 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2948
2949 * indent.c (compute_motion): Remove unused local.
2950
2951 2012-07-31 Glenn Morris <rgm@gnu.org>
2952
2953 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2954
2955 * conf_post.h [USG5_4]:
2956 Move remaining contents of s/usg5-4-common.h here.
2957 * s/usg5-4-common.h: Remove file.
2958
2959 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2960 * s/irix6-5.h: Remove file.
2961
2962 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2963 * s/darwin.h: Remove file.
2964
2965 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2966 * s/hpux10-20.h: Remove file, which is now empty.
2967
2968 2012-07-30 Glenn Morris <rgm@gnu.org>
2969
2970 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2971 * Makefile.in (config_h): Add conf_post.h.
2972 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2973
2974 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2975
2976 * nsterm.m (ns_do_open_file): New variable.
2977 (ns_term_init): Set ns_do_open_file to YES after run returns.
2978 (openFile, openTempFile, openFileWithoutUI, openFiles):
2979 Open files only if ns_do_open_file.
2980
2981 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2982
2983 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2984 This no-op macro hasn't been needed for many years.
2985 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2986
2987 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2988 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2989 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2990 gdb_make_enums_visible.
2991 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2992 (DIRECTORY_SEP): Now a constant, not a macro.
2993
2994 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2995
2996 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2997 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2998
2999 * w32term.c <w32_keyboard_codepage>: Renamed from
3000 keyboard_codepage and now external. All users changed.
3001
3002 * w32term.h: Add declaration of w32_keyboard_codepage.
3003
3004 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3005 the codepage to translate keys to Unicode. If this argument is
3006 -1, use the value returned by GetConsoleCP. All callers changed.
3007
3008 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3009
3010 Update .PHONY listings in makefiles.
3011 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3012 bootstrap-clean, distclean, maintainer-clean, versioclean,
3013 extraclean, frc.
3014
3015 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3016 This is a bit clearer. Fix some commentary typos.
3017
3018 2012-07-30 Glenn Morris <rgm@gnu.org>
3019
3020 * s/netbsd.h: Let configure include signal.h if needed.
3021 Remove file, which is now empty.
3022
3023 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3024 Let configure set them.
3025 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3026 No more need to undefine.
3027
3028 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3029
3030 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3031 non-single-byte char when adding meta modifier. (Bug#12090)
3032
3033 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3034
3035 Convert safe_call to use variable number of arguments.
3036 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3037 (safe_call2): Fix comment.
3038 * lisp.h (safe_call): Adjust prototype.
3039 * coding.c (encode_coding_object): Change to use safe_call2.
3040 * xfaces.c (merge_face_heights): Change to use safe_call1.
3041
3042 2012-07-30 Glenn Morris <rgm@gnu.org>
3043
3044 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3045 does that unconditionally. Remove file, which is now empty.
3046
3047 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3048 Remove empty files.
3049
3050 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3051
3052 Export to GDB most of lisp.h's remaining object-like macros.
3053 * lisp.h (min, max): Move earlier, because they're used earlier now.
3054 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3055 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3056 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3057 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3058 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3059 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3060 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3061 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3062 Now constants, for GDB. They need not be macros.
3063 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3064 Now constants, for GDB, as well as macros, for static initializers.
3065 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3066 Move to after the definition of struct Lisp_Char_Table,
3067 since the former now needs that type defined.
3068 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3069 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3070 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3071 New enums, for gdb_make_enums_visible.
3072 (GLYPH_MODE_LINE_FACE): Remove; unused.
3073 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3074 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3075 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3076 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3077 enum maxargs, enum MAX_ALLOCA.
3078 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3079 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3080 no longer needed, now that they are done in lisp.h.
3081
3082 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3083
3084 Cleanup string bytes checking.
3085 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3086 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3087 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3088 (check_sblock, compact_small_strings): Simplify.
3089
3090 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3091
3092 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3093 These macros are confusing and no longer need to be defined, as
3094 the enum values now suffice. All uses replaced with definiens.
3095 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3096
3097 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3098
3099 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3100 ($(BLD)/w32console.$(O)): Update dependencies.
3101
3102 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3103
3104 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3105 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3106 time. Adjust users.
3107 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3108
3109 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3110
3111 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3112 setting sitelisp (Bug#12010).
3113
3114 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3115
3116 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3117
3118 * w32heap.c (cache_system_info):
3119 * w32.c (sys_rename):
3120 * w32proc.c (find_child_console, sys_kill): All users changed.
3121
3122 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3123
3124 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3125
3126 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3127
3128 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3129
3130 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3131
3132 Cleanup statistics calculation in Fgarbage_collect.
3133 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3134 Fix zombies percentage calculation. Simplify elapsed time calculation.
3135
3136 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3137
3138 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3139 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3140 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3141 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3142 (replace_range, replace_range_2, del_range_2): Change to eassert.
3143 * marker.c (byte_char_debug_check): Adjust style.
3144
3145 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3146
3147 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3148 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3149 long-ago-commented-out code that talks about "WIN32".
3150 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3151 All uses changed.
3152
3153 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3154
3155 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3156 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3157 Simplify by using alignof.
3158 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3159 * lisp.h: Include <stdalign.h>.
3160 (GCALIGNMENT): New macro and constant.
3161 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3162 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3163 (stdalign): New macro, if not already defined.
3164
3165 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3166
3167 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3168 * w32inevt.c: Include w32inevt.h.
3169 (w32_read_console_input): New inline function, calls either
3170 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3171 w32_console_unicode_input.
3172 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3173 (w32_kbd_patch_key, key_event): Use the codepage returned by
3174 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3175 (key_event): use uChar.UnicodeChar only if
3176 w32_console_unicode_input is non-zero.
3177
3178 * w32console.c: Include w32heap.h.
3179 <w32_console_unicode_input>: New global variable.
3180 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3181 family of Windows, zero otherwise.
3182
3183 * w32inevt.h: Declare w32_console_unicode_input.
3184
3185 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3186 --without-x. (Bug#11742)
3187
3188 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3189
3190 Adjust GDB to reflect pvec_type changes (Bug#12036).
3191 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3192 2012-07-04 changes to pseudovector representation.
3193 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3194
3195 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3196
3197 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3198 bus address.
3199 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3200
3201 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3202
3203 * alloc.c (listn): Fix the order the arguments are consed onto the
3204 list.
3205
3206 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3207 enumeration constants, as PURE and HEAP are too general, and clash
3208 with other headers and sources, such as gmalloc.c and the
3209 MS-Windows system headers. All users changed.
3210
3211 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3212
3213 Revert last save_excursion_save and save_excursion_restore changes.
3214 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3215 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3216
3217 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3218
3219 Fix recently-introduced typos in Windows port.
3220 Reported by Martin Rudalics <rudalics@gmx.at>.
3221 * w32.c (init_environment): Replace comma with semicolon.
3222 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3223
3224 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3225
3226 Improve GDB symbol export (Bug#12036).
3227 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3228 arms of an 'if', not using conditional expressions; otherwise GDB
3229 complains about the types in the unevaluated arm when the argument
3230 is an integer literal.
3231 (xgetint): Simplify expression.
3232 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3233 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3234 Zaretskii in <http://bugs.gnu.org/12036#13>.
3235 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3236 needed now that we have gdb_make_enums_visible.
3237 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3238 (enum enum_USE_LSB_TAG):
3239 New enum types, packaging up enums that need to be exported to GDB.
3240
3241 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3242
3243 Utility function to make a list from specified amount of objects.
3244 * lisp.h (enum constype): New datatype.
3245 (listn): New prototype.
3246 * alloc.c (listn): New function.
3247 (Fmemory_use_count, syms_of_alloc): Use it.
3248 * buffer.c (syms_of_buffer): Likewise.
3249 * callint.c (syms_of_callint): Likewise.
3250 * charset.c (define_charset_internal): Likewise.
3251 * coding.c (syms_of_coding): Likewise.
3252 * keymap.c (syms_of_keymap): Likewise.
3253 * search.c (syms_of_search): Likewise.
3254 * syntax.c (syms_of_syntax): Likewise.
3255 * w32.c (init_environment): Likewise.
3256 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3257 * xdisp.c (syms_of_xdisp): Likewise.
3258 * xfns.c (syms_of_xfns): Likewise.
3259
3260 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3261
3262 Fast save_excursion_save and save_excursion_restore.
3263 * lisp.h (struct Lisp_Excursion): New data type.
3264 (PVEC_EXCURSION): New pseudovector type.
3265 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3266 to deal with it. Adjust comments.
3267 (init_marker, attach_marker): New prototype.
3268 (unchain_marker): Adjust prototype.
3269 * marker.c (attach_marker): Change to global.
3270 (init_marker): New function.
3271 * alloc.c (Fmake_marker, build_marker): Use it.
3272 (build_marker): More easserts.
3273 (mark_object): Handle struct Lisp_Excursion.
3274 * editfns.c (save_excursion_save, save_excursion_restore):
3275 Reimplement to use struct Lisp_Excursion. Add comments.
3276
3277 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3278
3279 Fix export of symbols to GDB (Bug#12036).
3280 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3281 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3282 emacs.c, as this is a more-suitable home. Had this been done earlier
3283 the fix for 12036 would have avoided some of the problems noted in
3284 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3285 would have been more obvious.
3286 * emacs.c: Do not include <verify.h>; no longer needed.
3287 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3288 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3289 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3290 Remove; now done in lisp.h.
3291 * lisp.h (PUBLISH_TO_GDB): New macro.
3292 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3293 (DATA_SEG_BITS): Use it.
3294 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3295 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3296 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3297 not be usable in #if. This simplifies things.
3298
3299 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3300
3301 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3302
3303 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3304
3305 Simplify export of symbols to GDB (Bug#12036).
3306 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3307 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3308 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3309 Adjust to changes in lisp.h and emacs.c, by using
3310 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3311 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3312 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3313 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3314 instead of gdb_valbits.
3315 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3316 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3317 instead of gdb_array_mark_flag.
3318 (xboolvector): Get size from $->size, not $->header.size.
3319 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3320 (xreload, hook-run, hookpost-run): Remove.
3321 * emacs.c: Include <verify.h>.
3322 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3323 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3324 Remove.
3325 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3326 (gdb_USE_LSB_TAG): New enum constants.
3327 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3328 Also define these as enum constants, so they're visible to GDB.
3329 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3330 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3331 as constants, so they're visible to GDB.
3332 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3333 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3334 Now enum constants, not macros, so they're visible to GDB.
3335 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3336 more convenient now. All uses changed.
3337 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3338 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3339
3340 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3341
3342 Explicitly free restriction data that are not needed anymore.
3343 * editfns.c (save_restriction_restore): Free restriction data.
3344
3345 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3346
3347 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3348 add argument, tune behavior, and adjust all callers.
3349
3350 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3351
3352 Use typedef for EMACS_INT, EMACS_UINT.
3353 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3354 than macros. This simplifies debugging in the usual case, since
3355 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3356 and it allows expressions involving EMACS_INT casts.
3357 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3358
3359 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3360
3361 * nsterm.m (ns_read_socket): Return early if there is a modal
3362 window (Bug#12043).
3363
3364 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3365
3366 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3367 that FOCUS-FRAME can be omitted.
3368
3369 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3370
3371 Adjust buffer text indirection counters at the end of Fkill_buffer.
3372 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3373 buffer is definitely dead. This should really fix an issue reported
3374 by Christoph Scholtes again. (Bug#12007).
3375 (init_buffer_once): Initialize indirection counters of
3376 buffer_defaults and buffer_local_symbols (for sanity and safety).
3377
3378 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3379
3380 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3381 and continuation glyphs on tooltip frames, leave them at zero.
3382 Avoids continued lines in tooltips. (Bug#11832)
3383
3384 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3385
3386 Simplify copy_overlay.
3387 * buffer.c (copy_overlay): Simplify. Use build_marker.
3388 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3389
3390 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3391
3392 * print.c (print_object): Don't crash when a frame's name is nil
3393 or invalid. (Bug#12025)
3394
3395 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3396 it signals an error when a tooltip frame is being created.
3397
3398 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3399
3400 Cleanup miscellaneous objects allocation and initialization.
3401 * alloc.c (allocate_misc): Change to static. Add argument to
3402 specify the subtype. Adjust comment and users.
3403 (build_overlay): New function.
3404 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3405 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3406 (allocate_misc): Remove prototype.
3407 (build_overlay): Add prototype.
3408
3409 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3410
3411 Swap buffer text indirection counters in Fbuffer_swap_text.
3412 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3413 This avoids crash reported by Christoph Scholtes at
3414 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3415
3416 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3417
3418 * nsmenu.m (Popdown_data): New struct.
3419 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3420 free Popdown_data.
3421 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3422 (initWithContentRect): Make imgView and contentView non-static
3423 and autorelease them. Also autorelease img and matrix (Bug#12005).
3424 (dealloc): Remove (Bug#12005).
3425
3426 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3427
3428 Adjust consing_since_gc when objects are explicitly freed.
3429 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3430 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3431 (free_cons, free_misc): Subtract object size from consing_since_gc.
3432
3433 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3434
3435 Simplify and cleanup markers positioning code.
3436 * marker.c (attach_marker): More useful eassert.
3437 (live_buffer, set_marker_internal): New function.
3438 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3439 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3440
3441 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3442
3443 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3444 as it's limited by the amount of memory, not by INT_MAX.
3445
3446 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3447
3448 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3449 in special-event-map. See the discussion at
3450 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3451 for the reasons.
3452
3453 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3454 info.dwItemData. Fixes crashes on 64-bit Windows.
3455 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3456
3457 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3458
3459 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3460 (conversationIdentifier): Return value is NSInteger.
3461 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3462
3463 2012-07-21 Chong Yidong <cyd@gnu.org>
3464
3465 * window.c (decode_any_window): Signal an error if the window is
3466 on a dead frame (Bug#11984).
3467
3468 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3469
3470 Add indirection counting to speed up Fkill_buffer.
3471 * buffer.h (struct buffer): New member.
3472 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3473 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3474 base buffer indirection counter.
3475 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3476 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3477 through buffer list if indirection counter is 0.
3478
3479 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3480
3481 Extend the value returned by Fgarbage_collect with heap statistics.
3482 * alloc.c (Qheap): New symbol.
3483 (syms_of_alloc): DEFSYM it.
3484 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3485 (Fmemory_free): Remove.
3486 (syms_of_alloc): Don't defsubr it.
3487 * buffer.c (Fcompact_buffer): Remove.
3488 (syms_of_buffer): Don't defsubr it.
3489
3490 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3491
3492 Make maybe_gc inline.
3493 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3494 * lisp.h (consing_since_gc, gc_relative_threshold)
3495 (memory_full_cons_threshold): Revert declaration.
3496 (maybe_gc): Remove prototype, define as inline.
3497 * alloc.c: Remove old commented-out code.
3498 (consing_since_gc, gc_relative_threshold)
3499 (memory_full_cons_threshold): Revert to global.
3500 (maybe_gc): Remove.
3501
3502 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3503
3504 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3505 * lisp.h (build_unibyte_string): New function.
3506 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3507 * sysdep.c, w32fns.c, xfns.c: Use it.
3508 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3509 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3510 Adjust users accordingly.
3511 * font.h (font_open_by_name): Adjust prototype.
3512
3513 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3514
3515 Cleanup calls to Fgarbage_collect.
3516 * lisp.h (maybe_gc): New prototype.
3517 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3518 Remove declarations.
3519 * alloc.c (maybe_gc): New function.
3520 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3521 Make them static.
3522 * bytecode.c (MAYBE_GC): Use maybe_gc.
3523 * eval.c (eval_sub, Ffuncall): Likewise.
3524 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3525 to avoid dependency from auto-save feature.
3526
3527 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3528
3529 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3530 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3531 'for_each_per_buffer_object_at'.
3532 All uses changed. It's better to use upper-case for macros that
3533 cannot be implemented as functions, to give the reader a clue
3534 that they're special.
3535
3536 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3537
3538 * alloc.c (Fgarbage_collect): Tweak docstring.
3539
3540 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3541
3542 Tweak the value returned from Fgarbage_collect again.
3543 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3544 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3545 Adjust documentation.
3546 (total_vector_bytes): Rename to total_vector_slots, adjust
3547 accounting.
3548 (total_free_vector_bytes): Rename to total_free_vector_slots,
3549 adjust accounting.
3550 (Qstring_bytes, Qvector_slots): New symbols.
3551 (syms_of_alloc): DEFSYM them.
3552
3553 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3554
3555 Buffer compaction primitive which may be used from Lisp.
3556 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3557 (syms_of_buffer): Register Fcompact_buffer.
3558 * alloc.c (Fgarbage_collect): Use compact_buffer.
3559 * buffer.h (compact_buffer): New prototype.
3560 (struct buffer_text): New member.
3561
3562 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3563
3564 New macro to iterate over all buffers, miscellaneous cleanups.
3565 * lisp.h (all_buffers): Remove declaration.
3566 * buffer.h (all_buffers): Add declaration, with comment.
3567 (for_each_buffer): New macro.
3568 * alloc.c (Fgarbage_collect, mark_object): Use it.
3569 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3570 (init_buffer): Likewise.
3571 * data.c (Fset_default): Likewise.
3572 * coding.c (code_conversion_restore): Remove redundant check
3573 for dead buffer.
3574 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3575
3576 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3577
3578 Fix bug that created negative-length intervals.
3579 * intervals.c (merge_interval_right, merge_interval_left):
3580 Do not zero out this interval if it is absorbed by its children,
3581 as this interval's total length doesn't change in that case. See
3582 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3583
3584 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3585
3586 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3587 when invoking (make-bool-vector N t) and N is a positive
3588 multiple of 8 -- the last 8 bits were mistakenly cleared.
3589
3590 Remove some struct layout assumptions in bool vectors.
3591 * alloc.c (bool_header_size): New constant.
3592 (header_size, word_size): Move earlier, as they're now used earlier.
3593 Use 'word_size' in a few more places, where it's appropriate.
3594 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3595 padding before the data member of a bool vector.
3596 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3597 than doing the check by hand with an abort ().
3598
3599 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3600
3601 * eval.c (Fdefvar): Don't check constants since we only set the var if
3602 it's not yet defined anyway (bug#11904).
3603
3604 * lisp.h (last_undo_boundary): Declare new var.
3605 * keyboard.c (command_loop_1): Set it.
3606 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3607 were auto-added by the command loop (bug#11774).
3608
3609 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3610
3611 * w32font.c (Qsymbol): Remove local definition.
3612 (syms_of_w32font): Don't DEFSYM it.
3613
3614 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3615
3616 Fix sweep_vectors to handle large bool vectors correctly.
3617 * alloc.c (sweep_vectors): Account total_vector_bytes for
3618 bool vectors larger than VBLOCK_BYTES_MAX.
3619
3620 2012-07-18 Chong Yidong <cyd@gnu.org>
3621
3622 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3623 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3624
3625 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3626
3627 Return more descriptive data from Fgarbage_collect.
3628 Suggested by Stefan Monnier in
3629 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3630 * alloc.c (bounded_number): New function.
3631 (total_buffers, total_vectors): New variable.
3632 (total_string_size): Rename to total_string_bytes, adjust users.
3633 (total_vector_size): Rename to total_vector_bytes, adjust users.
3634 (sweep_vectors): Account total_vectors and total_vector_bytes.
3635 (Fgarbage_collect): New return value. Adjust documentation.
3636 (gc_sweep): Account total_buffers.
3637 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3638 (VECTOR_SIZE): Remove.
3639 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3640 (Qinterval, Qmisc): New symbols.
3641 (syms_of_data): Initialize them.
3642 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3643 (Qcons, Qbuffer): New declarations.
3644
3645 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3646
3647 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3648 Round up, not down. Improve doc.
3649
3650 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3651
3652 Restore old code in allocate_string_data to avoid Faset breakage.
3653 Reported by Julien Danjou <julien@danjou.info> in
3654 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3655 * alloc.c (allocate_string_data): Restore old code with minor
3656 adjustments, fix comment to explain this subtle issue.
3657
3658 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3659
3660 Remove FILE_SYSTEM_CASE.
3661 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3662
3663 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3664 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3665 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3666 call-process-region passes it through expand-file-name.
3667
3668 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3669
3670 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3671
3672 Fix crash when creating indirect buffer (Bug#11917)
3673 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3674 Don't handle unbound variables specially if non-zero.
3675 (Fbuffer_local_variables): Pass zero.
3676 (clone_per_buffer_values): Pass non-zero.
3677
3678 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3679
3680 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3681 to make the loop interruptible.
3682
3683 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3684
3685 * gnutls.c (emacs_gnutls_handshake): Only retry if
3686 GNUTLS_E_INTERRUPTED.
3687
3688 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3689
3690 Cleanup and convert miscellaneous checks to eassert.
3691 * alloc.c (mark_interval): Fix comment, partially rephrase
3692 old comment from intervals.h (see below).
3693 * intervals.c (find_interval, adjust_intervals_for_insertion)
3694 (delete_interval, adjust_intervals_for_deletion)
3695 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3696 Convert to eassert.
3697 (adjust_intervals_for_insertion, make_new_interval):
3698 Remove obsolete and unused code.
3699 * intervals.h (struct interval): Remove obsolete comment.
3700 * textprotp.c (erase_properties): Remove unused code.
3701 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3702 (Fremove_list_of_text_properties): Convert to eassert.
3703
3704 2012-07-17 Chong Yidong <cyd@gnu.org>
3705
3706 * editfns.c (Finsert_char): Doc fix.
3707
3708 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3709
3710 Fix previous change to make Fmemory_free always accurate.
3711 * alloc.c (make_interval): Update total_free_intervals.
3712 (make_float): Likewise for total_free_floats.
3713 (free_cons, Fcons): Likewise for total_free_conses.
3714 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3715 Likewise for total_free_vector_bytes.
3716 (Fmake_symbol): Likewise for total_free_symbols.
3717 (bytes_free): Remove.
3718
3719 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3720
3721 Simple free memory accounting feature.
3722 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3723 (sweep_vectors): Accumulate size of free vectors.
3724 (Fgarbage_collect): Setup bytes_free.
3725 (Fmemory_free): New function.
3726 (syms_of_alloc): Register it.
3727
3728 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3729
3730 Cleanup overlays checking.
3731 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3732 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3733 eassert and OVERLAYP.
3734 (sort_overlays): Change to use OVERLAYP.
3735
3736 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3737
3738 * editfns.c (Finsert_char): Make it interactive, and make the
3739 second arg optional. Copy interactive spec and docstring from
3740 ucs-insert.
3741
3742 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3743
3744 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3745 Unlike the other wrapped functions, fabs has an unspecified
3746 effect on errno.
3747
3748 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3749
3750 * nsterm.m (keyDown): Interpret flags without left/right bits
3751 as the left key (Bug#11670).
3752
3753 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3754
3755 Remove empty and useless init functions.
3756 * lisp.h (init_character_once, init_fns, init_image)
3757 (init_filelock, init_sound): Remove prototype.
3758 * character.c (init_character_once): Remove.
3759 * filelock.c (init_filelock): Likewise.
3760 * fns.c (init_fns): Likewise.
3761 * image.c (init_image): Likewise.
3762 * sound.c (init_sound): Likewise.
3763 * emacs.c (main): Adjust accordingly.
3764
3765 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3766
3767 * gtkutil.h: Tiny cleanups.
3768 (use_old_gtk_file_dialog): Remove useless declaration.
3769 (xg_uses_old_file_dialog): Add suggested const attribute.
3770
3771 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3772
3773 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3774 (bidi_paragraph_init): Use it to limit search forward for a strong
3775 directional character in abnormally large paragraphs full of
3776 neutral or weak characters. (Bug#11943)
3777
3778 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3779
3780 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3781 the toolbar (Bug#9451).
3782 (xg_make_tool_item): Give the widget event box a transparent
3783 background.
3784
3785 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3786
3787 Cleanup basic allocation variables and functions.
3788 * alloc.c (ignore_warnings, init_intervals, init_float)
3789 (init_cons, init_symbol, init_marker): Remove.
3790 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3791 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3792 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3793 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3794 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3795 (staticidx, init_alloc_once, init_strings, free_ablock):
3796 Remove redundant initialization.
3797 * fns.c (init_weak_hash_tables): Remove.
3798 * lisp.h (init_weak_hash_tables): Remove prototype.
3799
3800 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3801
3802 Use zero_vector where appropriate.
3803 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3804 accordingly.
3805 * lisp.h (zero_vector): New declaration.
3806 * font.c (null_vector): Remove.
3807 (syms_of_font): Remove initialization and staticpro.
3808 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3809 * keymap.c (Faccessible_keymaps): Likewise.
3810
3811 2012-07-15 Leo Liu <sdl.web@gmail.com>
3812
3813 * fringe.c: Fix typo in comments.
3814
3815 2012-07-14 Leo Liu <sdl.web@gmail.com>
3816
3817 * fringe.c: Add a new bitmap exclamation-mark.
3818
3819 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3820
3821 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3822
3823 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3824 (HAVE_MENUS): Don't define, defined by editing config.in with
3825 msdos/sed2v2.inp.
3826 (GMALLOC_INHIBIT_VALLOC): Don't define.
3827 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3828
3829 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3830
3831 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3832
3833 2012-07-14 Glenn Morris <rgm@gnu.org>
3834
3835 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3836 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3837 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3838
3839 2012-07-13 Glenn Morris <rgm@gnu.org>
3840
3841 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3842
3843 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3844 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3845
3846 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3847
3848 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3849 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3850 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3851 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3852 where appropriate.
3853 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3854 as boolean expression.
3855 (x_set_window_size): Remove unused variable toolbar.
3856 (ns_get_color_default, ns_mod_to_lisp): Remove.
3857 (ns_mouse_position): Remove unused variables xchar and ychar.
3858 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3859 (ns_set_vertical_scroll_bar): Remove unused variable count.
3860 (ns_delete_terminal): Remove unused variable i.
3861 (ns_term_init): Remove unused variables r, g and b.
3862 (mouseDown): Remove unused variable window.
3863 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3864 (initFrameFromEmacs): Remove unused variable vbextra.
3865 (mouseEntered): Remove unused variables p and dpyinfo.
3866 (mouseExited): Remove unused variables p and r.
3867 (ns_define_frame_cursor, ns_clear_frame_area)
3868 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3869 (menuDown): Assign [sender tag] to variable and cast the variable.
3870
3871 * nsterm.h (menuDown): Add id as type to argument sender.
3872 (ns_display_info_for_name): Add Lisp_Object argument.
3873 (ns_term_init): Add Lisp_Object argument.
3874 (ns_map_event_to_object): Add void argument.
3875 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3876 prototype with arguments and only declare if __OBJC__.
3877 (nxatoms_of_nsselect): Add void argument.
3878 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3879 (ns_alloc_autorelease_pool): Add void argument.
3880 (ns_release_autorelease_pool): Add void* argument.
3881 (ns_get_defaults_value): Add const char* argument.
3882
3883 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3884 (initFromContents): Use SSDATA where appropriate.
3885 (ns_update_menubar): Add braces to ambigous if-else.
3886 (initWithTitle): Put () around assignment in if statement.
3887 (ns_menu_show): Remove unused variables window and keymap.
3888 (update_frame_tool_bar): Remove unused variable selected_p.
3889 (initWithContentRect): Remove unused variable this_cmd_name.
3890
3891 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3892 appropriate.
3893 (setXBMColor): Remove unused variable len.
3894 (setPixmapData): Put () around assignment in loop statement.
3895
3896 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3897 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3898 where appropriate.
3899 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3900 around assignment in loop statement.
3901 (nsfont_open): Remove unused variable i.
3902 (nsfont_open): Remove unused variable len.
3903 (nsfont_draw): Remove unused variable cs.
3904
3905 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3906 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3907 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3908 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3909 (Fns_font_name, Fns_perform_service)
3910 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3911 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3912 (ns_set_name): Remove unused variable view.
3913 (x_set_menu_bar_lines): Remove unused variable olines.
3914 (x_set_tool_bar_lines): Remove unused variable root_window.
3915 (Fns_list_colors): Put () around assignment in while statement.
3916 (Fns_perform_service): Remove unused variable len.
3917 (Fns_display_usable_bounds): Remove unused variable top.
3918 (syms_of_nsfns): Remove unused variable i.
3919
3920 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3921 memcpy (Bug#11907).
3922
3923 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3924
3925 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3926 and free it with DestroyExceptionInfo (Bug#11558).
3927
3928 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3929
3930 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3931 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3932 Set here, not in nt/config.nt.
3933
3934 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3935
3936 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3937 cursor overflow into the last glyph on display line when the right
3938 fringe is off. (Bug#11832)
3939
3940 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3941
3942 * xdisp.c (produce_special_glyphs): Now static.
3943 * dispextern.h (produce_special_glyphs): Remove decl.
3944
3945 2012-07-13 Glenn Morris <rgm@gnu.org>
3946
3947 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3948 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3949
3950 * s/usg5-4-common.h (USG, USG5):
3951 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3952 * s/sol2-6.h (SOLARIS2):
3953 * s/irix6-5.h (IRIX6_5):
3954 * s/hpux10-20.h (USG, USG5, HPUX):
3955 * s/gnu-linux.h (USG, GNU_LINUX):
3956 * s/freebsd.h (BSD_SYSTEM):
3957 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3958 * s/cygwin.h (CYGWIN):
3959 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3960 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3961
3962 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3963
3964 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3965
3966 2012-07-13 Glenn Morris <rgm@gnu.org>
3967
3968 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3969
3970 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3971
3972 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3973 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3974
3975 2012-07-12 Glenn Morris <rgm@gnu.org>
3976
3977 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3978
3979 * process.c (init_process_emacs): Rename from init_process.
3980 The old name is also the name of a Mach system call.
3981 * lisp.h, emacs.c: Update for this name change.
3982 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3983 longer needed.
3984
3985 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3986
3987 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3988 memmove call that removes glyphs covered by the left truncation
3989 glyph. Improve commentary.
3990 (display_line): Fix display of continuation glyphs on GUI frames
3991 when the right fringe is turned off and variable-size fonts are
3992 used in the window. Move the code that appends a stretch glyph to
3993 produce_special_glyphs, so that it could be used for truncation
3994 and continuation glyphs alike.
3995 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3996 glyph of a suitably computed width, to align the special glyphs at
3997 the window margin. Code moved from display_line. (Bug#11832)
3998
3999 2012-07-12 Glenn Morris <rgm@gnu.org>
4000
4001 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4002
4003 * s/gnu-linux.h, s/hpux10-20.h:
4004 Do not unconditionally define HAVE_XRMSETDATABASE.
4005
4006 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4007
4008 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4009
4010 Fix typos that broke OS X build.
4011 Reported by Randal L. Schwartz in
4012 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4013 * nsterm.m (ns_timeout): Add missing local decl.
4014 (ns_get_color): snprintf -> sprintf, to fix typo.
4015
4016 2012-07-12 Glenn Morris <rgm@gnu.org>
4017
4018 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4019 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4020 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4021 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4022
4023 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4024 Move PTY_OPEN to configure.
4025
4026 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4027 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4028 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4029
4030 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4031
4032 Use empty_unibyte_string where applicable.
4033 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4034 * lread.c (read1): Likewise.
4035 * xsettings.c (syms_of_xsettings): Likewise.
4036
4037 2012-07-12 Glenn Morris <rgm@gnu.org>
4038
4039 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4040 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4041 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4042 * s/hpux10-20.h (RUN_TIME_REMAP):
4043 * s/bsd-common.h (TABDLY): Move to configure.
4044
4045 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4046
4047 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4048
4049 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4050 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4051
4052 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4053
4054 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4055 * s/template.h: Move NARROWPROTO to configure.
4056
4057 2012-07-11 Glenn Morris <rgm@gnu.org>
4058
4059 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4060 unused since 2011-01-17 change to systty.h.
4061
4062 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4063 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4064 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4065
4066 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4067
4068 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4069
4070 2012-07-11 Glenn Morris <rgm@gnu.org>
4071
4072 * s/darwin.h, s/gnu-linux.h, s/template.h:
4073 Move INTERRUPT_INPUT to configure.
4074
4075 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4076
4077 Minor adjustments to interning code.
4078 * lisp.h (intern, intern_c_string): Redefine as static inline
4079 wrappers for intern_1 and intern_c_string_1, respectively.
4080 (intern_1, intern_c_string_1): Rename prototypes.
4081 * lread.c (intern_1, intern_c_string_1, oblookup):
4082 Simplify Vobarray checking.
4083 * font.c (font_intern_prop): Likewise. Adjust comment.
4084 * w32font.c (intern_font_name): Likewise.
4085
4086 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4087
4088 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4089
4090 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4091 of Fcar/Fcdr if possible.
4092 * font.c (check_otf_features): Likewise.
4093 * fontset.c (Fnew_fontset): Likewise.
4094 * gnutls.c (Fgnutls_boot): Likewise.
4095 * minibuf.c (read_minibuf): Likewise.
4096 * msdos.c (IT_set_frame_parameters): Likewise.
4097 * xmenu.c (Fx_popup_dialog): Likewise.
4098 * w32menu.c (Fx_popup_dialog): Likewise.
4099
4100 2012-07-11 Glenn Morris <rgm@gnu.org>
4101
4102 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4103 since nothing has defined it on these platforms.
4104
4105 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4106 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4107
4108 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4109 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4110 Move CLASH_DETECTION to configure.
4111
4112 * s/gnu.h: Remove file, which is now empty.
4113
4114 * s/gnu.h, s/gnu-linux.h:
4115 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4116
4117 2012-07-11 John Wiegley <johnw@newartisans.com>
4118
4119 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4120 function attribute, so we only use it if it exists in the
4121 compiler.
4122
4123 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4124
4125 Avoid call to strlen in fast_c_string_match_ignore_case.
4126 * search.c (fast_c_string_match_ignore_case): Change to use
4127 length argument. Adjust users accordingly.
4128 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4129
4130 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4131
4132 Assume mkdir, rmdir.
4133 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4134 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4135
4136 Assume rename.
4137 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4138
4139 Assume perror.
4140 * s/hpux10-20.h (HAVE_PERROR): Remove.
4141 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4142 Remove dummy definition, as this problem was obsolete long ago.
4143
4144 Assume strerror.
4145 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4146
4147 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4148
4149 Avoid calls to strlen in font processing functions.
4150 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4151 (font_open_by_name): Change to use length argument.
4152 Adjust users accordingly.
4153 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4154 Adjust prototypes.
4155 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4156 Change to return ptrdiff_t.
4157 (xfont_list_pattern, xfont_match): Use length returned by
4158 xfont_decode_coding_xlfd.
4159 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4160
4161 2012-07-11 Glenn Morris <rgm@gnu.org>
4162
4163 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4164 Move DONT_REOPEN_PTY to configure.
4165
4166 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4167 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4168
4169 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4170
4171 Remove "#define unix" that is no longer needed (Bug#11905).
4172 * s/aix4-2.h (unix): Remove; no longer needed.
4173
4174 EMACS_TIME simplification (Bug#11875).
4175 This replaces macros (which typically do not work in GDB)
4176 with functions, typedefs and enums, making the code easier to debug.
4177 The functional style also makes code easier to read and maintain.
4178 * systime.h: Include <sys/time.h> on all hosts, not just if
4179 WINDOWSNT, since 'struct timeval' is needed in general.
4180 (EMACS_TIME): Now a typedef, not a macro.
4181 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4182 not macros.
4183 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4184 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4185 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4186 (EMACS_TIME_LE): Now functions, not macros.
4187 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4188 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4189 which are not functions. All uses rewritten to use:
4190 (make_emacs_time): New function.
4191 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4192 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4193 not functions. All uses rewritten to use the following, respectively:
4194 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4195 (add_emacs_time, sub_emacs_time): New functions.
4196 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4197 * fileio.c (Fcopy_file):
4198 * xterm.c (XTflash): Get the current time closer to when it's used.
4199 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4200
4201 * bytecode.c (targets): Suppress -Woverride-init warnings.
4202
4203 Simplify by avoiding confusing use of strncpy etc.
4204 * doc.c (Fsnarf_documentation):
4205 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4206 * frame.c (Fmake_terminal_frame):
4207 * gtkutil.c (get_utf8_string):
4208 * lread.c (openp):
4209 * nsmenu.m (ns_update_menubar):
4210 * regex.c (regerror):
4211 Prefer memcpy to strncpy and strncat when either will do.
4212 * fileio.c (Fsubstitute_in_file_name):
4213 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4214 (menu_separator_name_p):
4215 * nsmenu.m (ns_update_menubar):
4216 Prefer memcmp to strncmp when either will do.
4217 * nsterm.m: Include <ftoastr.h>.
4218 (ns_get_color):
4219 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4220 Prefer snprintf to strncpy.
4221 * nsterm.m (ns_term_init):
4222 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4223 * nsterm.m (ns_term_init):
4224 Avoid the need for strncpy, by using build_string or
4225 make_unibyte_string directly. Use dtoastr, not snprintf.
4226 * process.c (Fmake_network_process): Diagnose service names that
4227 are too long, rather than silently truncating them or creating
4228 non-null-terminated names.
4229 (Fnetwork_interface_info): Likewise, for interface names.
4230 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4231 Prefer sprintf to strncat.
4232 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4233 Prefer vsnprintf to vsprintf + strncpy.
4234
4235 2012-07-10 Glenn Morris <rgm@gnu.org>
4236
4237 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4238 Clarify fallback case.
4239
4240 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4241
4242 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4243 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4244 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4245 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4246 where argument type is known to be a Lisp_Cons.
4247
4248 2012-07-10 Tom Tromey <tromey@redhat.com>
4249
4250 * bytecode.c (BYTE_CODE_THREADED): New macro.
4251 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4252 (enum byte_code_op): New type.
4253 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4254 (exec_byte_code): Use them. Use token threading when applicable.
4255
4256 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4257
4258 Optimize pure C strings initialization.
4259 * lisp.h (make_pure_string): Fix prototype.
4260 (build_pure_c_string): New function, defined as static inline. This
4261 provides a better opportunity to optimize away calls to strlen when
4262 the function is called with compile-time constant argument.
4263 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4264 argument, adjust users accordingly. Use build_pure_c_string where
4265 appropriate.
4266 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4267 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4268 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4269
4270 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4271
4272 Avoid calls to strlen in miscellaneous functions.
4273 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4274 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4275 * lread.c (openp): Likewise.
4276
4277 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4278
4279 Avoid calls to strlen in path processing functions.
4280 * fileio.c (file_name_as_directory): Add comment. Change to add
4281 srclen argument and return the length of result. Adjust users
4282 accordingly.
4283 (directory_file_name): Fix comment. Change to add srclen argument,
4284 swap 1st and 2nd arguments to obey the common convention.
4285 Adjust users accordingly.
4286 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4287
4288 2012-07-10 Glenn Morris <rgm@gnu.org>
4289
4290 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4291 Move PENDING_OUTPUT_COUNT definition to configure.
4292
4293 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4294 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4295 * s/gnu.h (DATA_START): Move definitions to configure.
4296
4297 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4298 We include usg5-4-common.h, which defines them both.
4299
4300 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4301 O_RDONLY already includes it).
4302
4303 Stop ns builds setting the EMACSLOADPATH environment variable.
4304 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4305 Now it does not set EMACSLOADPATH, just returns the load-path string.
4306 * nsterm.h: Update accordingly.
4307 * lread.c [HAVE_NS]: Include nsterm.h.
4308 (init_lread) [HAVE_NS]: Use ns_load_path.
4309 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4310
4311 2012-07-09 Glenn Morris <rgm@gnu.org>
4312
4313 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4314 since the included bsd-common.h does so.
4315
4316 Stop ns builds setting the EMACSPATH environment variable.
4317 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4318 (ns_init_paths): Do not set EMACSPATH.
4319 * nsterm.h (ns_exec_path): Add it.
4320 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4321 Use ns_exec_path.
4322
4323 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4324
4325 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4326
4327 * process.c (wait_reading_process_output): 'waitchannels' was unset
4328 when read_kbd || !NILP (wait_for_cell); fix this.
4329
4330 Add GCC-style 'const' attribute to functions that can use it.
4331 * character.h (char_resolve_modifier_mask):
4332 * keyboard.h (make_ctrl_char):
4333 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4334 (init_character_once, next_almost_prime, init_fns, init_image)
4335 (flush_pending_output, init_sound):
4336 * mem-limits.h (start_of_data):
4337 * menu.h (finish_menu_items):
4338 Add ATTRIBUTE_CONST.
4339 * emacs.c (DEFINE_DUMMY_FUNCTION):
4340 Declare the dummy function with ATTRIBUTE_CONST.
4341 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4342 Add decls with ATTRIBUTE_CONST.
4343
4344 Minor improvements to make_formatted_string.
4345 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4346 where int is good enough, as vsprintf returns an int.
4347 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4348
4349 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4350
4351 Use make_formatted_string to avoid double length calculation.
4352 * lisp.h (make_formatted_string): New prototype.
4353 * alloc.c (make_formatted_string): New function.
4354 * buffer.c (Fgenerate_new_buffer_name): Use it.
4355 * dbus.c (syms_of_dbusbind): Likewise.
4356 * editfns.c (Fcurrent_time_zone): Likewise.
4357 * filelock.c (get_boot_time): Likewise.
4358 * frame.c (make_terminal_frame, set_term_frame_name)
4359 (x_report_frame_params): Likewise.
4360 * image.c (gs_load): Likewise.
4361 * minibuf.c (get_minibuffer): Likewise.
4362 * msdos.c (dos_set_window_size): Likewise.
4363 * process.c (make_process): Likewise.
4364 * xdisp.c (ensure_echo_area_buffers): Likewise.
4365 * xsettings.c (apply_xft_settings): Likewise.
4366
4367 2012-07-09 Glenn Morris <rgm@gnu.org>
4368
4369 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4370 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4371 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4372 * nsterm.h (ns_etc_directory): Add it.
4373 * callproc.c [HAVE_NS]: Include nsterm.h.
4374 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4375
4376 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4377
4378 Move marker debugging code under MARKER_DEBUG.
4379 * marker.c (MARKER_DEBUG): Move marker debugging code under
4380 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4381 for bootstrap with --enable-checking (~3x slowdown reported
4382 by Juanma Barranquero <lekktu@gmail.com>).
4383 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4384
4385 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4386
4387 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4388 See <http://bugs.gnu.org/11825#29>.
4389
4390 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4391
4392 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4393 has no font, use the frame's font. (Bug#11813)
4394 (display_line): Add commentary about displaying truncation glyphs
4395 on GUI frames.
4396 (produce_special_glyphs): Move here from term.c.
4397
4398 * term.c (produce_special_glyphs): Move to xdisp.c.
4399
4400 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4401 section.
4402
4403 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4404
4405 * xdisp.c (display_line): Avoid warning about implicit declaration
4406 of FRAME_FONT.
4407
4408 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4409
4410 * lisp.h: Remove empty conditional.
4411
4412 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4413
4414 * lread.c (load_path_check): Now static.
4415
4416 Fix some minor --with-ns problems found by static checking.
4417 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4418 (x_set_font) [!HAVE_X_WINDOWS]:
4419 * image.c (xpm_load_image) [HAVE_NS]:
4420 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4421 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4422 Remove unused local.
4423 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4424 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4425 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4426 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4427 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4428 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4429 Fix pointer signedness problem.
4430 * xfaces.c (FRAME_X_FONT_TABLE):
4431 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4432
4433 2012-07-07 Glenn Morris <rgm@gnu.org>
4434
4435 * lread.c (load_path_check): New function, split from init_lread.
4436 (init_lread): Reorganize. Motivation:
4437 If EMACSLOADPATH is set, check/warn about that rather than the
4438 defaults, which we are not going to use. Hence we can remove
4439 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4440 Don't warn if site-lisp directories are missing.
4441 If not installed, start from a blank load-path, since
4442 PATH_LOADSEARCH refers to the eventual installation directories.
4443
4444 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4445
4446 Support truncation and continuation glyphs on GUI frames, when
4447 fringes are disabled. (Bug#11832)
4448 * xdisp.c (init_iterator): Get dimensions of truncation and
4449 continuation glyphs even if on GUI frames.
4450 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4451 or both, are absent.
4452 (start_display, move_it_in_display_line_to): Handle the case of a
4453 GUI frame without a fringe to display continuation or truncation
4454 glyphs.
4455 (insert_left_trunc_glyphs): Support GUI frames: make sure
4456 truncation glyphs overwrite enough glyphs from the current line to
4457 have sufficient space in pixels.
4458 (display_line): Support truncation and continuation glyphs on GUI
4459 frames. If some spare pixels are left on the line after inserting
4460 the truncation glyphs, fill that space with a stretch glyph of a
4461 suitably computed width.
4462
4463 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4464 produce_glyphs, to support GUI sessions.
4465
4466 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4467
4468 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4469
4470 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4471
4472 Do not require float-time's arg to fit in time_t (Bug#11825).
4473 This works better on hosts where time_t is unsigned, and where
4474 float-time is applied to the (negative) difference between two times.
4475 * editfns.c (decode_time_components): Last arg is now double *,
4476 not int *, and means to store all the result as a double, without
4477 worrying about whether the seconds part fits in time_t.
4478 All callers changed.
4479 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4480 All callers changed.
4481 (Ffloat_time): Do not fail merely because the specified time falls
4482 outside of time_t range.
4483
4484 2012-07-07 Glenn Morris <rgm@gnu.org>
4485
4486 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4487 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4488 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4489
4490 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4491
4492 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4493 Update dependencies.
4494
4495 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4496
4497 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4498
4499 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4500 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4501 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4502 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4503 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4504 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4505
4506 * xfont.c (compare_font_names): Redo to omit the need for casts.
4507
4508 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4509
4510 * xfns.c (Fx_change_window_property): Doc fix.
4511 * w32fns.c (Fx_change_window_property): Doc fix.
4512
4513 * w32fns.c (Fx_window_property): Accept the same arguments as the
4514 X Windows version. Doc fix.
4515 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4516
4517 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4518 Eli Zaretskii <eliz@gnu.org>
4519
4520 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4521 Windows-specific code from nt/config.nt moved here.
4522 Obsolete settings removed.
4523
4524 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4525
4526 * process.c: Avoid unnecessary calls to gettime.
4527 (wait_reading_process_output): Don't get the time of day
4528 when gobbling data immediately and not waiting, as there's no need
4529 for it in that case. This removes a FIXME.
4530
4531 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4532
4533 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4534 is defined (Bug#11768).
4535
4536 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4537
4538 Fix marker debugging code.
4539 * marker.c (byte_char_debug_check): Do not perform the check
4540 if buffer is not multibyte.
4541 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4542 Call byte_char_debug_check with correct arguments.
4543
4544 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4545
4546 Compile marker debugging code only if ENABLE_CHECKING is defined.
4547 * marker.c (byte_char_debug_check, count_markers):
4548 Use only if ENABLE_CHECKING is defined.
4549 (byte_debug_flag): Remove.
4550 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4551 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4552
4553 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4554
4555 Avoid code repetition in marker-related functions.
4556 * marker.c (attach_marker): New function.
4557 (Fset_marker, set_marker_restricted, set_marker_both)
4558 (set_marker_restricted_both): Use it.
4559 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4560 Consistently rename charno to charpos.
4561 (marker_position): Add eassert.
4562 (marker_byte_position): Convert to eassert.
4563
4564 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4565
4566 Simplify list operations in unchain_overlay and unchain_marker.
4567 * buffer.c (unchain_overlay): Simplify. Add comment.
4568 * marker.c (unchain_marker): Simplify. Fix comments.
4569
4570 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4571
4572 Introduce fast path for the widely used marker operation.
4573 * alloc.c (build_marker): New function.
4574 * lisp.h (build_marker): New prototype.
4575 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4576 * composite.c (autocmp_chars): Likewise.
4577 * editfns.c (buildmark): Remove.
4578 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4579 (save_restriction_save): Use build_marker.
4580 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4581 * window.c (save_window_save): Likewise.
4582
4583 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4584
4585 Do not use Fdelete_overlay in delete_all_overlays
4586 to avoid redundant calls to unchain_overlay.
4587 * buffer.c (drop_overlay): New function.
4588 (delete_all_overlays, Fdelete_overlay): Use it.
4589 * minibuf.c (get_minibuffer): Fix comment.
4590
4591 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4592
4593 Port to OpenBSD 5.1 amd64.
4594 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4595 This is needed for OpenBSD, and should be harmless on all BSD systems.
4596 Also, include <sys/sysctl.h>, as it should be available on all
4597 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4598 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4599 use p_pid member, not kp_proc.pid.
4600
4601 2012-07-06 Glenn Morris <rgm@gnu.org>
4602
4603 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4604
4605 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4606
4607 More xmalloc and related cleanup.
4608 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4609 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4610 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4611 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4612 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4613 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4614 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4615 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4616 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4617 * xterm.c:
4618 Omit needless casts involving void * pointers and allocation.
4619 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4620 as the former is more robust if P's type is changed.
4621 Prefer xzalloc to xmalloc + memset 0.
4622 Simplify malloc-or-realloc to realloc.
4623 Don't worry about xmalloc returning a null pointer.
4624 Prefer xstrdup to xmalloc + strcpy.
4625 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4626 growing it.
4627 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4628 alloca of a constant.
4629
4630 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4631
4632 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4633 hscroll is larger than the line width. Fixes long and futile
4634 looping inside extend_face_to_end_of_line (on a TTY) producing
4635 glyphs that are not needed and thrown away.
4636
4637 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4638
4639 * marker.c (set_marker_restricted_both): Simplify by using
4640 clip_to_bounds.
4641
4642 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4643
4644 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4645
4646 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4647
4648 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4649 not defined (Bug#11768).
4650 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4651 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4652 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4653 followed by gtk_box_set_homogeneous (Bug#11768).
4654 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4655 (update_theme_scrollbar_width, xg_create_scroll_bar):
4656 Use gtk_scrollbar_new (Bug#11768).
4657 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4658 (is_box_type): New function (Bug#11768).
4659 (xg_tool_item_stale_p): Call is_box_type.
4660 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4661 with default display (Bug#11768).
4662
4663 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4664
4665 * xdisp.c (window_hscroll_limited): New function.
4666 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4667 coordinates when window's hscroll is set to insanely large
4668 values. (Bug#11857)
4669
4670 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4671
4672 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4673 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4674
4675 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4676
4677 Cleanup xmalloc.
4678 * lisp.h (xzalloc): New prototype. Omit needless casts.
4679 * alloc.c (xzalloc): New function. Omit needless casts.
4680 * charset.c: Omit needless casts. Convert all calls to
4681 xmalloc with following memset to xzalloc.
4682 * dispnew.c: Likewise.
4683 * fringe.c: Likewise.
4684 * image.c: Likewise.
4685 * sound.c: Likewise.
4686 * term.c: Likewise.
4687 * w32fns.c: Likewise.
4688 * w32font.c: Likewise.
4689 * w32term.c: Likewise.
4690 * xfaces.c: Likewise.
4691 * xfns.c: Likewise.
4692 * xterm.c: Likewise.
4693 * atimer.c: Omit needless casts.
4694 * buffer.c: Likewise.
4695 * callproc.c: Likewise.
4696 * ccl.c: Likewise.
4697 * coding.c: Likewise.
4698 * composite.c: Likewise.
4699 * doc.c: Likewise.
4700 * doprnt.c: Likewise.
4701 * editfns.c: Likewise.
4702 * emacs.c: Likewise.
4703 * eval.c: Likewise.
4704 * filelock.c: Likewise.
4705 * fns.c: Likewise.
4706 * gtkutil.c: Likewise.
4707 * keyboard.c: Likewise.
4708 * lisp.h: Likewise.
4709 * lread.c: Likewise.
4710 * minibuf.c: Likewise.
4711 * msdos.c: Likewise.
4712 * print.c: Likewise.
4713 * process.c: Likewise.
4714 * region-cache.c: Likewise.
4715 * search.c: Likewise.
4716 * sysdep.c: Likewise.
4717 * termcap.c: Likewise.
4718 * terminal.c: Likewise.
4719 * tparam.c: Likewise.
4720 * w16select.c: Likewise.
4721 * w32.c: Likewise.
4722 * w32reg.c: Likewise.
4723 * w32select.c: Likewise.
4724 * w32uniscribe.c: Likewise.
4725 * widget.c: Likewise.
4726 * xdisp.c: Likewise.
4727 * xmenu.c: Likewise.
4728 * xrdb.c: Likewise.
4729 * xselect.c: Likewise.
4730
4731 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4732
4733 * fileio.c (time_error_value): Check the right error number.
4734 Problem reported by Troels Nielsen in
4735 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4736
4737 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4738
4739 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4740 This should be fixed in a better way; see Eli Zaretskii in
4741 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4742 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4743
4744 * fileio.c (time_error_value): Rename from special_mtime.
4745 The old name's problems were noted by Eli Zaretskii in
4746 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4747
4748 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4749 This variable's comment says Emacs needs at least one GDB-visible
4750 symbol of type enum pvec_type, to work around GDB problems.
4751 The symbol's value doesn't matter.
4752
4753 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4754 that causes compilation to fail on pre-C99 compilers.
4755
4756 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4757
4758 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4759 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4760
4761 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4762
4763 * buffer.c (init_buffer_once): Fix initialization of
4764 headers for buffer_defaults and buffer_local_symbols.
4765 Reported by Juanma Barranquero <lekktu@gmail.com>.
4766
4767 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4768
4769 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4770 * lisp.h (enum pvec_type): Use fewer bits.
4771 (PSEUDOVECTOR_SIZE_BITS): New constant.
4772 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4773 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4774 change in pvec_type.
4775 (PSEUDOVECTOR_TYPEP): New macro.
4776 (TYPED_PSEUDOVECTORP): Use it.
4777 * fns.c (internal_equal): Adapt code to extract pvectype.
4778 * emacs.c (gdb_pvec_type): Update type.
4779 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4780 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4781 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4782 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4783 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4784 abusing vector->header.next.nbytes.
4785 (live_vector_p): Use PVEC_TYPE.
4786 (mark_object): Adapt code to extract pvectype. Use switch.
4787
4788 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4789
4790 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4791 Tighten new eassert a bit.
4792
4793 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4794
4795 Fix compilation with --enable-gcc-warnings and -O1
4796 optimization level.
4797 * doprnt.c (doprnt): Change type of tem to int, initialize
4798 to avoid compiler warning. Add eassert.
4799 * search.c (simple_search): Initialize match_byte to avoid
4800 compiler warning. Add eassert.
4801
4802 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4803
4804 Avoid weird behavior with large horizontal scrolls.
4805 Without this change, for example, large hscroll values would
4806 mess up Emacs's display on Fedora 15 x86, presumably due to
4807 overflows in int calculations in the display code.
4808 Also, if buffers had long lines, Emacs would freeze.
4809 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4810 (set_window_hscroll): New function, containing the old guts of
4811 Fset_window_hscroll. Return the clipped value.
4812 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4813 This avoids the need to check against PTRDIFF_MAX.
4814
4815 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4816
4817 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4818
4819 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4820
4821 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4822
4823 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4824 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4825 since GCC 4.4.6 issues a bogus warning for them.
4826
4827 Fix bugs in file timestamp newness comparisons.
4828 * fileio.c (Ffile_newer_than_file_p):
4829 * lread.c (Fload): Use full timestamp resolution of files,
4830 not just the 1-second resolution, so that files that are only
4831 slightly newer still count as newer.
4832 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4833 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4834
4835 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4836
4837 * fileio.c: Improve handling of file time marker. (Bug#11852)
4838 (special_mtime): New function.
4839 (Finsert_file_contents, Fverify_visited_file_modtime):
4840 Use it to set special mtime values consistently.
4841
4842 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4843
4844 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4845 marker for non-existing file. (Bug#11852)
4846
4847 2012-07-03 Glenn Morris <rgm@gnu.org>
4848
4849 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4850 and did not make it into globals.h).
4851
4852 2012-07-03 Tom Tromey <tromey@redhat.com>
4853
4854 * window.c (Fset_window_margins, Fset_window_fringes)
4855 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4856 * textprop.c (Fprevious_property_change): No longer static.
4857 * syntax.c (Fsyntax_table_p): No longer static.
4858 * process.c (Fget_process, Fprocess_datagram_address): No longer
4859 static.
4860 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4861 * keyboard.c (Fcommand_execute): No longer static.
4862 Remove EXFUN.
4863 * insdel.c (Fcombine_after_change_execute): No longer static.
4864 * image.c (Finit_image_library): No longer static.
4865 * fileio.c (Fmake_symbolic_link): No longer static.
4866 * eval.c (Ffetch_bytecode): No longer static.
4867 * editfns.c (Fuser_full_name): No longer static.
4868 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4869 No longer static.
4870 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4871 static.
4872 * dired.c (Ffile_attributes): No longer static.
4873 * composite.c (Fcomposition_get_gstring): No longer static.
4874 * callproc.c (Fgetenv_internal): No longer static.
4875
4876 * ccl.h: Remove EXFUNs.
4877 * buffer.h: Remove EXFUNs.
4878 * dispextern.h: Remove EXFUNs.
4879 * intervals.h: Remove EXFUNs.
4880 * fontset.h: Remove EXFUN.
4881 * font.h: Remove EXFUNs.
4882 * dosfns.c (system_process_attributes): Remove EXFUN.
4883 * keymap.h: Remove EXFUNs.
4884 * lisp.h: Remove EXFUNs.
4885 * w32term.h: Remove EXFUNs.
4886 * window.h: Remove EXFUNs.
4887 * xsettings.h: Remove EXFUN.
4888 * xterm.h: Remove EXFUN.
4889
4890 2012-07-03 Glenn Morris <rgm@gnu.org>
4891
4892 * lisp.h (Frandom): Make it visible to C.
4893 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4894 buffer for invisible buffers. (Bug#1229)
4895
4896 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4897
4898 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4899 values which aren't power of 2.
4900 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4901 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4902 accordingly.
4903
4904 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4905
4906 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4907
4908 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4909
4910 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4911
4912 * alloc.c (allocate_vector_block): Remove redundant
4913 calls to mallopt if DOUG_LEA_MALLOC is defined.
4914 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4915 avoid calls to mallopt if zero_vector is returned.
4916
4917 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4918
4919 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4920 is enabled, avoid dereferencing NULL current_sblock if
4921 running undumped.
4922
4923 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4924
4925 Cleanup basic buffer management.
4926 * buffer.h (struct buffer): Change layout to use generic vector
4927 marking code. Fix some comments. Change type of 'clip_changed'
4928 to bitfield. Remove unused #ifndef old.
4929 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4930 (GET_OVERLAYS_AT): Fix indentation.
4931 (for_each_per_buffer_object_at): New macro.
4932 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4933 (Fbuffer_local_variables): Use it.
4934 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4935 * alloc.c (allocate_buffer): Adjust to match new layout of
4936 struct buffer. Fix comment.
4937 (mark_overlay): New function.
4938 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4939 Lisp area of struct buffer.
4940 (mark_object): Use it. Adjust marking of misc objects
4941 and related comments.
4942
4943 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4946 wrapper that is not needed because the wrapped code is a no-op (zero
4947 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4948 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4949
4950 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4951
4952 * alloc.c (mark_buffer): Simplify. Remove prototype.
4953 (mark_object): Add comment. Reorganize marking of vector-like
4954 objects. Use CHECK_LIVE for all vector-like objects except buffers
4955 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4956 Avoid redundant calls to mark_vectorlike for bool vectors.
4957
4958 2012-06-30 Glenn Morris <rgm@gnu.org>
4959
4960 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4961
4962 * epaths.in (PATH_SITELOADSEARCH): New.
4963 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4964 This is rather than relying on --enable-locallisppath elements
4965 having "site-lisp" in their names. (Bug#10208#25, 11658)
4966
4967 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4968
4969 * w32proc.c (sys_select): Accept and ignore one more argument.
4970
4971 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4972
4973 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4974 (pselect) [!MS_DOS]: Redirect to sys_select.
4975
4976 * sysdep.c: Don't include dos.h and dosfns.h.
4977
4978 * process.c (sys_select):
4979 * msdos.c (sys_select): Accept one more argument and ignore it.
4980
4981 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4982 adapt data types and code to that.
4983
4984 * dosfns.c:
4985 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4986 which clashes with the gnulib function of the same name.
4987
4988 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4989
4990 * font.c (font_style_to_value, font_style_symbolic)
4991 (font_prop_validate_style): Add type checks for values in
4992 font_style_table.
4993
4994 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4995 argument.
4996 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4997 uses.
4998
4999 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5000
5001 * xdisp.c (try_window_id): Undo last change.
5002
5003 * w32.c (getwd): Adjust commentary about startup_dir.
5004 (init_environment): Always call sys_access, even in non-MSVC
5005 builds. Don't chdir to the directory of the Emacs executable.
5006 This undoes code from 1997 which was justified by the need to
5007 "avoid conflicts when removing and renaming directories". But its
5008 downside was that every relative file name was being interpreted
5009 relative to the directory of the Emacs executable, which can never
5010 be TRT. In particular, it broke sys_access when called with
5011 relative file names.
5012 (sys_access): Map GetLastError to errno.
5013
5014 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5015
5016 * window.h (struct window): Change type of 'fringes_outside_margins'
5017 to bitfield. Fix comment. Adjust users accordingly.
5018 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5019 Adjust comment.
5020 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5021 to ptrdiff_t.
5022
5023 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5024
5025 * gnutls.c (emacs_gnutls_handshake):
5026 Add QUIT to make the loop interruptible.
5027
5028 2012-06-29 Glenn Morris <rgm@gnu.org>
5029
5030 * charset.c (init_charset): Make lack of etc/charsets fatal.
5031
5032 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5033
5034 * editfns.c (region_limit): Fix type mismatch.
5035
5036 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5037
5038 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5039 undefined. Convert from xassert to eassert.
5040 * nsmenu.m: Convert from xassert to eassert.
5041 * nsterm.m: Likewise.
5042
5043 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5044
5045 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5046
5047 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5048
5049 Avoid integer overflow on scroll-left and scroll-right.
5050 * window.c (HSCROLL_MAX): New macro.
5051 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5052 overflow when requested scroll falls outside ptrdiff_t range.
5053
5054 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5055
5056 * window.h (struct window): Change type of 'hscroll',
5057 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5058 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5059 Adjust users accordingly.
5060 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5061 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5062 from EMACS_INT to ptrdiff_t.
5063 (make_window): Omit redundant initialization.
5064
5065 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5066
5067 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5068
5069 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5070
5071 * window.h (struct window): Change type of 'use_time' and
5072 'sequence_number' from Lisp_Object to int.
5073 * frame.c (make_frame): Adjust users accordingly.
5074 * print.c (print_object): Likewise.
5075 * window.c (select_window, Fwindow_use_time, make_parent_window)
5076 (make_window): Likewise.
5077
5078 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5079
5080 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5081 enabled with --enable-checking=[all,glyphs] configure option.
5082 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5083 adjust comments accordingly.
5084 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5085 undefined, adjust comments accordingly.
5086 * image.c: Likewise.
5087 * scroll.c: Likewise.
5088 * w32fns.c: Likewise.
5089 * w32term.c: Likewise.
5090 * xdisp.c: Likewise.
5091 * xfaces.c: Likewise.
5092 * xfns.c: Likewise.
5093 * xterm.c: Likewise.
5094
5095 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5096
5097 Generalize run-time debugging checks.
5098 * dispextern.h (XASSERTS): Remove.
5099 * fontset.c (xassert): Remove.
5100 Convert from xassert to eassert.
5101 * alloc.c: Convert from xassert to eassert.
5102 * bidi.c: Likewise.
5103 * dispnew.c: Likewise.
5104 * fns.c: Likewise.
5105 * fringe.c: Likewise.
5106 * ftfont.c: Likewise.
5107 * gtkutil.c: Likewise.
5108 * image.c: Likewise.
5109 * keyboard.c: Likewise.
5110 * menu.c: Likewise.
5111 * process.c: Likewise.
5112 * scroll.c: Likewise.
5113 * sound.c: Likewise.
5114 * term.c: Likewise.
5115 * w32console.c: Likewise.
5116 * w32fns.c: Likewise.
5117 * w32term.c: Likewise.
5118 * window.c: Likewise.
5119 * xdisp.c: Likewise.
5120 * xfaces.c: Likewise.
5121 * xfns.c: Likewise.
5122 * xselect.c: Likewise.
5123 * xterm.c: Likewise.
5124
5125 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5126
5127 * fns.c (maybe_resize_hash_table): Output message when growing the
5128 purify-hashtable.
5129
5130 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5131
5132 * alloc.c (allocate_string_data): Remove dead code.
5133 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5134 avoid GCC warning about unused macro.
5135
5136 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5137
5138 * alloc.c (allocate_string): Omit intervals initialization.
5139 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5140 as in make_pure_string and make_pure_c_string.
5141
5142 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5143
5144 * alloc.c (allocate_string): Fix last change.
5145
5146 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5147
5148 * alloc.c (allocate_string): Remove two redundant calls
5149 to memset, add explicit initialization where appropriate.
5150
5151 2012-06-27 Glenn Morris <rgm@gnu.org>
5152
5153 * lisp.mk (lisp): Remove paths.elc.
5154
5155 2012-06-27 Chong Yidong <cyd@gnu.org>
5156
5157 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5158
5159 2012-06-26 John Wiegley <johnw@newartisans.com>
5160
5161 * unexmacosx.c (copy_data_segment): Add two section names used
5162 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5163
5164 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5165 when building with Clang.
5166
5167 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5168
5169 * eval.c (Fapply): Allow calling it with a single argument.
5170
5171 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5172
5173 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5174 _stricmp and _strnicmp.
5175 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5176
5177 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5178
5179 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5180 allocated window.
5181 (allocate_process): Likewise for new process.
5182 (allocate_terminal): Change to use offsetof.
5183 (allocate_frame): Likewise.
5184 * frame.c (make_frame): Omit redundant initialization.
5185 * window.c (make_parent_window): Use memset.
5186 (make_window): Omit redundant initialization.
5187 * process.c (make_process): Omit redundant initialization.
5188 * terminal.c (create_terminal): Likewise.
5189
5190 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5191
5192 * term.c (delete_tty): Remove redundant call to memset.
5193
5194 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5195
5196 * alloc.c: Remove build_string.
5197 * lisp.h: Define build_string as static inline. This provides
5198 a better opportunity to optimize away calls to strlen when the
5199 function is called with compile-time constant argument.
5200 * image.c (imagemagick_error): Convert to build_string.
5201 * w32proc.c (sys_spawnve): Likewise.
5202 * xterm.c (x_term_init): Likewise.
5203
5204 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5205
5206 Use sprintf return value instead of invoking strlen on result.
5207 In the old days this wasn't portable, since some sprintf
5208 implementations returned char *. But they died out years ago and
5209 Emacs already assumes sprintf returns int.
5210 Similarly for float_to_string.
5211 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5212 * ccl.c (ccl_driver):
5213 * character.c (string_escape_byte8):
5214 * data.c (Fnumber_to_string):
5215 * doprnt.c (doprnt):
5216 * print.c (print_object):
5217 * xdisp.c (message_dolog):
5218 * xfns.c (syms_of_xfns):
5219 Use sprintf or float_to_string result to avoid need to call strlen.
5220 * data.c (Fnumber_to_string):
5221 Use make_unibyte_string, since the string must be ASCII.
5222 * lisp.h, print.c (float_to_string): Now returns int length.
5223 * term.c (produce_glyphless_glyph):
5224 Use sprintf result rather than recomputing it.
5225
5226 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5227 * Makefile.in (ALL_CFLAGS):
5228 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5229 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5230
5231 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5232
5233 * dispextern.h (xstrcasecmp): Define to library function
5234 strcasecmp if available.
5235 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5236
5237 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5238
5239 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5240 Avoid comma operator.
5241 * menu.c (push_submenu_start, push_submenu_end)
5242 (push_left_right_boundary, push_menu_pane): Likewise.
5243 * msdos.c (dos_rawgetc): Likewise.
5244
5245 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5246
5247 * xfns.c (xic_create_fontsetname): Remove redundant calls
5248 to memset.
5249
5250 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5251
5252 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5253 sprintf already null-terminates its output.
5254
5255 * xfns.c (x_window): Remove redundant cast.
5256
5257 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5258
5259 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5260 `const char *' to `char *' to avoid compiler warning.
5261
5262 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5263
5264 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5265 instead of truncating it to 63 (admittedly a generous limit).
5266
5267 * process.c: Fix spelling and caps in comments.
5268
5269 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5270
5271 * emacs.c (setpgrp): Remove definition, unused.
5272 * sysdep.c (setpgrp): Remove definition, not used in this file.
5273
5274 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5275
5276 * makefile.w32-in: Update dependencies.
5277
5278 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5279
5280 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5281 (SYSTIME_H): Add nt/inc/sys/time.h.
5282
5283 * systime.h [WINDOWSNT]: Include sys/time.h.
5284
5285 * s/ms-w32.h (struct timespec): Definition moved from
5286 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5287
5288 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5289
5290 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5291 * buffer.h (buffer_slot_type_mismatch):
5292 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5293 * eval.c (unwind_to_catch):
5294 * image.c (my_png_error, my_error_exit):
5295 * keyboard.c (quit_throw_to_read_char, user_error)
5296 (Fexit_recursive_edit, Fabort_recursive_edit):
5297 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5298 (wrong_type_argument, buffer_overflow, __executable_start)
5299 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5300 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5301 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5302 (fatal):
5303 (child_setup) [!DOS_NT]:
5304 * lread.c (end_of_file_error, invalid_syntax):
5305 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5306 * puresize.h (pure_write_error):
5307 * search.c (matcher_overflow):
5308 * sound.c (sound_perror, alsa_sound_perror):
5309 * sysdep.c, syssignal.h (croak):
5310 * term.c (maybe_fatal, vfatal):
5311 * textprop.c (text_read_only):
5312 * undo.c (user_error):
5313 * unexmacosx.c (unexec_error):
5314 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5315 Use _Noreturn rather than NO_RETURN.
5316 No need for separate decl merely because of _Noreturn.
5317 * sound.c (sound_warning, parse_sound):
5318 Remove unnecessary forward decls.
5319
5320 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5321
5322 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5323 * lisp.h (WAIT_READING_MAX): New macro.
5324 * dispnew.c (Fsleep_for, sit_for):
5325 * keyboard.c (kbd_buffer_get_event):
5326 * process.c (Faccept_process_output):
5327 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5328 This improves on the previous patch, which introduced a bug
5329 when time_t is unsigned and as wide as intmax_t.
5330 See <http://bugs.gnu.org/9000#51>.
5331
5332 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5333
5334 * dispnew.c (sit_for, Fsleep_for):
5335 * keyboard.c (kbd_buffer_get_event):
5336 * process.c (Faccept_process_output): Avoid compiler warnings when
5337 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5338
5339 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5340
5341 * makefile.w32-in: Update dependencies.
5342
5343 * w32.c (ltime): Add return type and declare static.
5344 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5345
5346 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5347
5348 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5349 Privately reported by Herbert J. Skuhra.
5350 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5351 All uses changed.
5352 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5353 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5354
5355 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5356
5357 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5358 last argument of make_unibyte_string.
5359
5360 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5361 language ID in the event parameters.
5362
5363 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5364 event.code, not the obscure "character set ID".
5365
5366 2012-06-23 Chong Yidong <cyd@gnu.org>
5367
5368 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5369
5370 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5371
5372 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5373 * w32.c (fdutimens): New function.
5374
5375 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5376
5377 * s/ms-w32.h (pselect): Redirect to sys_select.
5378
5379 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5380
5381 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5382 in the logic of incrementing and decrementing the value of
5383 use_relocatable_buffers.
5384
5385 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5386
5387 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5388 Privately reported by Herbert J. Skuhra.
5389 [__FreeBSD__]: Remove "*/" typo after "#include".
5390 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5391 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5392 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5393 Don't assume EMACS_TIME and struct timeval are the same type.
5394
5395 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5396
5397 Support higher-resolution time stamps (Bug#9000).
5398 The time stamps are only nanosecond-resolution at the C level,
5399 since that's the best that any real-world system supports now.
5400 But they are picosecond-resolution at the Lisp level, as that's
5401 easy, and leaves room for future OS improvements.
5402
5403 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5404 (LIBES): Use it.
5405
5406 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5407 Don't get current time unless it's needed.
5408
5409 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5410 now provides it if it's absent.
5411 (start_atimer): Port to higher-res time stamps.
5412 Check for time stamp overflow. Don't get current time more
5413 often than is needed.
5414
5415 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5416 Include systime.h, not time.h.
5417 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5418
5419 * dired.c: Include stat-time.h.
5420 (Ffile-attributes): File times now have higher resolution.
5421
5422 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5423 (struct image): Timestamp now has higher resolution.
5424
5425 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5426 has at least microseconds now. All uses removed.
5427 (update_frame, update_single_window, update_window, update_frame_1)
5428 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5429 (duration_to_sec_usec): Remove; no longer needed.
5430
5431 * editfns.c (time_overflow): Now extern.
5432 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5433 (float-time, Fformat_time_string, Fcurrent_time_string)
5434 (Fcurrent_time_zone): Accept and generate higher-resolution
5435 time stamps.
5436 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5437 (decode_time_components, lisp_seconds_argument): New functions.
5438 (make_time): Now static.
5439 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5440 Report an error if the time is invalid, rather than having the caller
5441 do that.
5442
5443 * fileio.c: Include <stat-time.h>
5444 (Fcopy_file): Copy higher-resolution time stamps.
5445 Prefer to set the time stamp via a file descriptor if that works.
5446 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5447 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5448 (Fvisited_file_modtime, Fset_visited_file_modtime):
5449 Support higher-resolution time stamps.
5450
5451 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5452
5453 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5454
5455 * image.c (prepare_image_for_display, clear_image_cache)
5456 (lookup_image): Port to higer-resolution time stamps.
5457
5458 * keyboard.c (start_polling, bind_polling_period):
5459 Check for time stamp overflow.
5460 (read_char, kbd_buffer_get_event, timer_start_idle)
5461 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5462 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5463 Port to higher-resolution time stamps. Do not assume time_t is signed.
5464 (decode_timer): New function. Timers are now vectors of length 9,
5465 not 8, to accommodate the picosecond component.
5466 (timer_check_2): Use it.
5467
5468 * nsterm.m (select_timeout, timeval_subtract): Remove.
5469 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5470 as they're a bit more accurate and handle overflow better.
5471 (ns_select): Change prototype to be compatible with pselect.
5472 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5473 * nsterm.h (ns_select): Adjust prototype.
5474
5475 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5476 us-resolution time stamps.
5477 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5478
5479 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5480
5481 * lisp.h (time_overflow): New decl.
5482 (wait_reading_process_output): First arg is now intmax_t, not int,
5483 to accommodate larger waits.
5484
5485 * process.h (struct Lisp_Process.read_output_delay):
5486 Now counts nanoseconds, not microseconds.
5487 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5488 EMACS_HAS_USECS.
5489 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5490 (wait_reading_process_output):
5491 Port to ns-resolution time stamps.
5492 (Faccept_process_output, wait_reading_process_output):
5493 Check for time stamp overflow. Do not assume time_t is signed.
5494 (select_wrapper): Remove; we now use pselect.
5495 (Fprocess_attributes): Now generates ns-resolution time stamps.
5496
5497 * sysdep.c: Include utimens.h. Don't include utime.h
5498 or worry about struct utimbuf; gnulib does that for us now.
5499 (gettimeofday): Remove; gnulib provides a substitute.
5500 (make_timeval): New function.
5501 (set_file_times): Now sets ns-resolution time stamps.
5502 New arg FD; all uses changed.
5503 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5504 (system_process_attributes):
5505 Now returns ns-resolution time stamp. All uses changed.
5506 Check for time stamp overflow.
5507
5508 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5509 provides a substitute now.
5510
5511 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5512 since it guarantees struct timespec.
5513 (EMACS_TIME): Now struct timespec, so that we can support
5514 ns-resolution time stamps.
5515 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5516 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5517 (EMACS_USECS): Remove.
5518 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5519 so multiply the arg by 1000 before storing it.
5520 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5521 New macros.
5522 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5523 Port to ns-resolution time stamps.
5524 (EMACS_TIME_NEG_P): Remove; replaced by....
5525 (EMACS_TIME_SIGN): New macro.
5526 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5527 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5528 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5529 (make_timeval, make_lisp_time, decode_time_components): New decls.
5530 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5531 that it mishandled time_t overflow. You can't compare by subtracting!
5532 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5533 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5534
5535 * term.c: Include <sys/time.h>.
5536 (timeval_to_Time): New function, for proper overflow wraparound.
5537 (term_mouse_position, term_mouse_click): Use it.
5538
5539 * undo.c (record_first_change): Support higher-resolution time stamps
5540 in the undo buffer.
5541 (Fprimitive_undo): Use them when restoring time stamps.
5542
5543 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5544 (w32_get_internal_run_time):
5545 Port to higher-resolution Emacs time stamps.
5546 (ltime): Now accepts single 64-bit integer, as that's more convenient
5547 for callers.
5548
5549 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5550
5551 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5552 for compatibility with pselect. Support ns-resolution time stamps.
5553
5554 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5555
5556 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5557 Check for time stamp overflow, and support ns-resolution time stamps.
5558
5559 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5560 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5561 (timeval_subtract): Remove; no longer needed.
5562 (XTflash, XTring_bell, x_wait_for_event):
5563 Port to ns-resolution time stamps. Don't assume time_t is signed.
5564
5565 2012-06-22 Chong Yidong <cyd@gnu.org>
5566
5567 * xdisp.c (x_consider_frame_title): Revert last change.
5568
5569 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5570
5571 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5572 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5573 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5574 staticidx goes up to 1597 out of 1600 = 0x640.)
5575
5576 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5577
5578 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5579 Otherwise, the umask might be mistakenly 0 while handling input signals.
5580
5581 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5582
5583 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5584
5585 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5586
5587 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5588 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5589 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5590 access to `contents' member of Lisp_Vector objects with AREF and ASET
5591 where appropriate.
5592
5593 2012-06-19 Chong Yidong <cyd@gnu.org>
5594
5595 * frame.c (delete_frame): When selecting a frame on a different
5596 text terminal, do not alter the terminal's top-frame.
5597
5598 * xdisp.c (format_mode_line_unwind_data): Record the target
5599 frame's selected window and its terminal's top-frame.
5600 (unwind_format_mode_line): Restore them.
5601 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5602 Callers changed.
5603 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5604 since tty frames can be explicitly named.
5605 (prepare_menu_bars): Likewise.
5606
5607 * term.c (Ftty_top_frame): New function.
5608
5609 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5610
5611 Port byte-code-meter to modern targets.
5612 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5613 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5614 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5615 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5616 (METER_1, METER_2): Simplify.
5617
5618 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5619
5620 * data.c (Fdefalias): Return `symbol' (bug#11686).
5621
5622 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5623
5624 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5625 gets killed during executing of this function (Bug#11665).
5626 Try to always return Qt when the buffer has been actually killed.
5627 (Vkill_buffer_query_functions): In doc-string say that functions
5628 run by this hook should not change the current buffer.
5629
5630 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5631
5632 Fix recently-introduced process.c problems found by static checking.
5633 * process.c (write_queue_push, write_queue_pop, send_process):
5634 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5635 (write_queue_pop): Fix pointer signedness problem.
5636 (send_process): Remove unused local.
5637
5638 2012-06-17 Chong Yidong <cyd@gnu.org>
5639
5640 * xdisp.c (redisplay_internal): No need to redisplay terminal
5641 frames that are not on top.
5642
5643 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5644
5645 * process.c (make_process): Initialize write_queue.
5646 (write_queue_push, write_queue_pop): New functions.
5647 (send_process): Use them to maintain correct ordering of process
5648 writes (Bug#10815).
5649
5650 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5651
5652 * lisp.h (eassert): Assume C89 or later.
5653 This removes the need for CHECK.
5654 (CHECK): Remove. Its comments about always evaluating its
5655 argument were confusing, as 'eassert' typically does not evaluate
5656 its argument.
5657
5658 * coding.c (produce_chars): Use ptrdiff_t, not int.
5659
5660 * xterm.c (x_draw_underwave): Check for integer overflow.
5661 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5662
5663 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5664
5665 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5666 referenced (Bug#11583).
5667
5668 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5669
5670 Implement wave-style variant of underlining.
5671 * dispextern.h (face_underline_type): New enum.
5672 (face): Add field for underline type.
5673 * nsterm.m (ns_draw_underwave): New function.
5674 (ns_draw_text_decoration): Use it.
5675 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5676 New functions.
5677 (x_draw_glyph_string): Use them.
5678 * xfaces.c (Qline, Qwave): New Lisp objects.
5679 (check_lface_attrs, merge_face_ref)
5680 (Finternal_set_lisp_face_attribute, realize_x_face):
5681 Handle wave-style underline face attributes.
5682 * xterm.c (x_draw_underwave): New function.
5683 (x_draw_glyph_string): Use it.
5684
5685 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5686
5687 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5688 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5689 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5690 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5691 ($(BLD)/w32select.$(O)): Update dependencies.
5692
5693 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5694
5695 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5696 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5697 * character.c (_fetch_multibyte_char_p): Remove.
5698 * alloc.c: Include "character.h" before "buffer.h".
5699 * bidi.c: Likewise.
5700 * buffer.c: Likewise.
5701 * bytecode.c: Likewise.
5702 * callint.c: Likewise.
5703 * callproc.c: Likewise.
5704 * casefiddle.c: Likewise.
5705 * casetab.c: Likewise.
5706 * category.c: Likewise.
5707 * cmds.c: Likewise.
5708 * coding.c: Likewise.
5709 * composite.c: Likewise.
5710 * dired.c: Likewise.
5711 * dispnew.c: Likewise.
5712 * doc.c: Likewise.
5713 * dosfns.c: Likewise.
5714 * editfns.c: Likewise.
5715 * emacs.c: Likewise.
5716 * fileio.c: Likewise.
5717 * filelock.c: Likewise.
5718 * font.c: Likewise.
5719 * fontset.c: Likewise.
5720 * fringe.c: Likewise.
5721 * indent.c: Likewise.
5722 * insdel.c: Likewise.
5723 * intervals.c: Likewise.
5724 * keyboard.c: Likewise.
5725 * keymap.c: Likewise.
5726 * lread.c: Likewise.
5727 * macros.c: Likewise.
5728 * marker.c: Likewise.
5729 * minibuf.c: Likewise.
5730 * nsfns.m: Likewise.
5731 * nsmenu.m: Likewise.
5732 * print.c: Likewise.
5733 * process.c: Likewise.
5734 * regex.c: Likewise.
5735 * region-cache.c: Likewise.
5736 * search.c: Likewise.
5737 * syntax.c: Likewise.
5738 * term.c: Likewise.
5739 * textprop.c: Likewise.
5740 * undo.c: Likewise.
5741 * unexsol.c: Likewise.
5742 * w16select.c: Likewise.
5743 * w32fns.c: Likewise.
5744 * w32menu.c: Likewise.
5745 * window.c: Likewise.
5746 * xdisp.c: Likewise.
5747 * xfns.c: Likewise.
5748 * xmenu.c: Likewise.
5749 * xml.c: Likewise.
5750 * xselect.c: Likewise.
5751
5752 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5753
5754 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5755 If all the glyphs of the glyph row came from strings, and we have no
5756 cursor positioning clues, put the cursor on the first glyph of the
5757 row.
5758 (handle_face_prop): Use chunk-relative overlay string index when
5759 indexing into it->string_overlays array. (Bug#11653)
5760 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5761 the rightmost. (Bug#11720)
5762
5763 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5764
5765 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5766 (CATEGORY_MEMBER): Enforce 1/0 value.
5767 * category.c (_temp_category_set): Remove.
5768
5769 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5770
5771 * window.c (Fdelete_other_windows_internal)
5772 (Fdelete_window_internal): Don't access frame's mouse highlight
5773 info of the initial frame. (Bug#11677)
5774
5775 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5776
5777 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5778 Assume USE_2_TAGS_FOR_INTS.
5779 (xreload): Adjust $tagmask width to match recent lisp.h change.
5780
5781 Simplify lisp.h in minor ways that should not affect code.
5782 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5783 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5784 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5785 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5786 (INTTYPEBITS): New macro, for clarity.
5787 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5788 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5789 Simplify now that USE_LSB_TAG is always defined.
5790 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5791 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5792
5793 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5794
5795 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5796
5797 2012-06-13 Glenn Morris <rgm@gnu.org>
5798
5799 * s/bsd-common.h (BSD4_3):
5800 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5801
5802 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5803
5804 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5805 instead of union.
5806 (XLI, XIL): Define.
5807 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5808 Use them.
5809 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5810 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5811 * alloc.c (widen_to_Lisp_Object): Remove.
5812 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5813 * frame.c (delete_frame): Remove outdated comment.
5814 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5815 USE_LISP_UNION_TYPE.
5816 (Fw32_unregister_hot_key): Likewise.
5817 (Fw32_toggle_lock_key): Likewise.
5818 * w32menu.c (add_menu_item): Likewise.
5819 (w32_menu_display_help): Use XIL instead of checking
5820 USE_LISP_UNION_TYPE.
5821 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5822 (init_heap): Likewise.
5823 * w32term.c (w32_read_socket): Update comment.
5824
5825 2012-06-13 Glenn Morris <rgm@gnu.org>
5826
5827 * s/usg5-4-common.h, src/s/unixware.h:
5828 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5829
5830 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5831
5832 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5833
5834 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5835 * alloc.c (make_number) [!defined make_number]:
5836 Remove, as lisp.h always defines this now.
5837 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5838 (roundup_size): Verify that it is a power of 2.
5839 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5840 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5841 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5842 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5843 USE_LSB_TAG now is always defined to be either 0 or 1.
5844 All uses changed.
5845 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5846 code works fine either way, and efficiency is not a concern here,
5847 as the union type is for debugging, not for production.
5848 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5849 Use an inline function on all platforms when using the union type,
5850 since this is simpler and 'static inline' can be used portably
5851 within Emacs now.
5852 (LISP_INITIALLY_ZERO): New macro.
5853 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5854 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5855
5856 2012-06-12 Glenn Morris <rgm@gnu.org>
5857
5858 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5859
5860 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5861
5862 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5863 Move BROKEN_SIGIO to configure.
5864
5865 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5866 Move NO_TERMIO to configure.
5867
5868 2012-06-12 Chong Yidong <cyd@gnu.org>
5869
5870 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5871 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5872 MagickExportImagePixels is undefined.
5873
5874 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5875
5876 * image.c (imagemagick_load_image): Remove unused label.
5877
5878 2012-06-11 Glenn Morris <rgm@gnu.org>
5879
5880 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5881 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5882 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5883 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5884
5885 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5886
5887 * alloc.c (make_byte_code): New function.
5888 (Fmake_byte_code): Use it. Don't purify here.
5889 * lread.c (read1): Use it as well to avoid extra allocation.
5890
5891 2012-06-11 Chong Yidong <cyd@gnu.org>
5892
5893 * image.c (imagemagick_load_image): Implement transparency.
5894
5895 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5896
5897 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5898 account for preceding backslashes. (Bug#11663)
5899
5900 2012-06-09 Chong Yidong <cyd@gnu.org>
5901
5902 * term.c: Support italics in capable terminals (Bug#9652).
5903 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5904 (turn_on_face): Output using TS_enter_italic_mode if available.
5905 Don't handle unused blinking and alt-charset cases.
5906 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5907 and tty_alt_charset_p cases.
5908 (tty_capable_p, init_tty): Support italics.
5909
5910 * termchar.h (struct tty_display_info): Add field for italics.
5911 Remove unused blink field.
5912
5913 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5914 Handle slant.
5915
5916 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5917 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5918 tty_alt_charset_p. Add tty_italic_p.
5919
5920 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5921
5922 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5923 dbus_type_is_basic if available.
5924 (xd_extract_signed, xd_extract_unsigned): Rename from
5925 extract_signed and extract_unsigned, respectively. Adapt callers.
5926
5927 2012-06-09 Chong Yidong <cyd@gnu.org>
5928
5929 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5930
5931 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5932 case (Bug#9752).
5933
5934 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5935
5936 * xdisp.c (vmessage): Treat frame message as multibyte.
5937 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5938 would generate the diagnostic "Making \302\247 buffer-local while
5939 let-bound!".
5940
5941 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5942
5943 * dispnew.c (showing_window_margins_p): Undo last change, which
5944 was done due to an inadvertent commit.
5945 (adjust_frame_glyphs_for_frame_redisplay): Do call
5946 showing_window_margins_p.
5947
5948 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5949
5950 * eval.c (Fmake_var_non_special): New primitive.
5951 (syms_of_eval): Defsubr it.
5952 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5953
5954 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5955
5956 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5957 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5958
5959 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5960
5961 * alloc.c (allocate_vectorlike): Fix last change.
5962
5963 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5964
5965 Block-based vector allocation of small vectors.
5966 * lisp.h (struct vectorlike_header): New field `nbytes',
5967 adjust comment accordingly.
5968 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5969 to denote vector blocks. Adjust users (live_vector_p,
5970 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5971 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5972 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5973 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5974 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5975 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5976 (roundup_size): New constant.
5977 (struct vector_block): New data type.
5978 (vector_blocks, vector_free_lists, zero_vector): New variables.
5979 (all_vectors): Rename to `large_vectors'.
5980 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5981 (sweep_vectors): New functions.
5982 (allocate_vectorlike): Return `zero_vector' as the only vector of
5983 0 items. Allocate new vector from block if vector size is less than
5984 or equal to VBLOCK_BYTES_MAX.
5985 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5986 (init_alloc_once): Add call to init_vectors.
5987
5988 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5989
5990 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5991
5992 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5993
5994 * doprnt.c (doprnt): Truncate multibyte char correctly.
5995 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5996 would mishandle a string argument "Xc" if X was a multibyte
5997 character of length 2: it would truncate after X's first byte
5998 rather than including all of X.
5999
6000 2012-06-06 Chong Yidong <cyd@gnu.org>
6001
6002 * buffer.c (word_wrap): Doc fix.
6003
6004 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6005
6006 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6007
6008 2012-06-03 Glenn Morris <rgm@gnu.org>
6009
6010 * xdisp.c (tool-bar-style): Doc fix.
6011
6012 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6013
6014 * Makefile.in (PAXCTL): Define.
6015 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6016 binary via PaX flags if the paxctl utility is available.
6017 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6018 Restore PaX flags to their default. (Bug#11398)
6019
6020 2012-06-03 Chong Yidong <cyd@gnu.org>
6021
6022 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6023 buffer (Bug#11226).
6024
6025 2012-06-03 Chong Yidong <cyd@gnu.org>
6026
6027 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6028 (note_mode_line_or_margin_highlight): If there is no help echo,
6029 use mode-line-default-help-echo. Handle the case where the mouse
6030 position is past the end of the mode line string.
6031
6032 * buffer.c (buffer_local_value_1): New function, split from
6033 Fbuffer_local_value; can return Qunbound.
6034 (Fbuffer_local_value): Use it.
6035 (Vmode_line_format): Docstring tweaks.
6036
6037 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6038
6039 * sysdep.c (system_process_attributes): Improve comment.
6040
6041 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6042
6043 * keyboard.c: Export real-this-command to Elisp.
6044 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6045 and DEFVAR it. Update all users.
6046
6047 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6048
6049 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6050
6051 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6052 Convert pctcpu and pctmem to Lisp float properly.
6053 Let the compiler fold better, as 100.0/0x8000 is exact.
6054
6055 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6056
6057 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6058 cons_block.
6059
6060 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6061
6062 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6063
6064 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6065
6066 For a 'struct window', replace some Lisp_Object fields to
6067 bitfields where appropriate, remove unused fields.
6068 * window.h (struct window): Remove unused 'last_mark_x' and
6069 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6070 change it's type from Lisp_Object to bitfield.
6071 Change type of 'force_start', 'optional_new_start',
6072 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6073 fields from Lisp_Object to bitfield. Adjust users accordingly.
6074
6075 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6076
6077 Pacify gcc -Wdouble-precision when using Xaw.
6078 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6079 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6080 Use 'float' consistently, rather than 'float' in most places
6081 and 'double' in a couple of places.
6082
6083 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6084
6085 * xdisp.c (handle_stop): Detect whether we have overlay strings
6086 loaded by testing it->current.overlay_string_index to be
6087 non-negative, instead of checking whether n_overlay_strings is
6088 positive. (Bug#11587)
6089
6090 2012-05-31 Chong Yidong <cyd@gnu.org>
6091
6092 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6093
6094 * doc.c (Fsubstitute_command_keys): Doc fix.
6095
6096 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6097
6098 * search.c (search_buffer): Remove calls to
6099 r_alloc_inhibit_buffer_relocation, as it is now called by
6100 maybe_unify_char, which was the cause of relocation of buffer text
6101 in bug#11519.
6102
6103 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6104
6105 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6106 for the duration of call to load_charset, to avoid problems with
6107 callers of maybe_unify_char that access buffer text through C
6108 pointers.
6109
6110 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6111 decrement the inhibition flag, instead of just setting or
6112 resetting it.
6113
6114 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6115
6116 Remove obsolete '#define static' cruft.
6117 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6118 This #undef was "temporary" in 2000; it is no longer needed
6119 now that '#define static' has gone away.
6120 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6121 (gray_bitmap_bits): Remove; no longer needed.
6122 All uses replaced with definiens.
6123 * xterm.c: Include "bitmaps/gray.xbm".
6124
6125 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6126
6127 Clean up __executable_start, monstartup when --enable-profiling.
6128 The following changes affect the code only when profiling.
6129 * dispnew.c (__executable_start): Rename from safe_bcopy.
6130 Define only on platforms that need it.
6131 * emacs.c: Include <sys/gmon.h> when profiling.
6132 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6133 (__executable_start): Remove decl, since lisp.h does it now.
6134 (safe_bcopy): Remove decl; no longer has that name.
6135 (main): Coalesce #if into single bit of code, for simplicity.
6136 Cast pointers to uintptr_t, since standard libraries want integers
6137 and not pointers.
6138 * lisp.h (__executable_start): New decl.
6139
6140 2012-05-31 Glenn Morris <rgm@gnu.org>
6141
6142 * image.c (Fimagemagick_types): Doc fix.
6143
6144 2012-05-30 Jim Meyering <meyering@redhat.com>
6145
6146 * callproc.c (Fcall_process_region): Include directory component
6147 in mkstemp error message (Bug#11586).
6148
6149 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6150
6151 * alloc.c, lisp.h (make_pure_vector): Now static.
6152
6153 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6154
6155 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6156 Move to byte-run.el.
6157 (Fautoload): Do the hash-doc more carefully.
6158 * data.c (Fdefalias): Purify definition, except for keymaps.
6159 (Qdefun): Move from eval.c.
6160 * lisp.h (Qdefun): Remove.
6161 * lread.c (read1): Tiny simplification.
6162
6163 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6164
6165 Do not create empty overlays with the evaporate property (Bug#9642).
6166 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6167 Bug#9642, but explicitly check that the buffer the overlay would
6168 be moved to is live and rearrange lines to make sure that errors
6169 will not put the overlay in an inconsistent state.
6170 (Fdelete_overlay): Cosmetics.
6171
6172 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6173
6174 * w32term.c (my_bring_window_to_top): New function.
6175 (x_raise_frame): Use handle returned by DeferWindowPos, which
6176 could be different from the original one.
6177 Call my_bring_window_to_top instead of my_set_foreground_window.
6178 (Bug#11513)
6179
6180 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6181 by calling BringWindowToTop.
6182
6183 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6184 (WM_EMACS_END): Increase by one.
6185
6186 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6187
6188 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6189 This avoids undefined behavior that might cause the eassert
6190 to not catch an out-of-range value.
6191
6192 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6193
6194 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6195 Update dependencies.
6196
6197 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6198
6199 * bidi.c (bidi_mirror_char): Fix last change.
6200
6201 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6202
6203 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6204 when referring to sectname field in printf format.
6205
6206 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6207
6208 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6209 Only r_alloc_inhibit_buffer_relocation needed to be added;
6210 the others were already declared.
6211
6212 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6213 before checking whether it's out of range. Put the check inside
6214 eassert. See
6215 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6216
6217 2012-05-27 Ken Brown <kbrown@cornell.edu>
6218
6219 * callproc.c (Fcall_process): Restore a line that was accidentally
6220 commented out in the 2011-02-13 change (bug#11547).
6221
6222 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6223
6224 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6225 defined on ralloc.c.
6226
6227 * buffer.c [REL_ALLOC]: Remove prototypes of
6228 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6229 they are now on lisp.h.
6230
6231 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6232
6233 * search.c (search_buffer): Use it to inhibit relocation of buffer
6234 text while re_search_2 is doing its job, because re_search_2 is
6235 passed C pointers to buffer text. (Bug#11519)
6236
6237 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6238 Update value to 24.
6239
6240 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6241 state after an additional call to move_it_in_display_line_to, keep
6242 the values of it->max_ascent and it->max_descent found for the
6243 entire line.
6244 (pos_visible_p): Revert the comparison against bottom_y to what it
6245 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6246 (Bug#11464)
6247
6248 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6249
6250 Fix coding-related core dumps with gcc -ftrapv.
6251 The code was computing A - B, where A and B are pointers, and B is
6252 random garbage. This can lead to core dumps on platforms that
6253 have special pointer registers, and it also leads to core dumps on
6254 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6255 A - B only when B is initialized properly.
6256 * coding.c (coding_set_source, coding_set_destination): Return void.
6257 (coding_change_source, coding_change_destinations): New functions,
6258 with the old behaviors of coding_set_source and coding_set_destination.
6259 All callers that need an offset changed to use these new functions.
6260
6261 2012-05-26 Glenn Morris <rgm@gnu.org>
6262
6263 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6264
6265 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6266
6267 Extend mouse support on W32 text-mode console.
6268 * xdisp.c (draw_row_with_mouse_face):
6269 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6270
6271 * w32console.c: Include window.h.
6272 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6273 New functions.
6274 (initialize_w32_display): Initialize mouse-highlight data.
6275
6276 * w32inevt.c: Include termchar.h and window.h.
6277 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6278 moves, call note_mouse_highlight. If help_echo changed, call
6279 gen_help_event to produce help-echo message in the echo area.
6280 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6281 highlight info.
6282
6283 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6284
6285 * lread.c (read1): Simplify slightly to avoid an overflow warning
6286 with GCC 4.7.0 on x86-64.
6287
6288 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6289
6290 * bidi.c (bidi_mirror_char): Revert last change: an int is
6291 definitely wide enough here.
6292
6293 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6294
6295 Fix integer width and related bugs (Bug#9874).
6296 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6297 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6298 (string_bytes, check_sblock, allocate_string_data):
6299 (compact_small_strings, Fmake_bool_vector, make_string)
6300 (make_unibyte_string, make_multibyte_string)
6301 (make_string_from_bytes, make_specified_string)
6302 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6303 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6304 (mark_vectorlike):
6305 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6306 (allocate_pseudovector):
6307 Use int, not EMACS_INT, where int is wide enough.
6308 (inhibit_garbage_collection, Fgarbage_collect):
6309 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6310 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6311 int might not be wide enough.
6312 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6313 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6314 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6315 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6316 (bidi_level_of_next_char, bidi_move_to_visually_next):
6317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6318 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6319 (Fkill_buffer, Fset_buffer_major_mode)
6320 (advance_to_char_boundary, Fbuffer_swap_text)
6321 (Fset_buffer_multibyte, overlays_at, overlays_in)
6322 (overlay_touches_p, struct sortvec, record_overlay_string)
6323 (overlay_strings, recenter_overlay_lists)
6324 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6325 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6326 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6327 (Foverlay_recenter, last_overlay_modification_hooks_used)
6328 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6329 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6330 (validate_region): Omit unnecessary test for b <= e,
6331 since that's guaranteed by the previous test.
6332 (adjust_overlays_for_delete): Avoid pos + length overflow.
6333 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6334 (report_overlay_modification):
6335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6336 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6337 Omit pointer cast, which isn't needed anyway, and doesn't work
6338 after the EMACS_INT -> ptrdiff_t change.
6339 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6340 * buffer.h: Adjust decls to match defn changes elsewhere.
6341 (struct buffer_text, struct buffer):
6342 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6343 Use EMACS_INT, not int, where int might not be wide enough.
6344 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6345 not int, to avoid needless 32-bit limit on 64-bit hosts.
6346 (exec_byte_code): Use tighter memory-full test, one that checks
6347 for alloca overflow. Don't compute the address of the object just
6348 before an array, as that's not portable. Use EMACS_INT, not
6349 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6350 * callint.c (Fcall_interactively):
6351 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6352 * callproc.c (call_process_kill, Fcall_process):
6353 Don't assume pid_t fits into an Emacs fixnum.
6354 (call_process_cleanup, Fcall_process, child_setup):
6355 Don't assume pid_t fits into int.
6356 (call_process_cleanup, Fcall_process, delete_temp_file)
6357 (Fcall_process_region):
6358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6359 (Fcall_process): Simplify handling of volatile integers.
6360 Use int, not EMACS_INT, where int will do.
6361 * casefiddle.c (casify_object, casify_region, operate_on_word)
6362 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6363 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6364 (casify_object): Avoid integer overflow when overallocating buffer.
6365 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6366 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6367 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6368 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6369 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6370 integers are now checked earlier. All uses replaced with XINT.
6371 (ccl_driver):
6372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6373 For CCL_MapSingle, check that content and value are in int range.
6374 (ccl_driver, Fregister_code_conversion_map):
6375 Check that Vcode_version_map_vector is a vector.
6376 (resolve_symbol_ccl_program): Check that vector header is in range.
6377 Always copy the vector, so that we can check its contents reliably
6378 now rather than having to recheck each instruction as it's being
6379 executed. Check that vector words fit in 'int'.
6380 (ccl_get_compiled_code, Fregister_ccl_program)
6381 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6382 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6383 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6384 contents are in range.
6385 (Fccl_execute_on_string): Check that status is in range.
6386 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6387 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6388 Accept and return EMACS_INT, not int, because callers can pass values
6389 out of 'int' range.
6390 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6391 (multibyte_chars_in_text, parse_str_as_multibyte)
6392 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6393 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6394 (string_escape_byte8, Fget_byte):
6395 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6396 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6397 avoid mishandling large integers.
6398 * character.h: Adjust decls to match defn changes elsewhere.
6399 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6400 (Ffind_charset_region):
6401 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6402 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6403 (load_charset_map_from_vector, Fdefine_charset_internal):
6404 Don't assume fixnum fits in int.
6405 (load_charset_map_from_vector, Fmap_charset_chars):
6406 Remove now-unnecessary CHECK_NATNUMs.
6407 (Fdefine_charset_internal): Check ranges here, more carefully.
6408 Don't rely on undefined behavior with signed left shift overflow.
6409 Don't assume unsigned int fits into fixnum, or that fixnum fits
6410 into unsigned int. Don't require max_code to be a valid fixnum;
6411 that's not true for gb10830 4-byte on a 32-bit host. Allow
6412 invalid_code to be a cons, for the same reason. Require code_offset
6413 to be a character. Avoid int overflow if max_char is close
6414 to INT_MAX.
6415 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6416 this is intended anyway and avoids some undefined behavior.
6417 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6418 INDEX_TO_CODE_POINT, as that's what it expects.
6419 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6420 * charset.h (DECODE_CHAR): Return int, not unsigned;
6421 this is what was intended anyway, and it avoids undefined behavior.
6422 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6423 integer-overflow issues.
6424 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6425 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6426 where the argument is EMACS_INT, and this behavior is not intended.
6427 * chartab.c (Fmake_char_table, Fset_char_table_range)
6428 (uniprop_get_decoder, uniprop_get_encoder):
6429 Don't assume fixnum fits in int.
6430 * cmds.c (move_point): New function, that does the gist of
6431 Fforward_char and Fbackward_char, but does so while checking
6432 for integer overflow more accurately.
6433 (Fforward_char, Fbackward_char): Use it.
6434 (Fforward_line, Fend_of_line, internal_self_insert)
6435 (internal_self_insert):
6436 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6437 Fix a FIXME, by checking for integer overflow when calculating
6438 target_clm and actual_clm.
6439 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6440 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6441 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6442 (coding_alloc_by_making_gap, alloc_destination)
6443 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6444 (encode_coding_utf_16, detect_coding_emacs_mule)
6445 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6446 (detect_coding_iso_2022, decode_coding_iso_2022)
6447 (encode_invocation_designation, encode_designation_at_bol)
6448 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6449 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6450 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6451 (encode_coding_ccl, encode_coding_raw_text)
6452 (detect_coding_charset, decode_coding_charset)
6453 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6454 (produce_composition, produce_charset, produce_annotation)
6455 (decode_coding, handle_composition_annotation)
6456 (handle_charset_annotation, consume_chars, decode_coding_gap)
6457 (decode_coding_object, encode_coding_object, detect_coding_system)
6458 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6459 (code_convert_region, code_convert_string)
6460 (Fdefine_coding_system_internal)
6461 (coding_set_source, coding_set_destination):
6462 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6463 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6464 (Fdefine_coding_system_internal):
6465 Don't assume fixnums fit in int.
6466 (decode_coding_gap, decode_coding_object, encode_coding_object)
6467 (Fread_coding_system, Fdetect_coding_region)
6468 (Funencodable_char_position, Fcheck_coding_systems_region)
6469 (get_translation, handle_composition_annotation, consume_chars):
6470 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6471 (consume_chars): Rewrite to not calculate an address outside buffer.
6472 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6473 Don't access memory outside of the args array.
6474 (Fdefine_coding_system_internal): Check for charset-id overflow.
6475 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6476 result of ENCODE_CHAR.
6477 * coding.h: Adjust decls to match defn changes elsewhere.
6478 (struct coding_system):
6479 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6480 * composite.c (get_composition_id, find_composition)
6481 (run_composition_function, update_compositions)
6482 (compose_text, composition_gstring_put_cache)
6483 (composition_gstring_p, composition_gstring_width)
6484 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6485 (composition_compute_stop_pos, composition_reseat_it)
6486 (composition_update_it, struct position_record)
6487 (find_automatic_composition, composition_adjust_point)
6488 (Fcomposition_get_gstring, Ffind_composition_internal):
6489 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6490 (update_compositions):
6491 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6492 * composite.h: Adjust decls to match defn changes elsewhere.
6493 (struct composition):
6494 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6495 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6496 Do not attempt to compute the address of the object just before a
6497 buffer; this is not portable.
6498 (Faref, Faset):
6499 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6500 (Faset): Use int, not EMACS_INT, where int is wide enough.
6501 (Fstring_to_number): Don't assume fixnums fit in int.
6502 (Frem): Don't assume arg is nonnegative.
6503 * dbusbind.c (xd_append_arg): Check for integers out of range.
6504 (Fdbus_call_method): Don't overflow the timeout int.
6505 (extract_signed, extract_unsigned): New functions.
6506 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6507 (xd_get_connection_references): Return ptrdiff_t, not int.
6508 All uses changed.
6509 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6510 (xd_read_message_1):
6511 Use int, not unsigned, where the dbus API uses int.
6512 (Fdbus_message_internal): Don't overflow mtype.
6513 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6514 * dired.c (directory_files_internal, file_name_completion, scmp)
6515 (file_name_completion_stat):
6516 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6517 (file_name_completion): Don't overflow matchcount.
6518 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6519 * dispextern.h: Adjust decls to match defn changes elsewhere.
6520 (struct text_pos, struct glyph, struct bidi_saved_info)
6521 (struct bidi_string_data, struct bidi_it, struct composition_it)
6522 (struct it):
6523 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6524 (struct display_pos, struct composition_it, struct it):
6525 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6526 * dispnew.c (increment_matrix_positions)
6527 (increment_row_positions, mode_line_string)
6528 (marginal_area_string):
6529 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6530 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6532 (duration_to_sec_usec): New function, to check for overflow better.
6533 (Fsleep_for, sit_for): Use it.
6534 * doc.c (get_doc_string, store_function_docstring):
6535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6536 (get_doc_string, Fsnarf_documentation):
6537 Use int, not EMACS_INT, where int is wide enough.
6538 (get_doc_string):
6539 Use SAFE_ALLOCA, not alloca.
6540 Check for overflow when converting EMACS_INT to off_t.
6541 * doprnt.c (doprnt):
6542 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6543 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6544 Don't assume uid_t fits into fixnum.
6545 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6546 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6547 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6548 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6549 (general_insert_function)
6550 (Finsert_char, make_buffer_string, make_buffer_string_both)
6551 (update_buffer_properties, Fbuffer_substring)
6552 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6553 (Fsubst_char_in_region, check_translation)
6554 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6555 (transpose_markers, Ftranspose_regions):
6556 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6557 (clip_to_bounds): Move to lisp.h as an inline function).
6558 (Fconstrain_to_field): Don't assume integers are nonnegative.
6559 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6560 (Fsubst_char_in_region, Fsave_restriction):
6561 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6562 (Femacs_pid): Don't assume pid_t fits into fixnum.
6563 (lo_time): Use int, not EMACS_INT, when int suffices.
6564 (lisp_time_argument): Check for usec out of range.
6565 (Fencode_time): Don't assume fixnum fits in int.
6566 (Fuser_login_name, Fuser_full_name): Signal an error
6567 if a uid argument is out of range, rather than relying on
6568 undefined behavior.
6569 (Fformat_time_string): Remove now-unnecessary check.
6570 lisp_time_argument checks for out-of-range usec now.
6571 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6572 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6573 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6574 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6575 (init_cmdargs, Fdump_emacs):
6576 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6577 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6578 the bottom (typically) 32 bits of the fixnum.
6579 * eval.c (specpdl_size, call_debugger):
6580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6581 (when_entered_debugger, Fbacktrace_debug):
6582 Don't assume fixnum can fit in int.
6583 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6584 the object just before a buffer; this is not portable.
6585 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6586 (grow_specpdl, unbind_to):
6587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6588 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6589 (grow_specpdl): Simplify allocation by using xpalloc.
6590 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6591 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6592 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6593 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6594 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6595 (a_write, e_write):
6596 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6597 (Fcopy_file, non_regular_nbytes, read_non_regular)
6598 (Finsert_file_contents):
6599 Use int, not EMACS_INT, where int is wide enough.
6600 (READ_BUF_SIZE): Verify that it fits in int.
6601 (Finsert_file_contents): Check that counts are in proper range,
6602 rather than assuming fixnums fit into ptrdiff_t etc.
6603 Don't assume fixnums fit into int.
6604 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6605 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6606 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6607 (string_char_to_byte, string_byte_to_char)
6608 (string_make_multibyte, string_to_multibyte)
6609 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6610 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6611 (substring_both, Fdelete, internal_equal, Ffillarray)
6612 (Fclear_string, mapcar1)
6613 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6614 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6615 (larger_vector, make_hash_table, maybe_resize_hash_table)
6616 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6617 (Fmaphash, secure_hash):
6618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6619 (concat): Check for string index and length overflow.
6620 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6621 (Frequire):
6622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6623 (larger_vector): New API (vec, incr_min, size_max) replaces old
6624 one (vec, new_size, init). This catches size overflow.
6625 INIT was removed because it was always Qnil.
6626 All callers changed.
6627 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6628 the upper bound on a hash table index size.
6629 (make_hash_table, maybe_resize_hash_table): Use it.
6630 (secure_hash): Computer start_byte and end_byte only after
6631 they're known to be in ptrdiff_t range.
6632 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6633 (Ffont_get_glyphs, Ffont_at):
6634 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6635 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6636 (Flist_fonts, Fopen_font):
6637 Don't assume fixnum can fit in int.
6638 (check_gstring): Don't assume index can fit in int.
6639 (font_match_p): Check that fixnum is a character, not a nonnegative
6640 fixnum, since the later code needs to stuff it into an int.
6641 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6642 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6643 conversion overflow issues.
6644 (Fopen_font): Check for integer out of range.
6645 (Ffont_get_glyphs): Don't assume index can fit in int.
6646 * font.h: Adjust decls to match defn changes elsewhere.
6647 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6648 integer overflow.
6649 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6650 printmax_t, where ptrdiff_t is wide enough.
6651 (Finternal_char_font):
6652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6653 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6654 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6655 (Fset_frame_position, x_set_frame_parameters)
6656 (x_set_line_spacing, x_set_border_width)
6657 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6658 Check that fixnums are in proper range for system types.
6659 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6660 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6661 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6662 Use SAFE_ALLOCA_LISP, not alloca.
6663 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6664 intptr_t is wide enough.
6665 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6666 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6667 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6668 Check for fixnum out of range.
6669 * ftfont.c (ftfont_list): Don't assume index fits in int.
6670 Check that fixnums are in proper range for system types.
6671 (ftfont_shape_by_flt):
6672 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6673 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6675 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6676 Check that fixnums are in proper range for system types.
6677 * gnutls.h: Adjust decls to match defn changes elsewhere.
6678 * gtkutil.c (xg_dialog_run):
6679 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6680 (update_frame_tool_bar):
6681 Check that fixnums are in proper range for system types.
6682 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6683 (lookup_image): Check that fixnums are in range for system types.
6684 * indent.c (last_known_column, last_known_column_point):
6685 (current_column_bol_cache):
6686 (skip_invisible, current_column, check_display_width):
6687 (check_display_width, scan_for_column, current_column_1)
6688 (Findent_to, Fcurrent_indentation, position_indentation)
6689 (indented_beyond_p, Fmove_to_column, compute_motion):
6690 (Fcompute_motion, Fvertical_motion):
6691 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6692 (last_known_column_modified): Use EMACS_INT, not int.
6693 (check_display_width):
6694 (Fcompute_motion):
6695 Check that fixnums and floats are in proper range for system types.
6696 (compute_motion): Don't assume index or fixnum fits in int.
6697 (compute_motion, Fcompute_motion):
6698 Use int, not EMACS_INT, when it is wide enough.
6699 (vmotion): Omit local var start_hpos that is always 0; that way
6700 we don't need to worry about overflow in expressions involving it.
6701 * indent.h: Adjust decls to match defn changes elsewhere.
6702 (struct position):
6703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6704 Use int, not EMACS_INT, where int is wide enough.
6705 Remove unused members ovstring_chars_done and tab_offset;
6706 all uses removed.
6707 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6708 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6709 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6710 (make_gap, copy_text, insert, insert_and_inherit)
6711 (insert_before_markers, insert_before_markers_and_inherit)
6712 (insert_1, count_combining_before, count_combining_after)
6713 (insert_1_both, insert_from_string)
6714 (insert_from_string_before_markers, insert_from_string_1)
6715 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6716 (adjust_after_replace, adjust_after_insert, replace_range)
6717 (replace_range_2, del_range, del_range_1, del_range_byte)
6718 (del_range_both, del_range_2, modify_region)
6719 (prepare_to_modify_buffer, signal_before_change)
6720 (signal_after_change, Fcombine_after_change_execute):
6721 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6722 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6723 (balance_an_interval, split_interval_right, split_interval_left)
6724 (find_interval, next_interval, update_interval)
6725 (adjust_intervals_for_insertion, delete_node, delete_interval)
6726 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6727 (static_offset_intervals, offset_intervals)
6728 (merge_interval_right, merge_interval_left, make_new_interval)
6729 (graft_intervals_into_buffer, temp_set_point_both)
6730 (temp_set_point, set_point, adjust_for_invis_intang)
6731 (set_point_both, move_if_not_intangible, get_property_and_range)
6732 (get_local_map, copy_intervals, copy_intervals_to_string)
6733 (compare_string_intervals, set_intervals_multibyte_1):
6734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6735 * intervals.h: Adjust decls to match defn changes elsewhere.
6736 (struct interval):
6737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6738 * keyboard.c (this_command_key_count, this_single_command_key_start)
6739 (before_command_key_count, before_command_echo_length, echo_now)
6740 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6741 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6742 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6743 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6745 (last_non_minibuf_size, last_point_position, echo_truncate)
6746 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6747 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6748 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6749 (stuff_buffered_input):
6750 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6751 (last_auto_save, command_loop_1, read_char):
6752 Use EMACS_INT, not int, to avoid integer overflow.
6753 (record_char): Avoid overflow in total_keys computation.
6754 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6755 * keyboard.h: Adjust decls to match defn changes elsewhere.
6756 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6757 (Fkey_description, Fdescribe_vector, Flookup_key):
6758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6759 (click_position): New function, to check that positions are in range.
6760 (Fcurrent_active_maps):
6761 (describe_command):
6762 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6763 (Faccessible_keymaps, Fkey_description):
6764 (preferred_sequence_p):
6765 Don't assume fixnum can fit into int.
6766 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6767 Check for integer overflow in size calculations.
6768 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6769 avoid mishandling large integers.
6770 * lisp.h: Adjust decls to match defn changes elsewhere.
6771 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6772 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6773 (struct Lisp_Marker):
6774 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6775 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6776 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6777 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6778 All callers changed.
6779 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6780 Assume the arg has valid form, since it always does.
6781 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6782 unsigned integer system type.
6783 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6784 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6786 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6787 (duration_to_sec_usec): New decl.
6788 * lread.c (read_from_string_index, read_from_string_index_byte)
6789 (read_from_string_limit, readchar, unreadchar, openp)
6790 (read_internal_start, read1, oblookup):
6791 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6792 (Fload, readevalloop, Feval_buffer, Feval_region):
6793 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6794 (openp): Check for out-of-range argument to 'access'.
6795 (read1): Use int, not EMACS_INT, where int is wide enough.
6796 Don't assume fixnum fits into int.
6797 Fix off-by-one error that can read outside a buffer.
6798 (read_filtered_event): Use duration_to_sec_usec
6799 to do proper overflow checking on durations.
6800 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6801 in size calculation.
6802 (Fexecute_kbd_macro):
6803 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6804 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6805 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6806 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6807 (set_marker_both, set_marker_restricted_both, marker_position)
6808 (marker_byte_position, Fbuffer_has_markers_at):
6809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6810 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6811 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6812 It now merely ensures that the menu is large enough, without
6813 necessarily growing it, as this avoids some integer overflow issues.
6814 All callers changed.
6815 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6817 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6818 Use SAFE_ALLOCA_LISP, not alloca.
6819 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6820 to EMACS_INT. Check that fixnums are in proper range for system types.
6821 * minibuf.c (minibuf_prompt_width, string_to_object)
6822 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6823 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6824 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6825 (get_minibuffer, read_minibuf_unwind):
6826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6827 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6828 this simplifies overflow checking. All callers changed.
6829 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6830 (Ftest_completion):
6831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6832 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6833 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6834 Check that fixnums are in proper range for system types.
6835 (Fx_create_frame, Fx_show_tip):
6836 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6837 * nsfont.m (ns_findfonts, nsfont_list_family):
6838 Don't assume fixnum fits in long.
6839 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6841 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6842 wide enough.
6843 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6844 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6845 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6846 (PRINTDECLARE, PRINTPREPARE):
6847 (strout, print_string):
6848 (print, print_preprocess, print_check_string_charset_prop)
6849 (print_object):
6850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6851 (PRINTDECLARE):
6852 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6853 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6854 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6855 (printchar, strout): Use xpalloc to catch size calculation overflow.
6856 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6857 (print_error_message): Use SAFE_ALLOCA, not alloca.
6858 (print_object): Use int, not EMACS_INT, where int is wide enough.
6859 (print_depth, new_backquote_output, print_number_index):
6860 Use ptrdiff_t, not int, where int might not be wide enough.
6861 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6862 (Fset_process_window_size, Fformat_network_address)
6863 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6864 (sigchld_handler):
6865 Check that fixnums are in proper range for system types.
6866 (Fsignal_process): Simplify by avoiding a goto.
6867 Check for process-ids out of pid_t range rather than relying on
6868 undefined behavior.
6869 (process_tick, update_tick): Use EMACS_INT, not int.
6870 (Fformat_network_address, read_process_output, send_process)
6871 (Fprocess_send_region, status_notify):
6872 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6873 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6874 (wait_reading_process_output, read_process_output, exec_sentinel):
6875 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6876 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6877 (Faccept_process_output): Use duration_to_sec_usec to do proper
6878 overflow checking on durations.
6879 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6880 Don't assume pid_t fits in int.
6881 * process.h (struct Lisp_Process): Members tick and update_tick
6882 are now of type EMACS_INT, not int.
6883 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6884 configured --with-wide-int.
6885 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6886 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6887 * search.c (looking_at_1, string_match_1):
6888 (fast_string_match, fast_c_string_match_ignore_case)
6889 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6890 (scan_newline, find_before_next_newline, search_command)
6891 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6892 (set_search_regs, wordify):
6893 (Freplace_match):
6894 (Fmatch_data):
6895 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6896 (string_match_1, search_buffer, set_search_regs):
6897 (Fmatch_data):
6898 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6899 (wordify): Check for overflow in size calculation.
6900 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6901 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6902 Check that fixnums are in proper range for system types.
6903 * sound.c (struct sound_device)
6904 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6905 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6906 (Fplay_sound_internal):
6907 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6908 * syntax.c (struct lisp_parse_state, find_start_modiff)
6909 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6910 (Fparse_partial_sexp):
6911 Don't assume fixnums can fit in int.
6912 (struct lisp_parse_state, find_start_pos, find_start_value)
6913 (find_start_value_byte, find_start_begv)
6914 (update_syntax_table, char_quoted, dec_bytepos)
6915 (find_defun_start, prev_char_comend_first, back_comment):
6916 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6917 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6918 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6919 (Finternal_describe_syntax_value): Check that match_lisp is a
6920 character, not an integer, since the code stuffs it into int.
6921 (scan_words, scan_sexps_forward):
6922 Check that fixnums are in proper range for system types.
6923 (Fforward_word):
6924 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6925 (scan_sexps_forward):
6926 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6927 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6928 * syntax.h: Adjust decls to match defn changes elsewhere.
6929 (struct gl_state_s):
6930 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6931 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6932 MOST_POSITIVE_FIXNUM.
6933 * sysdep.c (wait_for_termination_1, wait_for_termination)
6934 (interruptible_wait_for_termination, mkdir):
6935 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6936 (emacs_read, emacs_write):
6937 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6938 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6939 and double all fit in int.
6940 * term.c (set_tty_color_mode):
6941 Check that fixnums are in proper range for system types.
6942 * termhooks.h (struct input_event):
6943 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6944 * textprop.c (validate_interval_range, interval_of)
6945 (Fadd_text_properties, set_text_properties_1)
6946 (Fremove_text_properties, Fremove_list_of_text_properties)
6947 (Ftext_property_any, Ftext_property_not_all)
6948 (copy_text_properties, text_property_list, extend_property_ranges)
6949 (verify_interval_modification):
6950 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6951 (Fnext_single_char_property_change)
6952 (Fprevious_single_char_property_change):
6953 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6954 (copy_text_properties):
6955 Check for integer overflow in index calculation.
6956 * undo.c (last_boundary_position, record_point, record_insert)
6957 (record_delete, record_marker_adjustment, record_change)
6958 (record_property_change):
6959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6960 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6961 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6962 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6963 (Fx_hide_tip, Fx_file_dialog):
6964 * w32menu.c (set_frame_menubar):
6965 Use ptrdiff_t, not int, for consistency with rest of code.
6966 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6967 (select_window, Fdelete_other_windows_internal)
6968 (window_scroll_pixel_based, window_scroll_line_based)
6969 (Frecenter, Fset_window_configuration):
6970 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6971 (Fset_window_hscroll, run_window_configuration_change_hook)
6972 (set_window_buffer, temp_output_buffer_show, scroll_command)
6973 (Fscroll_other_window, Frecenter):
6974 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6975 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6976 Don't assume fixnum fits in int.
6977 (Fset_window_scroll_bars):
6978 Check that fixnums are in proper range for system types.
6979 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6980 (string_pos, c_string_pos, number_of_chars, init_iterator)
6981 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6982 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6983 (compute_display_string_end, handle_face_prop)
6984 (face_before_or_after_it_pos, handle_invisible_prop)
6985 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6986 (display_prop_intangible_p, string_buffer_position_lim)
6987 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6988 (get_overlay_strings_1, get_overlay_strings)
6989 (iterate_out_of_display_property, forward_to_next_line_start)
6990 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6991 (get_next_display_element, set_iterator_to_next)
6992 (get_visually_first_element, compute_stop_pos_backwards)
6993 (handle_stop_backwards, next_element_from_buffer)
6994 (move_it_in_display_line_to, move_it_in_display_line)
6995 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6996 (add_to_log, message_dolog, message_log_check_duplicate)
6997 (message2, message2_nolog, message3, message3_nolog
6998 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6999 (current_message_1, truncate_echo_area, truncate_message_1)
7000 (set_message, set_message_1, store_mode_line_noprop)
7001 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7002 (text_outside_line_unchanged_p, check_point_in_composition)
7003 (reconsider_clip_changes)
7004 (redisplay_internal, set_cursor_from_row, try_scrolling)
7005 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7006 (redisplay_window, find_last_unchanged_at_beg_row)
7007 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7008 (trailing_whitespace_p, find_row_edges, display_line)
7009 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7010 (display_mode_element, store_mode_line_string)
7011 (pint2str, pint2hrstr, decode_mode_spec)
7012 (display_count_lines, display_string, draw_glyphs)
7013 (x_produce_glyphs, x_insert_glyphs)
7014 (rows_from_pos_range, mouse_face_from_buffer_pos)
7015 (fast_find_string_pos, mouse_face_from_string_pos)
7016 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7017 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7018 (safe_call, init_from_display_pos, handle_fontified_prop)
7019 (handle_single_display_spec, load_overlay_strings)
7020 (with_echo_area_buffer, setup_echo_area_for_printing)
7021 (display_echo_area, echo_area_display)
7022 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7023 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7024 (redisplay_window, dump_glyph_row, display_mode_line)
7025 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7026 (handle_display_spec, display_prop_string_p):
7027 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7028 (handle_single_display_spec, build_desired_tool_bar_string)
7029 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7030 (get_specified_cursor_type):
7031 Check that fixnums are in proper range for system types.
7032 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7033 (Flookup_image_map):
7034 Don't assume fixnums fit in int.
7035 (compare_overlay_entries):
7036 Avoid mishandling comparisons due to subtraction overflow.
7037 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7038 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7039 (handle_tool_bar_click):
7040 Use int, not unsigned, since we prefer signed and the signedness
7041 doesn't matter here.
7042 (get_next_display_element, next_element_from_display_vector):
7043 Use int, not EMACS_INT, when int is wide enough.
7044 (start_hourglass): Use duration_to_sec_usec to do proper
7045 overflow checking on durations.
7046 * xfaces.c (Fbitmap_spec_p):
7047 Check that fixnums are in proper range for system types.
7048 (compare_fonts_by_sort_order):
7049 Avoid mishandling comparisons due to subtraction overflow.
7050 (Fx_family_fonts, realize_basic_faces):
7051 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7052 (Fx_family_fonts):
7053 Don't assume fixnum fits in int.
7054 Use SAFE_ALLOCA_LISP, not alloca.
7055 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7056 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7057 (face_at_buffer_position, face_for_overlay_string)
7058 (face_at_string_position):
7059 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7060 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7061 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7062 (Fx_show_tip):
7063 Check that fixnums are in proper range for system types.
7064 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7065 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7066 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7067 (Fx_change_window_property): Don't assume fixnums fit in int.
7068 * xfont.c (xfont_chars_supported):
7069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7070 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7071 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7072 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7073 * xml.c (parse_region):
7074 * xrdb.c (magic_file_p):
7075 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7076 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7077 (x_get_local_selection, x_reply_selection_request)
7078 (x_handle_selection_request, wait_for_property_change):
7079 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7080 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7081 short is wide enough.
7082 (x_send_client_event): Don't assume fixnum fits in int.
7083 * xterm.c (x_x_to_emacs_modifiers):
7084 Don't assume EMACS_INT overflows nicely into int.
7085 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7086 may come from Lisp.
7087 (handle_one_xevent): NATNUMP can eval its arg twice.
7088 (x_connection_closed):
7089 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7090 * xterm.h: Adjust decls to match defn changes elsewhere.
7091 (struct scroll_bar): Use struct vectorlike_header
7092 rather than rolling our own approximation.
7093 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7094
7095 2012-05-25 Glenn Morris <rgm@gnu.org>
7096
7097 * lisp.mk (lisp): Update for more files being compiled now.
7098
7099 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7100
7101 * lread.c: Remove `read_pure' which makes no difference.
7102 (read_pure): Remove var.
7103 (unreadpure): Remove function.
7104 (readevalloop): Don't call read_list with -1 flag.
7105 (read1, read_vector): Don't test read_pure any more.
7106 (read_list): Simplify.
7107
7108 * fileio.c, character.h: Minor style tweaks.
7109
7110 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7111
7112 * window.h (clip_changed): Remove useless declaration.
7113
7114 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7115
7116 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7117 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7118
7119 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7120
7121 Remove src/m/*.
7122 This directory predates autoconf and is no longer needed nowadays.
7123 Move its few remaining bits of functionality to where they're needed.
7124 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7125 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7126 * m/template.h: Remove.
7127 * Makefile.in (M_FILE): Remove. All uses removed.
7128 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7129 * lisp.h (USE_LSB_TAG):
7130 * mem-limits.h (EXCEEDS_LISP_PTR):
7131 Use VAL_MAX, not VALBITS, in #if.
7132 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7133 (EMACS_UINT): Define unconditionally now.
7134 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7135 (BITS_PER_EMACS_INT): New constants, replacing
7136 what used to be in config.h, but not useful in #if.
7137 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7138 define them any more.
7139 (VAL_MAX): New macro.
7140 (VALMASK): Use it.
7141 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7142 BITS_PER_EMACS_INT, in #if.
7143 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7144 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7145 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7146 * s/ms-w32.h (DATA_START):
7147 Move here from removed file m/intel386.h.
7148 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7149 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7150
7151 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7152
7153 Assume C89 or later.
7154 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7155 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7156 (xrealloc):
7157 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7158 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7159 * textprop.c, tparam.c (NULL): Remove.
7160 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7161 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7162 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7163 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7164 * xterm.c (input_signal_count): Assume volatile works.
7165
7166 2012-05-21 Ken Brown <kbrown@cornell.edu>
7167
7168 * xgselect.c (xg_select): Fix first argument in call to 'select'
7169 (bug#11508).
7170
7171 2012-05-20 Ken Brown <kbrown@cornell.edu>
7172
7173 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7174 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7175
7176 2012-05-19 Ken Brown <kbrown@cornell.edu>
7177
7178 * xfns.c (x_in_use): Remove `static' qualifier.
7179 * xterm.h (x_in_use): Declare.
7180 * xgselect.c: Include xterm.h.
7181 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7182 and `display_arg' (bug#9754).
7183
7184 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7185
7186 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7187
7188 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7189 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7190
7191 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7192
7193 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7194
7195 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7196 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7197
7198 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7199 reference to image_cache->refcount.
7200 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7201
7202 2012-05-17 Juri Linkov <juri@jurta.org>
7203
7204 * search.c (Fword_search_regexp, Fword_search_backward)
7205 (Fword_search_forward, Fword_search_backward_lax)
7206 (Fword_search_forward_lax): Move functions to isearch.el
7207 (bug#10145, bug#11381).
7208
7209 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7210
7211 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7212
7213 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7214
7215 * lread.c (init_obarray): Declare Qt and Qnil as special.
7216
7217 2012-05-14 Glenn Morris <rgm@gnu.org>
7218
7219 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7220 Put "libexec" before "bin", for the sake of init_callproc_1.
7221
7222 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7223
7224 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7225
7226 * unexaix.c: Port to more-recent AIX compilers.
7227 (report_error, report_error_1, make_hdr, copy_sym)
7228 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7229 Make arguments const char *, not char *, to avoid violations of C
7230 standard and to fix some AIX warnings reported by Gilles Pion.
7231
7232 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7233
7234 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7235 already have overlays loaded.
7236 (handle_single_display_spec): Before returning without displaying
7237 fringe bitmap, synchronize the bidi iterator with the main display
7238 iterator, by calling iterate_out_of_display_property.
7239 (iterate_out_of_display_property): Detect buffer iteration by
7240 testing that it->string is a Lisp string.
7241 (get_next_display_element): When the current object is exhausted,
7242 and there's something on it->stack, call set_iterator_to_next to
7243 proceed with what's on the stack, instead of returning zero.
7244 (set_iterator_to_next): If called at the end of a Lisp string,
7245 proceed to consider_string_end without incrementing string
7246 position. Don't increment display vector index past the end of
7247 the display vector. (Bug#11417)
7248 (pos_visible_p): Don't report a position visible when move_it_to
7249 stopped at the last line of window, which happens to be scanned
7250 backwards by the bidi iteration. (Bug#11464)
7251
7252 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7253
7254 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7255 and right-margin display specs even if the spec is invalid or we
7256 are on a TTY, and thus unable to display on the fringes.
7257 That's because the text with the property will not be displayed anyway,
7258 so we need to signal to the caller that this is a "replacing"
7259 display spec. This fixes display when the spec is invalid or we
7260 are on a TTY.
7261
7262 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7263
7264 * unexaix.c (make_hdr): Fix typo in prototype.
7265 This bug broke the build on AIX. Problem reported by Gilles Pion.
7266
7267 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7268
7269 * keyboard.c (kbd_buffer_get_event): Read special events also in
7270 batch mode. (Bug#11415)
7271
7272 2012-05-12 Glenn Morris <rgm@gnu.org>
7273
7274 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7275
7276 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7277
7278 * lisp.mk (lisp): Add newcomment.elc.
7279
7280 2012-05-12 Glenn Morris <rgm@gnu.org>
7281
7282 * Makefile.in (MKDIR_P): New, set by configure.
7283 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7284
7285 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7286
7287 Remove unused function hourglass_started.
7288 * dispextern.h (hourglass_started):
7289 * w32fns.c (hourglass_started):
7290 * xdisp.c (hourglass_started): Remove.
7291
7292 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7293
7294 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7295 Update dependencies.
7296
7297 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7298
7299 * xgselect.c (xg_select): Put maxfds+1 into a var.
7300 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7301
7302 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7303
7304 2012-05-10 Dave Abrahams <dave@boostpro.com>
7305
7306 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7307 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7308
7309 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7310
7311 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7312 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7313 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7314 Initialize xd_registered_buses.
7315
7316 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7317
7318 Untag more efficiently if USE_LSB_TAG.
7319 This is based on a proposal by YAMAMOTO Mitsuharu in
7320 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7321 For an admittedly artificial (nth 8000 longlist) benchmark on
7322 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7323 Emacs's overall text size by 1%.
7324 * lisp.h (XUNTAG): New macro.
7325 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7326 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7327 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7328 * eval.c (Fautoload):
7329 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7330 * frame.h (XFRAME): Use XUNTAG.
7331
7332 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7333 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7334 Remove unportable assumptions about print widths of types like
7335 dbus_uint32_t.
7336 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7337 intptr_t when converting between pointer and integer, to avoid GCC
7338 warnings about wrong width.
7339
7340 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7341
7342 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7343 stack for each reader_thread, instead of defaulting to 8MB
7344 determined by the linker. This avoids failures in creating
7345 subprocesses on Windows 7, see the discussion in this thread:
7346 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7347
7348 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7349
7350 Fix up display of the *Minibuf-0* buffer in the mini window.
7351 * keyboard.c (read_char): Don't clear the echo area if there's no
7352 message to clear.
7353 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7354 contents of *Minibuf-0*) if there's no message displayed in its stead.
7355
7356 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7357
7358 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7359 batch mode.
7360
7361 2012-05-06 Chong Yidong <cyd@gnu.org>
7362
7363 * lisp.mk (lisp): Update.
7364
7365 2012-05-05 Jim Meyering <meyering@redhat.com>
7366
7367 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7368
7369 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7370
7371 * data.c (PUT_ERROR): New macro.
7372 (syms_of_data): Use it. Add new error type `user-error'.
7373 * undo.c (user_error): New function.
7374 (Fprimitive_undo): Use it.
7375 * print.c (print_error_message): Adjust print style for `user-error'.
7376 * keyboard.c (user_error): New function.
7377 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7378
7379 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7380
7381 Do not limit current-time-string to years 1000..9999.
7382 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7383 (Fcurrent_time_string): Support any year that is supported by the
7384 underlying localtime representation. Don't use asctime, as it
7385 has undefined behavior for years outside the range -999..9999.
7386
7387 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7388
7389 Fix race conditions involving setenv, gmtime, localtime, asctime.
7390 Without this fix, interrupts could mess up code that uses these
7391 nonreentrant functions, since setting TZ invalidates existing
7392 tm_zone or tzname values, and since most of these functions return
7393 pointers to static storage.
7394 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7395 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7396 Grow the critical sections to include not just invoking
7397 localtime/gmtime, but also accessing these functions' results
7398 including their tm_zone values if any, and any related TZ setting.
7399 (format_time_string): Last arg is now struct tm *, not struct tm **,
7400 so that the struct tm is saved in the critical section.
7401 All callers changed. Simplify allocation of initial buffer, partly
7402 motivated by the fact that memory allocation needs to be outside
7403 the critical section.
7404
7405 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7406
7407 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7408 with RESET_INTERVAL.
7409
7410 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7411 Remove duplicated buffer name initialization.
7412
7413 2012-05-02 Jim Meyering <jim@meyering.net>
7414
7415 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7416
7417 * xfns.c (x_window): Use xstrdup (Bug#11375).
7418
7419 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7420
7421 * xdisp.c (pos_visible_p): If already at a newline from the
7422 display string before the 'while' loop, don't walk back the glyphs
7423 from it3.glyph_row. Solves assertion violation when the display
7424 string begins with a newline (egg.el). (Bug#11367)
7425
7426 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7427
7428 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7429 Move to simple.el.
7430
7431 2012-05-01 Glenn Morris <rgm@gnu.org>
7432
7433 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7434 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7435 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7436 All were removed before 23.1.
7437
7438 * dispnew.c: Remove HAVE_LIBNCURSES test;
7439 it is always true on relevant platforms.
7440
7441 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7442 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7443
7444 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7445
7446 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7447
7448 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7449 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7450 Remove.
7451
7452 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7453
7454 Do not avoid creating empty evaporating overlays (Bug#9642).
7455 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7456 That is, do not delete an evaporating overlay if it becomes
7457 empty after its bounds are adjusted to fit within its buffer.
7458 This fix caused other problems, and I'm reverting it until we get
7459 to the bottom of them.
7460
7461 2012-04-27 Chong Yidong <cyd@gnu.org>
7462
7463 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7464
7465 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7466
7467 * xdisp.c (pos_visible_p): If the window start position is beyond
7468 ZV, start the display from buffer beginning. Prevents assertion
7469 violation in init_iterator when the minibuffer window is scrolled
7470 via the scroll bar.
7471
7472 * window.c (window_scroll_pixel_based): Likewise.
7473
7474 2012-04-27 Chong Yidong <cyd@gnu.org>
7475
7476 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7477
7478 2012-04-27 Glenn Morris <rgm@gnu.org>
7479
7480 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7481 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7482
7483 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7484
7485 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7486 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7487
7488 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7489
7490 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7491 display element, check also the underlying string or buffer
7492 character. (Bug#11341)
7493
7494 * w32menu.c: Include w32heap.h.
7495 (add_menu_item): If the call to AppendMenuW (via
7496 unicode_append_menu) fails, disable Unicode menus only if we are
7497 running on Windows 9X/Me.
7498
7499 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7500
7501 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7502 (xgetint): Add missing shift for LSB tags.
7503
7504 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7505
7506 * keyboard.c (read_char): Don't wipe echo area for select window
7507 events: These might get delayed via `mouse-autoselect-window'
7508 (Bug#11304).
7509
7510 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7511
7512 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7513 manipulation of :loaded-from data.
7514
7515 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7516
7517 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7518 now a cons (bug#11311).
7519
7520 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7521
7522 Do not create empty overlays with the evaporate property (Bug#9642).
7523 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7524 if it becomes empty after its bounds are adjusted to fit within
7525 its buffer. Without this fix, in a nonempty buffer (let ((o
7526 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7527 yields an empty overlay that has the evaporate property, which is
7528 not supposed to happen.
7529
7530 Fix minor GTK3 problems found by static checking.
7531 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7532 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7533 (struct _EmacsFixedClass, emacs_fixed_get_type):
7534 Move decls here from emacsgtkfixed.h, since they needn't be public.
7535 (emacs_fixed_get_type): Now static.
7536 (emacs_fixed_class_init): Omit unused local.
7537 (emacs_fixed_child_type): Remove; unused.
7538 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7539 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7540 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7541 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7542 (EMACS_FIXED_GET_CLASS): Remove; unused.
7543 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7544
7545 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7546 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7547
7548 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7549
7550 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7551 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7552 (__malloc_size_t, __malloc_ptrdiff_t):
7553 Remove. All uses removed, replaced by the definiens if needed,
7554 since we can assume C89 or better now.
7555 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7556 (protect_malloc_state, align, get_contiguous_space)
7557 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7558 (malloc_atfork_handler_child, malloc_enable_thread)
7559 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7560 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7561 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7562 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7563 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7564 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7565 Define using prototypes, not old style.
7566 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7567 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7568 (align): Don't assume that signed integer overflow wraps around.
7569 Omit unused local var.
7570 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7571 (_free_internal_nolock, memalign, mallochook, reallochook):
7572 Omit no-longer-needed casts.
7573 (valloc): Use getpagesize, not __getpagesize.
7574 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7575 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7576
7577 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7578
7579 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7580
7581 Move functions from C to Lisp. Make non-blocking method calls
7582 the default. Implement further D-Bus standard interfaces.
7583
7584 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7585 (QCdbus_request_name_allow_replacement)
7586 (QCdbus_request_name_replace_existing)
7587 (QCdbus_request_name_do_not_queue)
7588 (QCdbus_request_name_reply_primary_owner)
7589 (QCdbus_request_name_reply_in_queue)
7590 (QCdbus_request_name_reply_exists)
7591 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7592 (QCdbus_registered_serial, QCdbus_registered_method)
7593 (QCdbus_registered_signal): New Lisp objects.
7594 (XD_DEBUG_MESSAGE): Use sizeof.
7595 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7596 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7597 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7598 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7599 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7600 (xd_signature, xd_append_arg): Allow float for integer types.
7601 (xd_get_connection_references): New function.
7602 (xd_get_connection_address): Rename from xd_initialize.
7603 Return cached address.
7604 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7605 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7606 level.
7607 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7608 Return number of refcounts.
7609 (Fdbus_get_unique_name): Make stronger parameter check.
7610 (Fdbus_message_internal): New defun.
7611 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7612 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7613 (Fdbus_send_signal, Fdbus_register_service)
7614 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7615 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7616 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7617 (Vdbus_compiled_version, Vdbus_runtime_version)
7618 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7619 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7620 (Vdbus_message_type_signal): New defvars.
7621 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7622 Adapt docstring.
7623
7624 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7625
7626 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7627 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7628 Do not assume ptrdiff_t is the same width as 'int'.
7629
7630 * alloc.c: Handle unusual debugging option combinations.
7631 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7632 since the two debugging options are incompatible.
7633 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7634 is defined.
7635 (mem_init, mem_insert, mem_insert_fixup):
7636 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7637 (NEED_MEM_INSERT): Remove; no longer needed.
7638
7639 2012-04-22 Leo Liu <sdl.web@gmail.com>
7640
7641 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7642
7643 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7644
7645 * sysdep.c [__FreeBSD__]: Minor cleanups.
7646 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7647 Use Emacs indenting style more consistently. Avoid some casts.
7648 Use 'double' consistently rather than mixing 'float' and 'double'.
7649
7650 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7651
7652 * sysdep.c (list_system_processes, system_process_attributes):
7653 Add implementation for FreeBSD (Bug#5243).
7654
7655 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7656
7657 * lisp.mk (lisp): Update.
7658
7659 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7660
7661 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7662 It is never used otherwise.
7663
7664 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7665
7666 * print.c (print_preprocess): Only check print_depth if print-circle
7667 is nil.
7668 (print_object): Check for cycles even when print-circle is nil and
7669 print-gensym is t, but only check print_depth if print-circle is nil.
7670
7671 2012-04-20 Chong Yidong <cyd@gnu.org>
7672
7673 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7674 set the status to "failed" and ensure that sentinel is run.
7675
7676 2012-04-20 Glenn Morris <rgm@gnu.org>
7677
7678 * process.c (Fset_process_inherit_coding_system_flag)
7679 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7680 (Fmake_network_process, Fmake_serial_process): Doc fix.
7681
7682 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7683
7684 * xdisp.c (string_buffer_position_lim): Limit starting position to
7685 BEGV.
7686 (set_cursor_from_row): If called for a mode-line or header-line
7687 row, return zero immediately.
7688 (try_cursor_movement): If inside continuation line, don't back up
7689 farther than the first row after the header line, if any.
7690 Don't consider the header-line row as "partially visible", even if
7691 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7692
7693 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7694
7695 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7696 (bug#11238).
7697
7698 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7699 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7700
7701 configure: new option --enable-gcc-warnings (Bug#11207)
7702 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7703 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7704 (ALL_CFLAGS): Use new macros rather than old.
7705 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7706 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7707 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7708 -Wunused-result, -Wunused-variable. This should go away once
7709 the Emacs and Gnulib regex code is merged.
7710 (xmalloc, xrealloc): Now static.
7711
7712 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7713
7714 * dired.c (Fsystem_groups): Remove unused local.
7715
7716 2012-04-17 Glenn Morris <rgm@gnu.org>
7717
7718 * dired.c (Fsystem_users): Doc fix.
7719
7720 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7721
7722 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7723 (syms_of_dired): Add them.
7724
7725 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7726
7727 Fix minor alloc.c problems found by static checking.
7728 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7729 New extern decls, to avoid calling undeclared functions.
7730 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7731 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7732 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7733 (NEED_MEM_INSERT): New macro.
7734 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7735 Remove one incorrect comment and fix another.
7736
7737 Fix minor ralloc.c problems found by static checking.
7738 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7739 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7740 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7741 (r_alloc_sbrk): Now static.
7742
7743 Improve ralloc.c interface checking.
7744 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7745 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7746 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7747 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7748 [REL_ALLOC]: ... to here, to check interface.
7749 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7750 Remove decls. This fixes an "It stinks!".
7751
7752 * alloc.c (which_symbols): Fix alignment issue / type clash.
7753
7754 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7755
7756 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7757 (struct Lisp_Misc_Any): Likewise.
7758 (struct Lisp_Free): Likewise.
7759 * alloc.c (union aligned_Lisp_Symbol): Define.
7760 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7761 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7762 (union aligned_Lisp_Misc): Define.
7763 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7764 aligned_Lisp_Misc instead of union Lisp_Misc.
7765 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7766
7767 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7768
7769 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7770 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7771 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7772 * s/netbsd.h, s/sol2-6.h:
7773 Remove definition of GC_MARK_STACK, since the default now works.
7774 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7775 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7776 no longer the default.
7777 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7778
7779 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7780
7781 * lread.c (lisp_file_lexically_bound_p):
7782 Fix hang at ";-*-\n" (bug#11238).
7783
7784 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7785
7786 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7787 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7788
7789 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7790
7791 * nsterm.m (constrainFrameRect): Always constrain when there is only
7792 one screen (Bug#10962).
7793
7794 2012-04-13 Ken Brown <kbrown@cornell.edu>
7795
7796 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7797
7798 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7799
7800 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7801
7802 2012-04-11 Daniel Colascione <dancol@dancol.org>
7803
7804 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7805 against is gone. It's better to use vfork now so that when Cygwin
7806 gains a new, working vfork, we use it automatically (bug#10398).
7807
7808 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7809
7810 * window.c (save_window_save): Obey window-point-insertion-type.
7811
7812 2012-04-11 Glenn Morris <rgm@gnu.org>
7813
7814 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7815
7816 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7817
7818 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7819
7820 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7821
7822 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7823 (force_quit_count): New var.
7824 (handle_interrupt): Use it.
7825
7826 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7827
7828 * w32.c (w32_delayed_load): Record the full path of the library
7829 being loaded (bug#10424).
7830
7831 2012-04-09 Glenn Morris <rgm@gnu.org>
7832
7833 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7834 not just in the obarray, before snarfing them. (Bug#11036)
7835
7836 * Makefile.in ($(leimdir)/leim-list.el):
7837 Pass EMACS rather than BUILT_EMACS.
7838
7839 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7840
7841 * process.c (make_process):
7842 * process.h: Add integer `gnutls_handshakes_tried' member to
7843 process struct.
7844
7845 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7846 Add convenience `GNUTLS_LOG2i' macro.
7847
7848 * gnutls.c (gnutls_log_function2i): Convenience log function.
7849 (emacs_gnutls_read): Use new log functions,
7850 `gnutls_handshakes_tried' process member, and
7851 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7852 attempts per process (connection).
7853
7854 2012-04-09 Chong Yidong <cyd@gnu.org>
7855
7856 * eval.c (Fuser_variable_p, user_variable_p_eh)
7857 (lisp_indirect_variable): Functions deleted.
7858 (Fdefvar): Caller changed.
7859
7860 * callint.c (Finteractive, Fcall_interactively):
7861 * minibuf.c (Fread_variable): Callers changed.
7862
7863 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7864
7865 * xdisp.c (set_cursor_from_row): If the display string appears in
7866 the buffer at position that is closer to point than the position
7867 after the display string, display the cursor on the first glyph of
7868 the display string. Fixes cursor display when a 'display' text
7869 property immediately follows invisible text. (Bug#11094)
7870
7871 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7872
7873 composite.c: use 'double' consistently
7874 * composite.c (get_composition_id): Use 'double' consistently
7875 instead of converting 'float' to 'double' and vice versa; this is
7876 easier to understand and avoids a GCC warning.
7877
7878 2012-04-09 Glenn Morris <rgm@gnu.org>
7879
7880 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7881 preparation for dumping it with emacs. (Bug#4789)
7882 (leimdir): New variable.
7883 ($(leimdir)/leim-list.el): New rule.
7884 (emacs$(EXEEXT)): Depend on leim-list.el.
7885
7886 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7887 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7888 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7889
7890 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7891
7892 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7893 proper alignment.
7894
7895 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7896
7897 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7898 Remove unused local variable.
7899
7900 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7901
7902 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7903 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7904 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7905 objects, as mark_maybe_pointer will catch them otherwise.
7906 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7907 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7908
7909 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7910
7911 Fix typo that broke non-Windows builds.
7912 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7913
7914 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7915
7916 Support building on MS-Windows with libxml2.
7917
7918 * makefile.w32-in (OBJ2): Add xml.$(O).
7919 (GLOBAL_SOURCES): Add xml.c.
7920 ($(BLD)/xml.$(O)): New dependency list.
7921
7922 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7923 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7924 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7925 [!WINDOWSNT]: New macros.
7926 (init_libxml2_functions, libxml2_loaded_p): New functions.
7927 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7928 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7929 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7930 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7931 linked in).
7932 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7933 Call init_libxml2_functions before calling libxml2 functions.
7934 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7935
7936 * emacs.c: Don't include libxml/parser.h.
7937 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7938 xmlCleanupParser directly.
7939
7940 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7941
7942 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7943
7944 * indent.c (Fvertical_motion): If there is a display string at
7945 point, use it.vpos to compute how many lines to backtrack after
7946 move_it_to point. (Bug#11133)
7947
7948 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7949
7950 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7951 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7952 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7953 macros related to unification of CJK characters. For the details,
7954 see the discussion following the message here:
7955 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7956
7957 2012-04-04 Chong Yidong <cyd@gnu.org>
7958
7959 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7960
7961 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7962
7963 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7964 instead of alloca. (Bug#11138)
7965
7966 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7967
7968 * w32menu.c (is_simple_dialog): Properly check lisp types.
7969 (Bug#11141)
7970
7971 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7972
7973 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7974 position we get to after a call to move_it_to fails the
7975 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7976 only if we wind up in a string from display property. (Bug#11063)
7977
7978 * window.c (Fdelete_other_windows_internal): Invalidate the row
7979 and column information about mouse highlight, so that redisplay
7980 restores it after reallocating the glyph matrices. (Bug#7464)
7981
7982 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7983 string comes from a `display' text property, use the buffer
7984 position of that property as if we actually saw that position in
7985 the row's glyphs.
7986 (move_it_by_lines): Remove the assertion that
7987 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7988 violated when there's a before-string at the beginning of a line.
7989 (Bug#11063)
7990
7991 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7992
7993 * xdisp.c (append_space_for_newline): If the default face was
7994 remapped, use the remapped face for the appended newline.
7995 (extend_face_to_end_of_line): Use the remapped default face for
7996 extending the face to the end of the line.
7997 (display_line): Call extend_face_to_end_of_line when the default
7998 face was remapped. (Bug#11068)
7999
8000 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8001
8002 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8003
8004 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8005
8006 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8007
8008 2012-03-27 Glenn Morris <rgm@gnu.org>
8009
8010 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8011 Doc fixes.
8012
8013 2012-03-26 Kenichi Handa <handa@m17n.org>
8014
8015 * dispextern.h (struct glyph): Fix previous change. Change the
8016 bit length of glyphless.ch to 25 (Bug#11082).
8017
8018 2012-03-26 Chong Yidong <cyd@gnu.org>
8019
8020 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8021 (command_loop_1): Use it; inhibit selection update for
8022 handle-select-window too (Bug#8996).
8023
8024 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8025
8026 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8027
8028 2012-03-25 Kenichi Handa <handa@m17n.org>
8029
8030 * dispextern.h (struct glyph): Change the bit length of
8031 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8032
8033 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8034
8035 * s/ms-w32.h (tzname): Include time.h before redirecting to
8036 _tzname. Fixes the MSVC build. (Bug#9960)
8037
8038 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8039
8040 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8041 characters.
8042
8043 * xterm.c (XTread_socket): Only modify handling_signal if
8044 !SYNC_INPUT. (Bug#11080)
8045
8046 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8047
8048 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8049 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8050 when fetching a multibyte character consumes more bytes than
8051 CHAR_BYTES returns, due to unification of CJK characters in
8052 string_char. (Bug#11073)
8053
8054 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8055
8056 * process.c (wait_reading_process_output): Handle pty disconnect
8057 by refraining from sending oneself a SIGCHLD (bug#10933).
8058
8059 2012-03-22 Chong Yidong <cyd@gnu.org>
8060
8061 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8062
8063 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8064 Mark string as coming from a prefix property.
8065 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8066 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8067
8068 2012-03-21 Chong Yidong <cyd@gnu.org>
8069
8070 * xfaces.c (Vface_remapping_alist): Doc fix.
8071
8072 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8073
8074 * w32proc.c (Fw32_set_console_codepage)
8075 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8076 Doc fixes.
8077
8078 2012-03-20 Chong Yidong <cyd@gnu.org>
8079
8080 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8081 to reflect default non-nil value of redisplay-dont-pause.
8082
8083 2012-03-19 Kenichi Handa <handa@m17n.org>
8084
8085 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8086 it fit in a valid range (Bug#11003).
8087
8088 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8089
8090 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8091 that is not from display property, accept the row as a "cursor
8092 row" if one of the string's character has a non-nil `cursor'
8093 property. Fixes cursor positioning when there are newlines in
8094 overlay strings, e.g. in icomplete.el. (Bug#11035)
8095
8096 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8097
8098 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8099
8100 2012-03-12 Chong Yidong <cyd@gnu.org>
8101
8102 * eval.c (inhibit_lisp_code): Rename from
8103 inhibit_window_configuration_change_hook; move from window.c.
8104
8105 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8106 * window.c (run_window_configuration_change_hook)
8107 (syms_of_window): Callers changed.
8108
8109 2012-03-11 Chong Yidong <cyd@gnu.org>
8110
8111 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8112
8113 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8114
8115 2012-03-10 Chong Yidong <cyd@gnu.org>
8116
8117 * frame.c (other_visible_frames): Don't assume the selected frame
8118 is visible (Bug#10955).
8119
8120 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8121
8122 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8123
8124 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8125
8126 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8127 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8128 zero (Bug#10954).
8129
8130 2012-03-03 Glenn Morris <rgm@gnu.org>
8131
8132 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8133
8134 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8135
8136 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8137 position past the first glyph_row that ends at ZV. (Bug#10902)
8138 (redisplay_window, next_element_from_string): Fix typos in
8139 comments.
8140 (redisplay_window): Pass to move_it_vertically the margin in
8141 pixels, not in screen lines.
8142
8143 2012-03-02 Glenn Morris <rgm@gnu.org>
8144
8145 * buffer.c (buffer-list-update-hook): Doc fix.
8146
8147 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8148
8149 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8150 push_it before setting up the iterator for the first overlay
8151 string, even if we have an empty string loaded.
8152 (next_overlay_string): If there's an empty string on the iterator
8153 stack, pop the stack. (Bug#10903)
8154
8155 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8156
8157 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8158 Suggested by Stefan Monnier in
8159 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8160 * alloc.c (widen_to_Lisp_Object): New static function.
8161 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8162 and widening them to Lisp_Objects. This would work even if
8163 USE_LSB_TAG is defined and wide integers are used, which might
8164 happen in a future version of Emacs.
8165
8166 2012-02-25 Chong Yidong <cyd@gnu.org>
8167
8168 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8169 Doc fix.
8170
8171 * xselect.c (Fx_selection_exists_p): Doc fix.
8172 (x_clipboard_manager_save_all): Print an informative message
8173 before saving to clipboard manager.
8174
8175 2012-02-24 Chong Yidong <cyd@gnu.org>
8176
8177 * keyboard.c (process_special_events): Handle all X selection
8178 requests in kbd_buffer, not just the next one (Bug#8869).
8179
8180 2012-02-23 Chong Yidong <cyd@gnu.org>
8181
8182 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8183 call when setting menu-bar-lines and tool-bar-lines parameters.
8184 (unwind_create_frame_1): New helper function.
8185
8186 * window.c (inhibit_window_configuration_change_hook): New var.
8187 (run_window_configuration_change_hook): Obey it.
8188 (syms_of_window): Initialize it.
8189
8190 2012-02-22 Chong Yidong <cyd@gnu.org>
8191
8192 * xterm.c (x_draw_image_relief): Add missing type check for
8193 Vtool_bar_button_margin (Bug#10743).
8194
8195 2012-02-21 Chong Yidong <cyd@gnu.org>
8196
8197 * fileio.c (Vfile_name_handler_alist): Doc fix.
8198
8199 * buffer.c (Fget_file_buffer): Protect against invalid file
8200 handler return value.
8201
8202 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8203
8204 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8205 when computing $valmask.
8206
8207 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8208 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8209 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8210 It's useless in that case, and it can cause problems on hosts
8211 that allocate halves of EMACS_INT values separately.
8212 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8213 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8214 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8215 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8216 it avoids undefined behavior on hosts where shifting right by more
8217 than the word width has undefined behavior.
8218
8219 2012-02-19 Chong Yidong <cyd@gnu.org>
8220
8221 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8222 (Funhandled_file_name_directory, Ffile_name_as_directory)
8223 (Fdirectory_file_name, Fexpand_file_name)
8224 (Fsubstitute_in_file_name): Protect against invalid file handler
8225 return values (Bug#10845).
8226
8227 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8228
8229 * .gdbinit (pitx): Fix incorrect references to fields of the
8230 iterator stack.
8231
8232 2012-02-17 Chong Yidong <cyd@gnu.org>
8233
8234 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8235
8236 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8237
8238 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8239 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8240
8241 2012-02-15 Chong Yidong <cyd@gnu.org>
8242
8243 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8244 marked as special. Also, starting docstrings with * is obsolete.
8245
8246 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8247
8248 * gnutls.c (emacs_gnutls_write): Fix last change.
8249
8250 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8251
8252 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8253 send_process.
8254
8255 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8256
8257 * keymap.c (Fsingle_key_description): Handle char ranges.
8258
8259 2012-02-12 Chong Yidong <cyd@gnu.org>
8260
8261 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8262 as that creates a dangerous corner case.
8263
8264 * window.c (Fdelete_window_internal): Invalidate the mouse
8265 highlight (Bug#9904).
8266
8267 2012-02-12 Glenn Morris <rgm@gnu.org>
8268
8269 * xselect.c (Fx_own_selection_internal)
8270 (Fx_get_selection_internal, Fx_disown_selection_internal)
8271 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8272 * nsselect.m (Fx_own_selection_internal)
8273 (Fx_disown_selection_internal, Fx_selection_exists_p)
8274 (Fx_selection_owner_p, Fx_get_selection_internal):
8275 Sync docs and argument specs with the xselect.c versions.
8276
8277 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8278
8279 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8280
8281 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8282
8283 * w32select.c (Fx_selection_exists_p): Sync doc string and
8284 argument list with xselect.c. (Bug#10783)
8285
8286 * w16select.c (Fx_selection_exists_p): Sync doc string and
8287 argument list with xselect.c. (Bug#10783)
8288
8289 2012-02-10 Glenn Morris <rgm@gnu.org>
8290
8291 * fns.c (Fsecure_hash): Doc fix.
8292
8293 2012-02-09 Kenichi Handa <handa@m17n.org>
8294
8295 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8296
8297 2012-02-07 Chong Yidong <cyd@gnu.org>
8298
8299 * buffer.c (Fbuffer_local_variables)
8300 (buffer_lisp_local_variables): Handle unbound vars correctly;
8301 don't let Qunbound leak into Lisp.
8302
8303 2012-02-07 Glenn Morris <rgm@gnu.org>
8304
8305 * image.c (Fimagemagick_types): Doc fix.
8306
8307 * image.c (imagemagick-render-type): Change it from a lisp object
8308 to an integer. Move the doc here from the lisp manual.
8309 Treat all values not equal to 0 the same.
8310
8311 2012-02-06 Chong Yidong <cyd@gnu.org>
8312
8313 * doc.c (store_function_docstring): Avoid applying docstring of
8314 alias to base function (Bug#2603).
8315
8316 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8317
8318 * .gdbinit (pp1, pv1): Remove redundant defines.
8319 (pr): Use pp.
8320
8321 2012-02-04 Chong Yidong <cyd@gnu.org>
8322
8323 * nsterm.m: Declare a global (Bug#10694).
8324
8325 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8326
8327 * w32.c (get_emacs_configuration_options):
8328 Include --enable-checking, if specified, in the return value.
8329
8330 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8331
8332 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8333 after rounding frame sizes. (Bug#9723)
8334
8335 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8336
8337 * keyboard.c (adjust_point_for_property): Don't position point
8338 before BEGV. (Bug#10696)
8339
8340 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8341
8342 Handle overflow when computing char display width (Bug#9496).
8343 * character.c (char_width): Return EMACS_INT, not int.
8344 (char_width, c_string_width): Check for overflow when
8345 computing the width; this is possible now that individual
8346 characters can have unbounded width. Problem introduced
8347 by merge from Emacs 23 on 2012-01-19.
8348
8349 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8350
8351 * dbusbind.c (Fdbus_register_method): Mention the return value
8352 :ignore in the docstring.
8353
8354 2012-02-02 Glenn Morris <rgm@gnu.org>
8355
8356 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8357
8358 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8359 Unconditionally set to t. (Bug#10673)
8360 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8361 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8362 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8363
8364 2012-02-02 Kenichi Handa <handa@m17n.org>
8365
8366 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8367 0, do not call append_composite_glyph.
8368
8369 2012-02-02 Kenichi Handa <handa@m17n.org>
8370
8371 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8372 NULL (Bug#6988).
8373 (x_produce_glyphs): If the component of a composition is a null
8374 string, set it->pixel_width to 1 to avoid zero-width glyph.
8375
8376 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8377
8378 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8379 first 2 arguments are identical. This makes inserting large
8380 output from a subprocess an order of magnitude faster on
8381 MS-Windows, where all sbrk'ed memory is always contiguous.
8382
8383 2012-01-31 Glenn Morris <rgm@gnu.org>
8384
8385 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8386 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8387 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8388
8389 2012-01-29 Glenn Morris <rgm@gnu.org>
8390
8391 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8392
8393 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8394
8395 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8396
8397 2012-01-28 Chong Yidong <cyd@gnu.org>
8398
8399 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8400
8401 2012-01-26 Chong Yidong <cyd@gnu.org>
8402
8403 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8404
8405 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8406 repeat counts (Bug#10507).
8407
8408 2012-01-26 Glenn Morris <rgm@gnu.org>
8409
8410 * lread.c (syms_of_lread): Doc fix.
8411
8412 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8413
8414 * coding.c (encode_designation_at_bol): Change return value to
8415 EMACS_INT.
8416
8417 2012-01-25 Chong Yidong <cyd@gnu.org>
8418
8419 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8420
8421 2012-01-21 Chong Yidong <cyd@gnu.org>
8422
8423 * floatfns.c (Fcopysign): Make the second argument non-optional,
8424 since nil is not allowed anyway.
8425
8426 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8427
8428 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8429 (send_process): Likewise.
8430
8431 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8432
8433 * window.c (save_window_save, Fcurrent_window_configuration)
8434 (Vwindow_persistent_parameters): Do not use Qstate.
8435 Rewrite doc-strings.
8436
8437 2012-01-19 Kenichi Handa <handa@m17n.org>
8438
8439 * character.c (char_width): New function.
8440 (Fchar_width, c_string_width, lisp_string_width):
8441 Use char_width (Bug#9496).
8442
8443 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8444
8445 * window.c (Vwindow_persistent_parameters): New variable.
8446 (Fset_window_configuration, save_window_save): Handle persistent
8447 window parameters.
8448
8449 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8450
8451 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8452 thrashing the stack of the thread. (Bug#9087)
8453
8454 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8455
8456 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8457
8458 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8459
8460 * xdisp.c (rows_from_pos_range): Handle the case where the
8461 highlight ends on a newline. (Bug#10464)
8462 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8463 he end column for display of highlight that ends on a newline
8464 before a R2L line.
8465
8466 2012-01-11 Glenn Morris <rgm@gnu.org>
8467
8468 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8469 from load-path also when installation-directory is nil. (Bug#10208)
8470
8471 2012-01-10 Glenn Morris <rgm@gnu.org>
8472
8473 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8474
8475 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8476 Update template values to be closer to their typical values these days.
8477
8478 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8479
8480 * xdisp.c (rows_from_pos_range): Accept additional argument
8481 DISP_STRING, and accept any glyph in a row whose object is that
8482 string as eligible for mouse highlight. Fixes mouse highlight of
8483 display strings from overlays. (Bug#10464)
8484
8485 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8486
8487 emacs: fix an auto-save permissions race condition (Bug#10400)
8488 * fileio.c (auto_saving_dir_umask): New static var.
8489 (Fmake_directory_internal): Use it.
8490 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8491 creating the directory. The old code temporarily assigns
8492 too-generous permissions to the directory.
8493 (do_auto_save_eh): Clear it.
8494 (Fdo_auto_save): Catch all errors, not just file errors, so
8495 that the var is always cleared.
8496
8497 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8498
8499 * search.c (scan_buffer): Pass character positions to
8500 know_region_cache, not byte positions. (Bug#6540)
8501
8502 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8503
8504 * w32.c (sys_rename): Report EXDEV when rename of a directory
8505 fails because the target is on another logical disk. (Bug#10284)
8506
8507 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8508
8509 * xterm.c (x_embed_request_focus): New function.
8510
8511 * xterm.h: Add prototype.
8512
8513 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8514
8515 2012-01-05 Glenn Morris <rgm@gnu.org>
8516
8517 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8518
8519 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8520
8521 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8522 Load gnutls_transport_set_lowat only if GnuTLS version is below
8523 2.11.1.
8524 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8525 GnuTLS versions below 2.11.1.
8526
8527 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8528
8529 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8530 to the doc string advising against its use for altering the way
8531 windows are scrolled.
8532
8533 2011-12-28 Kenichi Handa <handa@m17n.org>
8534
8535 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8536 coding-system ASCII compatible only when it does not produce BOM
8537 on encoding (Bug#10383).
8538
8539 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8540
8541 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8542 can scroll.
8543 (create_and_show_popup_menu): Always use menu_position_func for
8544 Gtk3 (Bug#10361).
8545
8546 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8547
8548 * callint.c (Fcall_interactively): Don't truncate prompt string.
8549
8550 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8551
8552 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8553 property that ends at ZV, so that the bidi iteration could be
8554 resumed from there (after widening). (Bug#10360)
8555
8556 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8557
8558 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8559
8560 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8561
8562 * nsterm.m (x_free_frame_resources):
8563 Release f->output_data.ns->miniimage.
8564 (ns_index_color): Fix indentation. Do not retain
8565 color_table->colors[i].
8566
8567 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8568 before returning.
8569
8570 * nsfns.m (x_set_background_color): Assign return value from
8571 ns_index_color to face-background instead of NSColor*.
8572 (ns_implicitly_set_icon_type): Fix indentation.
8573 Change assignment in for loop to comparison.
8574
8575 * emacs.c (ns_pool): New variable.
8576 (main): Assign ns_pool.
8577 (Fkill_emacs): Call ns_release_autorelease_pool.
8578
8579 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8580 autorelease fdesc, release fdAttrs and tdict.
8581 (ns_get_covering_families): Release charset.
8582 (ns_findfonts): Release NSFontDescriptor created with new.
8583 (ns_uni_to_glyphs): Fix indentation.
8584 (setString): Release attrStr before assigning new value.
8585
8586 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8587
8588 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8589 and NS_IMPL_COCOA.
8590 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8591 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8592
8593 2011-12-18 David Reitter <reitter@cmu.edu>
8594
8595 * nsterm.m (ns_term_init): Subscribe for notifications
8596 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8597 to method trackingNotification in EmacsMenu.
8598
8599 * nsmenu.m (trackingMenu): New variable.
8600 (trackingNotification): New method (from Aquamacs).
8601 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8602 from Aquamacs (Bug#7030).
8603
8604 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8605
8606 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8607 (symbol_to_nsstring): Fix indentation.
8608 (ns_symbol_to_pb): New function.
8609 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8610 (Fns_rotate_cut_buffers_internal): Remove.
8611 (Fns_store_selection_internal): Rename from
8612 Fns_store_cut_buffer_internal.
8613 (ns_get_foreign_selection, Fx_own_selection_internal)
8614 (Fx_disown_selection_internal, Fx_selection_exists_p)
8615 (Fns_get_selection_internal, Fns_store_selection_internal):
8616 Use ns_symbol_to_pb and check if return value is nil.
8617 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8618 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8619 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8620 renamed to Sns_store_selection_internal.
8621 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8622 and remove this function.
8623 (ns_handle_selection_clear): Remove, never used.
8624 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8625 here.
8626
8627 2011-12-17 Ken Brown <kbrown@cornell.edu>
8628
8629 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8630 GID is unknown (Bug#10257).
8631
8632 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8633
8634 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8635 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8636 which caused a build failure on GNU/Linux IA-64. This problem was
8637 introduced by my 2011-10-07 patch.
8638
8639 2011-12-15 Juri Linkov <juri@jurta.org>
8640
8641 * image.c (imagemagick_error): New function. (Bug#10112)
8642 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8643 Use `imagemagick_error' where ImageMagick functions return
8644 `MagickFalse'.
8645 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8646 proper order.
8647
8648 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8649
8650 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8651 fill background (Bug#8992).
8652
8653 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8654
8655 * window.c (Vwindow_combination_resize)
8656 (Vwindow_combination_limit): Use t instead of non-nil in
8657 doc-strings.
8658 (Vrecenter_redisplay): Add first sentence of doc-string on
8659 separate line.
8660 (Frecenter): Fix doc-string typo.
8661
8662 2011-12-11 Kenichi Handa <handa@m17n.org>
8663
8664 * coding.c (Funencodable_char_position): Pay attention to the
8665 buffer text relocation (Bug#9389).
8666
8667 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8668
8669 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8670 gtk_init (Bug#10100).
8671
8672 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8673
8674 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8675 IT->string is nil. (Bug#10263)
8676
8677 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8678
8679 * nsterm.h (x_free_frame_resources): Declare.
8680
8681 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8682 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8683
8684 * nsterm.h (ns_get_defaults_value): Declare.
8685
8686 * nsterm.m (ns_default): Call ns_get_defaults_value.
8687
8688 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8689
8690 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8691 (Bug#10170)
8692
8693 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8694
8695 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8696 that where the value of an _OBJC_* symbol points to is in the .bss
8697 section (Bug#10240).
8698
8699 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8700
8701 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8702 after the loop to call ccl_driver at least once (Bug#8619).
8703
8704 2011-12-08 Kenichi Handa <handa@m17n.org>
8705
8706 * ftfont.c (get_adstyle_property): Fix previous change
8707 (Bug#10233).
8708
8709 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8710
8711 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8712 dirs from the default value of EMACSLOADPATH (bug#10208).
8713
8714 2011-12-07 Glenn Morris <rgm@gnu.org>
8715
8716 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8717 installation and source directories as well. (Bug#10208)
8718
8719 2011-12-06 Chong Yidong <cyd@gnu.org>
8720
8721 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8722
8723 2011-12-06 Glenn Morris <rgm@gnu.org>
8724
8725 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8726 as an error, not just -1. (Bug#10217)
8727
8728 2011-12-05 Chong Yidong <cyd@gnu.org>
8729
8730 * keyboard.c (process_special_events): New function.
8731 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8732
8733 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8734
8735 * coding.c (encode_designation_at_bol): Don't use uninitialized
8736 local variable (Bug#9318).
8737
8738 2011-12-05 Kenichi Handa <handa@m17n.org>
8739
8740 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8741 return Qnil (Bug#8046, Bug#10193).
8742
8743 2011-12-05 Kenichi Handa <handa@m17n.org>
8744
8745 * coding.c (encode_designation_at_bol): New args charbuf_end and
8746 dst. Return the number of produced bytes. Callers changed.
8747 (coding_set_source): Return how many bytes coding->source was
8748 relocated.
8749 (coding_set_destination): Return how many bytes
8750 coding->destination was relocated.
8751 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8752 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8753
8754 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8755
8756 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8757 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8758 macro (Bug#9318).
8759
8760 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8761
8762 The following changes are to fix Bug#9318.
8763
8764 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8765 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8766 (encode_coding_iso_2022, encode_coding_sjis)
8767 (encode_coding_big5, encode_coding_charset): Use the above macros.
8768
8769 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8770
8771 * lisp.h (process_quit_flag): Fix external declaration.
8772
8773 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8774
8775 Don't macro-inline non-performance-critical code.
8776 * eval.c (process_quit_flag): New function.
8777 * lisp.h (QUIT): Use it.
8778
8779 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8780
8781 * nsfns.m (get_geometry_from_preferences): New function.
8782 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8783
8784 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8785
8786 * emacs.c (Qkill_emacs): Define.
8787 (syms_of_emacs): Initialize it.
8788 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8789 Qquit_flag to `kill-emacs' instead.
8790 (quit_throw_to_read_char): Add parameter `from_signal'.
8791 All callers changed. Call Fkill_emacs if requested and safe.
8792 * lisp.h (QUIT): Call Fkill_emacs if requested.
8793
8794 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8795
8796 * widget.c (update_wm_hints): Return if wmshell is null.
8797 (widget_update_wm_size_hints): New function.
8798
8799 * widget.h (widget_update_wm_size_hints): Declare.
8800
8801 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8802 widget_update_wm_size_hints (Bug#10104).
8803
8804 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8805
8806 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8807 before a newline, prepare the bidi iterator for consuming the
8808 newline, and keep the current paragraph direction. (Bug#10183)
8809 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8810
8811 2011-12-02 Juri Linkov <juri@jurta.org>
8812
8813 * search.c (Fword_search_regexp): New Lisp function created from
8814 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8815 (Fword_search_backward, Fword_search_forward)
8816 (Fword_search_backward_lax, Fword_search_forward_lax):
8817 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8818 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8819
8820 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8821
8822 * fileio.c (Finsert_file_contents): Move after-change-function call
8823 to before the "handled:" label, since all "goto handled" appear in
8824 cases where the *-change-functions have already been properly called
8825 (bug#10117).
8826
8827 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8828
8829 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8830 waiting for input. (Bug#10169)
8831
8832 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8833
8834 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8835 verifies glyph row's hash code--we have just reallocated the
8836 glyphs, so their contents can be complete garbage. (Bug#10164)
8837
8838 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8839
8840 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8841
8842 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8843
8844 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8845 attributes are tested _before_ calling verify_row_hash, to protect
8846 against GCC re-ordering of the tests. (Bug#10164)
8847
8848 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8849
8850 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8851
8852 * xterm.c (handle_one_xevent): Only set async_visible and friends
8853 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8854 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8855 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8856
8857 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8858
8859 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8860 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8861 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8862 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8863 All uses changed to use GCPRO1 etc.
8864 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8865 Revert to old implementation (i.e., before 2011-03-11).
8866
8867 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8868
8869 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8870 of scroll runs so as to avoid assigning disabled bogus rows and
8871 unnecessary graphics copy operations.
8872
8873 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8874
8875 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8876 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8877 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8878 (malloc, free, realloc, calloc): Redirect to e_* only when
8879 compiling Emacs.
8880
8881 * lisp.h (GCTYPEBITS): Move before first use.
8882 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8883 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8884 this macro definition.
8885
8886 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8887 _MSC_VER.
8888
8889 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8890
8891 * gtkutil.c (xg_create_frame_widgets):
8892 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8893 present with Gtk+ 2.0.
8894
8895 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8896
8897 * fileio.c (Finsert_file_contents): Undo previous change; see
8898 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8899
8900 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8901
8902 Rename locals to avoid shadowing.
8903 * fileio.c (Finsert_file_contents):
8904 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8905 * process.c (wait_reading_process_output):
8906 Rename inner 'proc' to 'p' to avoid shadowing.
8907 Indent for consistency with usual Emacs style.
8908
8909 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8910
8911 * xdisp.c (redisplay_window): If cursor row is not fully visible
8912 after recentering, and scroll-conservatively is set to a large
8913 number, scroll window by a few more lines to make the cursor fully
8914 visible and out of scroll-margin. (Bug#10105)
8915 (start_display): Don't move to the next line if the display should
8916 start at a newline that is part of a display vector or an overlay
8917 string. (Bug#10119)
8918
8919 2011-11-24 Juri Linkov <juri@jurta.org>
8920
8921 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8922 after the `MagickPingImage' call. (Bug#10112)
8923
8924 2011-11-23 Chong Yidong <cyd@gnu.org>
8925
8926 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8927
8928 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8929
8930 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8931 making another buffer current. (Bug#10114)
8932
8933 2011-11-23 Glenn Morris <rgm@gnu.org>
8934
8935 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8936
8937 2011-11-23 Chong Yidong <cyd@gnu.org>
8938
8939 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8940 using it (Bug#5984).
8941
8942 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8943
8944 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8945 and header-lines, as they don't have one computed for them.
8946 (Bug#10098)
8947
8948 * .gdbinit (prow): Make displayed values more self-explaining.
8949 Add row's hash code.
8950
8951 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8952
8953 * process.c (wait_reading_process_output): Fix asynchrounous
8954 GnuTLS socket handling on some versions of the GnuTLS library.
8955 (wait_reading_process_output): Add comment and URL.
8956
8957 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8958
8959 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8960
8961 2011-11-21 Chong Yidong <cyd@gnu.org>
8962
8963 * window.c (Fnext_window, Fprevious_window): Doc fix.
8964
8965 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8966
8967 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8968
8969 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8970
8971 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8972
8973 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8974
8975 * window.c (Fset_window_combination_limit): Rename argument
8976 STATUS to LIMIT.
8977 (Vwindow_combination_limit): Remove "status" from doc-string.
8978
8979 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8980
8981 * m/ibms390.h: Remove.
8982 * m/ibms390x.h: Don't include "ibms390.h".
8983
8984 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8985
8986 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8987 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8988
8989 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8990
8991 * casetab.c (Fset_case_table):
8992 * charset.c (Fcharset_after): Fix typos.
8993
8994 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8995
8996 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8997 Otherwise, valgrind does not work on some platforms.
8998 Problem reported by Andreas Schwab in
8999 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9000 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9001 is set, removing the need for VIRT_ADDRESS_VARIES.
9002 (PURE_P): Use a more-efficient implementation that needs just one
9003 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9004 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9005 to 4 (xorl, subq, cmpq, setbe).
9006 * alloc.c (pure): Always extern now, since that's the
9007 VIRT_ADDR_VARIES behavior.
9008 (PURE_POINTER_P): Use a single comparison, not two, for
9009 consistency with the new puresize.h.
9010 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9011 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9012 Remove VIRT_ADDR_VARIES no longer needed.
9013
9014 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9015
9016 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9017 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9018 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9019 behave as if the cursor position were at the window margin.
9020
9021 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9022 and the cursor position is out of bounds, behave as if the cursor
9023 position were at the window margin. (Bug#10075)
9024
9025 2011-11-18 Chong Yidong <cyd@gnu.org>
9026
9027 * window.c (Fwindow_combination_limit): Make first argument
9028 non-optional, since it is meaningless for live windows like the
9029 selected window.
9030
9031 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9032
9033 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9034
9035 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9036
9037 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9038 (graft_intervals_into_buffer): Simplify.
9039
9040 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9041
9042 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9043 hash values of the two rows.
9044 (copy_row_except_pointers): Preserve the used[] arrays and the
9045 hash values of the two rows. (Bug#10035)
9046 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9047
9048 * xdisp.c (row_hash): New function, body extracted from
9049 compute_line_metrics.
9050 (compute_line_metrics): Call row_hash, instead of computing the
9051 hash code inline.
9052
9053 * dispnew.c (verify_row_hash): Call row_hash for computing the
9054 hash code of a row, instead of duplicating code from xdisp.c.
9055
9056 * dispextern.h (row_hash): Add prototype.
9057
9058 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9059
9060 * frame.c (delete_frame): Don't delete the terminal when the last
9061 X frame is closed if emacs is built with GTK toolkit.
9062
9063 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9064
9065 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9066
9067 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9068
9069 * window.c (Vwindow_splits): Rename to
9070 Vwindow_combination_resize. Suggested by Juri Linkov.
9071 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9072 of Vwindow_splits.
9073
9074 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9075
9076 * nsfns.m (Fns_font_name):
9077 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9078
9079 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9080
9081 * window.h (window): Rename slot "nest" to "combination_limit".
9082 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9083 (Fset_window_nest): Rename to Fset_window_combination_limit.
9084 (Vwindow_nest): Rename to Vwindow_combination_limit.
9085 (recombine_windows, make_parent_window, make_window)
9086 (Fsplit_window_internal, saved_window)
9087 (Fset_window_configuration, save_window_save): Rename all
9088 occurrences of window_nest to window_combination_limit.
9089
9090 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9091
9092 * image.c (imagemagick_load_image): Fix typo.
9093
9094 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9095
9096 * xdisp.c (display_line): Move the call to
9097 highlight_trailing_whitespace before the call to
9098 compute_line_metrics, since the latter needs to see the final
9099 faces of all the glyphs to compute ROW's hash value.
9100 Fixes assertion violations in row_equal_p. (Bug#10035)
9101
9102 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9103
9104 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9105 just return (bug#10044).
9106
9107 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9108
9109 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9110 with user-defined heap size. Bump the default size of the temacs
9111 heap to 27MB, to avoid memory warning when running temacs.
9112 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9113
9114 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9115 current_matrix and desired_matrix. (Bug#9990)
9116 (verify_row_hash) [XASSERTS]: New function.
9117 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9118 that the hash value of glyph rows is correct.
9119
9120 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9121
9122 * window.h (window): Remove splits slot.
9123 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9124 (Fdelete_other_windows_internal, make_parent_window)
9125 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9126 (Fset_window_configuration, save_window_save): Don't deal with
9127 split status of windows.
9128 (saved_window): Remove splits slot.
9129 (Vwindow_splits): Rewrite doc-string.
9130
9131 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9132
9133 * xfns.c (unwind_create_frame):
9134 * nsfns.m (unwind_create_frame):
9135 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9136 Vframe_list (Bug#9999).
9137
9138 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9139
9140 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9141
9142 2011-11-11 Kenichi Handa <handa@m17n.org>
9143
9144 * callproc.c (Fcall_process): Set the member dst_multibyte of
9145 process_coding.
9146
9147 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9148
9149 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9150 avoid a crash (bug#9496).
9151
9152 2011-11-09 Chong Yidong <cyd@gnu.org>
9153
9154 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9155 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9156
9157 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9158
9159 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9160
9161 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9162
9163 Avoid some portability problems by eschewing 'extern inline' functions.
9164 The trivial performance wins aren't worth the portability hassles; see
9165 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9166 et seq.
9167 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9168 (window_box_width, window_box_left, window_box_left_offset)
9169 (window_box_right, window_box_right_offset): Undo previous change,
9170 by removing the "extern"s.
9171 * intervals.c (adjust_intervals_for_insertion)
9172 (adjust_intervals_for_deletion): Undo previous change,
9173 making these static again.
9174 (offset_intervals, temp_set_point_both, temp_set_point)
9175 (copy_intervals_to_string): No longer inline.
9176 * xdisp.c (window_text_bottom_y, window_box_width)
9177 (window_box_height, window_box_left_offset)
9178 (window_box_right_offset, window_box_left, window_box_right)
9179 (window_box): No longer inline.
9180
9181 2011-11-08 Chong Yidong <cyd@gnu.org>
9182
9183 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9184 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9185 Signal an error if not a live window.
9186 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9187 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9188
9189 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9190
9191 * lisp.h (syms_of_abbrev): Remove declaration.
9192 Reported by CHENG Gao <chenggao@royau.me>.
9193
9194 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9195
9196 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9197 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9198 of temacs in GUI mode.
9199
9200 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9201
9202 * window.h: Declare delete_all_child_windows instead of
9203 delete_all_subwindows.
9204 * window.c (Fwindow_nest, Fset_window_nest)
9205 (Fset_window_new_total, Fset_window_new_normal)
9206 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9207 (delete_all_subwindows): Rename to delete_all_child_windows.
9208 (Fdelete_other_windows_internal, Fset_window_configuration):
9209 Call delete_all_child_windows instead of delete_all_subwindows.
9210 * frame.c (delete_frame): Call delete_all_child_windows instead
9211 of delete_all_subwindows.
9212
9213 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9214
9215 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9216 This is also needed for porting to any host where GC_MARK_STACK is
9217 not GC_MAKE_GCPROS_NOOPS.
9218 (which_symbols): Use it.
9219
9220 2011-11-07 Kenichi Handa <handa@m17n.org>
9221
9222 * coding.c (coding_set_destination): Check coding->src_pos only
9223 when coding->src_object is a buffer (bug#9910).
9224
9225 * process.c (send_process): Set the member src_multibyte of coding
9226 to 0 (bug#9911) when sending a unibyte text.
9227
9228 * callproc.c (Fcall_process): Set the member src_multibyte of
9229 process_coding to 0 (bug#9912).
9230
9231 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9232
9233 * xmenu.c (cleanup_widget_value_tree): New function.
9234 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9235 calling free_menubar_widget_value_tree directly (Bug#9830).
9236
9237 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9238
9239 Fix some portability problems with 'inline'.
9240 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9241 (window_box_width, window_box_left, window_box_left_offset)
9242 (window_box_right, window_box_right_offset): Declare extern.
9243 Otherwise, these inline functions do not conform to C99 and
9244 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9245 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9246 * intervals.c (adjust_intervals_for_insertion)
9247 (adjust_intervals_for_deletion): Now extern, because otherwise the
9248 extern inline functions 'offset_intervals' couldn't refer to it.
9249 (static_offset_intervals): Remove.
9250 (offset_intervals): Rewrite using the old contents of
9251 static_offset_intervals. The old version didn't conform to C99
9252 because an extern inline function contained a reference to an
9253 identifier with static linkage.
9254
9255 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9256
9257 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9258 GC.
9259
9260 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9261
9262 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9263 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9264 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9265 return Qleft_to_right.
9266
9267 2011-11-06 Chong Yidong <cyd@gnu.org>
9268
9269 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9270 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9271 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9272 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9273 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9274 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9275 (Fwindow_vscroll): Doc fix.
9276 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9277 argument, since it makes no sense to pass a live window and for
9278 consistency with window-child.
9279
9280 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9281
9282 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9283 support MSVC.
9284
9285 2011-11-05 Jason Rumney <jasonr@gnu.org>
9286
9287 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9288 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9289 fonts (Bug#6029).
9290 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9291 bitwise arithmetic preventing use of unicode-sip and non-truetype
9292 opentype fonts.
9293
9294 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9295
9296 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9297 "emacs"-only part.
9298
9299 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9300 initialization code to keep similarity to xfns.c after changes
9301 from 2011-11-05.
9302
9303 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9304
9305 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9306 (unwind_create_frame): New function (Bug#9943).
9307 (Fx_create_frame): Restructure code to be more similar to the one in
9308 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9309 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9310 Move terminal->reference_count++ just before making the frame official
9311 (Bug#9943).
9312
9313 * nsterm.m (x_free_frame_resources): New function.
9314 (x_destroy_window): Move code to x_free_frame_resources.
9315
9316 * xfns.c (unwind_create_frame): Fix comment.
9317 (Fx_create_frame, x_create_tip_frame):
9318 Move terminal->reference_count++ just before making the frame
9319 official. Move initialization of image_cache_refcount and
9320 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9321
9322 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9323
9324 Support MSVC build with newer versions of Visual Studio.
9325 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9326 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9327 nt/gmake.defs.
9328
9329 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9330 which are not supported by MSVC.
9331 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9332 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9333 bitfields.
9334 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9335 types in bitfields.
9336 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9337
9338 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9339
9340 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9341
9342 Support MSVC build with newer versions of Visual Studio.
9343 * w32.c: Don't include w32api.h for MSVC.
9344 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9345
9346 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9347 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9348 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9349 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9350 e_* cousins.
9351 (alloca) [_MSC_VER]: Define to _alloca.
9352
9353 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9354
9355 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9356
9357 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9358
9359 * xdisp.c (note_mouse_highlight): If either of
9360 previous/next-single-property-change returns nil, treat that as
9361 the beginning or the end of the buffer. (Bug#9955)
9362
9363 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9364
9365 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9366 label is not null (Bug#9951).
9367 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9368 may be NULL.
9369
9370 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9371
9372 * window.c (Fwindow_body_size): Mention in the doc string that the
9373 return value is in frame's canonical units. (Bug#9949)
9374
9375 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9376
9377 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9378
9379 * w32fns.c (unwind_create_frame): If needed, free the glyph
9380 matrices of the partially constructed frame. (Bug#9943)
9381 * xfns.c (unwind_create_frame): Likewise.
9382
9383 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9384
9385 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9386 Don't stop backward scan on the continuation glyph, even though
9387 its CHARPOS is positive.
9388 (mouse_face_from_buffer_pos, note_mouse_highlight):
9389 Rename cover_string to disp_string.
9390
9391 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9392
9393 * window.c (temp_output_buffer_show): Don't use
9394 Vtemp_buffer_show_specifiers.
9395 (Vtemp_buffer_show_specifiers): Remove unused variable.
9396
9397 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9398
9399 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9400 past the beginning of the current glyph matrix.
9401
9402 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9403
9404 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9405 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9406 HAVE_GTK3 (Bug#9869).
9407
9408 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9409 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9410
9411 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9412
9413 * xterm.c: Declare x_handle_net_wm_state to return int.
9414 (handle_one_xevent): Check if we are iconified but don't have
9415 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9416 (get_current_wm_state): Return non-zero if not hidden,
9417 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9418 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9419 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9420 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9421
9422 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9423
9424 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9425 so that this new function doesn't get optimized away by a
9426 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9427
9428 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9429
9430 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9431
9432 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9433
9434 Fix the `xbytecode' command.
9435 * .gdbinit (xprintbytestr): New command.
9436 (xwhichsymbols): Rename from `which'; all callers changed.
9437 (xbytecode): Print the byte-code string as well.
9438
9439 2011-10-29 Kim Storm <storm@cua.dk>
9440
9441 * alloc.c (which_symbols): New function.
9442
9443 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9444
9445 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9446 line. (Bug#9903)
9447
9448 2011-10-29 Glenn Morris <rgm@gnu.org>
9449
9450 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9451 Not clear what it was for, and it causes various bugs. (Bug#9839)
9452
9453 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9454
9455 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9456 possible random value that matches one of those tested as
9457 condition to clear the mouse face.
9458
9459 2011-10-28 Chong Yidong <cyd@gnu.org>
9460
9461 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9462
9463 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9464
9465 * window.c (make_window): Initialize phys_cursor_on_p.
9466
9467 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9468
9469 * lisp.h (struct Lisp_Symbol): Update comments.
9470
9471 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9472
9473 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9474
9475 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9476
9477 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9478 <oslsachem@gmail.com> for helping to debug this.
9479
9480 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9481 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9482 (g_b_init_get_glyph_outline_w): New static variables.
9483 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9484 (GetGlyphOutlineW_Proc): New typedefs.
9485 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9486 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9487 New functions.
9488 (w32font_open_internal, compute_metrics):
9489 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9490 instead of calling the "wide" APIs directly.
9491
9492 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9493
9494 * w32.h (syms_of_w32font): Add prototype.
9495
9496 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9497
9498 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9499 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9500 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9501 (Fmove_to_window_line): Doc fix.
9502
9503 2011-10-27 Chong Yidong <cyd@gnu.org>
9504
9505 * process.c (make_process): Set gnutls_state to NULL.
9506
9507 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9508 non-NULL, regardless of GNUTLS_INITSTAGE.
9509 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9510 an error. Set process slots as soon as we allocate them.
9511
9512 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9513
9514 2011-10-27 Chong Yidong <cyd@gnu.org>
9515
9516 * gnutls.c (emacs_gnutls_deinit): New function.
9517 Deallocate credentials structures as well as calling gnutls_deinit.
9518 (Fgnutls_deinit, Fgnutls_boot): Use it.
9519
9520 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9521 (deactivate_process): Call emacs_gnutls_deinit.
9522
9523 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9524
9525 * image.c (x_create_x_image_and_pixmap):
9526 * w32.c (sys_rename, w32_delayed_load):
9527 * w32font.c (fill_in_logfont):
9528 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9529
9530 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9531
9532 * w32fns.c (w32_default_color_map): New function,
9533 extracted from Fw32_default_color_map.
9534 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9535
9536 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9537
9538 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9539
9540 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9541
9542 * keyboard.c (test_undefined): New function (bug#9751).
9543 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9544
9545 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9546
9547 * sysdep.c (init_sys_modes): Fix the check for the controlling
9548 terminal (Bug#6649).
9549
9550 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9551
9552 * dispextern.h (struct bidi_it): New member next_en_type.
9553
9554 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9555 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9556 current character, check also for next_en_type being WEAK_EN.
9557 (bidi_resolve_weak): Don't enter the expensive loop if the current
9558 position is before next_en_pos. Record the bidi type of the first
9559 non-ET, non-BN character we find, in addition to its position.
9560 (bidi_level_of_next_char): Invalidate next_en_type when
9561 next_en_pos is over-stepped.
9562
9563 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9564
9565 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9566 * editfns.c: Rewrite current-time-zone so that it invokes
9567 the equivalent of (format-time-string "%Z") to get the time zone name.
9568 This fixes a bug when the time zone name contains characters that
9569 need converting from the system time locale to Emacs internal format.
9570 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9571 that patch fixed format-time-string to do the conversion, but
9572 I forgot to fix current-time-zone.
9573 (format_time_string): New function, containing most of
9574 what Fformat_time_string used to contain.
9575 (Fformat_time_string): Rewrite in terms of format_time_string.
9576 This doesn't change this function's behavior.
9577 (current-time-zone): Rewrite to use format_time_string.
9578 This fixes the bug reported by Michael Schierl in
9579 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9580 Jason Rumney's 2007-06-07 change worked around this bug, but
9581 didn't fix it.
9582 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9583
9584 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9585
9586 * xdisp.c (start_display): If the character at POS is displayed
9587 via a display vector, reset IT->current.dpvec_index to zero.
9588 (try_window_reusing_current_matrix): If a line ends in a display
9589 vector or the next line starts in a display vector, continue
9590 redrawing the window even though the character position of
9591 start_row was reached.
9592 (Bug#9771, part 2)
9593
9594 2011-10-18 Chong Yidong <cyd@gnu.org>
9595
9596 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9597 with nobreak-char-display too.
9598
9599 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9600
9601 Fix part 3 of bug#9771.
9602 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9603 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9604 non-neutral characters if the current character is a paragraph
9605 separator (a.k.a. Newline). This avoids running the same
9606 expensive loop twice, once when we consume the preceding newline
9607 and the other time when the line actually needs to be displayed.
9608 Avoid the loop when we see neutrals on the base embedding level
9609 following a character whose directionality is the same as the
9610 paragraph's. This avoids running the expensive loop when a line
9611 ends in a long sequence of neutrals, like control characters.
9612 Add assertion against STRONG_AL type. Slightly rearrange code
9613 that determines the type of a neutral given the first non-neutral
9614 that follows it.
9615 (bidi_level_of_next_char): Set next_en_pos to zero when
9616 invalidating its info.
9617
9618 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9619
9620 * xdisp.c (push_display_prop): Determine whether to record string
9621 or buffer position by IT->string, not by IT->method. Allow
9622 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9623 (move_it_vertically_backward): Don't look for character position
9624 immediately after the newline when in a continuation line.
9625 (Bug#9771, part 1)
9626
9627 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9628
9629 * window.c (coordinates_in_window): Rewrite and delabelize
9630 vertical border check. (Bug#5357) (Bug#9618)
9631
9632 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9633
9634 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9635 errors in XSetWindowBorder (bug#9310).
9636
9637 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9638
9639 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9640 avoid crash when xmalloc overrun checking is enabled.
9641
9642 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9643
9644 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9645 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9646 cursor motion with <left> and <right> arrow keys.
9647
9648 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9649 some callers set that themselves.
9650
9651 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9652
9653 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9654 display string and the previous row comes from the same string and
9655 is empty. (Bug#9739) (Bug#9738)
9656
9657 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9658
9659 * doc.c (get_doc_string): Encode file name (bug#9735).
9660
9661 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9662
9663 * bidi.c (bidi_level_of_next_char):
9664 * xdisp.c (get_visually_first_element): Remove old incorrect
9665 comments regarding the Unicode Line Separator character.
9666
9667 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9668
9669 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9670
9671 * alloc.c (Fgc_status): Do not access beyond zombies array
9672 boundary if nzombies > MAX_ZOMBIES.
9673 * alloc.c (dump_zombies): Add missing format specifier.
9674
9675 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9676
9677 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9678 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9679
9680 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9681 Some packages use them to denote characters with modifiers.
9682
9683 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9684
9685 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9686 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9687 matching a pp-number. Rename parameter var to var1.
9688
9689 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9690
9691 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9692
9693 2011-10-08 Glenn Morris <rgm@gnu.org>
9694
9695 * callint.c (Fcall_interactively): Give a more explicit error for the
9696 'c' case with a non-character input. (Bug#8479)
9697
9698 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9699
9700 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9701 lines.
9702 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9703 lines that are hscrolled on the left.
9704
9705 * dispnew.c (buffer_posn_from_coords): Account for a possible
9706 presence of header-line. (Bug#4426)
9707
9708 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9709
9710 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9711 Don't advertise functionality which we discourage or doesn't work.
9712
9713 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9714
9715 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9716 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9717 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9718 this makes Emacs dump core during garbage collection on rare
9719 occasions. sizeof is obviously inferior to offsetof here, so
9720 stick with offsetof.
9721 (GC_POINTER_ALIGNMENT): New macro.
9722 (mark_memory): Omit 3rd (offset) arg; caller changed.
9723 Don't assume EMACS_INT alignment is the same as pointer alignment.
9724
9725 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9726
9727 * keyboard.c (read_key_sequence_remapped): New var.
9728 (read_key_sequence): Compute remapping in the right buffer.
9729 (command_loop_1): Use read_key_sequence's remapping directly.
9730
9731 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9732
9733 * dired.c (file_name_completion): Don't expand file name.
9734 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9735 before checking file name handler.
9736
9737 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9738 they've been requested explicitly (bug#9591).
9739
9740 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9741
9742 * keymap.c (Fsingle_key_description): Use make_specified_string
9743 instead of build_string to build string from push_key_description.
9744 (Bug#5193)
9745
9746 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9747
9748 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9749 This fixes a Y2038 bug on 64-bit hosts.
9750 * buffer.c (reset_buffer):
9751 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9752 (Fclear_buffer_auto_save_failure):
9753 Use 0, not -1, to represent an unset failure time, since time_t
9754 might not be signed.
9755
9756 Remove dependency on glibc malloc internals.
9757 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9758 Move back here from lisp.h, but with their new implementations.
9759 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9760 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9761 * charset.c (charset_table_init): New static var.
9762 (syms_of_charset): Use it instead of xmalloc. This removes a
9763 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9764 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9765 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9766 Move back to alloc.c.
9767 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9768 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9769
9770 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9771
9772 * nsterm.m (windowDidResize): Call x_set_window_size only when
9773 ns_in_resize is true. Otherwise set pixelwidth/height and
9774 call change_frame_size (Bug#9628).
9775
9776 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9777
9778 Port --enable-checking=all to Fedora 14 x86-64.
9779 * charset.c (syms_of_charset): Also account for glibc malloc's
9780 internal overhead when calculating the initial malloc maximum.
9781
9782 Port --enable-checking=all to Fedora 14 x86.
9783 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9784 Move to lisp.h.
9785 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9786 (overrun_check_realloc, overrun_check_free):
9787 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9788 That way, xmalloc returns a properly-aligned pointer even if
9789 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9790 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9791 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9792 into account when calculating the initial malloc maximum.
9793 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9794 Move here from alloc.c, so that charset.c can use it too.
9795 Properly align; the old code wasn't right for common 32-bit hosts
9796 when configured with --enable-checking=all.
9797 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9798 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9799
9800 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9801
9802 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9803 use EDOM.
9804
9805 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9806
9807 * xdisp.c (compute_display_string_end): If there's no display
9808 string at CHARPOS, return -1.
9809
9810 * bidi.c (bidi_fetch_char): When compute_display_string_end
9811 returns a negative value, treat the character as a normal
9812 character not covered by a display string. (Bug#9624)
9813
9814 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9815
9816 * lread.c (Fread_from_string): Fix typo in docstring.
9817
9818 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9819
9820 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9821 newline, reseat the iterator instead of bidi-iterating there one
9822 character at a time. (Bug#9610)
9823 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9824 TO_CHARPOS if the bidi iterator is at base embedding level.
9825
9826 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9827
9828 * lread.c (readevalloop): Use correct code for NBSP.
9829 (read1): Likewise. (Bug#9608)
9830
9831 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9832
9833 * dbusbind.c (Fdbus_register_signal): When service is not
9834 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9835
9836 2011-09-25 Glenn Morris <rgm@gnu.org>
9837
9838 * buffer.c (truncate-lines): Doc fix.
9839
9840 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9841
9842 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9843 (Fset_window_next_buffers): Doc fix.
9844
9845 2011-09-24 Glenn Morris <rgm@gnu.org>
9846
9847 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9848
9849 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9850
9851 Fix minor problems found by static checking.
9852 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9853 * indent.c (Fvertical_motion): Fix == vs = typo.
9854
9855 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9856
9857 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9858 Default value is now t. Doc fix.
9859
9860 * indent.c (Fvertical_motion): Compute and apply the overshoot
9861 logic when moving up, not only when moving down. Fix the
9862 confusing name and values of the it_overshoot_expected variable;
9863 logic changes accordingly. (Bug#9254) (Bug#9549)
9864
9865 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9866 CHARPOS is covered by a display string which includes newlines.
9867 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9868 is covered by a display string with embedded newlines.
9869
9870 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9871
9872 * dbusbind.c (Fdbus_register_signal): Add match rule to
9873 Vdbus_registered_objects_table. (Bug#9581)
9874 (Fdbus_register_method, Vdbus_registered_objects_table):
9875 Fix docstring.
9876
9877 2011-09-24 Jim Meyering <meyering@redhat.com>
9878
9879 do not ignore write error for any output size
9880 The previous change was incomplete.
9881 While it makes emacs --batch detect the vast majority of stdout
9882 write failures, errors were still ignored whenever the output size is
9883 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9884 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9885 && echo FAIL: ignored write error
9886 FAIL: ignored write error
9887 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9888 && echo FAIL: ignored write error
9889 FAIL: ignored write error
9890 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9891
9892 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9893
9894 * emacs.c (Fkill_emacs): In noninteractive mode exit
9895 non-successfully if a write error occurred on stdout. (Bug#9574)
9896
9897 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9898
9899 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9900 the xassert test.
9901
9902 * dispextern.h (struct it): Update the comment documenting what
9903 can it->OBJECT be.
9904
9905 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9906
9907 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9908 a display string, extend search for cursor position to end of row.
9909 (find_row_edges): If the row ends in a newline from a display
9910 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9911 Handle the case of a display string with multiple newlines.
9912 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9913 non-empty line. Fixes confusing cursor motion with arrow keys at
9914 the beginning of a line that starts with whitespace.
9915
9916 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9917
9918 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9919 (bug#9493).
9920
9921 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9922
9923 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9924 boolean (Bug#9154).
9925
9926 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9927
9928 * xdisp.c (display_line): Record maximum and minimum buffer
9929 positions even if no glyphs were produced (e.g., by a zero-width
9930 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9931 buffer positions that will be removed from the glyph row because
9932 they don't fit.
9933 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9934 column is beyond frame width: don't subtract 1 "pixel" when
9935 computing width of the stretch.
9936 (reseat_at_next_visible_line_start): Undo the change made on
9937 2011-09-17 that saved paragraph information and restored it after
9938 the call to `reseat'. (Bug#9545)
9939
9940 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9941
9942 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9943 and turn window cursor on if cleared (Bug#9415).
9944
9945 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9946
9947 * search.c (boyer_moore): Take unibyte characters from pattern
9948 literally. (Bug#9458)
9949
9950 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9951
9952 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9953
9954 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9955
9956 Fix minor problem found by static checking.
9957 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9958 initialized, to pacify gcc -Wuninitialized.
9959
9960 * fileio.c: Report proper errno when syscall falls.
9961 (Finsert_file_contents): Save and restore errno,
9962 so that report_file_error outputs the correct diagnostic.
9963 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9964
9965 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9966
9967 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9968
9969 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9970
9971 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9972 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9973
9974 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9975
9976 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9977 about the current paragraph and restore it after the call to reseat.
9978
9979 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9980 (bidi_find_paragraph_start): Search back for paragraph beginning
9981 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9982 (bidi_move_to_visually_next): Only trigger paragraph-related
9983 computations when the last character is a newline or at EOB, not
9984 just any NEUTRAL_B. (Bug#9470)
9985
9986 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9987 truncated lines if point is covered by a display string. (Bug#9524)
9988
9989 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9990
9991 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9992 (cons_to_x_long): New function.
9993 (lisp_data_to_selection_data): Use it. Correct the test for
9994 short-versus-long data; it was negated. Break out of vector
9995 loop, for efficiency, when a long datum is discovered.
9996
9997 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9998
9999 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10000
10001 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10002
10003 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10004 GCC PR/17406) by declaring this function with external scope.
10005
10006 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10007
10008 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10009 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10010
10011 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10012
10013 * editfns.c (Fformat): Correctly handle text properties on "%%".
10014
10015 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10016
10017 * xterm.c (x_draw_composite_glyph_string_foreground):
10018 * w32term.c (x_draw_composite_glyph_string_foreground):
10019 * term.c (encode_terminal_code):
10020 * composite.c (composition_update_it, get_composition_id):
10021 * xdisp.c (get_next_display_element)
10022 (fill_composite_glyph_string): Add comments about special meaning
10023 of TAB characters in a composition.
10024
10025 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10026
10027 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10028 This occurs when processing a multibyte format.
10029 Problem reported by Wolfgang Jenker.
10030
10031 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10032
10033 * xdisp.c (try_cursor_movement): Only check for exact match if
10034 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10035
10036 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10037
10038 Remove unused external symbols.
10039 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10040 * xdisp.c (calc_pixel_width_or_height): Now static.
10041 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10042 * indent.c (check_display_width):
10043 * w32term.c: Fix comment to match code.
10044 * xterm.c, xterm.h (x_catching_errors): Remove.
10045
10046 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10047
10048 * xselect.c: Use signed conversions more consistently (Bug#9498).
10049 (selection_data_to_lisp_data): Assume incoming selection data are
10050 signed integers, not unsigned. This is to be consistent with
10051 outgoing selection data, which was modified to use signed integers
10052 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10053 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10054 expects long, not unsigned long.
10055
10056 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10057
10058 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10059 computation of loop end. Reported by Johan Bockgård
10060 <bojohan@gnu.org>.
10061
10062 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10063
10064 * frame.c (Fother_visible_frames_p): Function deleted.
10065
10066 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10067
10068 * indent.c (compute_motion): Process display vector front to back
10069 rather than the other way around. (Bug#2496)
10070
10071 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10072
10073 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10074
10075 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10076
10077 * minibuf.c (Fread_from_minibuffer): Doc fix.
10078
10079 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10080
10081 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10082 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10083
10084 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10085
10086 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10087 value for non-existent files.
10088
10089 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10090
10091 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10092 set its "size" to -1. This will set the modtime_size field of
10093 the corresponding buffer to -1, which is what
10094 verify-visited-file-modtime expects for files that do not exist.
10095 (Bug#9139)
10096
10097 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10098
10099 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10100 here ...
10101 * lisp.h: ... from here. push_key_description is no longer
10102 defined in keyboard.c, so its declaration should not be in
10103 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10104 logically belongs with push_key_description.
10105
10106 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10107
10108 * buffer.h: Include <sys/types.h> instead of <time.h>.
10109 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10110 Problem reported by Herbert J. Skuhra.
10111
10112 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10113
10114 * xml.c (parse_region): Make the parsing work for
10115 non-comment-starting XML files again (bug#9144).
10116
10117 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10118
10119 * image.c (gif_load): Fix calculation of bottom and right corner.
10120 (Bug#9468)
10121
10122 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10123
10124 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10125 redisplay in small windows.
10126
10127 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10128
10129 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10130
10131 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10132
10133 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10134 Operate on live windows only.
10135
10136 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10137
10138 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10139
10140 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10141
10142 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10143 only under bidi iteration.
10144
10145 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10146
10147 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10148
10149 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10150
10151 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10152 Without this fix, the command to link temacs failed due to an
10153 undefined symbol __builtin_isnan. This is because
10154 /usr/include/iso/math_c99.h #defines isnan(x) to
10155 __builtin_isnan(x), but the bundled gcc, which identifies itself
10156 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10157 a __builtin_isnan.
10158 * floatfns.c (isnan): #undef, and then #define to a clone of
10159 what's in data.c.
10160 (Fisnan): Always define, since it's always available now.
10161 (syms_of_floatfns): Always define isnan at the Lisp level.
10162
10163 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10164
10165 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10166
10167 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10168
10169 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10170 The previous code assumed that file offsets (off_t values) fit in
10171 EMACS_INT variables, which is not true on typical 32-bit hosts.
10172 The code messed up by falsely reporting buffer overflow in cases
10173 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10174 when "big" contains more than 2**29 bytes, even though this
10175 inserts just one byte and does not overflow the buffer.
10176 (Finsert_file_contents): Store file offsets as off_t
10177 values, not as EMACS_INT values. Check for overflow when
10178 converting between EMACS_INT and off_t. When checking for
10179 buffer overflow or for overlap, take the offsets into account.
10180 Don't use EMACS_INT for small values where int suffices.
10181 When checking for overlap, fix a typo: ZV was used where
10182 ZV_BYTE was intended.
10183 (Fwrite_region): Don't assume off_t fits into 'long'.
10184 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10185
10186 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10187
10188 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10189
10190 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10191
10192 sprintf-related integer and memory overflow issues (Bug#9412).
10193
10194 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10195 (esprintf, exprintf, evxprintf): New functions.
10196 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10197 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10198 (modify_event_symbol): Do not assume that the length of
10199 name_alist_or_stem is safe to alloca and fits in int.
10200 (Fexecute_extended_command): Likewise for function name and binding.
10201 (Frecursion_depth): Wrap around reliably on integer overflow.
10202 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10203 since some callers pass EMACS_INT values.
10204 (Fsingle_key_description): Don't crash if symbol name contains more
10205 than MAX_ALLOCA bytes.
10206 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10207 (get_minibuffer): Arg is now EMACS_INT, not int.
10208 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10209 (esprintf, exprintf, evxprintf): New decls.
10210 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10211
10212 * dbusbind.c (signature_cat): New function.
10213 (xd_signature, Fdbus_register_signal):
10214 Do not overrun buffer; instead, report string overflow.
10215
10216 * dispnew.c (add_window_display_history): Don't overrun buffer.
10217 Truncate instead; this is OK since it's just a log.
10218
10219 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10220 even if the time zone offset is outlandishly large.
10221 Don't mishandle offset == INT_MIN.
10222
10223 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10224 when creating daemon; the previous buffer-overflow check was incorrect.
10225
10226 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10227 which has the guts of the old verror function.
10228
10229 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10230 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10231
10232 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10233 (font_unparse_xlfd): Don't blindly alloca long strings.
10234 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10235 fits in int, when using sprintf. Use single snprintf to count
10236 length of string rather than counting it via multiple sprintfs;
10237 that's simpler and more reliable.
10238 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10239 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10240 sprintf, in case result does not fit in int.
10241
10242 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10243 (fontset_from_font): Print it.
10244
10245 * frame.c (tty_frame_count): Now printmax_t, not int.
10246 (make_terminal_frame, set_term_frame_name): Print it.
10247 (x_report_frame_params): In X, window IDs are unsigned long,
10248 not signed long, so print them as unsigned.
10249 (validate_x_resource_name): Check for implausibly long names,
10250 and don't assume name length fits in 'int'.
10251 (x_get_resource_string): Don't blindly alloca invocation name;
10252 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10253 not fit in int.
10254
10255 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10256 (xg_check_special_colors, xg_set_geometry):
10257 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10258
10259 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10260 Use esprintf, not sprintf, in case result does not fit in int.
10261
10262 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10263 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10264 it as a large positive number.
10265 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10266 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10267
10268 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10269 in case result does not fit in int.
10270
10271 * print.c (float_to_string): Detect width overflow more reliably.
10272 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10273 buffer overrun. Don't assume list length fits in 'int'. Treat
10274 print length of 0 as 0, not as infinity; to be consistent with other
10275 uses of print length in this function. Don't overflow print length
10276 index. Don't assume hash table size fits in 'long', or that
10277 vectorlike size fits in 'unsigned long'.
10278
10279 * process.c (make_process): Use printmax_t, not int, to format
10280 process-name gensyms.
10281
10282 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10283
10284 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10285 to avoid potential buffer overrun.
10286
10287 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10288 if X resource line is longer than 512 bytes.
10289
10290 * xfns.c (x_window): Make sprintf buffer a bit bigger
10291 to avoid potential buffer overrun.
10292
10293 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10294
10295 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10296
10297 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10298
10299 Integer overflow fixes for scrolling, etc.
10300 Without these, Emacs silently mishandles large integers sometimes.
10301 For example, "C-u 4294967297 M-x recenter" was treated as if
10302 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10303
10304 * xdisp.c (try_window_id): Check Emacs fixnum range before
10305 converting to 'int'.
10306
10307 * window.c (window_scroll_line_based, Frecenter):
10308 Check that an Emacs fixnum is in range before assigning it to 'int'.
10309 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10310 values converted from Emacs fixnums.
10311 (Frecenter): Don't wrap around a line count if it is out of 'int'
10312 range; instead, treat it as an extreme value.
10313 (Fset_window_configuration, compare_window_configurations):
10314 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10315
10316 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10317 that can exceed INT_MAX. Check that EMACS_INT value is in range
10318 before assigning it to the (possibly-narrower) index.
10319 (match_limit): Don't assume that a fixnum can fit in 'int'.
10320
10321 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10322 exceed INT_MAX.
10323
10324 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10325 (Fvertical_motion): Don't wrap around LINES values that don't fit
10326 in 'int'. Instead, treat them as extreme values. This is good
10327 enough for windows, which can't have more than INT_MAX lines anyway.
10328
10329 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10330
10331 * Require libxml/parser.h to avoid compilation warning.
10332
10333 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10334
10335 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10336 since this reportedly can destroy thread storage.
10337
10338 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10339
10340 * syntax.c (find_defun_start): Update all cache variables if
10341 exiting early (Bug#9401).
10342
10343 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10344
10345 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10346
10347 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10348 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10349 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10350
10351 * term.c (tty_append_glyph): New function.
10352 (produce_stretch_glyph): Static function and its prototype deleted.
10353
10354 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10355 Add prototypes.
10356
10357 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10358
10359 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10360 when checking :margin (Bug#9390).
10361 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10362 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10363 so that the name doesn't mislead. All uses changed.
10364
10365 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10366
10367 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10368 set_tty_hooks.
10369
10370 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10371
10372 * xdisp.c (move_it_to): Don't bail out early when reaching
10373 position beyond to_charpos, if we are scanning backwards.
10374 (move_it_vertically_backward): When DY == 0, make sure we get to
10375 the first character in the line after the newline.
10376
10377 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10378
10379 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10380 (ccl_driver): Do not generate an out-of-range pointer.
10381 (Fccl_execute_on_string): Remove unnecessary check for
10382 integer overflow, noted by Stefan Monnier in
10383 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10384 Remove a FIXME that didn't need fixing.
10385 Simplify the newly-introduced buffer reallocation code.
10386
10387 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10388
10389 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10390
10391 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10392
10393 Integer and memory overflow issues (Bug#9196).
10394
10395 * doc.c (get_doc_string): Rework so that
10396 get_doc_string_buffer_size is the actual buffer size, rather than
10397 being 1 less than the actual buffer size; this makes xpalloc more
10398 convenient.
10399
10400 * image.c (x_allocate_bitmap_record, cache_image):
10401 * xselect.c (Fx_register_dnd_atom):
10402 Simplify previous changes by using xpalloc.
10403
10404 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10405 since either will do and ptrdiff_t is convenient with xpalloc.
10406
10407 * charset.c (charset_table_size)
10408 (struct charset_sort_data.priority): Now ptrdiff_t.
10409 (charset_compare): Don't overflow if priorities differ greatly.
10410 (Fsort_charsets): Don't assume list length fits in int.
10411 Check for size-calculation overflow when allocating sort data.
10412 (syms_of_charset): Allocate an initial charset table that is
10413 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10414
10415 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10416
10417 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10418 The actual value is always <= INT_MAX, and leaving it unsigned made
10419 overflow checking harder.
10420
10421 * dispextern.h (struct glyph_matrix.rows_allocated)
10422 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10423 with xpalloc. The values are still always <= INT_MAX.
10424
10425 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10426
10427 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10428 (SAFE_NALLOCA): New macro.
10429
10430 * region-cache.c (struct boundary.pos, find_cache_boundary)
10431 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10432 (set_cache_region, invalidate_region_cache)
10433 (revalidate_region_cache, know_region_cache, region_cache_forward)
10434 (region_cache_backward, pp_cache):
10435 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10436 so that ptrdiff_t * can be passed to xpalloc.
10437 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10438 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10439 (pp_cache): Don't assume cache_len fits in int.
10440 * region-cache.h: Adjust extern decls to match.
10441
10442 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10443 EMACS_INT, since either will do, for xpalloc.
10444
10445 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10446 (xnmalloc, xnrealloc, xpalloc): New functions.
10447
10448 * bidi.c (bidi_shelve_header_size): New constant.
10449 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10450 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10451
10452 * bidi.c (bidi_cache_shrink):
10453 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10454 (overlay_strings):
10455 Don't update size of array until after memory allocation succeeds,
10456 because xmalloc/xrealloc may not return.
10457 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10458 now that we have proper integer overflow checking.
10459 (record_overlay_string, overlay_strings): Catch overflows when
10460 calculating size of overlay_str_buf.
10461
10462 * callproc.c (Fcall_process): Check for size overflow when
10463 calculating size of args2.
10464 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10465 Normally we prefer signed values, but sticking with ptrdiff_t would
10466 require adding more-complicated checks.
10467
10468 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10469 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10470 Redo buffer-overflow calculations to avoid integer overflow.
10471 Add a FIXME comment where memory seems to be over-allocated.
10472
10473 * character.c (Fstring): Check for size-calculation overflow.
10474
10475 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10476 unnecessary integer overflow. Check for size overflow.
10477 (encode_coding_object): Don't update size until xmalloc succeeds.
10478
10479 * composite.c (get_composition_id): Check for overflow in glyph
10480 length calculations.
10481
10482 Integer and memory overflow fixes for display code.
10483 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10484 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10485 (scrolling_window): Check for overflow in size calculations.
10486 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10487 Don't assume glyph table len fits in int.
10488 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10489 (row_table_size): Now ptrdiff_t, not int.
10490 (scrolling_window): Avoid overflow in size calculations.
10491 Don't update size until allocation succeeds.
10492 * fns.c (concat): Check for overflow in size calculations.
10493 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10494 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10495 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10496
10497 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10498 (get_doc_string): Check for size calculation overflow.
10499 Don't update size until allocation succeeds.
10500 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10501 EMACS_INT, where ptrdiff_t will do.
10502 (Fsubstitute_command_keys): Check for string overflow.
10503
10504 * editfns.c (set_time_zone_rule): Don't assume environment length
10505 fits in int.
10506 (message_length): Now ptrdiff_t, not int.
10507 (Fmessage_box): Don't update size until allocation succeeds.
10508 Don't assume message length fits in int.
10509 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10510
10511 * emacs.c (main): Do not reallocate argv, since there is a null at
10512 the end that can be overwritten, and this way there's no need to
10513 worry about size-calculation overflow.
10514 (sort_args): Check for size-calculation overflow.
10515
10516 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10517 alloc succeeds.
10518 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10519
10520 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10521 (x_set_scroll_bar_width, x_figure_window_size):
10522 Check for integer overflow.
10523 (x_set_alpha): Do not assume XINT fits in int.
10524
10525 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10526 This is for the members text_lines, text_cols, total_lines, total_cols,
10527 where the system imposes an 'int' limit.
10528
10529 * fringe.c (Fdefine_fringe_bitmap):
10530 Don't update size until alloc works.
10531
10532 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10533 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10534
10535 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10536 Check for size-calculation overflow.
10537 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10538 do, as we prefer signed integers.
10539 (id_to_widget.max_size, id_to_widget.used)
10540 (xg_store_widget_in_map, xg_remove_widget_from_map)
10541 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10542 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10543 Use and return ptrdiff_t, not int.
10544 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10545 * gtkutil.h: Change prototypes to match the above.
10546
10547 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10548 are duplicate now that they've been promoted to lisp.h.
10549 (x_allocate_bitmap_record, x_alloc_image_color)
10550 (make_image_cache, cache_image, xpm_load):
10551 Don't update size until alloc is done.
10552 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10553 (x_detect_edges):
10554 Check for size calculation overflow.
10555 (ct_colors_allocated_max): New constant.
10556 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10557 overflow.
10558
10559 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10560 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10561 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10562 Use ptrdiff_t, not int, to count maps.
10563 (read_char_minibuf_menu_prompt): Check for overflow in size
10564 calculations. Don't update size until allocation succeeds.
10565 Redo calculations to avoid overflow.
10566 * keyboard.h: Change prototypes to match the above.
10567
10568 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10569 to count maps.
10570 (current_minor_maps): Check for size calculation overflow.
10571 * keymap.h: Change prototypes to match the above.
10572
10573 * lread.c (read1, init_obarray): Don't update size until alloc done.
10574
10575 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10576 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10577
10578 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10579 Now ptrdiff_t, not int.
10580 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10581 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10582
10583 * process.c (Fnetwork_interface_list): Check for overflow
10584 in size calculation.
10585
10586 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10587
10588 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10589 overflow. Don't bother calling xmalloc when xrealloc will do.
10590
10591 * search.c (Freplace_match): Check for size calculation overflow.
10592 (Fset_match_data): Don't assume list lengths fit in 'int'.
10593
10594 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10595 for command line length. Do not attempt to address one before the
10596 beginning of an array, as that's not portable.
10597
10598 * term.c (max_frame_lines): Remove; unused.
10599 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10600 not int.
10601 (encode_terminal_code, calculate_costs): Check for size
10602 calculation overflow.
10603 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10604 table lengths and related sizes. Don't update size until alloc
10605 done. Redo calculations to avoid overflow.
10606 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10607
10608 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10609 subtracting pointers.
10610 (gobble_line): Check for overflow more carefully. Don't update size
10611 until alloc done.
10612
10613 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10614 Don't update size until alloc done.
10615 Redo size calculations to avoid overflow.
10616 Check for size calculation overflow.
10617 (main) [DEBUG]: Fix typo in invoking tparam1.
10618
10619 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10620 Use ptrdiff_t, not int, for sizes.
10621 (store_mode_line_noprop_char): Don't update size until alloc done.
10622
10623 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10624 Use ptrdiff_t, not int, for sizes.
10625 (Finternal_make_lisp_face, cache_face):
10626 Check for size calculation overflow.
10627 (cache_face): Treat size calculation overflows as if they were
10628 memory exhaustion (the usual treatment), rather than aborting.
10629
10630 * xfns.c (x_encode_text, x_set_name_internal)
10631 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10632 sizes, since they can exceed INT_MAX in size. Check for size
10633 calculation overflow.
10634
10635 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10636 (xg_select): Check for size calculation overflow.
10637 Don't update size until alloc done.
10638
10639 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10640 as sprintf is limited to int lengths.
10641
10642 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10643 (X_LONG_MIN): New macros.
10644 Use them to make the following changes clearer.
10645 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10646 This change doesn't affect the value now, but it may help remind
10647 future maintainers not to raise the value too much later.
10648 (SELECTION_QUANTUM): Remove, replacing with ...
10649 (selection_quantum): ... new function, which avoids overflow.
10650 All uses changed.
10651 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10652 assumption that selection length fits in 'int'.
10653 (x_reply_selection_request, x_handle_selection_request)
10654 (x_get_window_property, receive_incremental_selection)
10655 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10656 (lisp_data_to_selection_data, clean_local_selection_data):
10657 Use ptrdiff_t, not int, to record length of selection.
10658 (x_reply_selection_request, x_get_window_property)
10659 (receive_incremental_selection, x_property_data_to_lisp):
10660 Redo calculations to avoid overflow.
10661 (x_reply_selection_request): When sending hint, ceiling it at
10662 X_LONG_MAX rather than relying on wraparound overflow to send
10663 something.
10664 (x_get_window_property, receive_incremental_selection)
10665 (lisp_data_to_selection_data, x_property_data_to_lisp):
10666 Check for size-calculation overflow.
10667 (x_get_window_property, receive_incremental_selection)
10668 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10669 Don't store size until memory allocation succeeds.
10670 (x_get_window_property): Plug memory leak on memory exhaustion.
10671 Don't double-block input; malloc is safe here. Don't assume 2**34
10672 - 4 fits in unsigned long. Add an xassert to check
10673 XGetWindowProperty overflow. Be more careful about overflow
10674 calculations, and distinguish size from memory overflow better.
10675 (receive_incremental_selection): When tracing, don't assume
10676 unsigned int is less than INT_MAX.
10677 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10678 harmful) conversions of unsigned short to int.
10679 (lisp_data_to_selection_data): Don't assume that integers
10680 in the range -65535 through -1 fit in an X unsigned short.
10681 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10682 result parameters unless successful. Rely on cons_to_unsigned
10683 to report problems with elements; the old code wasn't right anyway.
10684 (x_check_property_data): Check for int overflow; we cannot use
10685 a wider type due to X limits.
10686 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10687
10688 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10689
10690 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10691 (x_term_init): Check for size calculation overflow.
10692 (x_color_cells): Don't store size until memory allocation succeeds.
10693 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10694 Don't assume alloca size is less than MAX_ALLOCA.
10695 (x_term_init): Don't assume length fits in int (sprintf is limited
10696 to int size).
10697
10698 Use ptrdiff_t for composition IDs.
10699 * character.c (lisp_string_width):
10700 * composite.c (composition_table_size, n_compositions)
10701 (get_composition_id, composition_gstring_from_id):
10702 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10703 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10704 * window.c (Frecenter):
10705 Use ptrdiff_t, not int, for composition IDs.
10706 * composite.c (get_composition_id): Check for integer overflow.
10707 * composite.h: Adjust prototypes to match the above changes.
10708
10709 Use ptrdiff_t for hash table indexes.
10710 * category.c (hash_get_category_set):
10711 * ccl.c (ccl_driver):
10712 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10713 * coding.c (coding_system_charset_list, detect_coding_system):
10714 * coding.h (struct coding_system.id):
10715 * composite.c (get_composition_id, gstring_lookup_cache):
10716 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10717 * image.c (xpm_get_color_table_h):
10718 * lisp.h (hash_lookup, hash_put):
10719 * minibuf.c (Ftest_completion):
10720 Use ptrdiff_t for hash table indexes, not int (which is too
10721 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10722 32-bit --with-wide-int hosts).
10723
10724 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10725 Add a FIXME comment about memory leaks.
10726 (syms_of_charset): Don't assume xmalloc returns.
10727
10728 Don't assume that stated character widths fit in int.
10729 * character.c (Fchar_width, c_string_width, lisp_string_width):
10730 * character.h (CHAR_WIDTH):
10731 * indent.c (MULTIBYTE_BYTES_WIDTH):
10732 Use sanitize_char_width to avoid undefined and/or bad behavior
10733 with outlandish widths.
10734 * character.h (sanitize_tab_width): Rename from sanitize_width,
10735 now that we have two such functions. All uses changed.
10736 (sanitize_char_width): New inline function.
10737
10738 Don't assume that tab-width fits in int.
10739 * character.h (sanitize_width): New inline function.
10740 (SANE_TAB_WIDTH): New macro.
10741 (ASCII_CHAR_WIDTH): Use it.
10742 * indent.c (sane_tab_width): Remove. All uses replaced by
10743 SANE_TAB_WIDTH (current_buffer).
10744 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10745
10746 * fileio.c: Integer overflow issues with file modes.
10747 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10748
10749 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10750 Remove unreachable code.
10751 (read_hex, load_charset_map_from_file): Check for integer overflow.
10752
10753 * xterm.c: Don't go over XClientMessageEvent limit.
10754 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10755 (x_send_scroll_bar_event): Likewise. Check that the size does not
10756 exceed limits imposed by XClientMessageEvent, as well as the usual
10757 ptrdiff_t and size_t limits.
10758
10759 * keyboard.c: Overflow, signedness and related fixes.
10760 (make_lispy_movement): Use same integer type in forward decl
10761 that is used in the definition.
10762 (read_key_sequence, keyremap_step):
10763 Change bufsize argument back to int, undoing my 2011-03-30 change.
10764 We prefer signed types, and int is wide enough here.
10765 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10766 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10767 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10768 length, not size_t. Use ptrdiff_t for index, not int.
10769 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10770 possibility of integer overflow.
10771
10772 Overflow, signedness and related fixes for images.
10773
10774 * dispextern.h (struct it.stack[0].u.image.image_id)
10775 (struct_it.image_id, struct image.id, struct image_cache.size)
10776 (struct image_cache.used, struct image_cache.ref_count):
10777 * gtkutil.c (update_frame_tool_bar):
10778 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10779 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10780 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10781 * nsmenu.m (update_frame_tool_bar):
10782 * xdisp.c (calc_pixel_width_or_height):
10783 * xfns.c (image_cache_refcount):
10784 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10785 on typical 64-bit hosts.
10786
10787 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10788 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10789 Omit unnecessary casts to int.
10790 (parse_image_spec): Check that integers fall into 'int' range
10791 when the callers expect that.
10792 (image_ascent): Redo ascent calculation to avoid int overflow.
10793 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10794 (lookup_image): Remove unnecessary tests.
10795 (xbm_image_p): Locals are now of int, not EMACS_INT,
10796 since parse_image_check makes sure they fit into int.
10797 (png_load, gif_load, svg_load_image):
10798 Prefer int to unsigned where either will do.
10799 (tiff_handler): New function, combining the cores of the
10800 old tiff_error_handler and tiff_warning_handler.
10801 This function is rewritten to use vsnprintf and thereby avoid
10802 stack buffer overflows. It uses only the features of vsnprintf
10803 that are common to both POSIX and native Microsoft.
10804 (tiff_error_handler, tiff_warning_handler): Use it.
10805 (tiff_load, gif_load, imagemagick_load_image):
10806 Don't assume :index value fits in 'int'.
10807 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10808 (imagemagick_load_image): Check that crop parameters fit into
10809 the integer types that MagickCropImage accepts. Don't assume
10810 Vimagemagick_render_type has a nonnegative value. Don't assume
10811 size_t fits in 'long'.
10812 (gs_load): Use printmax_t to print the widest integers possible.
10813 Check for integer overflow when computing image height and width.
10814
10815 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10816
10817 * xdisp.c (redisplay_window): Don't force window start if point
10818 will be invisible in the resulting window. (Bug#9324)
10819
10820 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10821
10822 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10823 the display spec is of the form `(space ...)'.
10824 (handle_display_spec): Return the value returned by
10825 handle_single_display_spec, not just 1 or zero.
10826 (handle_single_display_spec): If the display spec is of the form
10827 `(space ...)', and specifies display in the text area, return 2
10828 rather than 1.
10829 (try_cursor_movement): Check for the need to scroll more
10830 accurately, and prefer exact match for point under bidi.
10831 Don't advance `row' beyond the last row of the window.
10832
10833 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10834 into disp_prop; all users changed.
10835
10836 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10837 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10838 for the text covered by the display property.
10839
10840 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10841
10842 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10843 Change return value to nil.
10844 (Frecord_buffer): Delete unused function.
10845
10846 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10847
10848 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10849 buffers, return left-to-right.
10850 (set_cursor_from_row): Consider candidate row a win if its glyph
10851 represents a newline and point is on that newline. Fixes cursor
10852 positioning on the newline at EOL of R2L text within L2R
10853 paragraph, and vice versa.
10854 (try_cursor_movement): Check continued rows, in addition to
10855 continuation rows. Fixes unwarranted scroll when point enters a
10856 continued line of R2L text within an L2R paragraph, or vice versa.
10857 (cursor_row_p): Consider the case of point being equal to
10858 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10859 from the end of a short line to the beginning of a continued line
10860 of R2L text within L2R paragraph.
10861 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10862 composed characters.
10863
10864 * bidi.c (bidi_check_type): Use xassert.
10865 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10866 members.
10867
10868 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10869
10870 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10871 a character.
10872
10873 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10874
10875 * nsfont.m (ns_otf_to_script): Fix typo.
10876
10877 2011-08-22 Kenichi Handa <handa@m17n.org>
10878
10879 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10880 extra slot even if the purpose is char-code-property-table.
10881
10882 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10883
10884 * xdisp.c (redisplay_window): When computing centering_position,
10885 account for the height of the header line. (Bug#8874)
10886
10887 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10888 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10889 candidate is selected by the mouse, and that candidate has a
10890 composed character under the mouse.
10891
10892 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10893 coordinates reported by pos-visible-in-window-p for a composed
10894 character in column zero.
10895
10896 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10897
10898 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10899
10900 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10901
10902 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10903 consider it a hit if to_charpos is anywhere in the range of the
10904 composed buffer positions.
10905
10906 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10907
10908 * image.c (gif_load): Don't assume that each subimage has the same
10909 dimensions as the base image. Handle disposal method that is
10910 "undefined" by the gif spec (Bug#9335).
10911
10912 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10913
10914 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10915 (Fcondition_case): Document `debug' symbol in error handler.
10916
10917 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10918
10919 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10920 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10921 from an Org mode buffer to a Speedbar frame.
10922
10923 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10924 a composition, take its buffer position from IT->cmp_it.charpos.
10925 Fixes cursor positioning at the beginning of a line that begins
10926 with a composed character.
10927
10928 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10929
10930 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10931 character bidirectional type, use STRONG_L instead. Fixes crashes
10932 in a buffer produced by `describe-categories'.
10933
10934 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10935 members before the level stack, so they would be saved and
10936 restored when copying iterator state. Fixes incorrect reordering
10937 around TABs covered by display properties.
10938
10939 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10940
10941 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10942
10943 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10944
10945 * eval.c (internal_condition_case, internal_condition_case_1)
10946 (internal_condition_case_2, internal_condition_case_n):
10947 Remove unnecessary aborts (Bug#9081).
10948
10949 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10950
10951 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10952 has no `load' handler, try opening the file locally. (Bug#9311)
10953
10954 2011-08-16 Ken Brown <kbrown@cornell.edu>
10955
10956 * gmalloc.c: Expand comment.
10957
10958 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10959
10960 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10961 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10962
10963 2011-08-16 Ken Brown <kbrown@cornell.edu>
10964
10965 Fix memory allocation problems in Cygwin build (Bug#9273).
10966
10967 * unexcw.c ( __malloc_initialized): Declare external variable.
10968 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10969
10970 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10971 New variables.
10972 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10973 dumped emacs.
10974 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10975 in the static heap.
10976 [CYGWIN] (special_realloc): New function.
10977 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10978 requests to realloc storage in the static heap.
10979
10980 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10981
10982 * bidi.c (bidi_initialize): Remove unused local.
10983
10984 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10985
10986 * bidimirror.h:
10987 * biditype.h: Remove file.
10988 * makefile.w32-in ($(BLD)/bidi.$(O)):
10989 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10990
10991 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10992
10993 * chartab.c: Improve commentary for the uniprop_table API.
10994
10995 * bidi.c (bidi_paragraph_init): Support zero value of
10996 bidi_ignore_explicit_marks_for_paragraph_level.
10997 (bidi_initialize): Use uniprop_table instead of including
10998 biditype.h and bidimirror.h.
10999
11000 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11001 coordinates of the iterator when restoring from ppos_it.
11002 (Bug#9296)
11003
11004 2011-08-14 Kenichi Handa <handa@m17n.org>
11005
11006 * process.c (create_process): Call setup_process_coding_systems
11007 after the pid of the process is set to -1 (Bug#8162).
11008
11009 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11010
11011 * xdisp.c (move_it_in_display_line_to): Don't invoke
11012 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11013 ppos_it. Fixes vertical cursor motion when line beginning is
11014 covered by an image. (Bug#9296)
11015
11016 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11017
11018 * nsterm.h (ns_run_ascript): Declare.
11019 (NSAPP_DATA2_RUNASSCRIPT): Define.
11020
11021 * nsfns.m (as_script, as_result, as_status): New static variables.
11022 (ns_run_ascript): New function.
11023 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11024 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11025 the event loop. Get status from as_status (Bug#7276).
11026
11027 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11028 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11029 the event loop (Bug#7276).
11030
11031 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11032
11033 * gnutls.c (QCgnutls_bootprop_priority)
11034 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11035 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11036 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11037 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11038 (QCgnutls_bootprop_verify_hostname_error)
11039 (QCgnutls_bootprop_callbacks_verify): Rename from
11040 Qgnutls_bootprop_..., all uses changed.
11041
11042 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11043 uses changed.
11044
11045 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11046
11047 * xfaces.c (Qframe_set_background_mode): Now static.
11048 * dispextern.h (Qframe_set_background_mode): Remove decl.
11049
11050 * process.c (Fnetwork_interface_info): Declare local only if needed.
11051
11052 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11053
11054 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11055 (Fnetwork_interface_list): Allocate in increments of bytes instead
11056 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11057 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11058 sockaddr.
11059 (struct ifflag_def): notrailers is smart on OSX.
11060 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11061 Get hardware address with getifaddrs if available.
11062
11063 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11064
11065 * xdisp.c (iterate_out_of_display_property): xassert that
11066 IT->position is set to within IT->object's boundaries. Break from
11067 the loop as soon as EOB is reached; avoids infloops in redisplay
11068 when IT->position is set up wrongly due to some bug.
11069 Set IT->current to match the bidi iterator unconditionally.
11070 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11071 entry. Force push_it to save on the stack the current
11072 buffer/string position, to be restored by pop_it. Fix flags in
11073 the iterator structure wrt the object coming from a display
11074 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11075 properties. (Bug#9284)
11076
11077 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11078
11079 * fontset.c (fontset_get_font_group): Add proper type checks.
11080 (Bug#9172)
11081
11082 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11083
11084 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11085 and LC_VERSION_MIN_MACOSX.
11086 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11087 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11088
11089 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11090
11091 * xdisp.c (forward_to_next_line_start): Allow to use the
11092 no-display-properties-and-no-overlays under bidi display.
11093 Set disp_pos in the bidi iterator to avoid searches for display
11094 properties and overlays.
11095
11096 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11097
11098 * editfns.c (Fset_time_zone_rule): Document relationship with the
11099 setenv function.
11100
11101 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11102 the font entity extracted from the cache (Bug#8109).
11103
11104 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11105
11106 * composite.c (autocmp_chars): Don't reset point. That is done by
11107 restore_point_unwind (Bug#5984).
11108
11109 2011-08-07 Juri Linkov <juri@jurta.org>
11110
11111 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11112 to show the arg `TIME' instead of `TIMEVAL'.
11113
11114 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11115
11116 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11117 display property strides EOL and includes a newline, as in
11118 longlines-mode. (Bug#9254)
11119 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11120 word-wrap under bidirectional display. (Bug#9224)
11121
11122 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11123 is non-zero, even if the data buffer is NULL. Fixes a crash in
11124 vertical-motion with longlines-mode. (Bug#9254)
11125
11126 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11127
11128 * bidi.c <bidi_cache_total_alloc>: Now static.
11129 (bidi_initialize): Initialize bidi_cache_total_alloc.
11130
11131 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11132 cache. (Bug#9221)
11133
11134 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11135 amount allocated this far in `bidi_cache_total_alloc'.
11136 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11137 non-zero, only free the data buffer without restoring the cache
11138 contents. All callers changed.
11139
11140 * dispextern.h (bidi_unshelve_cache): Update prototype.
11141
11142 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11143 (move_it_in_display_line, move_it_to)
11144 (move_it_vertically_backward, move_it_by_lines): Replace the call
11145 to xfree to an equivalent call to bidi_unshelve_cache.
11146 (move_it_in_display_line_to): Fix logic of returning
11147 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11148
11149 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11150
11151 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11152 came from a string character with a `cursor' property. (Bug#9229)
11153
11154 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11155
11156 * Makefile.in (LIB_PTHREAD): New variable.
11157 (LIBES): Add LIB_PTHREAD (Bug#9216).
11158
11159 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11160 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11161
11162 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11163
11164 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11165
11166 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11167
11168 * xterm.c (x_find_topmost_parent): New function.
11169 (x_set_frame_alpha): Find topmost parent window with
11170 x_find_topmost_parent and set the property there also (bug#9181).
11171 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11172
11173 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11174
11175 * callproc.c (Fcall_process): Avoid vfork clobbering
11176 the local vars buffer, coding_systems, current_dir.
11177
11178 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11179
11180 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11181
11182 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11183
11184 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11185 so that it is not optimized away.
11186
11187 * xdisp.c (compute_display_string_pos): Remove unused local.
11188
11189 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11190
11191 Fix slow cursor motion and scrolling in large buffers with
11192 selective display, like Org Mode buffers. (Bug#9218)
11193
11194 * dispextern.h (struct bidi_it): New member disp_prop_p.
11195
11196 * xdisp.c: Remove one-slot cache of display string positions.
11197 (compute_display_string_pos): Accept an additional argument
11198 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11199 for a display string or property. If found, set DISP_PROP_P
11200 non-zero.
11201
11202 * bidi.c (bidi_fetch_char): Accept an additional argument
11203 DISP_PROP_P, and pass it to compute_display_string_pos.
11204 Only handle text covered by a display string if DISP_PROP_P is returned
11205 non-zero. All callers of bidi_fetch_char changed.
11206
11207 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11208
11209 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11210
11211 2010-12-03 Don March <don@ohspite.net>
11212
11213 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11214 last character M-[char] is translated to ESC [char] (bug#7541).
11215
11216 2011-08-02 Kenichi Handa <handa@m17n.org>
11217
11218 * lisp.h (uniprop_table): Extern it.
11219
11220 * chartab.c (uniprop_table): Make it non-static.
11221
11222 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11223
11224 * xdisp.c (forward_to_next_line_start): Accept additional argument
11225 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11226 on the newline.
11227 (reseat_at_next_visible_line_start): Use the bidi iterator state
11228 returned by forward_to_next_line_start to restore the state of
11229 it->bidi_it after backing up to previous newline. (Bug#9212)
11230
11231 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11232
11233 * regex.c (re_comp): Protoize.
11234 (re_exec): Fix return type.
11235 (regexec): Fix type of `ret'. (Bug#9203)
11236
11237 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11238
11239 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11240 This is needed if max-image-size is a floating-point number.
11241
11242 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11243
11244 * print.c (print_object): Print empty symbol as ##.
11245
11246 * lread.c (read1): Read ## as empty symbol.
11247
11248 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11249
11250 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11251 setting frame foreground color (Bug#9175).
11252 (x_set_background_color): Likewise.
11253
11254 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11255 contents (Bug#9176).
11256 (EmacsTooltip -init): Remove bezels and add shadows to
11257 tooltip windows.
11258
11259 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11260 or scroll bar (Bug#8470).
11261
11262 * nsfont.m (nsfont_open): Remove assignment to voffset and
11263 unnecessary vars hshink, expand, hd, full_height, min_height.
11264 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11265
11266 * nsterm.h (nsfont_info): Remove voffset field.
11267
11268 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11269
11270 Implement strike-through and overline on NextStep (Bug#8863).
11271
11272 * nsfont.m (nsfont_open): Use underline position provided by font,
11273 instead of hard-coded value of 2.
11274 (nsfont_draw): Call ns_draw_text_decoration instead.
11275
11276 * nsterm.h: Add declaration for ns_draw_text_decoration.
11277
11278 * nsterm.m (ns_draw_text_decoration): New function for drawing
11279 underline, overline, and strike-through.
11280 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11281 ns_draw_text_decoration. Change treatment of cursor drawing to
11282 accommodate underlining, etc.
11283
11284 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11285
11286 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11287 default.
11288
11289 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11290
11291 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11292 Without this fix, if a signal arrives just after memory fills up,
11293 'malloc' might be invoked reentrantly.
11294
11295 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11296 In other words, assume that every image size is allowed, on non-X
11297 hosts. This assumption is probably wrong, but it lets Emacs compile.
11298
11299 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11300
11301 * regex.c (re_iswctype): Convert return values to boolean.
11302
11303 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11304
11305 * xdisp.c (compute_display_string_pos): Don't use cached display
11306 string position if the buffer had its restriction changed.
11307 (Bug#9184)
11308
11309 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11310
11311 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11312
11313 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11314
11315 Integer signedness and overflow and related fixes. (Bug#9079)
11316
11317 * bidi.c: Integer size and overflow fixes.
11318 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11319 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11320 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11321 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11322 (bidi_find_other_level_edge):
11323 Use ptrdiff_t instead of EMACS_INT where either will do.
11324 This works better on 32-bit hosts configured --with-wide-int.
11325 (bidi_cache_ensure_space): Check for size-calculation overflow.
11326 Use % rather than repeated addition, for better worst-case speed.
11327 Don't set bidi_cache_size until after xrealloc returns, because it
11328 might not return.
11329 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11330 (bidi_cache_ensure_space): Also check that the bidi cache size
11331 does not exceed that of the largest Lisp string or buffer. See Eli
11332 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11333
11334 * alloc.c (__malloc_size_t): Remove.
11335 All uses replaced by size_t. See Andreas Schwab's note
11336 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11337
11338 * image.c: Improve checking for integer overflow.
11339 (check_image_size): Assume that f is nonnull, since
11340 it is always nonnull in practice. This is one less thing to
11341 worry about when checking for integer overflow later.
11342 (x_check_image_size): New function, which checks for integer
11343 overflow issues inside X.
11344 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11345 This removes the need for a memory_full check.
11346 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11347 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11348 (xbm_read_bitmap_data): Change locals back to 'int', since
11349 their values must fit in 'int'.
11350 (xpm_load_image, png_load, tiff_load):
11351 Invoke x_create_x_image_and_pixmap earlier,
11352 to avoid much needless work if the image is too large.
11353 (tiff_load): Treat overly large images as if
11354 x_create_x_image_and_pixmap failed, not as malloc failures.
11355 (gs_load): Use x_check_image_size.
11356
11357 * gtkutil.c: Omit integer casts.
11358 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11359 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11360
11361 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11362
11363 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11364 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11365 would wrongly return t on a 64-bit host.
11366
11367 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11368 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11369 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11370 and therefore cause GCC to emit a bogus diagnostic in some cases.
11371
11372 * image.c: Integer signedness and overflow and related fixes.
11373 This is not an exhaustive set of fixes, but it's time to
11374 record what I've got.
11375 (lookup_pixel_color, check_image_size): Remove redundant decls.
11376 (check_image_size): Don't assume that arbitrary EMACS_INT values
11377 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11378 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11379 (tiff_load, imagemagick_load_image):
11380 Check for overflow in size calculations.
11381 (x_create_x_image_and_pixmap): Remove unnecessary test for
11382 xmalloc returning NULL; that can't happen.
11383 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11384 (xpm_color_bucket): Use better integer hashing function.
11385 (xpm_cache_color): Don't possibly over-allocate memory.
11386 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11387 (gif_memory_source):
11388 Use ptrdiff_t, not int or size_t, to record sizes.
11389 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11390 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11391 either works, as we prefer signed integers.
11392 (tiff_read_from_memory, tiff_write_from_memory):
11393 Return tsize_t, not size_t, since that's what the TIFF API wants.
11394 (tiff_read_from_memory): Don't fail simply because the read would
11395 go past EOF; instead, return a short read.
11396 (tiff_load): Omit no-longer-needed casts.
11397 (Fimagemagick_types): Don't assume size fits into 'int'.
11398
11399 Improve hashing quality when configured --with-wide-int.
11400 * fns.c (hash_string): New function, taken from sxhash_string.
11401 Do not discard information about ASCII character case; this
11402 discarding is no longer needed.
11403 (sxhash-string): Use it. Change sig to match it. Caller changed.
11404 * lisp.h: Declare it.
11405 * lread.c (hash_string): Remove, since we now use fns.c's version.
11406 The fns.c version returns a wider integer if --with-wide-int is
11407 specified, so this should help the quality of the hashing a bit.
11408
11409 * emacs.c: Integer overflow minor fix.
11410 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11411 Define only if GNU_LINUX.
11412 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11413
11414 * dispnew.c: Integer signedness and overflow fixes.
11415 Remove unnecessary forward decls, that were a maintenance hassle.
11416 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11417 All uses changed.
11418 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11419 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11420 (prepare_desired_row, line_draw_cost):
11421 Use int, not unsigned, where either works.
11422 (save_current_matrix, restore_current_matrix):
11423 Use ptrdiff_t, not size_t, where either works.
11424 (init_display): Check for overflow more accurately, and without
11425 relying on undefined behavior.
11426
11427 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11428 Remove, replacing with the new symbols in lisp.h. All uses changed.
11429 * fileio.c (make_temp_name):
11430 * filelock.c (lock_file_1, lock_file):
11431 * xdisp.c (message_dolog):
11432 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11433 Use pMd etc. instead.
11434 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11435 replacing the pWIDE etc. symbols removed from editfns.c.
11436
11437 * keyboard.h (num_input_events): Now uintmax_t.
11438 This is (very slightly) less likely to mess up due to wraparound.
11439 All uses changed.
11440
11441 * buffer.c: Integer signedness fixes.
11442 (alloc_buffer_text, enlarge_buffer_text):
11443 Use ptrdiff_t rather than size_t when either will do, as we prefer
11444 signed integers.
11445
11446 * alloc.c: Integer signedness and overflow fixes.
11447 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11448 (__malloc_size_t): Default to size_t, not to int.
11449 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11450 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11451 Prefer ptrdiff_t to size_t when either would do, as we prefer
11452 signed integers.
11453 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11454 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11455 Now const. Initialize with values that are in range even if char
11456 is signed.
11457 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11458 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11459 These functions do the right thing with sizes > 2**32.
11460 (check_depth): Now ptrdiff_t, not int.
11461 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11462 Adjust to new way of storing sizes. Check for size overflow bugs
11463 in rest of code.
11464 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11465 slightly wrong anyway, as it missed one instance of
11466 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11467 (refill_memory_reserve): Omit needless cast to size_t.
11468 (mark_object_loop_halt): Mark as externally visible.
11469
11470 * xselect.c: Integer signedness and overflow fixes.
11471 (Fx_register_dnd_atom, x_handle_dnd_message):
11472 Use ptrdiff_t, not size_t, since we prefer signed.
11473 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11474 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11475 x_dnd_atoms_size and x_dnd_atoms_length.
11476
11477 * doprnt.c: Prefer signed to unsigned when either works.
11478 * eval.c (verror):
11479 * doprnt.c (doprnt):
11480 * lisp.h (doprnt):
11481 * xdisp.c (vmessage):
11482 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11483 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11484 prefer signed arithmetic to avoid comparison confusion.
11485 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11486 but is a bit tricky.
11487
11488 Assume freestanding C89 headers, string.h, stdlib.h.
11489 * data.c, doprnt.c, floatfns.c, print.c:
11490 Include float.h unconditionally.
11491 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11492 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11493 * regex.c: Likewise for stddef.h, string.h.
11494 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11495 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11496 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11497 (STDC_HEADERS): Remove obsolete defines.
11498 * sysdep.c: Include limits.h unconditionally.
11499
11500 Assume support for memcmp, memcpy, memmove, memset.
11501 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11502 * regex.c (memcmp, memcpy):
11503 Remove; we assume C89 now.
11504
11505 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11506 (__malloc_safe_bcopy): Remove; no longer needed.
11507
11508 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11509 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11510 well either way, and we prefer signed to unsigned.
11511
11512 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11513
11514 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11515 closes the connection while we're reading (bug#9182).
11516
11517 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11518
11519 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11520 are specified (Bug#9168).
11521
11522 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11523
11524 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11525 Found by GCC static checking and --with-wide-int on a 32-bit host.
11526
11527 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11528
11529 * xdisp.c (compute_display_string_pos): Fix logic of caching
11530 previous display string position. Initialize cached_prev_pos to
11531 -1. Fixes slow-down at the beginning of a buffer.
11532
11533 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11534
11535 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11536 for attrs[LFACE_FONTSET_INDEX].
11537
11538 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11539
11540 * xml.c (parse_region): Remove unused local
11541 that was recently introduced.
11542
11543 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11544
11545 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11546 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11547
11548 * xdisp.c (move_it_in_display_line_to): Record the best matching
11549 position for TO_CHARPOS while scanning the line, and restore it on
11550 exit if none of the characters scanned was an exact match.
11551 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11552 when exact match is impossible due to invisible text, and the
11553 lines are truncated.
11554
11555 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11556
11557 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11558 for OSX >= 10.7.
11559
11560 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11561
11562 Fix a significant slow-down of cursor motion with C-n, C-p,
11563 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11564 auto-repeat under bidi redisplay in fontified buffers.
11565 * xdisp.c (compute_stop_pos_backwards): New function.
11566 (next_element_from_buffer): Call compute_stop_pos_backwards to
11567 find a suitable prev_stop when we find ourselves before
11568 base_level_stop.
11569 (reseat): Don't look for prev_stop, as that could mean a very long
11570 run.
11571 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11572 <cached_disp_overlay_modiff>: Cache for last found display string
11573 position.
11574 (compute_display_string_pos): Return the cached position if asked
11575 about the same buffer in the same area of character positions, and
11576 the buffer wasn't changed since the time the display string
11577 position was cached.
11578
11579 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11580
11581 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11582 is an integer, which is important for empty lines. (Bug#9149)
11583
11584 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11585
11586 * frame.c (Fmodify_frame_parameters): In tty case, update the
11587 default face if necessary (Bug#4238).
11588
11589 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11590
11591 * editfns.c (Fstring_to_char): No need to explain what a character
11592 is in the docstring (Bug#6576).
11593
11594 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11595
11596 * xml.c (parse_region): Make sure we always return a tree.
11597
11598 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11599
11600 * xml.c (parse_region): If a document contains only comments,
11601 return that, too.
11602
11603 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11604
11605 * xml.c (make_dom): Return comments, too.
11606
11607 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11608
11609 Port to OpenBSD.
11610 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11611 and the surrounding thread.
11612 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11613 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11614 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11615 timer goes off.
11616 * s/openbsd.h (BROKEN_SIGIO): Define.
11617 * unexelf.c (unexec) [__OpenBSD__]:
11618 Don't update the .mdebug section of the Alpha COFF symbol table.
11619
11620 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11621
11622 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11623 (bug#8460).
11624
11625 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11626
11627 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11628 This fixes some race conditions on the permissions of any newly
11629 created file.
11630
11631 * alloc.c (valid_pointer_p): Use pipe, not open.
11632 This fixes some permissions issues when debugging.
11633
11634 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11635 If fchown fails to set both uid and gid, try to set just gid,
11636 as that is sometimes allowed. Adjust the file's mode to eliminate
11637 setuid or setgid bits that are inappropriate if fchown fails.
11638
11639 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11640
11641 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11642 to compare Lisp_Objects.
11643 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11644 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11645 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11646
11647 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11648
11649 * lread.c (read_integer): Unread even EOF character.
11650 (read1): Likewise. Properly record start position of symbol.
11651
11652 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11653 symbol character follows.
11654
11655 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11656
11657 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11658 This works around a problem with the previous change to Fcopy_file.
11659 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11660 and without this change, GCC might complain about discarding
11661 fchown's return value.
11662
11663 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11664
11665 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11666
11667 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11668
11669 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11670
11671 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11672
11673 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11674 it's used from the C level.
11675
11676 * process.c: Use the same condition for POLL_FOR_INPUT in both
11677 keyboard.c and process.c (bug#1858).
11678
11679 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11680
11681 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11682 (Fgnutls_boot): Use it.
11683
11684 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11685
11686 * doc.c (Fsubstitute_command_keys): Revert last change.
11687
11688 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11689
11690 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11691 quotes the next character, and doesn't affect other longer
11692 sequences (bug#8935).
11693
11694 * lread.c (syms_of_lread): Clarify that is isn't only
11695 `eval-buffer' and `eval-defun' that's affected by
11696 `lexical-binding' (bug#8460).
11697
11698 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11699
11700 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11701 bidi redisplay when a line includes both an image and is truncated.
11702
11703 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11704
11705 Fix minor problems found by static checking.
11706 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11707 (elsz): Now a signed constant, not a size_t var. We prefer signed
11708 types to unsigned, to avoid integer comparison confusion. Without
11709 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11710 "cannot optimize loop, the loop counter may overflow", a symptom
11711 of the confusion.
11712 * indent.c (Fvertical_motion): Mark locals as initialized.
11713 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11714
11715 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11716
11717 * search.c (Fre_search_backward): Mention `case-fold-search' in
11718 all the re_search_* functions (bug#8138).
11719
11720 * keyboard.c (Fopen_dribble_file): Document when the file is
11721 closed (bug#8056).
11722
11723 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11724
11725 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11726 bidi_cache_idx.
11727
11728 Support bidi reordering of display and overlay strings.
11729 * xdisp.c (compute_display_string_pos)
11730 (compute_display_string_end): Accept additional argument STRING.
11731 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11732 (reseat_to_string): Initialize bidi_it->string.s and
11733 bidi_it->string.schars.
11734 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11735 NULL (avoids a crash in bidi_paragraph_init).
11736 Initialize itb.string.lstring.
11737 (init_iterator): Call bidi_init_it only of a valid
11738 buffer position was specified. Initialize paragraph_embedding to
11739 L2R.
11740 (reseat_to_string): Initialize the bidi iterator.
11741 (display_string): If we need to ignore text properties of
11742 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11743 original value of -1 will not work with bidi.)
11744 (compute_display_string_pos): First arg is now struct
11745 `text_pos *'; all callers changed. Support display properties on
11746 Lisp strings.
11747 (compute_display_string_end): Support display properties on Lisp
11748 strings.
11749 (init_iterator, reseat_1, reseat_to_string): Initialize the
11750 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11751 when iterating on a string not from display properties).
11752 (compute_display_string_pos, compute_display_string_end):
11753 Fix calculation of the object to scan. Fixes an error when using
11754 arrow keys.
11755 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11756 base_level_stop; instead, set base_level_stop to BEGV.
11757 Fixes crashes in vertical-motion.
11758 (next_element_from_buffer): Improve commentary for when
11759 the iterator is before prev_stop.
11760 (init_iterator): Initialize bidi_p from the default value of
11761 bidi-display-reordering, not from buffer-local value. Use the
11762 buffer-local value only if initializing for buffer iteration.
11763 (handle_invisible_prop): Support invisible properties on strings
11764 that are being bidi-reordered.
11765 (set_iterator_to_next): Support bidi reordering of C strings and
11766 Lisp strings.
11767 (next_element_from_string): Support bidi reordering of Lisp
11768 strings.
11769 (handle_stop_backwards): Support Lisp strings as well.
11770 (display_string): Support display of R2L glyph rows.
11771 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11772 (init_iterator): Don't initialize it->bidi_p for strings
11773 here.
11774 (reseat_to_string): Initialize it->bidi_p for strings here.
11775 (next_element_from_string, next_element_from_c_string)
11776 (next_element_from_buffer): Add xassert's for correspondence
11777 between IT's object being iterated and it->bidi_it.string
11778 structure.
11779 (face_before_or_after_it_pos): Support bidi iteration.
11780 (next_element_from_c_string): Handle the case of the first string
11781 character that is not the first one in the visual order.
11782 (get_visually_first_element): New function, refactored from common
11783 parts of next_element_from_buffer, next_element_from_string, and
11784 next_element_from_c_string.
11785 (tool_bar_lines_needed, redisplay_tool_bar)
11786 (display_menu_bar): Force left-to-right direction. Add a FIXME
11787 comment for making that be controlled by a user option.
11788 (push_it, pop_it): Save and restore the state of the
11789 bidi iterator. Save and restore the bidi_p flag.
11790 (pop_it): Iterate out of display property for string iteration as
11791 well.
11792 (iterate_out_of_display_property): Support iteration over strings.
11793 (handle_single_display_spec): Set up it->bidi_it for iteration
11794 over a display string, and call bidi_init_it.
11795 (handle_single_display_spec, next_overlay_string)
11796 (get_overlay_strings_1, push_display_prop): Set up the bidi
11797 iterator for displaying display or overlay strings.
11798 (forward_to_next_line_start): Don't use the shortcut if
11799 bidi-iterating.
11800 (back_to_previous_visible_line_start): If handle_display_prop
11801 pushed the iterator stack, restore the internal state of the bidi
11802 iterator by calling bidi_pop_it same number of times.
11803 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11804 and we are bidi-iterating, don't decrement the iterator position;
11805 instead, set the first_elt flag in the bidi iterator, to produce
11806 the same effect.
11807 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11808 (push_display_prop): xassert that we are iterating a buffer.
11809 (push_it, pop_it): Save and restore paragraph_embedding member.
11810 (handle_single_display_spec, next_overlay_string)
11811 (get_overlay_strings_1, reseat_1, reseat_to_string)
11812 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11813 correctly. Don't assume unibyte strings are not bidi-reordered.
11814 (compute_display_string_pos)
11815 (compute_display_string_end): Fix handling the case of C string.
11816 (push_it, pop_it): Save and restore from_disp_prop_p.
11817 (handle_single_display_spec, push_display_prop): Set the
11818 from_disp_prop_p flag.
11819 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11820 (pop_it): Call iterate_out_of_display_property only if we are
11821 popping after iteration over a string that came from a display
11822 property. Fix a typo in popping stretch info. Add an assertion
11823 for verifying that the iterator position is in sync with the bidi
11824 iterator.
11825 (handle_single_display_spec, get_overlay_strings_1)
11826 (push_display_prop): Fix initialization of paragraph direction for
11827 string when that of the parent object is not yet determined.
11828 (reseat_1): Call bidi_init_it to resync the bidi
11829 iterator with IT's position. (Bug#7616)
11830 (find_row_edges): If ROW->start.pos gives position
11831 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11832 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11833 Reset the from_disp_prop_p flag.
11834 (SAVE_IT, RESTORE_IT): New macros.
11835 (pos_visible_p, face_before_or_after_it_pos)
11836 (back_to_previous_visible_line_start)
11837 (move_it_in_display_line_to, move_it_in_display_line)
11838 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11839 (try_scrolling, redisplay_window, display_line): Use them when
11840 saving a temporary copy of the iterator and restoring it back.
11841 (back_to_previous_visible_line_start, reseat_1)
11842 (init_iterator): Empty the bidi cache "stack".
11843 (move_it_in_display_line_to): If iterator ended up at
11844 EOL, but we never saw any buffer positions smaller than
11845 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11846 motion in bidi-reordered lines.
11847 (move_it_in_display_line_to): Record prev_method and prev_pos
11848 immediately before the call to set_iterator_to_next. Fixes cursor
11849 motion in bidi-reordered lines with stretch glyphs and strings
11850 displayed in margins. (Bug#8133) (Bug#8867)
11851 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11852 TO_CHARPOS.
11853 (pos_visible_p): Support positions in bidi-reordered lines.
11854 Save and restore bidi cache.
11855
11856 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11857 (bidi_paragraph_info): Delete unused struct.
11858 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11859 (bidi_cache_start): New variable.
11860 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11861 to zero.
11862 (bidi_cache_fetch_state, bidi_cache_search)
11863 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11864 (bidi_cache_find, bidi_peek_at_next_level)
11865 (bidi_level_of_next_char, bidi_find_other_level_edge)
11866 (bidi_move_to_visually_next): Compare cache index with
11867 bidi_cache_start rather than with zero.
11868 (bidi_fetch_char): Accept new argument STRING; all callers
11869 changed. Support iteration over a string. Support strings with
11870 display properties. Support unibyte strings. Fix the type of
11871 `len' according to what STRING_CHAR_AND_LENGTH expects.
11872 (bidi_paragraph_init, bidi_resolve_explicit_1)
11873 (bidi_resolve_explicit, bidi_resolve_weak)
11874 (bidi_level_of_next_char, bidi_move_to_visually_next):
11875 Support iteration over a string.
11876 (bidi_set_sor_type, bidi_resolve_explicit_1)
11877 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11878 can now be zero (for strings); special values 0 and -1 were
11879 changed to -1 and -2, respectively.
11880 (bidi_char_at_pos): New function.
11881 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11882 Call it instead of FETCH_MULTIBYTE_CHAR.
11883 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11884 initialized to valid values.
11885 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11886 values.
11887 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11888 the test for valid cached positions. Fix the logic for looking up
11889 the sentinel state in the cache. GCPRO the Lisp string we are
11890 iterating.
11891 (bidi_push_it, bidi_pop_it): New functions.
11892 (bidi_initialize): Initialize the bidi cache start stack pointer.
11893 (bidi_cache_ensure_space): New function, refactored from part of
11894 bidi_cache_iterator_state. Don't assume the required size is just
11895 one BIDI_CACHE_CHUNK away.
11896 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11897 (bidi_count_bytes, bidi_char_at_pos): New functions.
11898 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11899 always valid if bidi_cache_idx is valid.
11900 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11901 is valid if it's going to be used.
11902 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11903 (bidi_cache_fetch_state, bidi_cache_search)
11904 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11905 (bidi_cache_iterator_state, bidi_cache_find)
11906 (bidi_find_other_level_edge, bidi_cache_start_stack):
11907 All variables related to cache indices are now EMACS_INT.
11908
11909 * dispextern.h (struct bidi_string_data): New structure.
11910 (struct bidi_it): New member `string'. Make flag members be 1-bit
11911 fields, and put them last in the struct.
11912 (compute_display_string_pos, compute_display_string_end):
11913 Update prototypes.
11914 (bidi_push_it, bidi_pop_it): Add prototypes.
11915 (struct iterator_stack_entry): New members bidi_p,
11916 paragraph_embedding, and from_disp_prop_p.
11917 (struct it): Member bidi_p is now a bit field 1 bit wide.
11918 (bidi_shelve_cache, bidi_unshelve_cache):
11919 Declare prototypes.
11920
11921 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11922 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11923 and vector-like objects.
11924
11925 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11926 cache around display iteration.
11927
11928 * window.c (Fwindow_end, window_scroll_pixel_based)
11929 (displayed_window_lines, Frecenter): Save and restore the bidi
11930 cache around display iteration.
11931
11932 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11933
11934 * editfns.c (Fdelete_region): Clarify the use of the named
11935 parameters (bug#6788).
11936
11937 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11938
11939 * indent.c (Fvertical_motion): Set and restore w->pointm when
11940 saving and restoring the window's buffer (Bug#9006).
11941
11942 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11943
11944 * editfns.c (Fstring_to_char): Clarify just what is returned
11945 (bug#6576). Text by Eli Zaretskii.
11946
11947 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11948
11949 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11950
11951 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11952
11953 * buffer.c (mmap_find): Fix a typo.
11954
11955 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11956
11957 Fix execution of x selection hooks.
11958 * xselect.c (Qx_lost_selection_functions)
11959 (Qx_sent_selection_functions): New vars.
11960 (syms_of_xselect): DEFSYM them.
11961 (x_handle_selection_request): Pass Qx_sent_selection_functions
11962 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11963 (x_handle_selection_clear,x_clear_frame_selections):
11964 Pass Qx_lost_selection_functions rather than
11965 Vx_lost_selection_functions to Frun_hook_with_args.
11966
11967 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11968
11969 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11970 The old code sometimes used this field without initializing it.
11971
11972 * alloc.c (gc_sweep): Don't read past end of array.
11973 In theory, the old code could also have corrupted Emacs internals,
11974 though it'd be very unlikely.
11975
11976 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11977
11978 * character.c (Fcharacterp): Don't advertise optional ignored
11979 argument. (Bug#4026)
11980
11981 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11982
11983 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11984 key" (bug#4257).
11985
11986 * window.c (Fset_window_start): Doc fix (bug#4199).
11987 (Fset_window_hscroll): Ditto.
11988
11989 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11990
11991 Fix minor new problems caught by GCC 4.6.1.
11992 * term.c (init_tty): Remove unused local.
11993 * xsettings.c (store_monospaced_changed): Define this function only
11994 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11995 not used otherwise.
11996
11997 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11998
11999 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12000
12001 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12002
12003 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12004 are the mini-buffer and the echo area (bug#3320).
12005
12006 * term.c (init_tty): Remove support for supdup, c10 and perq
12007 terminals, which are no longer supported (bug#1482).
12008
12009 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12010
12011 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12012
12013 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12014
12015 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12016 for non-popups (Bug#3642).
12017
12018 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12019
12020 * alloc.c (reset_malloc_hooks): Protoize.
12021 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12022 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12023 * cm.c (losecursor): Likewise.
12024 * data.c (fmod): Likewise.
12025 * dispnew.c (swap_glyphs_in_rows): Likewise.
12026 * emacs.c (memory_warning_signal): Likewise.
12027 * floatfns.c (float_error): Likewise.
12028 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12029 (otf_open, font_otf_capability, generate_otf_features)
12030 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12031 Likewise.
12032 * image.c (pbm_read_file): Likewise.
12033 * indent.c (string_display_width): Likewise.
12034 * intervals.c (check_for_interval, search_for_interval)
12035 (inc_interval_count, count_intervals, root_interval)
12036 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12037 * lread.c (defalias): Likewise.
12038 * ralloc.c (r_alloc_check): Likewise.
12039 * regex.c (set_image_of_range_1, set_image_of_range)
12040 (regex_grow_registers): Likewise.
12041 * sysdep.c (strerror): Likewise.
12042 * termcap.c (valid_filename_p, tprint, main): Likewise.
12043 * tparam.c (main): Likewise.
12044 * unexhp9k800.c (run_time_remap, save_data_space)
12045 (update_file_ptrs, read_header, write_header, calculate_checksum)
12046 (copy_file, copy_rest, display_header): Likewise.
12047 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12048 Likewise.
12049 * xdisp.c (check_it): Likewise.
12050 * xfaces.c (register_color, unregister_color, unregister_colors):
12051 Likewise.
12052 * xfns.c (print_fontset_result): Likewise.
12053 * xrdb.c (member, fatal, main): Likewise.
12054
12055 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12056
12057 Fix minor problems found by static checking (Bug#9031).
12058 * chartab.c (char_table_set_range, map_sub_char_table):
12059 Remove unused locals.
12060 (uniprop_table): Now static.
12061 * composite.c (_work_char): Remove unused static var.
12062
12063 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12064
12065 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12066
12067 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12068
12069 * gtkutil.c (qttip_cb): Remove code without function.
12070
12071 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12072
12073 * w32.c (pthread_sigmask): New stub.
12074
12075 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12076
12077 Use pthread_sigmask, not sigprocmask (Bug#9010).
12078 sigprocmask is portable only for single-threaded applications, and
12079 Emacs can be multi-threaded when it uses GTK.
12080 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12081 (LIBES): Use it.
12082 * callproc.c (Fcall_process):
12083 * process.c (create_process):
12084 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12085 Use pthread_sigmask, not sigprocmask.
12086
12087 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12088
12089 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12090 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12091 wrong (Bug#8591).
12092
12093 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12094
12095 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12096 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12097 (xg_hide_tooltip): Fix comment.
12098
12099 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12100 in registerServicesMenuSendTypes.
12101 (validRequestorForSendType): Don't check ns_return_types.
12102
12103 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12104 ns_return_type.
12105
12106 2011-07-08 Jason Rumney <jasonr@gnu.org>
12107
12108 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12109 SH_SHOW for hidden windows (Bug#5482).
12110
12111 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12112 frame struct members of non-existent frames (Bug#6284).
12113
12114 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12115
12116 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12117 variable firstTime not needed on OSX >= 10.6.
12118 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12119 >= 10.5. Use setKnobProportion, setDoubleValue.
12120
12121 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12122 (MAC_OS_X_VERSION_10_5): Define if not defined.
12123 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12124 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12125 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12126
12127 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12128 cString and lossyCString on OSX >= 10.4.
12129
12130 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12131 sizeToFit on OSX >= 10.2.
12132
12133 * nsimage.m (allocInitFromFile): Don't use deprecated method
12134 bestRepresentationForDevice on OSX >= 10.6.
12135
12136 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12137 to avoid warning.
12138
12139 * emacs.c: Declare unexec_init_emacs_zone.
12140
12141 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12142
12143 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12144
12145 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12146 on svcsMenu (Bug#8842).
12147
12148 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12149 ns_return_types.
12150 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12151
12152 * nsterm.m (QUTF8_STRING): Declare.
12153 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12154 (validRequestorForSendType): Return type is (id).
12155 Change indexOfObjectIdenticalTo to indexOfObject.
12156 Check if we have local selection before returning self (Bug#8842).
12157 (writeSelectionToPasteboard): Put local selection into paste board
12158 if we have a local selection (Bug#8842).
12159 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12160
12161 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12162 (ns_get_local_selection): Declare.
12163
12164 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12165
12166 * keymap.c (describe_map_tree): Don't insert a double newline at
12167 the end of the buffer (bug#1169) and return whether we inserted
12168 something.
12169
12170 * callint.c (Fcall_interactively): Change "reading args" to
12171 "providing args" to try to clarify what it does (bug#1010).
12172
12173 2011-07-07 Kenichi Handa <handa@m17n.org>
12174
12175 * composite.c (composition_compute_stop_pos): Ignore a static
12176 composition starting before CHARPOS (Bug#8915).
12177
12178 * xdisp.c (handle_composition_prop): Likewise.
12179
12180 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12181
12182 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12183 (Bug#9015)
12184
12185 2011-07-07 Kenichi Handa <handa@m17n.org>
12186
12187 * character.h (unicode_category_t): New enum type.
12188
12189 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12190 (Qchar_code_property_table): New variable.
12191 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12192 (UNIPROP_COMPRESSED_FORM_P): New macros.
12193 (char_table_ascii): Uncompress the compressed values.
12194 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12195 Uncompress the compressed values.
12196 (sub_char_table_ref_and_range): Likewise.
12197 (char_table_ref_and_range): Uncompress the compressed values.
12198 (sub_char_table_set): New arg is_uniprop. Callers changed.
12199 Uncompress the compressed values.
12200 (sub_char_table_set_range): Args changed. Callers changed.
12201 (char_table_set_range): Adjuted for the above change.
12202 (map_sub_char_table): Delete args default_val and parent. Add arg
12203 top. Give decoded values to a Lisp function.
12204 (map_char_table): Adjust for the above change. Give decoded
12205 values to a Lisp function. Gcpro more variables.
12206 (uniprop_table_uncompress)
12207 (uniprop_decode_value_run_length): New functions.
12208 (uniprop_decoder, uniprop_decoder_count): New variables.
12209 (uniprop_get_decoder, uniprop_encode_value_character)
12210 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12211 New functions.
12212 (uniprop_encoder, uniprop_encoder_count): New variables.
12213 (uniprop_get_encoder, uniprop_table)
12214 (Funicode_property_table_internal, Fget_unicode_property_internal)
12215 (Fput_unicode_property_internal): New functions.
12216 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12217 Sunicode_property_table_internal, Sget_unicode_property_internal,
12218 and Sput_unicode_property_internal. Defvar_lisp
12219 char-code-property-alist.
12220
12221 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12222 Vunicode_category_table.
12223
12224 * font.c (font_range): Adjust for the change of
12225 Vunicode_category_table.
12226
12227 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12228
12229 * m/iris4d.h: Remove file, move contents ...
12230 * s/irix6-5.h: ... here.
12231
12232 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12233
12234 Remove unportable assumption about struct layout (Bug#8884).
12235 * alloc.c (mark_buffer):
12236 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12237 (clone_per_buffer_values): Don't assume that
12238 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12239 This isn't true in general, and it's particularly not true
12240 if Emacs is configured with --with-wide-int.
12241 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12242 New macros, used in the buffer.c change.
12243
12244 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12245
12246 * xsettings.c: Use both GConf and GSettings if both are available.
12247 (store_config_changed_event): Add comment.
12248 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12249 (store_tool_bar_style_changed): New functions.
12250 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12251 (struct xsettings): Move font inside HAVE_XFT.
12252 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12253 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12254 Move inside HAVE_XFT.
12255 (something_changed_gsettingsCB): Rename from something_changedCB.
12256 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12257 also.
12258 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12259 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12260 (something_changed_gconfCB): Rename from something_changedCB.
12261 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12262 (parse_settings): Move check for font inside HAVE_XFT.
12263 (read_settings, apply_xft_settings): Add comment.
12264 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12265 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12266 call store_font_name_changed.
12267 (xft_settings_event): Add comment.
12268 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12269 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12270 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12271 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12272 (xsettings_initialize): Call init_gsettings last.
12273 (xsettings_get_system_font, xsettings_get_system_normal_font):
12274 Add comment.
12275
12276 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12277
12278 Random fixes. E.g., (random) never returned negative values.
12279 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12280 subseconds part to the entropy, as that's a bit more random.
12281 Prefer signed to unsigned, since the signedness doesn't matter and
12282 in general we prefer signed. When given a limit, use a
12283 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12284 latter isn't right if USE_2_TAGS_FOR_INTS.
12285 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12286 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12287
12288 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12289
12290 * textprop.c (text_property_stickiness):
12291 Obey Vtext_property_default_nonsticky.
12292 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12293 * w32fns.c (syms_of_w32fns):
12294 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12295
12296 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12297
12298 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12299 This is more efficient than Ffile_directory_p and avoids a minor race.
12300
12301 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12302
12303 * buffer.c (Foverlay_put): Say what the return value is
12304 (bug#7835).
12305
12306 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12307 is a directory before asking whether to use the file name
12308 (bug#7564).
12309 (barf_or_query_if_file_exists): Make the "File is a directory"
12310 error be more correct.
12311
12312 * fns.c (Frequire): Remove the mention of the .gz files, since
12313 that's installation-specific, but keep the mention of
12314 `get-load-suffixes'.
12315
12316 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12317
12318 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12319 Report string overflow if the output is too long.
12320
12321 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12322
12323 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12324 (syms_of_gnutls): Remove duplicate DEFSYM for
12325 Qgnutls_bootprop_verify_hostname_error, an error for
12326 Qgnutls_bootprop_verify_error (which is no longer used).
12327
12328 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12329 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12330 Also (re)move comments that are misplaced or no longer relevant.
12331
12332 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12333
12334 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12335
12336 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12337
12338 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12339 and background color parameters if they have been changed.
12340
12341 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12342
12343 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12344
12345 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12346
12347 * xsettings.c (SYSTEM_FONT): Define only when used.
12348 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12349
12350 * keymap.c (access_keymap_1): Now static.
12351
12352 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12353
12354 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12355 leave any prefix arg for the up event (Bug#1586).
12356
12357 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12358
12359 * lread.c (syms_of_lread): Mention single symbols defined by
12360 `defvar' or `defconst' (bug#7154).
12361
12362 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12363 (Frequire): Mention get-load-suffixes.
12364
12365 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12366
12367 * window.h (window): Remove clone_number slot.
12368 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12369 Remove.
12370 (make_parent_window, make_window, saved_window)
12371 (Fset_window_configuration, save_window_save): Don't deal with
12372 clone numbers.
12373 * buffer.c (Qclone_number): Remove declaration.
12374 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12375
12376 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12377
12378 Add multiple inheritance to keymaps.
12379 * keymap.c (Fmake_composed_keymap): New function.
12380 (Fset_keymap_parent): Simplify.
12381 (fix_submap_inheritance): Remove.
12382 (access_keymap_1): New function extracted from access_keymap to handle
12383 embedded parents and handle lists of maps.
12384 (access_keymap): Use it.
12385 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12386 (Fcopy_keymap): Handle embedded parents.
12387 (Fcommand_remapping, define_as_prefix): Simplify.
12388 (Fkey_binding): Simplify.
12389 (syms_of_keymap): Move minibuffer-local-completion-map,
12390 minibuffer-local-filename-completion-map,
12391 minibuffer-local-must-match-map, and
12392 minibuffer-local-filename-must-match-map to Elisp.
12393 (syms_of_keymap): Defsubr make-composed-keymap.
12394 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12395 (parse_menu_item): Trivial simplification.
12396
12397 2011-07-01 Glenn Morris <rgm@gnu.org>
12398
12399 * Makefile.in (SETTINGS_LIBS): Fix typo.
12400
12401 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12402
12403 * coding.c (Fencode_coding_string): Record the last coding system
12404 used, as the function doc string says (bug#8738).
12405
12406 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12407
12408 * xsettings.c (store_monospaced_changed): Take new font as arg and
12409 check for change against current_mono_font.
12410 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12411 (emacs_settings_constructor, emacs_settings_get_property)
12412 (emacs_settings_set_property, emacs_settings_class_init)
12413 (emacs_settings_init, gsettings_obj): Remove.
12414 (something_changedCB): New function for HAVE_GSETTINGS.
12415 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12416 with value as argument.
12417 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12418 g_settings_new (Bug#8967). Do not create gsettings_obj.
12419 Remove calls to g_settings_bind. Connect something_changedCB to
12420 "changed".
12421
12422 * xgselect.c: Add defined (HAVE_GSETTINGS).
12423 (xgselect_initialize): Ditto.
12424
12425 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12426 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12427 xg_select.
12428
12429 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12430
12431 * eval.c (struct backtrace): Simplify and port the data structure.
12432 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12433 signed bit field, as this assumption is not portable and it makes
12434 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12435 "char debug_on_exit : 1" as this is not portable either; instead,
12436 use the portable "unsigned int debug_on_exit : 1". Remove unused
12437 member evalargs. Remove obsolete comments about cc bombing out.
12438
12439 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12440
12441 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12442 Let HAVE_GSETTINGS override HAVE_GCONF.
12443 (store_monospaced_changed): New function.
12444 (EMACS_SETTINGS): A new type derived from GObject to handle
12445 GSettings notifications.
12446 (emacs_settings_constructor, emacs_settings_get_property)
12447 (emacs_settings_set_property, emacs_settings_class_init):
12448 New functions.
12449 (gsettings_client, gsettings_obj): New variables.
12450 (GSETTINGS_SCHEMA): New define.
12451 (something_changedCB): Call store_monospaced_changed.
12452 (init_gsettings): New function.
12453 (xsettings_initialize): Call init_gsettings.
12454 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12455 to NULL.
12456
12457 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12458 GCONF_CFLAGS/LIBS.
12459
12460 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12461
12462 * window.c (resize_root_window, grow_mini_window)
12463 (shrink_mini_window): Rename Qresize_root_window to
12464 Qwindow_resize_root_window and Qresize_root_window_vertically to
12465 Qwindow_resize_root_window_vertically.
12466
12467 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12468
12469 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12470
12471 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12472
12473 * makefile.w32-in: Redesign dependencies so they reflect more
12474 clearly which files are directly included by each source file,
12475 and not through other includes.
12476
12477 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12478
12479 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12480 (sort_overlays, overlay_strings): When an overlay's clone number
12481 matches the window's clone number process the overlay even if
12482 the overlay's window property doesn't match the current window.
12483
12484 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12485 (Fwindow_hchild): Rename to Fwindow_left_child.
12486 (Fwindow_next): Rename to Fwindow_next_sibling.
12487 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12488 (resize_window_check): Rename to window_resize_check.
12489 (resize_window_apply): Rename to window_resize_apply.
12490 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12491 (Fdelete_other_windows_internal, resize_frame_windows)
12492 (Fsplit_window_internal, Fdelete_window_internal)
12493 (grow_mini_window, shrink_mini_window)
12494 (Fresize_mini_window_internal): Fix callers accordingly.
12495
12496 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12497
12498 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12499 (emacs_fixed_set_min_size): Remove.
12500 (emacs_fixed_new): Take frame as argument.
12501
12502 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12503 (_EmacsFixedPrivate): Remove minwidth/height.
12504 Add struct frame *f.
12505 (emacs_fixed_init): Initialize priv->f.
12506 (get_parent_class, emacs_fixed_set_min_size): Remove.
12507 (emacs_fixed_new): Set priv->f to argument.
12508 (emacs_fixed_get_preferred_width)
12509 (emacs_fixed_get_preferred_height): Use min_width/height from
12510 frames size_hint to set minimum and natural (Bug#8919).
12511 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12512 and use min_width/height from frames size_hint to set
12513 min_width/height (Bug#8919).
12514
12515 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12516 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12517 Fix indentation.
12518
12519 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12520
12521 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12522 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12523 called at ZV.
12524
12525 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12526
12527 * process.c (wait_reading_process_output): Bypass select if
12528 waiting for a cell while ignoring keyboard input, and input is
12529 pending. Suggested by Jan Djärv (Bug#8869).
12530
12531 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12532
12533 Use gnulib's dup2 module instead of rolling our own.
12534 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12535
12536 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12537
12538 * dispnew.c (scrolling_window): Before scrolling, turn off a
12539 mouse-highlight in the window being scrolled.
12540
12541 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12542
12543 Move DEFSYM to lisp.h and use everywhere.
12544
12545 * character.h (DEFSYM): Move declaration...
12546 * lisp.h (DEFSYM): ...here.
12547
12548 * gnutls.c:
12549 * minibuf.c:
12550 * w32menu.c:
12551 * w32proc.c:
12552 * w32select.c: Don't include character.h.
12553
12554 * alloc.c (syms_of_alloc):
12555 * buffer.c (syms_of_buffer):
12556 * bytecode.c (syms_of_bytecode):
12557 * callint.c (syms_of_callint):
12558 * casefiddle.c (syms_of_casefiddle):
12559 * casetab.c (init_casetab_once):
12560 * category.c (init_category_once, syms_of_category):
12561 * ccl.c (syms_of_ccl):
12562 * cmds.c (syms_of_cmds):
12563 * composite.c (syms_of_composite):
12564 * dbusbind.c (syms_of_dbusbind):
12565 * dired.c (syms_of_dired):
12566 * dispnew.c (syms_of_display):
12567 * doc.c (syms_of_doc):
12568 * editfns.c (syms_of_editfns):
12569 * emacs.c (syms_of_emacs):
12570 * eval.c (syms_of_eval):
12571 * fileio.c (syms_of_fileio):
12572 * fns.c (syms_of_fns):
12573 * frame.c (syms_of_frame):
12574 * fringe.c (syms_of_fringe):
12575 * insdel.c (syms_of_insdel):
12576 * keymap.c (syms_of_keymap):
12577 * lread.c (init_obarray, syms_of_lread):
12578 * macros.c (syms_of_macros):
12579 * msdos.c (syms_of_msdos):
12580 * print.c (syms_of_print):
12581 * process.c (syms_of_process):
12582 * search.c (syms_of_search):
12583 * sound.c (syms_of_sound):
12584 * syntax.c (init_syntax_once, syms_of_syntax):
12585 * terminal.c (syms_of_terminal):
12586 * textprop.c (syms_of_textprop):
12587 * undo.c (syms_of_undo):
12588 * w32.c (globals_of_w32):
12589 * window.c (syms_of_window):
12590 * xdisp.c (syms_of_xdisp):
12591 * xfaces.c (syms_of_xfaces):
12592 * xfns.c (syms_of_xfns):
12593 * xmenu.c (syms_of_xmenu):
12594 * xsettings.c (syms_of_xsettings):
12595 * xterm.c (syms_of_xterm): Use DEFSYM.
12596
12597 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12598
12599 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12600
12601 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12602
12603 Integer and buffer overflow fixes (Bug#8873).
12604
12605 * print.c (printchar, strout): Check for string overflow.
12606 (PRINTPREPARE, printchar, strout):
12607 Don't set size unless allocation succeeds.
12608
12609 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12610 for sizes. Check for string overflow more accurately.
12611 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12612
12613 * macros.c: Integer and buffer overflow fixes.
12614 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12615 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12616 Use ptrdiff_t, not int, for sizes.
12617 Don't increment bufsize until after realloc succeeds.
12618 Check for size-calculation overflow.
12619 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12620
12621 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12622
12623 * lread.c: Integer overflow fixes.
12624 (read_integer): Radix is now EMACS_INT, not int,
12625 to improve quality of diagnostics for out-of-range radices.
12626 Calculate buffer size correctly for out-of-range radices.
12627 (read1): Check for integer overflow in radices, and in
12628 read-circle numbers.
12629 (read_escape): Avoid int overflow.
12630 (Fload, openp, read_buffer_size, read1)
12631 (substitute_object_recurse, read_vector, read_list, map_obarray):
12632 Use ptrdiff_t, not int, for sizes.
12633 (read1): Use EMACS_INT, not int, for sizes.
12634 Check for size overflow.
12635
12636 * image.c (cache_image): Check for size arithmetic overflow.
12637
12638 * lread.c: Integer overflow issues.
12639 (saved_doc_string_size, saved_doc_string_length)
12640 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12641 Now ptrdiff_t, not int.
12642 (read1): Don't assume doc string length fits in int. Check for
12643 out-of-range doc string lengths.
12644 (read_list): Don't assume file position fits in int.
12645 (read_escape): Check for hex character overflow.
12646
12647 2011-06-22 Leo Liu <sdl.web@gmail.com>
12648
12649 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12650 Move to minibuffer.el.
12651
12652 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12653
12654 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12655 The following patches are for when GLYPH_DEBUG && !XASSERT.
12656 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12657 * dispnew.c (flush_stdout):
12658 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12659 Mark as externally visible.
12660 * dispnew.c (check_window_matrix_pointers): Now static.
12661 * dispnew.c (window_to_frame_vpos):
12662 * xfns.c (unwind_create_frame):
12663 * xterm.c (x_check_font): Remove unused local.
12664 * scroll.c (CHECK_BOUNDS):
12665 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12666 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12667 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12668 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12669 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12670 Now static.
12671 (debug_method_add): Use va_list and vsprintf rather than relying
12672 on undefined behavior with wrong number of arguments.
12673 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12674 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12675 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12676 since we're not interested in debugging glyphs with old libraries.
12677 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12678 GCC 4.6.0's static checking.
12679
12680 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12681
12682 Integer overflow and signedness fixes (Bug#8873).
12683 A few related buffer overrun fixes, too.
12684
12685 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12686
12687 * dispextern.h (struct face.stipple):
12688 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12689 (x_bitmap_mask, x_allocate_bitmap_record)
12690 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12691 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12692 (x_create_bitmap_from_xpm_data):
12693 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12694 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12695 (.bitmaps_last):
12696 * xfaces.c (load_pixmap):
12697 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12698 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12699 (.bitmaps_last, struct x_output.icon_bitmap):
12700 Use ptrdiff_t, not int, for bitmap indexes.
12701 (x_allocate_bitmap_record): Check for size overflow.
12702 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12703
12704 Use ptrdiff_t, not int, for overlay counts.
12705 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12706 * editfns.c (overlays_around, get_pos_property):
12707 * textprop.c (get_char_property_and_overlay):
12708 * xdisp.c (next_overlay_change, note_mouse_highlight):
12709 * xfaces.c (face_at_buffer_position):
12710 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12711 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12712 (Fnext_overlay_change, Fprevious_overlay_change)
12713 (mouse_face_overlay_overlaps, Foverlays_in):
12714 Use ptrdiff_t, not int, for sizes.
12715 (overlays_at, overlays_in): Check for size-calculation overflow.
12716
12717 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12718
12719 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12720 (x_session_initialize): Do not assume string length fits in int.
12721
12722 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12723 This is unlikely, but can occur if DPI is outlandish.
12724
12725 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12726 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12727
12728 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12729 * xrdb.c (magic_file_p, search_magic_path):
12730 Omit last arg SUFFIX; it was always 0. All callers changed.
12731 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12732
12733 * xfont.c (xfont_match): Avoid need for strlen.
12734
12735 * xfns.c: Don't assume strlen fits in int.
12736 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12737
12738 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12739 not unsigned long, as we prefer signed integers. All callers changed.
12740 Detect integer overflow in repeat count.
12741 (message_dolog): Don't assume print length fits in 39 bytes.
12742 (display_mode_element): Don't assume strlen fits in int.
12743
12744 * termcap.c: Don't assume sizes fit in int and never overflow.
12745 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12746 (gobble_line): Check for size-calculation overflow.
12747
12748 * minibuf.c (Fread_buffer):
12749 * lread.c (intern, intern_c_string):
12750 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12751 Don't assume string length fits in int.
12752
12753 * keyboard.c (parse_tool_bar_item):
12754 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12755
12756 * font.c: Don't assume string length fits in int.
12757 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12758 Use ptrdiff_t, not int.
12759 (font_intern_prop): Don't assume string length fits in int.
12760 Don't assume integer property fits in fixnum.
12761 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12762
12763 * filelock.c: Fix some buffer overrun and integer overflow issues.
12764 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12765 Reformulate so as not to need the command string.
12766 Invoke gzip -cd rather than gunzip, as it's more portable.
12767 (lock_info_type, lock_file_1, lock_file):
12768 Don't assume pid_t and time_t fit in unsigned long.
12769 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12770 (current_lock_owner): Prefer signed type for sizes.
12771 Use memcpy, not strncpy, where memcpy is what is really wanted.
12772 Don't assume (via atoi) that time_t and pid_t fit in int.
12773 Check for time_t and/or pid_t out of range, e.g., via a network share.
12774 Don't alloca where an auto var works fine.
12775
12776 * fileio.c: Fix some integer overflow issues.
12777 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12778 Don't assume string length fits in int.
12779 (directory_file_name): Don't assume string length fits in long.
12780 (make_temp_name): Don't assume pid fits in int, or that its print
12781 length is less than 20.
12782
12783 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12784
12785 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12786
12787 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12788
12789 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12790 We prefer signed integers, even for size calculations.
12791
12792 * emacs.c: Don't assume string length fits in 'int'.
12793 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12794 (main): Don't invoke strlen when not needed.
12795
12796 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12797 (XD_DEBUG_MESSAGE): Don't waste a byte.
12798
12799 * callproc.c (getenv_internal_1, getenv_internal)
12800 (Fgetenv_internal):
12801 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12802
12803 * lread.c (invalid_syntax): Omit length argument.
12804 All uses changed. This doesn't fix a bug, but it simplifies the
12805 code away from its former Hollerith-constant appearance, and it's
12806 one less 'int' to worry about when looking at integer-overflow issues.
12807 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12808
12809 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12810 This didn't break anything, but it didn't help either.
12811 It's confusing to put a bogus integer in a place where the actual
12812 value does not matter.
12813 (LIST_END_P): Remove unused macro and its bogus comment.
12814 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12815
12816 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12817 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12818 implementation.
12819 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12820 We prefer signed types, and the value cannot exceed the EMACS_INT
12821 range anyway (because otherwise the length would not be representable).
12822 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12823 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12824 This avoids a GCC warning when WIDE_EMACS_INT.
12825
12826 * indent.c (sane_tab_width): New function.
12827 (current_column, scan_for_column, Findent_to, position_indentation)
12828 (compute_motion): Use it. This is just for clarity.
12829 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12830
12831 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12832
12833 * lisp.h (lint_assume): New macro.
12834 * composite.c (composition_gstring_put_cache):
12835 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12836
12837 * editfns.c, insdel.c:
12838 Omit unnecessary forward decls, to simplify future changes.
12839
12840 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12841
12842 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12843
12844 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12845 Use much-faster test for byte-length change.
12846 Don't assume string byte-length fits in 'int'.
12847 Check that character arg fits in 'int'.
12848 (mapcar1): Declare byte as byte, for clarity.
12849
12850 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12851
12852 * fns.c (concat): Catch string overflow earlier.
12853 Do not rely on integer wraparound.
12854
12855 * dispextern.h (struct it.overlay_strings_charpos)
12856 (struct it.selective): Now EMACS_INT, not int.
12857 * xdisp.c (forward_to_next_line_start)
12858 (back_to_previous_visible_line_start)
12859 (reseat_at_next_visible_line_start, next_element_from_buffer):
12860 Don't arbitrarily truncate the value of 'selective' to int.
12861
12862 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12863
12864 * composite.c: Don't truncate sizes to 'int'.
12865 (composition_gstring_p, composition_reseat_it)
12866 (composition_adjust_point): Use EMACS_INT, not int.
12867 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12868 not EMACS_UINT, for indexes.
12869
12870 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12871
12872 * buffer.c: Include <verify.h>.
12873 (struct sortvec.priority, struct sortstr.priority):
12874 Now EMACS_INT, not int.
12875 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12876 (struct sortstr.size, record_overlay_string)
12877 (struct sortstrlist.size, struct sortlist.used):
12878 Don't truncate size to int.
12879 (record_overlay_string): Check for size-calculation overflow.
12880 (init_buffer_once): Check at compile-time, not run-time.
12881
12882 2011-06-22 Jim Meyering <meyering@redhat.com>
12883
12884 Don't leak an XBM-image-sized buffer
12885 * image.c (xbm_load): Free the image buffer after using it.
12886
12887 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12888
12889 Port to Sun C.
12890 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12891 that Sun C diagnosed.
12892 * fns.c (secure_hash): Fix pointer signedness issue.
12893 * intervals.c (static_offset_intervals): New function.
12894 (offset_intervals): Use it.
12895
12896 2011-06-21 Leo Liu <sdl.web@gmail.com>
12897
12898 * deps.mk (fns.o):
12899 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12900 sha512.h.
12901
12902 * fns.c (secure_hash): Rename from crypto_hash_function and change
12903 the first arg to accept symbols.
12904 (Fsecure_hash): New primitive.
12905 (syms_of_fns): New symbols.
12906
12907 2011-06-20 Deniz Dogan <deniz@dogan.se>
12908
12909 * process.c (Fset_process_buffer): Clarify return value in
12910 docstring.
12911
12912 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12913
12914 * dispnew.c (add_window_display_history): Use BVAR.
12915
12916 * xdisp.c (debug_method_add): Use BVAR.
12917 (check_window_end, dump_glyph_matrix, dump_glyph)
12918 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12919
12920 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12921 Likewise.
12922
12923 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12924 check till after the cache is created in init_frame_faces.
12925
12926 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12927
12928 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12929
12930 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12931
12932 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12933 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12934 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12935
12936 Improve buffer-overflow checking (Bug#8873).
12937 * fileio.c (Finsert_file_contents):
12938 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12939 Remove the old (too-loose) buffer overflow checks.
12940 They weren't needed, since make_gap checks for buffer overflow.
12941 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12942 The old code merely checked for Emacs fixnum overflow, and relied
12943 on undefined (wraparound) behavior. The new code avoids undefined
12944 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12945
12946 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12947 Tune. Don't use wider integers than needed. Don't use alloca.
12948 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12949
12950 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12951
12952 * insdel.c, lisp.h (buffer_overflow): New function.
12953 (insert_from_buffer_1, replace_range, replace_range_2):
12954 * insdel.c (make_gap_larger):
12955 * editfns.c (Finsert_char):
12956 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12957
12958 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12959
12960 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12961
12962 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12963
12964 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12965 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12966
12967 * fileio.c: Don't assume EMACS_INT fits in off_t.
12968 (emacs_lseek): New static function.
12969 (Finsert_file_contents, Fwrite_region): Use it.
12970 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12971
12972 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12973
12974 * fns.c: Don't overflow int when computing a list length.
12975 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12976 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12977 truncation on 64-bit hosts. Check for QUIT every
12978 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12979 faster and is responsive enough.
12980 (Flength): Report an error instead of overflowing an integer.
12981 (Fsafe_length): Return a float if the value is not representable
12982 as a fixnum. This shouldn't happen except in contrived situations.
12983 (Fnthcdr, Fsort): Don't assume list length fits in int.
12984 (Fcopy_sequence): Don't assume vector length fits in int.
12985
12986 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12987 (header_size, word_size): New constants.
12988 (allocate_vectorlike): Don't check size overflow here.
12989 (allocate_vector): Check it here instead, since this is the only
12990 caller of allocate_vectorlike that could cause overflow.
12991 Check that the new vector's length is representable as a fixnum.
12992
12993 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12994 The previous code was bogus. For example, next_almost_prime (32)
12995 returned 39, which is undesirable as it is a multiple of 3; and
12996 next_almost_prime (24) returned 25, which is a multiple of 5 so
12997 why was the code bothering to check for multiples of 7?
12998
12999 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13000
13001 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13002
13003 Variadic C functions now count arguments with ptrdiff_t.
13004 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13005 Back then I didn't know that the Emacs coding style prefers signed int.
13006 Also, in the meantime I found a few more instances where arguments
13007 were being counted with int, which may truncate counts on 64-bit
13008 machines, or EMACS_INT, which may be unnecessarily wide.
13009 * lisp.h (struct Lisp_Subr.function.aMANY)
13010 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13011 Arg counts are now ptrdiff_t, not size_t.
13012 All variadic functions and their callers changed accordingly.
13013 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13014 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13015 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13016 * callint.c (Fcall_interactively): Check arg count for overflow,
13017 to avoid potential buffer overrun. Use signed char, not 'int',
13018 for 'varies' array, so that we needn't bother to check its size
13019 calculation for overflow.
13020 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13021 * eval.c (apply_lambda):
13022 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13023 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13024 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13025
13026 * callint.c (Fcall_interactively): Don't use index var as event count.
13027
13028 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13029 * mem-limits.h (SIZE): Remove; no longer used.
13030
13031 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13032
13033 Remove unnecessary casts.
13034 * xterm.c (x_term_init):
13035 * xfns.c (x_set_border_pixel):
13036 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13037 These aren't needed now that we assume ANSI C.
13038
13039 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13040 It's more likely to cause problems (due to unsigned overflow)
13041 than to cure them.
13042
13043 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13044
13045 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13046
13047 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13048
13049 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13050
13051 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13052
13053 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13054
13055 GLYPH_CODE_FACE returns EMACS_INT, not int.
13056 * dispextern.h (merge_faces):
13057 * xfaces.c (merge_faces):
13058 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13059 Don't assume EMACS_INT fits in int.
13060
13061 * character.h (CHAR_VALID_P): Remove unused parameter.
13062 * fontset.c, lisp.h, xdisp.c: All uses changed.
13063
13064 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13065
13066 * fns.c (concat): Minor tuning based on overflow analysis.
13067 This doesn't fix any bugs. Use int to hold character, instead
13068 of constantly refetching from Emacs object. Use XFASTINT, not
13069 XINT, for value known to be a character. Don't bother comparing
13070 a single byte to 0400, as it's always less.
13071
13072 * floatfns.c (Fexpt):
13073 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13074
13075 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13076 for characters.
13077
13078 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13079
13080 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13081 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13082 incorrectly succeed when S was a string, because 4294967386 was
13083 truncated before it was used.
13084
13085 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13086 Otherwise, an out-of-range integer could cause undefined behavior
13087 on a 64-bit host.
13088
13089 * composite.c: Use int, not EMACS_INT, for characters.
13090 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13091 EMACS_INT, for values that are known to be in character range.
13092 This doesn't fix any bugs but is the usual style inside Emacs and
13093 may generate better code on 32-bit machines.
13094
13095 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13096 This is for reasons similar to the recent CHAR_STRING fix.
13097 * charset.c (Fencode_char): Check that character arg is actually
13098 a character. Pass an int to ENCODE_CHAR.
13099 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13100 wider than 'int', as a compile-time check to prevent future regressions
13101 in this area.
13102
13103 * character.c (char_string): Remove unnecessary casts.
13104
13105 Make sure a 64-bit char is never passed to CHAR_STRING.
13106 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13107 by silently ignoring the top 32 bits, allowing some values
13108 that were far too large to be valid characters.
13109 * character.h: Include <verify.h>.
13110 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13111 arguments are no wider than unsigned, as a compile-time check
13112 to prevent future regressions in this area.
13113 * data.c (Faset):
13114 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13115 (Fsubst_char_in_region):
13116 * fns.c (concat):
13117 * xdisp.c (decode_mode_spec_coding):
13118 Adjust to CHAR_STRING's new requirement.
13119 * editfns.c (Finsert_char, Fsubst_char_in_region):
13120 * fns.c (concat): Check that character args are actually
13121 characters. Without this test, these functions did the wrong
13122 thing with wildly out-of-range values on 64-bit hosts.
13123
13124 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13125 These casts should not be needed on 32-bit hosts, either.
13126 * keyboard.c (read_char):
13127 * lread.c (Fload): Remove casts to unsigned.
13128
13129 * lisp.h (UNSIGNED_CMP): New macro.
13130 This fixes comparison bugs on 64-bit hosts.
13131 (ASCII_CHAR_P): Use it.
13132 * casefiddle.c (casify_object):
13133 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13134 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13135 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13136 * dispextern.h (FACE_FROM_ID):
13137 * keyboard.c (read_char): Use UNSIGNED_CMP.
13138
13139 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13140 not to EMACS_INT, to avoid GCC warning.
13141
13142 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13143
13144 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13145 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13146 isn't needed on 32-bit machines.
13147
13148 * buffer.c (Fgenerate_new_buffer_name):
13149 Use EMACS_INT for count, not int.
13150 (advance_to_char_boundary): Return EMACS_INT, not int.
13151
13152 * data.c (Qcompiled_function): Now static.
13153
13154 * window.c (window_body_lines): Now static.
13155
13156 * image.c (gif_load): Rename local to avoid shadowing.
13157
13158 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13159 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13160 * alloc.c (make_save_value): Integer argument is now of type
13161 ptrdiff_t, not int.
13162 (mark_object): Use ptrdiff_t, not int.
13163 * lisp.h (pD): New macro.
13164 * print.c (print_object): Use it.
13165
13166 * alloc.c: Use EMACS_INT, not int, to count objects.
13167 (total_conses, total_markers, total_symbols, total_vector_size)
13168 (total_free_conses, total_free_markers, total_free_symbols)
13169 (total_free_floats, total_floats, total_free_intervals)
13170 (total_intervals, total_strings, total_free_strings):
13171 Now EMACS_INT, not int. All uses changed.
13172 (Fgarbage_collect): Compute overall total using a double, so that
13173 integer overflow is less likely to be a problem. Check for overflow
13174 when converting back to an integer.
13175 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13176 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13177 These were 'int' variables that could overflow on 64-bit hosts;
13178 they were never used, so remove them instead of repairing them.
13179 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13180 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13181 Previously, this ceilinged at INT_MAX, but that doesn't work on
13182 64-bit machines.
13183 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13184
13185 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13186 (allocate_vectorlike): Check for ptrdiff_t overflow.
13187 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13188 when a (possibly-narrower) signed value would do just as well.
13189 We prefer using signed arithmetic, to avoid comparison confusion.
13190
13191 * alloc.c: Catch some string size overflows that we were missing.
13192 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13193 for convenience in STRING_BYTES_MAX.
13194 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13195 The definition here is exact; the one in lisp.h was approximate.
13196 (allocate_string_data): Check for string overflow. This catches
13197 some instances we weren't catching before. Also, it catches
13198 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13199 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13200 and ptrdiff_t and EMACS_INT are both 64 bits.
13201
13202 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13203 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13204 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13205
13206 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13207
13208 * alloc.c (Fmake_string): Check for out-of-range init.
13209
13210 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13211
13212 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13213
13214 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13215
13216 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13217 xg_get_default_scrollbar_width.
13218
13219 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13220 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13221 (style_changed_cb): Call update_theme_scrollbar_width and call
13222 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13223 all frames (Bug#8505).
13224 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13225 Call gtk_window_set_resizable if HAVE_GTK3.
13226 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13227 and height if HAVE_GTK3 (Bug#8505).
13228 (scroll_bar_width_for_theme): New variable.
13229 (update_theme_scrollbar_width): New function.
13230 (xg_get_default_scrollbar_width): Move code to
13231 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13232 (xg_initialize): Call update_theme_scrollbar_width.
13233
13234 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13235
13236 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13237
13238 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13239
13240 * frame.c (make_frame): Call other_buffer_safely instead of
13241 other_buffer.
13242
13243 * window.c (temp_output_buffer_show): Call display_buffer with
13244 second argument Vtemp_buffer_show_specifiers and reset latter
13245 immediately after the call.
13246 (Vtemp_buffer_show_specifiers): New variable.
13247 (auto_window_vscroll_p, next_screen_context_lines)
13248 (Vscroll_preserve_screen_position): Remove leading asterisks from
13249 doc-strings.
13250
13251 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13252
13253 Fix minor problems found by GCC 4.6.0 static checking.
13254 * buffer.c (Qclone_number): Remove for now, as it's unused.
13255 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13256 (record_buffer): Remove unused local.
13257 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13258 (set_frame_buffer_list): Remove; unused.
13259 * frame.h (other_visible_frames): Remove decl.
13260 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13261 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13262 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13263 if HAVE_GPM.
13264 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13265 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13266 Define only if HAVE_GPM.
13267 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13268 (update_hints_inhibit): Remove; never set. All uses removed.
13269 * widgetprv.h (emacsFrameClassRec): Remove decl.
13270 * window.c (delete_deletable_window): Now returns void, since it
13271 wasn't returning anything.
13272 (compare_window_configurations): Remove unused locals.
13273 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13274 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13275 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13276 the same widths as pointers. This follows up on the 2011-05-06 patch.
13277 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13278 * xterm.h: Likewise.
13279 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13280
13281 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13282
13283 * makefile.w32-in: Update dependencies.
13284 (LISP_H): Add lib/intprops.h.
13285
13286 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13287
13288 * image.c (gif_load): Add animation frame delay to the metadata.
13289 (syms_of_image): Use DEFSYM. New symbol `delay'.
13290
13291 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13292
13293 * window.c (delete_deletable_window): Re-add.
13294 (Fset_window_configuration): Rewrite to handle dead buffers and
13295 consequently deletable windows.
13296 (window_tree, Fwindow_tree): Remove. Supply functionality in
13297 window.el.
13298 (compare_window_configurations): Simplify code.
13299
13300 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13301
13302 * image.c (imagemagick_load_image): Fix type mismatch.
13303 (Fimagemagick_types): Likewise.
13304
13305 * window.h (replace_buffer_in_windows): Declare.
13306
13307 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13308
13309 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13310 Qclone_number. Remove external declaration of Qdelete_window.
13311 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13312 code.
13313 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13314 Run Qbuffer_list_update_hook if allowed.
13315 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13316 buffer list implementation.
13317 (other_buffer_safely): New function.
13318 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13319 calls to replace_buffer_in_windows and
13320 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13321 if allowed.
13322 (record_buffer): Inhibit quitting and rewrite using quittable
13323 functions. Run Qbuffer_list_update_hook if allowed.
13324 (Frecord_buffer, Funrecord_buffer): New functions.
13325 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13326 Move switch-to-buffer to window.el.
13327 (bury-buffer): Move to window.el.
13328 (Vbuffer_list_update_hook): New variable.
13329
13330 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13331 section.
13332
13333 * window.h (resize_frame_windows): Move up in code.
13334 (Fwindow_frame): Remove EXFUN.
13335 (replace_buffer_in_all_windows): Remove prototype.
13336 (replace_buffer_in_windows_safely): Add prototype.
13337
13338 * window.c: Declare Qdelete_window static again. Move down
13339 declaration of select_count.
13340 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13341 (Fother_window): Move to window.el.
13342 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13343 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13344 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13345 window.el.
13346 (replace_buffer_in_windows): Implement by calling
13347 Qreplace_buffer_in_windows.
13348 (replace_buffer_in_all_windows): Remove with some functionality
13349 moved into replace_buffer_in_windows_safely.
13350 (replace_buffer_in_windows_safely): New function.
13351 (select_window_norecord, select_frame_norecord): Move in front
13352 of run_window_configuration_change_hook. Remove now obsolete
13353 declarations.
13354 (Fset_window_buffer): Rewrite doc-string.
13355 Call Qrecord_window_buffer.
13356 (keys_of_window): Move binding for other-window to window.el.
13357
13358 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13359
13360 * dispextern.h (struct image): Replace data member, whose int_val
13361 and ptr_val fields were not used by anything, with a single
13362 lisp_val object.
13363
13364 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13365 (gif_clear_image, gif_load, imagemagick_load_image)
13366 (gs_clear_image, gs_load): Callers changed.
13367
13368 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13369
13370 * buffer.h: Include <time.h>, for time_t.
13371 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13372
13373 Fix minor problems found by static checking.
13374
13375 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13376
13377 Make identifiers static if they are not used in other modules.
13378 * data.c (Qcompiled_function, Qframe, Qvector):
13379 * image.c (QimageMagick, Qsvg):
13380 * minibuf.c (Qmetadata):
13381 * window.c (resize_window_check, resize_root_window): Now static.
13382 * window.h (resize_window_check, resize_root_window): Remove decls.
13383
13384 * window.c (window_deletion_count, delete_deletable_window):
13385 Remove; unused.
13386 (window_body_lines): Now static.
13387 (Fdelete_other_windows_internal): Mark vars as initialized.
13388 Make sure 'resize_failed' is initialized.
13389 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13390 (resize_window_apply): Remove unused local.
13391 * window.h (delete_deletable_window): Remove decl.
13392
13393 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13394 (imagemagick_load_image): Fix pointer signedness problem by changing
13395 last arg from unsigned char * to char *. All uses changed.
13396 Also, fix a local for similar reasons.
13397 Remove unused locals. Remove locals to avoid shadowing.
13398 (fn_rsvg_handle_free): Remove; unused.
13399 (svg_load, svg_load_image): Fix pointer signedness problem.
13400 (imagemagick_load_image): Don't use garbage pointer image_wand.
13401
13402 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13403
13404 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13405
13406 * image.c (gif_load): Fix omitted cast error introduced by
13407 2011-06-06 change.
13408
13409 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13410
13411 * window.h (resize_proportionally, orig_total_lines)
13412 (orig_top_line): Remove from window structure.
13413 (set_window_height, set_window_width, change_window_heights)
13414 (Fdelete_window): Remove prototypes.
13415 (resize_frame_windows): Remove duplicate declaration.
13416
13417 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13418
13419 * window.h (resize_frame_windows, resize_window_check)
13420 (delete_deletable_window, resize_root_window)
13421 (resize_frame_windows): Declare prototypes.
13422
13423 * window.c (resize_window_apply): Make definition be "static" to
13424 match the prototype.
13425
13426 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13427
13428 * window.c: Remove declarations of Qwindow_size_fixed,
13429 window_min_size_1, window_min_size_2, window_min_size,
13430 size_window, window_fixed_size_p, enlarge_window, delete_window.
13431 Remove static from declaration of Qdelete_window, it's
13432 temporarily needed by Fbury_buffer.
13433 (replace_window): Don't assign orig_top_line and
13434 orig_total_lines.
13435 (Fdelete_window, delete_window): Remove. Window deletion is
13436 handled by window.el.
13437 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13438 Replace Fdelete_window calls with calls to Qdelete_window.
13439 (Fdelete_other_windows): Remove. Deleting other windows is
13440 handled by window.el.
13441 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13442 handled in window.el.
13443 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13444 Window minimum sizes are handled in window.el.
13445 (shrink_windows, size_window, set_window_height)
13446 (set_window_width, change_window_heights, window_height)
13447 (window_width, CURBEG, CURSIZE, enlarge_window)
13448 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13449 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13450 handled in window.el.
13451 (make_dummy_parent): Rename to make_parent_window and give it a
13452 second argument horflag.
13453 (make_window): Don't set resize_proportionally any more.
13454 (Fsplit_window): Remove. Windows are split in window.el.
13455 (save_restore_action, save_restore_orig_size)
13456 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13457 Resize mini windows in window.el.
13458 (grow_mini_window, shrink_mini_window): Implement by calling
13459 Qresize_root_window_vertically, resize_window_check and
13460 resize_window_apply.
13461 (saved_window, Fset_window_configuration, save_window_save):
13462 Do not handle orig_top_line, orig_total_lines, and
13463 resize_proportionally.
13464 (window_min_height, window_min_width): Move to window.el.
13465 (keys_of_window): Move bindings for delete-other-windows,
13466 split-window, delete-window and enlarge-window to window.el.
13467
13468 * buffer.c: Temporarily extern Qdelete_window.
13469 (Fbury_buffer): Temporarily call Qdelete_window instead of
13470 Fdelete_window (Fbury_buffer will move to window.el soon).
13471
13472 * frame.c (set_menu_bar_lines_1): Remove code handling
13473 orig_top_line and orig_total_lines.
13474
13475 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13476 set_window_height but set heights directly.
13477 (change_frame_size_1): Use resize_frame_windows.
13478
13479 * xdisp.c (init_xdisp): Don't use set_window_height but set
13480 heights directly.
13481
13482 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13483 Use resize_frame_windows instead of change_window_heights and run
13484 run_window_configuration_change_hook.
13485
13486 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13487 instead of change_window_heights and run
13488 run_window_configuration_change_hook.
13489
13490 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13491
13492 * window.c (replace_window): Rename second argument REPLACEMENT to
13493 NEW. New third argument SETFLAG. Rewrite.
13494 (delete_window, make_dummy_parent): Call replace_window with
13495 third argument 1.
13496 (window_list_1): Move down in code.
13497 (run_window_configuration_change_hook): Move set_buffer part
13498 before select_frame_norecord part in order to unwind correctly.
13499 Rename count1 to count.
13500 (recombine_windows, delete_deletable_window, resize_root_window)
13501 (Fdelete_other_windows_internal)
13502 (Frun_window_configuration_change_hook, make_parent_window)
13503 (resize_window_check, resize_window_apply, Fresize_window_apply)
13504 (resize_frame_windows, Fsplit_window_internal)
13505 (Fdelete_window_internal, Fresize_mini_window_internal):
13506 New functions.
13507 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13508
13509 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13510
13511 * window.h (window): Add some new members to window structure -
13512 normal_lines, normal_cols, new_total, new_normal, clone_number,
13513 splits, nest, prev_buffers, next_buffers.
13514 (WINDOW_TOTAL_SIZE): Move here from window.c.
13515 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13516
13517 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13518 Remove.
13519 (make_dummy_parent): Set new members of windows structure.
13520 (make_window): Move down in code. Handle new members of window
13521 structure.
13522 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13523 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13524 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13525 (Fset_window_prev_buffers, Fwindow_next_buffers)
13526 (Fset_window_next_buffers, Fset_window_clone_number):
13527 New functions.
13528 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13529 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13530 Doc-string fixes.
13531 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13532 Argument WINDOW can be now internal window too.
13533 (Fwindow_use_time): Move up in code.
13534 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13535 Rewrite doc-string.
13536 (Fset_window_configuration, saved_window)
13537 (Fcurrent_window_configuration, save_window_save): Handle new
13538 members of window structure.
13539 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13540 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13541 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13542 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13543 Qget_mru_window, Qresize_root_window,
13544 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13545 Qauto_buffer_name; staticpro them.
13546
13547 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13548
13549 * window.c (Fwindow_total_size, Fwindow_left_column)
13550 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13551 (Fwindow_list_1): New functions.
13552 (window_box_text_cols): Replace with window_body_cols.
13553 (Fwindow_width, Fscroll_left, Fscroll_right):
13554 Use window_body_cols instead of window_box_text_cols.
13555 (delete_window, Fset_window_configuration):
13556 Call delete_all_subwindows with window as argument.
13557 (delete_all_subwindows): Take a window as argument and not a
13558 structure. Rewrite.
13559 (window_loop): Remove handling of GET_LRU_WINDOW and
13560 GET_LARGEST_WINDOW.
13561 (Fget_lru_window, Fget_largest_window): Move to window.el.
13562
13563 * window.h: Extern window_body_cols instead of
13564 window_box_text_cols. delete_all_subwindows now takes a
13565 Lisp_Object as argument.
13566
13567 * indent.c (compute_motion, Fcompute_motion):
13568 Use window_body_cols instead of window_box_text_cols.
13569
13570 * frame.c (delete_frame): Call delete_all_subwindows with root
13571 window as argument.
13572
13573 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13574
13575 * fns.c (Fputhash): Document return value.
13576
13577 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13578
13579 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13580
13581 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13582
13583 Cons<->int and similar integer overflow fixes (Bug#8794).
13584
13585 Check for overflow when converting integer to cons and back.
13586 * charset.c (Fdefine_charset_internal, Fdecode_char):
13587 Use cons_to_unsigned to catch overflow.
13588 (Fencode_char): Use INTEGER_TO_CONS.
13589 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13590 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13591 * data.c (long_to_cons, cons_to_long): Remove.
13592 (cons_to_unsigned, cons_to_signed): New functions.
13593 These signal an error for invalid or out-of-range values.
13594 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13595 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13596 * font.c (Ffont_variation_glyphs):
13597 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13598 * lisp.h: Include <intprops.h>.
13599 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13600 (cons_to_signed, cons_to_unsigned): New decls.
13601 (long_to_cons, cons_to_long): Remove decls.
13602 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13603 (Fprimitive_undo): Use CONS_TO_INTEGER.
13604 * xfns.c (Fx_window_property): Likewise.
13605 * xselect.c: Include <limits.h>.
13606 (x_own_selection, selection_data_to_lisp_data):
13607 Use INTEGER_TO_CONS.
13608 (x_handle_selection_request, x_handle_selection_clear)
13609 (x_get_foreign_selection, Fx_disown_selection_internal)
13610 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13611 (lisp_data_to_selection_data): Use cons_to_unsigned.
13612 (x_fill_property_data): Use cons_to_signed.
13613 Report values out of range.
13614
13615 Check for buffer and string overflow more precisely.
13616 * buffer.h (BUF_BYTES_MAX): New macro.
13617 * lisp.h (STRING_BYTES_MAX): New macro.
13618 * alloc.c (Fmake_string):
13619 * character.c (string_escape_byte8):
13620 * coding.c (coding_alloc_by_realloc):
13621 * doprnt.c (doprnt):
13622 * editfns.c (Fformat):
13623 * eval.c (verror):
13624 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13625 since they may not be the same number.
13626 * editfns.c (Finsert_char):
13627 * fileio.c (Finsert_file_contents):
13628 Likewise for BUF_BYTES_MAX.
13629
13630 * image.c: Use ptrdiff_t, not int, for sizes.
13631 (slurp_file): Switch from int to ptrdiff_t.
13632 All uses changed.
13633 (slurp_file): Check that file size fits in both size_t (for
13634 malloc) and ptrdiff_t (for sanity and safety).
13635
13636 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13637 if b->modtime has its maximal value.
13638
13639 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13640
13641 Don't assume time_t can fit into int.
13642 * buffer.h (struct buffer.modtime): Now time_t, not int.
13643 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13644 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13645
13646 Minor fixes for signed vs unsigned integers.
13647 * character.h (MAYBE_UNIFY_CHAR):
13648 * charset.c (maybe_unify_char):
13649 * keyboard.c (read_char, reorder_modifiers):
13650 XINT -> XFASTINT, since the integer must be nonnegative.
13651 * ftfont.c (ftfont_spec_pattern):
13652 * keymap.c (access_keymap, silly_event_symbol_error):
13653 XUINT -> XFASTINT, since the integer must be nonnegative.
13654 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13655 since it makes no difference and we prefer signed.
13656 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13657 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13658 nonnegative.
13659
13660 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13661
13662 * window.h (Fwindow_frame): Declare.
13663
13664 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13665
13666 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13667 (SPARE_MEMORY): Always define.
13668 (LARGE_REQUEST): Remove.
13669 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13670
13671 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13672
13673 * lisp.h: Move EXFUNS for Fframe_root_window,
13674 Fframe_first_window and Fset_frame_selected_window to window.h.
13675
13676 * window.h: Move EXFUNS for Fframe_root_window,
13677 Fframe_first_window and Fset_frame_selected_window here from
13678 lisp.h.
13679
13680 * frame.c (Fwindow_frame, Fframe_first_window)
13681 (Fframe_root_window, Fframe_selected_window)
13682 (Fset_frame_selected_window): Move to window.c.
13683 (Factive_minibuffer_window): Move to minibuf.c.
13684 (Fother_visible_frames_p): New function.
13685
13686 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13687
13688 * window.c (decode_window, decode_any_window): Move up in code.
13689 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13690 (inhibit_frame_unsplittable): Remove unused variable.
13691 (Fwindow_buffer): Move up and rewrite doc-string.
13692 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13693 (Fwindow_prev): New functions.
13694 (Fwindow_frame): Move here from frame.c. Accept any window as
13695 argument.
13696 (Fframe_root_window, Fframe_first_window)
13697 (Fframe_selected_window): Move here from frame.c. Accept frame
13698 or arbitrary window as argument. Update doc-strings.
13699 (Fminibuffer_window): Move up in code.
13700 (Fwindow_minibuffer_p): Move up in code and simplify.
13701 (Fset_frame_selected_window): Move here from frame.c.
13702 Marginal rewrite.
13703 (Fselected_window, select_window, Fselect_window): Move up in
13704 code. Minor doc-string fixes.
13705
13706 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13707
13708 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13709 Do not assume that spare memory exists; that assumption is valid
13710 only if SYSTEM_MALLOC.
13711 (LARGE_REQUEST): New macro, so that the issue of large requests
13712 is separated from the issue of spare memory.
13713
13714 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13715
13716 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13717 format. (Bug#8806)
13718
13719 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13720
13721 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13722 before statements.
13723
13724 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13725
13726 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13727
13728 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13729
13730 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13731 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13732
13733 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13734
13735 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13736
13737 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13738
13739 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13740 (x_clipboard_manager_save): Add return value.
13741 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13742 New error handlers.
13743 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13744 Obey Vx_select_enable_clipboard_manager. Catch errors in
13745 x_clipboard_manager_save (Bug#8779).
13746 (Vx_select_enable_clipboard_manager): New variable.
13747 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13748
13749 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13750
13751 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13752
13753 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13754
13755 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13756 in the current matrix if keep_current_p is non-zero.
13757
13758 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13759
13760 * bidi.c (bidi_level_of_next_char): Fix last change.
13761
13762 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13763
13764 Support bidi reordering of text covered by display properties.
13765
13766 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13767 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13768 (bidi_cache_search, bidi_cache_iterator_state)
13769 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13770 (bidi_level_of_next_char, bidi_move_to_visually_next):
13771 Support character positions inside a run of characters covered by a
13772 display string.
13773 (bidi_paragraph_init, bidi_resolve_explicit_1)
13774 (bidi_level_of_next_char): Call bidi_fetch_char and
13775 bidi_fetch_char_advance instead of FETCH_CHAR and
13776 FETCH_CHAR_ADVANCE.
13777 (bidi_init_it): Initialize new members.
13778 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13779 definitions.
13780 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13781 instead of using explicit *_CHAR codes.
13782 (bidi_resolve_explicit, bidi_resolve_weak):
13783 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13784 bidirectional text is supported only in multibyte buffers.
13785 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13786 it to initialize the frame_window_p member of struct bidi_it.
13787 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13788 (bidi_resolve_explicit, bidi_resolve_weak)
13789 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13790 bidi_it->nchars is non-positive.
13791 (bidi_level_of_next_char): Don't try to lookup the cache for the
13792 next/previous character if nothing is cached there yet, or if we
13793 were just reseat()'ed to a new position.
13794
13795 * xdisp.c (set_cursor_from_row): Set start and stop points
13796 according to the row's direction when priming the loop that looks
13797 for the glyph on which to display cursor.
13798 (single_display_spec_intangible_p): Function deleted.
13799 (display_prop_intangible_p): Reimplement to call
13800 handle_display_spec instead of single_display_spec_intangible_p.
13801 Accept 3 additional arguments needed by handle_display_spec.
13802 This fixes incorrect cursor motion across display property with complex
13803 values: lists, `(when COND...)' forms, etc.
13804 (single_display_spec_string_p): Support property values that are
13805 lists with the argument STRING its top-level element.
13806 (display_prop_string_p): Fix the condition for processing a
13807 property that is a list to be consistent with handle_display_spec.
13808 (handle_display_spec): New function, refactored from the
13809 last portion of handle_display_prop.
13810 (compute_display_string_pos): Accept additional argument
13811 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13812 value of a `display' property is a "replacing spec".
13813 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13814 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13815 the display property, but just return a value indicating whether
13816 the display property will replace the characters it covers.
13817 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13818 frame_window_p members of struct bidi_it.
13819 (compute_display_string_pos, compute_display_string_end):
13820 New functions.
13821 (push_it): Accept second argument POSITION, where pop_it should
13822 jump to continue iteration.
13823 (reseat_1): Initialize bidi_it.disp_pos.
13824
13825 * keyboard.c (adjust_point_for_property): Adjust the call to
13826 display_prop_intangible_p to its new signature.
13827
13828 * dispextern.h (struct bidi_it): New member frame_window_p.
13829 (bidi_init_it): Update prototypes.
13830 (display_prop_intangible_p): Update prototype.
13831 (compute_display_string_pos, compute_display_string_end):
13832 Declare prototypes.
13833 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13834 EMACS_INT.
13835
13836 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13837
13838 Malloc failure behavior now depends on size of allocation.
13839 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13840 * lisp.h: Change signatures accordingly.
13841 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13842 All callers changed. (Bug#8762)
13843
13844 * gnutls.c: Use Emacs's memory allocators.
13845 Without this change, the gnutls library would invoke malloc etc.
13846 directly, which causes problems on non-SYNC_INPUT hosts, and which
13847 runs afoul of improving memory_full behavior. (Bug#8761)
13848 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13849 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13850 xfree instead of the default malloc, realloc, free.
13851 (Fgnutls_boot): No need to check for memory allocation failure,
13852 since xmalloc does that for us.
13853
13854 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13855 * category.c (hash_get_category_set):
13856 * ccl.c (ccl_driver):
13857 * charset.c (Fdefine_charset_internal):
13858 * charset.h (struct charset.hash_index):
13859 * composite.c (get_composition_id, gstring_lookup_cache)
13860 (composition_gstring_put_cache):
13861 * composite.h (struct composition.hash_index):
13862 * dispextern.h (struct image.hash):
13863 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13864 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13865 (hashfn_equal, hashfn_user_defined, make_hash_table)
13866 (maybe_resize_hash_table, hash_lookup, hash_put)
13867 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13868 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13869 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13870 * image.c (make_image, search_image_cache, lookup_image)
13871 (xpm_put_color_table_h):
13872 * lisp.h (struct Lisp_Hash_Table):
13873 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13874 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13875 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13876 * alloc.c (allocate_vectorlike):
13877 Check for overflow in vector size calculations.
13878 * ccl.c (ccl_driver):
13879 Check for overflow when converting EMACS_INT to int.
13880 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13881 need to be updated by these changes.
13882 * fns.c (make_hash_table, maybe_resize_hash_table):
13883 Check for integer overflow with large hash tables.
13884 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13885 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13886 (SXHASH_REDUCE): New macro.
13887 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13888 Use it instead of discarding useful hash info with large hash values.
13889 (sxhash_float): New function.
13890 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13891 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13892 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13893 Rewrite to use FIXNUM_BITS, as this simplifies things.
13894 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13895 Adjust signatures to match updated version of code.
13896 (consing_since_gc): Now EMACS_INT, since a single hash table can
13897 use more than INT_MAX bytes.
13898
13899 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13900
13901 Make it possible to build with GCC-4.6+ -O2 -flto.
13902
13903 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13904
13905 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13906
13907 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13908 Call minibuffer-inactive-mode.
13909
13910 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13911
13912 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13913 Update dependencies.
13914
13915 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13916
13917 * data.c (init_data): Remove code for UTS, this system is not
13918 supported anymore.
13919
13920 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13921
13922 Don't force ./temacs to start in terminal mode.
13923
13924 * frame.c (make_initial_frame): Initialize faces in all cases, not
13925 only when CANNOT_DUMP is defined.
13926 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13927
13928 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13929
13930 * dispnew.c (add_window_display_history): Use const for the string
13931 pointer. Remove declaration, not needed.
13932
13933 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13934
13935 Use 'inline', not 'INLINE'.
13936 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13937 * alloc.c, fontset.c (INLINE): Remove.
13938 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13939 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13940 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13941 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13942 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13943
13944 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13945
13946 Make it possible to run ./temacs.
13947
13948 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13949 syms_of_callproc does the same thing. Remove test for
13950 "initialized", do it in the caller.
13951 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13952
13953 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13954
13955 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13956 (read_minibuf): Use get_minibuffer.
13957 (syms_of_minibuf): Use DEFSYM.
13958 (Qmetadata): New var.
13959 * data.c (Qbuffer): Don't make it static.
13960 (syms_of_data): Use DEFSYM.
13961
13962 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13963
13964 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13965 (CCL_CODE_MIN): New macro.
13966
13967 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13968
13969 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13970
13971 * eval.c (Qdebug): Now static.
13972 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13973 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13974 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13975
13976 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13977
13978 * image.c: Various fixes to ImageMagick code comments.
13979 (Fimagemagick_types): Doc fix.
13980
13981 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13982
13983 Minor fixes prompted by GCC 4.6.0 warnings.
13984
13985 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13986
13987 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13988 (x_clipboard_manager_save_all): Move extern decl to ...
13989 * xterm.h: ... here, so that it can be checked for consistency.
13990
13991 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13992
13993 * xselect.c (x_clipboard_manager_save_frame)
13994 (x_clipboard_manager_save_all): New functions.
13995 (Fx_clipboard_manager_save): Lisp function deleted.
13996
13997 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13998 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13999
14000 * xterm.h: Update prototype.
14001
14002 2011-05-28 William Xu <william.xwl@gmail.com>
14003
14004 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14005 exiting (Bug#8239).
14006
14007 2011-05-28 Jim Meyering <meyering@redhat.com>
14008
14009 Avoid a sign-extension bug in crypto_hash_function.
14010 * fns.c (to_uchar): Define.
14011 (crypto_hash_function): Use it to convert some newly-signed
14012 variables to unsigned, to avoid sign-extension bugs. For example,
14013 without this change, (md5 "truc") would evaluate to
14014 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14015 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14016 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14017
14018 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14019
14020 Integer overflow fixes.
14021
14022 * dbusbind.c: Serial number integer overflow fixes.
14023 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14024 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14025 to hold a serial number that is too large for a fixnum.
14026 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14027 Check for serial numbers out of range. Decode any serial number
14028 that was so large that it became a float. (Bug#8722)
14029
14030 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14031 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14032 Use XFASTINT rather than XUINT when numbers are nonnegative.
14033 (xd_append_arg, Fdbus_method_return_internal):
14034 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14035 arguments, check that Lisp number is nonnegative, rather than
14036 silently wrapping negative numbers around. (Bug#8722)
14037 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14038 (Bug#8722)
14039
14040 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14041
14042 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14043
14044 ccl: Add integer overflow checks.
14045 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14046 (IN_INT_RANGE): New macros.
14047 (ccl_driver): Use them to check for integer overflow when
14048 decoding a CCL program. Many of the new checks are whether XINT (x)
14049 fits in int; it doesn't always, on 64-bit hosts. The new version
14050 doesn't catch all possible integer overflows, but it's an
14051 improvement. (Bug#8719)
14052
14053 * alloc.c (make_event_array): Use XINT, not XUINT.
14054 There's no need for unsigned here.
14055
14056 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14057 This follows up to the 2011-05-06 change that substituted uintptr_t
14058 for EMACS_INT. This case wasn't caught back then.
14059
14060 Rework Fformat to avoid integer overflow issues.
14061 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14062 now (part of C89). Include <verify.h>.
14063 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14064 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14065 (Fformat): Avoid the prepass trying to compute sizes; it was only
14066 approximate and thus did not catch overflow reliably. Instead, walk
14067 through the format just once, formatting and computing sizes as we go,
14068 checking for integer overflow at every step, and allocating a larger
14069 buffer as needed. Keep track separately whether the format is
14070 multibyte. Keep only the most-recently calculated precision, rather
14071 than them all. Record whether each argument has been converted to
14072 string. Use EMACS_INT, not int, for byte and char and arg counts.
14073 Support field widths and precisions larger than INT_MAX. Avoid
14074 sprintf's undefined behavior with conversion specifications such as %#d
14075 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14076 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14077 formatting out-of-range floating point numbers with int
14078 formats. (Bug#8668)
14079
14080 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14081
14082 * data.c: Avoid integer truncation in expressions involving floats.
14083 * data.c: Include <intprops.h>.
14084 (arith_driver): When there's an integer overflow in an expression
14085 involving floating point, convert the integers to floating point
14086 so that the resulting value does not suffer from catastrophic
14087 integer truncation. For example, on a 64-bit host (* 4
14088 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14089 Do not rely on undefined behavior after integer overflow.
14090
14091 merge count_size_as_multibyte, parse_str_to_multibyte
14092 * character.c, character.h (count_size_as_multibyte):
14093 Rename from parse_str_to_multibyte; all uses changed.
14094 Check for integer overflow.
14095 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14096 since it's now a duplicate of the other. This is more of
14097 a character than a buffer op, so better that it's in character.c.
14098 * fns.c, print.c: Adjust to above changes.
14099
14100 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14101
14102 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14103
14104 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14105
14106 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14107 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14108 (x_clipboard_manager_save): Now static.
14109 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14110
14111 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14112 (crypto_hash_function): Now static.
14113 Fix pointer signedness problems. Avoid unnecessary initializations.
14114
14115 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14116
14117 * termhooks.h (Vselection_alist): Make it terminal-local.
14118
14119 * terminal.c (create_terminal): Initialize it.
14120
14121 * xselect.c: Support for clipboard managers.
14122 (Vselection_alist): Move to termhooks.h as terminal-local var.
14123 (LOCAL_SELECTION): New macro.
14124 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14125 (symbol_to_x_atom): Remove gratuitous arg.
14126 (x_handle_selection_request, lisp_data_to_selection_data)
14127 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14128 (x_own_selection, x_get_local_selection, x_convert_selection):
14129 New arg, specifying work frame. Use terminal-local Vselection_alist.
14130 (some_frame_on_display): Delete unused function.
14131 (Fx_own_selection_internal, Fx_get_selection_internal)
14132 (Fx_disown_selection_internal, Fx_selection_owner_p)
14133 (Fx_selection_exists_p): New optional frame arg.
14134 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14135 (x_handle_selection_clear): Don't treat other terminals with the
14136 same keyboard specially. Use the terminal-local Vselection_alist.
14137 (x_clear_frame_selections): Use Frun_hook_with_args.
14138
14139 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14140
14141 * xterm.h: Add support for those atoms.
14142
14143 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14144
14145 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14146 (converted_selections, conversion_fail_tag): New global variables.
14147 (x_selection_request_lisp_error): Free the above.
14148 (x_get_local_selection): Remove unnecessary code.
14149 (x_reply_selection_request): Args changed; handle arbitrary array
14150 of converted selections stored in converted_selections.
14151 Separate the XChangeProperty and SelectionNotify steps.
14152 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14153 (x_convert_selection): New function.
14154 (x_handle_selection_event): Simplify.
14155 (x_get_foreign_selection): Don't ignore incoming requests while
14156 waiting for an answer; this will fail when we implement
14157 SAVE_TARGETS, and seems unnecessary anyway.
14158 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14159 (Vx_sent_selection_functions): Doc fix.
14160
14161 2011-05-26 Leo Liu <sdl.web@gmail.com>
14162
14163 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14164
14165 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14166
14167 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14168
14169 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14170 for fringe update if it has periodic bitmap.
14171 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14172 and fringe_bitmap_periodic_p.
14173
14174 * fringe.c (get_fringe_bitmap_data): New function.
14175 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14176 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14177 row. Mark glyph row for fringe update if periodicity changed.
14178
14179 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14180 for fringe update unless it has periodic bitmap.
14181
14182 2011-05-25 Kenichi Handa <handa@m17n.org>
14183
14184 * xdisp.c (get_next_display_element): Set correct it->face_id for
14185 a static composition.
14186
14187 2011-05-24 Leo Liu <sdl.web@gmail.com>
14188
14189 * deps.mk (fns.o):
14190 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14191
14192 * fns.c (crypto_hash_function, Fsha1): New function.
14193 (Fmd5): Use crypto_hash_function.
14194 (syms_of_fns): Add Ssha1.
14195
14196 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14197
14198 * gnutls.c: Remove unused macros.
14199 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14200 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14201 Remove macros that are defined and never used.
14202 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14203
14204 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14205
14206 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14207 (Fx_get_selection_internal): Minor cleanup.
14208 (Fx_own_selection_internal): Rename arguments for consistency with
14209 select.el.
14210
14211 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14212
14213 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14214
14215 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14216
14217 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14218
14219 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14220
14221 * dispnew.c (scrolling_window): Don't exclude the case that the
14222 last enabled row in the desired matrix touches the bottom boundary.
14223
14224 2011-05-21 Glenn Morris <rgm@gnu.org>
14225
14226 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14227 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14228 and add some more files.
14229
14230 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14231
14232 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14233 report_file_error introduced by the change from 2011-05-07.
14234
14235 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14236
14237 * systime.h (Time): Define only if emacs is defined.
14238 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14239 where the include path doesn't have X11/X.h by default. See
14240 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14241
14242 2011-05-20 Kenichi Handa <handa@m17n.org>
14243
14244 * composite.c (find_automatic_composition): Fix previous change.
14245
14246 2011-05-20 Glenn Morris <rgm@gnu.org>
14247
14248 * lisp.mk: New file, split from Makefile.in.
14249 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14250 (shortlisp): Remove.
14251 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14252
14253 2011-05-19 Glenn Morris <rgm@gnu.org>
14254
14255 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14256 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14257 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14258 (lisp): Set the order to that of loadup.el.
14259 (shortlisp): Make it a copy of $lisp.
14260 (SOME_MACHINE_LISP): Remove.
14261 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14262 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14263
14264 2011-05-18 Kenichi Handa <handa@m17n.org>
14265
14266 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14267 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14268 (find_automatic_composition): Mostly rewrite for efficiency.
14269
14270 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14271
14272 * makefile.w32-in: Update dependencies.
14273
14274 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14275
14276 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14277 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14278
14279 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14280
14281 Fix some integer overflow issues, such as string length overflow.
14282
14283 * insdel.c (count_size_as_multibyte): Check for string overflow.
14284
14285 * character.c (lisp_string_width): Check for string overflow.
14286 Use EMACS_INT, not int, for string indexes and lengths; in
14287 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14288 the resulting string length overflows an EMACS_INT; instead,
14289 report a string overflow if no precision given. When checking for
14290 precision exhaustion, use a check that cannot possibly have
14291 integer overflow. (Bug#8675)
14292 * character.h (lisp_string_width): Adjust to new signature.
14293
14294 * alloc.c (string_overflow): New function.
14295 (Fmake_string): Use it. This doesn't change behavior, but saves
14296 a few bytes and will simplify future changes.
14297 * character.c (string_escape_byte8): Likewise.
14298 * lisp.h (string_overflow): New decl.
14299
14300 Fixups, following up to the user-interface timestamp change.
14301 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14302 for UI timestamps, instead of unsigned long.
14303 * msdos.c (mouse_get_pos): Likewise.
14304 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14305 * w32gui.h (Time): Define by including "systime.h" rather than by
14306 declaring it ourselves. (Bug#8664)
14307
14308 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14309 * image.c (clear_image_cache): Likewise.
14310
14311 * term.c (term_mouse_position): Don't assume time_t wraparound.
14312
14313 Be more systematic about user-interface timestamps.
14314 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14315 and sometimes 'EMACS_UINT', to represent these timestamps.
14316 This change causes it to use 'Time' uniformly, as that's what X uses.
14317 This makes the code easier to follow, and makes it easier to catch
14318 integer overflow bugs such as Bug#8664.
14319 * frame.c (Fmouse_position, Fmouse_pixel_position):
14320 Use Time, not unsigned long, for user-interface timestamps.
14321 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14322 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14323 * keyboard.h (last_event_timestamp): Likewise.
14324 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14325 * menu.h (xmenu_show): Likewise.
14326 * term.c (term_mouse_position): Likewise.
14327 * termhooks.h (struct input_event.timestamp): Likewise.
14328 (struct terminal.mouse_position_hook): Likewise.
14329 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14330 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14331 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14332 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14333 what it was before.
14334 * menu.h, termhooks.h: Include "systime.h", for Time.
14335
14336 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14337 Don't assume that the difference between two unsigned long values
14338 can fit into an integer. At this point, we know button_down_time
14339 <= event->timestamp, so the difference must be nonnegative, so
14340 there's no need to cast the result if double-click-time is
14341 nonnegative, as it should be; check that it's nonnegative, just in
14342 case. This bug is triggered when events are more than 2**31 ms
14343 apart (about 25 days). (Bug#8664)
14344
14345 * xselect.c (last_event_timestamp): Remove duplicate decl.
14346 (x_own_selection): Remove needless cast to unsigned long.
14347
14348 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14349 that always fit in int. Use a sentinel instead of a counter, to
14350 avoid a temp and to allay GCC's concerns about possible int overflow.
14351 * frame.h (struct frame): Use int for menu_bar_items_used
14352 instead of EMACS_INT, since it always fits in int.
14353
14354 * menu.c (grow_menu_items): Check for int overflow.
14355
14356 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14357
14358 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14359 Before, the code was not consistent. These values cannot exceed
14360 2**31 - 1 so there's no need to make them unsigned.
14361 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14362 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14363 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14364 as modifiers.
14365 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14366
14367 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14368 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14369 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14370 presumably because the widths might not match.
14371
14372 * window.c (size_window): Avoid needless test at loop start.
14373
14374 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14375
14376 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14377
14378 2011-05-12 Drew Adams <drew.adams@oracle.com>
14379
14380 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14381
14382 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14383
14384 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14385 `width' to `bar_area_x' and `bar_area_width', respectively.
14386 (x_scroll_run): Take account of fringe background extension.
14387
14388 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14389 Rename local vars `left' and `width' to `bar_area_x' and
14390 `bar_area_width', respectively.
14391 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14392 background extension.
14393
14394 2011-05-10 Jim Meyering <meyering@redhat.com>
14395
14396 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14397
14398 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14399
14400 * image.c (Finit_image_library): Return t for built-in image types,
14401 like pbm and xbm. (Bug#8640)
14402
14403 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14404
14405 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14406
14407 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14408
14409 * w32console.c (Fset_screen_color): Doc fix.
14410 (Fget_screen_color): New function.
14411 (syms_of_ntterm): Defsubr it.
14412
14413 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14414 unlink the temporary file if Fcall_process didn't create it in the
14415 first place.
14416 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14417 child process will be redirected to a file specified with `:file'.
14418 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14419 cue to call_process_cleanup not to close that handle.
14420
14421 2011-05-07 Ben Key <bkey76@gmail.com>
14422
14423 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14424 one of two shell specific rules, either bootstrap-temacs-CMD or
14425 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14426 to the previous implementation of the bootstrap-temacs rule.
14427 The bootstrap-temacs-CMD rule is similar to the previous
14428 implementation of the bootstrap-temacs rule except that it
14429 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14430 variable.
14431
14432 These changes, along with some changes to nt/configure.bat,
14433 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14434 earlier fix to add support for --cflags and --ldflags options
14435 that include quotes so that it works whether make uses cmd or
14436 sh as the shell.
14437
14438 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14439
14440 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14441 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14442 is a constant.
14443 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14444 a string. Handle both cases.
14445 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14446 (Fdbus_register_method): Use Qinvalid_function.
14447
14448 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14449
14450 * makefile.w32-in: Update dependencies.
14451 (LISP_H): Add inttypes.h and stdin.h.
14452 (PROCESS_H): Add unistd.h.
14453
14454 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14455
14456 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14457 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14458
14459 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14460
14461 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14462
14463 * term.c (vfatal): Remove stray call to va_end.
14464 It's not needed and the C Standard doesn't allow it here anyway.
14465
14466 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14467 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14468
14469 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14470 bytes.
14471
14472 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14473
14474 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14475
14476 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14477
14478 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14479
14480 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14481
14482 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14483 * charset.c (Fdefine_charset_internal): Don't initialize
14484 charset.code_space[15]. The value was garbage, on hosts with
14485 32-bit int (Bug#8600).
14486
14487 * lread.c (read_integer): Be more consistent with string-to-number.
14488 Use string_to_number to do the actual conversion; this avoids
14489 rounding errors and fixes some other screwups. Without this fix,
14490 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14491 (digit_to_number): Move earlier, for benefit of read_integer.
14492 Return -1 if the digit is out of range for the base, -2 if it is
14493 not a digit in any supported base. (Bug#8602)
14494
14495 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14496
14497 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14498 to match comment at start of function. This also removes a
14499 GCC warning about overflow in a 32+64-bit port.
14500
14501 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14502
14503 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14504 Reported by Stefan Monnier in
14505 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14506 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14507 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14508
14509 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14510 (EMACS_UINTPTR): Likewise, with uintptr_t.
14511
14512 * lisp.h: Prefer 64-bit EMACS_INT if available.
14513 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14514 on 32-bit hosts that have 64-bit int, so that they can access
14515 large files.
14516 However, temporarily disable this change unless the temporary
14517 symbol WIDE_EMACS_INT is defined.
14518
14519 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14520
14521 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14522 This removes an assumption that EMACS_INT and long are the same
14523 width as pointers. The assumption is true for Emacs porting targets
14524 now, but we want to make other targets possible.
14525 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14526 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14527 In the rest of the code, change types of integers that hold casted
14528 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14529 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14530 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14531 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14532 No need to cast type when ORing.
14533 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14534 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14535 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14536 assume EMACS_INT is the same width as char *.
14537 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14538 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14539 Remove no-longer-needed casts.
14540 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14541 (xg_tool_bar_help_callback, xg_make_tool_item):
14542 Use EMACS_INTPTR to hold an integer
14543 that will be cast to void *; this can avoid a GCC warning
14544 if EMACS_INT is not the same width as void *.
14545 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14546 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14547 (current_message_1, set_message_1):
14548 Use a local to convert to proper width without a cast.
14549 * xmenu.c (dialog_selection_callback): Likewise.
14550
14551 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14552 Also, don't assume VALBITS / RAND_BITS is less than 5,
14553 and don't rely on undefined behavior when shifting a 1 left into
14554 the sign bit.
14555 * lisp.h (get_random): Change signature to match.
14556
14557 * lread.c (hash_string): Use size_t, not int, for hash computation.
14558 Normally we prefer signed values; but hashing is special, because
14559 it's better to use unsigned division on hash table sizes so that
14560 the remainder is nonnegative. Also, size_t is the natural width
14561 for hashing into memory. The previous code used 'int', which doesn't
14562 retain enough info to hash well into very large tables.
14563 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14564
14565 * dbusbind.c: Don't possibly lose pointer info when converting.
14566 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14567 Use XPNTR rather than XHASH, so that the high-order bits of
14568 the pointer aren't lost when converting through void *.
14569
14570 * eval.c (Fautoload): Don't double-shift a pointer.
14571
14572 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14573
14574 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14575
14576 * gnutls.c (DEF_GNUTLS_FN):
14577 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14578
14579 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14580
14581 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14582 marker. (Bug#8610)
14583
14584 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14585
14586 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14587 New version that can reserve upto 2GB of heap space.
14588
14589 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14590
14591 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14592
14593 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14594
14595 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14596 `gnutls_certificate_set_x509_key_file'.
14597
14598 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14599
14600 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14601 Update dependencies.
14602
14603 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14604
14605 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14606 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14607 Remove unused parameter `fildes'.
14608 * process.c (read_process_output, send_process): Don't pass it.
14609
14610 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14611
14612 Fix previous change: the library cache is defined in w32.c.
14613 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14614 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14615
14616 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14617
14618 Implement dynamic loading of GnuTLS on Windows.
14619
14620 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14621 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14622 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14623 Declare.
14624
14625 * gnutls.c (Qgnutls_dll): Define.
14626 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14627 (gnutls_*): Declare function pointers.
14628 (init_gnutls_functions): New function to initialize function pointers.
14629 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14630 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14631 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14632 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14633 (emacs_gnutls_write, emacs_gnutls_read)
14634 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14635 (Fgnutls_available_p): New function.
14636 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14637 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14638 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14639
14640 * image.c: Include w32.h.
14641 (Vimage_type_cache): Delete.
14642 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14643 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14644 (w32_delayed_load): Move to w32.c.
14645
14646 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14647
14648 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14649 (w32_delayed_load): Move from image.c. When loading a library, record
14650 its filename in the :loaded-from property of the library id.
14651 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14652 Initialize and staticpro them.
14653 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14654
14655 * process.c: Include lisp.h before w32.h, not after.
14656 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14657 instead of gnutls_record_check_pending.
14658
14659 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14660
14661 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14662
14663 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14664 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14665 as passed in.
14666
14667 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14668
14669 * xterm.c (x_set_frame_alpha): Do not set property on anything
14670 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14671
14672 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14673
14674 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14675
14676 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14677
14678 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14679 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14680 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14681 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14682 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14683 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14684 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14685 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14686 (Qgnutls_bootprop_callbacks_verify): Make static.
14687
14688 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14689
14690 * callproc.c: Indentation fixup.
14691
14692 * sysdep.c (wait_for_termination_1): Make static.
14693 (wait_for_termination, interruptible_wait_for_termination):
14694 Move after wait_for_termination_1.
14695
14696 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14697
14698 * sysdep.c (interruptible_wait_for_termination): New function
14699 which is like wait_for_termination, but allows keyboard
14700 interruptions.
14701
14702 * callproc.c (Fcall_process): Add (:file "file") as an option for
14703 the STDOUT buffer.
14704 (Fcall_process_region): Ditto.
14705
14706 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14707
14708 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14709 rather than `XVECTOR (FOO)->size'.
14710
14711 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14712 inttypes.h, as a gnulib replacement is used if it not available in
14713 system headers.
14714
14715 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14716
14717 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14718 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14719 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14720
14721 * coding.c (coding_alloc_by_realloc): Error out if destination
14722 will grow beyond MOST_POSITIVE_FIXNUM.
14723 (decode_coding_emacs_mule): Abort if there isn't enough place in
14724 charbuf for the composition carryover bytes. Reserve an extra
14725 space for up to 2 characters produced in a loop.
14726 (decode_coding_iso_2022): Abort if there isn't enough place in
14727 charbuf for the composition carryover bytes.
14728
14729 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14730
14731 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14732 aborting when %lld or %lll format is passed.
14733 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14734 %llo or %llx format is passed. (Bug#8545)
14735
14736 * window.c (window_scroll_line_based): Use a marker instead of
14737 simple variables to record original value of point. (Bug#7952)
14738
14739 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14740 produced by %s or %c overflows available buffer space. (Bug#8545)
14741
14742 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14743
14744 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14745 (SIZE_MAX): Move defn after all includes, as they might #define it.
14746
14747 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14748
14749 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14750
14751 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14752
14753 * keyboard.c (Qdelayed_warnings_hook): Define.
14754 (command_loop_1): Run `delayed-warnings-hook'
14755 if Vdelayed_warnings_list is non-nil.
14756 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14757 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14758
14759 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14760
14761 * doprnt.c (doprnt): Don't return value smaller than the buffer
14762 size if the message was truncated. (Bug#8545).
14763
14764 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14765
14766 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14767 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14768
14769 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14770
14771 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14772
14773 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14774
14775 * makefile.w32-in: Update dependencies.
14776
14777 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14778
14779 Improve `doprnt' and its usage. (Bug#8545)
14780 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14781 `format_end'. Remove support for %l as a conversion specifier.
14782 Don't use xrealloc. Improve diagnostics when the %l size modifier
14783 is used. Update the commentary.
14784
14785 * eval.c (verror): Simplify calculation of size_t.
14786
14787 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14788 messages.
14789
14790 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14791
14792 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14793 change.
14794
14795 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14796
14797 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14798 This makes this file independent of the recent pseudovector change.
14799
14800 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14801
14802 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14803
14804 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14805 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14806 Remove unused local.
14807 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14808
14809 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14810 GCC 4.6.0 optimizes based on type-based alias analysis.
14811 For example, if b is of type struct buffer * and v of type struct
14812 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14813 != &v->size, and therefore "v->size = 1; b->size = 2; return
14814 v->size;" must therefore return 1. This assumption is incorrect
14815 for Emacs, since it type-puns struct Lisp_Vector * with many other
14816 types. To fix this problem, this patch adds a new type struct
14817 vectorlike_header that documents the constraints on layout of vectors
14818 and pseudovectors, and helps optimizing compilers not get fooled
14819 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14820 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14821 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14822 the size member.
14823 (XSETPVECTYPE): Rewrite in terms of new macro.
14824 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14825 This is a bit clearer, and further avoids the possibility of
14826 undesirable aliasing.
14827 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14828 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14829 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14830 since Lisp_Subr is a special case (no "next" field).
14831 (ASIZE): Now uses header.size rather than size.
14832 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14833 to avoid the hassle of writing XVECTOR (foo)->header.size.
14834 (struct vectorlike_header): New type.
14835 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14836 object, to help avoid aliasing.
14837 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14838 (SUBRP): Likewise, since Lisp_Subr is a special case.
14839 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14840 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14841 (struct Lisp_Hash_Table): Combine first two members into a single
14842 struct vectorlike_header member. All uses of "size" and "next" members
14843 changed to be "header.size" and "header.next".
14844 * buffer.h (struct buffer): Likewise.
14845 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14846 * frame.h (struct frame): Likewise.
14847 * process.h (struct Lisp_Process): Likewise.
14848 * termhooks.h (struct terminal): Likewise.
14849 * window.c (struct save_window_data, struct saved_window): Likewise.
14850 * window.h (struct window): Likewise.
14851 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14852 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14853 * buffer.c (init_buffer_once): Likewise.
14854 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14855 special case.
14856 * process.c (Fformat_network_address): Use local var for size,
14857 for brevity.
14858
14859 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14860
14861 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14862 * data.c (atof): Remove decl; no longer used or needed.
14863 (digit_to_number): Move to lread.c.
14864 (Fstring_to_number): Use new string_to_number function, to be
14865 consistent with how the Lisp reader treats infinities and NaNs.
14866 Do not assume that floating-point numbers represent EMACS_INT
14867 without losing information; this is not true on most 64-bit hosts.
14868 Avoid double-rounding errors, by insisting on integers when
14869 parsing non-base-10 numbers, as the documentation specifies.
14870 * lisp.h (string_to_number): New decl, replacing ...
14871 (isfloat_string): Remove.
14872 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14873 (read1): Do not accept +. and -. as integers; this
14874 appears to have been a coding error. Similarly, do not accept
14875 strings like +-1e0 as floating point numbers. Do not report
14876 overflow for integer overflows unless the base is not 10 which
14877 means we have no simple and reliable way to continue.
14878 Break out the floating-point parsing into a new
14879 function string_to_number, so that Fstring_to_number parses
14880 floating point numbers consistently with the Lisp reader.
14881 (digit_to_number): Move here from data.c. Make it static inline.
14882 (E_CHAR, EXP_INT): Remove, replacing with ...
14883 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14884 (string_to_number): New function, replacing isfloat_string.
14885 This function checks for valid syntax and produces the resulting
14886 Lisp float number too. Rework it so that string-to-number
14887 no longer mishandles examples like "1.0e+". Use strtoumax,
14888 so that overflow for non-base-10 numbers is reported only when
14889 there's no portable and simple way to convert to floating point.
14890
14891 * textprop.c (set_text_properties_1): Rewrite for clarity,
14892 and to avoid GCC warning about integer overflow.
14893
14894 * intervals.h (struct interval): Use EMACS_INT for members
14895 where EMACS_UINT might cause problems. See
14896 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14897 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14898 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14899 All uses changed.
14900 (offset_intervals): Tell GCC not to worry about length overflow
14901 when negating a negative length.
14902
14903 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14904 (overrun_check_free): Likewise.
14905
14906 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14907 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14908 word size.
14909
14910 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14911 (gnutls_make_error): Rename local to avoid shadowing.
14912 (gnutls_emacs_global_deinit): ifdef out; not used.
14913 (Fgnutls_boot): Use const for pointer to readonly storage.
14914 Comment out unused local. Fix pointer signedness problems.
14915
14916 * lread.c (openp): Don't stuff size_t into an 'int'.
14917 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14918 about possible signed overflow.
14919
14920 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14921 (GDK_KEY_g): Don't define if already defined.
14922 (xg_prepare_tooltip): Avoid pointer signedness problem.
14923 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14924
14925 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14926 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14927
14928 * xfns.c (Fx_window_property): Simplify a bit,
14929 to make a bit faster and to avoid GCC 4.6.0 warning.
14930 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14931
14932 * fns.c (internal_equal): Don't assume size_t fits in int.
14933
14934 * alloc.c (compact_small_strings): Tighten assertion a little.
14935
14936 Replace pEd with more-general pI, and fix some printf arg casts.
14937 * lisp.h (pI): New macro, generalizing old pEd macro to other
14938 conversion specifiers. For example, use "...%"pI"d..." rather
14939 than "...%"pEd"...".
14940 (pEd): Remove. All uses replaced with similar uses of pI.
14941 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14942 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14943 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14944 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14945 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14946 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14947 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14948 64-bit hosts.
14949 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14950 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14951 * print.c (safe_debug_print, print_object): Likewise.
14952 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14953 to int.
14954 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14955 avoiding the 0 flag, which is not portable.
14956 * process.c (Fmake_network_process): Use pI to avoid cast.
14957 * region-cache.c (pp_cache): Likewise.
14958 * xdisp.c (decode_mode_spec): Likewise.
14959 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14960 behavior on 64-bit hosts with printf arg.
14961 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14962 (x_stop_queuing_selection_requests): Likewise.
14963 (x_get_window_property): Don't truncate byte count to an 'int'
14964 when tracing.
14965
14966 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14967 here, since it parses constructs like leading '-' and spaces,
14968 which are not wanted; and it overflows with large numbers.
14969 Instead, simply match F[0-9]+, which is what is wanted anyway.
14970
14971 * alloc.c: Remove unportable assumptions about struct layout.
14972 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14973 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14974 (allocate_vectorlike, make_pure_vector): Use the new macros,
14975 plus offsetof, to remove unportable assumptions about struct layout.
14976 These assumptions hold on all porting targets that I know of, but
14977 they are not guaranteed, they're easy to remove, and removing them
14978 makes further changes easier.
14979
14980 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14981 This doesn't fix a bug but makes the code clearer.
14982 (string_overrun_cookie): Now const. Use initializers that
14983 don't formally overflow signed char, to avoid warnings.
14984 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14985 can cause Emacs to crash when string overrun checking is enabled.
14986 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14987 multiple of sizeof (EMACS_INT); it need not be, if
14988 alignof(EMACS_INT) < sizeof (EMACS_INT).
14989 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14990
14991 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14992
14993 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14994
14995 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14996
14997 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14998 supposed to be handshaking. (Bug#8556)
14999 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15000
15001 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15002
15003 * lisp.h (Qdebug): List symbol.
15004 * eval.c (Qdebug): Restore global linkage.
15005 * keyboard.c (debug-on-event): New variable.
15006 (handle_user_signal): Break into debugger when debug-on-event
15007 matches the current signal symbol.
15008
15009 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15010
15011 * alloc.c (check_sblock, check_string_bytes)
15012 (check_string_free_list): Convert to standard C.
15013
15014 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15015
15016 * w32.c (emacs_gnutls_push): Fix typo.
15017
15018 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15019
15020 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15021 "cast to pointer from integer of different size".
15022
15023 Improve doprnt and its use in verror. (Bug#8545)
15024 * doprnt.c (doprnt): Document the set of format control sequences
15025 supported by the function. Use SAFE_ALLOCA instead of always
15026 using `alloca'.
15027
15028 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15029 is one byte too soon. Don't use xrealloc; instead xfree and
15030 xmalloc anew.
15031
15032 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15033
15034 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15035 callbacks stage.
15036
15037 * gnutls.c: Renamed global_initialized to
15038 gnutls_global_initialized. Added internals for the
15039 :verify-hostname-error, :verify-error, and :verify-flags
15040 parameters of `gnutls-boot' and documented those parameters in the
15041 docstring. Start callback support.
15042 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15043 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15044 on error. Return error code.
15045 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15046 (emacs_gnutls_read): Likewise.
15047 (Fgnutls_boot): Return handshake error code.
15048 (emacs_gnutls_handle_error): New function.
15049 (wsaerror_to_errno): Likewise.
15050
15051 * w32.h (emacs_gnutls_pull): Add prototype.
15052 (emacs_gnutls_push): Likewise.
15053
15054 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15055 (emacs_gnutls_push): Likewise.
15056
15057 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15058
15059 * process.c (wait_reading_process_output): Check if GnuTLS
15060 buffered some data internally if no FDs are set for TLS
15061 connections.
15062
15063 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15064 (LIBS): Link to USER_LIBS.
15065 ($(BLD)/gnutls.$(0)): New target.
15066
15067 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15068
15069 * xdisp.c (handle_single_display_spec): Rename the
15070 display_replaced_before_p argument into display_replaced_p, to
15071 make it consistent with the commentary. Fix typos in the
15072 commentary.
15073
15074 * textprop.c (syms_of_textprop): Remove dead code.
15075 (copy_text_properties): Delete obsolete commentary about an
15076 interface that was deleted long ago. Fix typos in the description
15077 of arguments.
15078
15079 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15080 to changes in oldXMenu/XMenu.h from 2011-04-16.
15081 <menu_help_message, prev_menu_help_message>: Constify.
15082 (IT_menu_make_room): menu->help_text is now `const char **';
15083 adjust.
15084
15085 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15086 to changes in oldXMenu/XMenu.h from 2011-04-16.
15087 (struct XMenu): Declare `help_text' `const char **'.
15088
15089 * xfaces.c <Qunspecified>: Make extern again.
15090
15091 * syntax.c: Include sys/types.h before including regex.h, as
15092 required by POSIX.
15093
15094 * doc.c (get_doc_string): Improve the format passed to `error'.
15095
15096 * doprnt.c (doprnt): Improve commentary.
15097
15098 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15099
15100 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15101 them with etags.
15102
15103 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15104 changes in globals.h immediately force recompilation.
15105 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15106 $(CURDIR)/s/ms-w32.h.
15107 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15108
15109 * character.c (Fchar_direction): Function deleted.
15110 (syms_of_character): Don't defsubr it.
15111 <char-direction-table>: Deleted.
15112
15113 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15114
15115 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15116 * doprnt.c: Include limits.h.
15117 (SIZE_MAX): New macro.
15118 (doprnt): Return a size_t value. 2nd arg is now size_t.
15119 Many local variables are now size_t instead of int or unsigned.
15120 Improve overflow protection. Support `l' modifier for integer
15121 conversions. Support %l conversion. Don't assume an EMACS_INT
15122 argument for integer conversions and for %c.
15123
15124 * lisp.h (doprnt): Restore prototype.
15125
15126 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15127 $(SRC)/character.h.
15128
15129 * Makefile.in (base_obj): Add back doprnt.o.
15130
15131 * deps.mk (doprnt.o): Add back prerequisites.
15132 (callint.o): Depend on character.h.
15133
15134 * eval.c (internal_lisp_condition_case): Include the handler
15135 representation in the error message.
15136 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15137 when breaking from the loop.
15138
15139 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15140
15141 * callint.c (Fcall_interactively): When displaying error message
15142 about invalid control letter, pass the character's codepoint, not
15143 a pointer to its multibyte form. Improve display of the character
15144 in octal and display also its hex code.
15145
15146 * character.c (char_string): Use %x to display the (unsigned)
15147 codepoint of an invalid character, to avoid displaying a bogus
15148 negative value.
15149
15150 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15151 `error', not SYMBOL_NAME itself.
15152
15153 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15154 character arguments to `error'.
15155
15156 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15157 to `error' in error message about FINAL_CHAR argument. Make sure
15158 FINAL_CHAR is a character, and use %c when it is passed as
15159 argument to `error'.
15160
15161 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15162
15163 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15164
15165 * w32.c: Include <time.h>.
15166 (sys_localtime): New function.
15167
15168 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15169
15170 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15171
15172 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15173
15174 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15175
15176 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15177 zombies (Bug#8467).
15178
15179 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15180
15181 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15182 gl_state.e_property when gl_state.object is Qt.
15183
15184 * insdel.c (make_gap_larger): Remove limitation of buffer size
15185 to <= INT_MAX.
15186
15187 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15188
15189 * xdisp.c (lookup_glyphless_char_display)
15190 (produce_glyphless_glyph): Handle cons cell entry in
15191 glyphless-char-display.
15192 (Vglyphless_char_display): Document it.
15193
15194 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15195 glyphless-char-display.
15196
15197 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15198
15199 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15200
15201 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15202
15203 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15204 definition for no-X builds.
15205
15206 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15207
15208 Static checks with GCC 4.6.0 and non-default toolkits.
15209
15210 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15211
15212 * process.c (keyboard_bit_set): Define only if SIGIO.
15213 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15214 (send_process): Repair possible setjmp clobbering.
15215
15216 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15217
15218 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15219
15220 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15221
15222 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15223 Define only if needed.
15224
15225 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15226 by pacifying GCC about it. Maybe it's time to retire it?
15227 * xfaces.c (USG, __TIMEVAL__): Likewise.
15228
15229 * dispextern.h (struct redisplay_interface): Rename param
15230 to avoid shadowing.
15231 * termhooks.h (struct terminal): Likewise.
15232 * xterm.c (xembed_send_message): Likewise.
15233
15234 * insdel.c (make_gap_smaller): Define only if
15235 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15236
15237 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15238 it.
15239
15240 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15241 so that we aren't warned about unused symbols.
15242
15243 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15244
15245 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15246
15247 * xfns.c (x_real_positions): Mark locals as initialized.
15248
15249 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15250
15251 * xterm.c: Fix problems found by static analysis with other toolkits.
15252 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15253 (x_dispatch_event): Declare static if USE_GTK, and
15254 define if USE_GTK || USE_X_TOOLKIT.
15255 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15256 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15257 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15258 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15259
15260 * xmenu.c (menu_help_callback): Pointer type fixes.
15261 Use const pointers when pointing at readonly data. Avoid pointer
15262 signedness clashes.
15263 (FALSE): Remove unused macro.
15264 (update_frame_menubar): Remove unused decl.
15265
15266 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15267
15268 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15269 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15270 (single_menu_item): Rename local to avoid shadowing.
15271
15272 * keyboard.c (make_lispy_event): Remove unused local var.
15273
15274 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15275 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15276
15277 * bitmaps: Change bitmaps from unsigned char back to the X11
15278 compatible char. Avoid the old compiler warnings about
15279 out-of-range initializers by using, for example, '\xab' rather
15280 than 0xab.
15281
15282 * xgselect.c (xgselect_initialize): Check vs interface
15283 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15284
15285 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15286
15287 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15288 to read-only memory.
15289
15290 * fns.c (vector): Remove; this old hack is no longer needed.
15291
15292 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15293 Remove unused var.
15294 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15295
15296 * xrdb.c (x_load_resources): Omit unused local.
15297
15298 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15299 (x_window): Rename locals to avoid shadowing.
15300 (USG): Use the kludged USG macro, to pacify gcc.
15301
15302 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15303 (x_term_init): Remove local to avoid shadowing.
15304
15305 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15306
15307 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15308 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15309
15310 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15311
15312 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15313
15314 Fix regex.c, syntax.c and friends for buffers > 2GB.
15315 * syntax.h (struct gl_state_s): Declare character position members
15316 EMACS_INT.
15317
15318 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15319
15320 * textprop.c (verify_interval_modification, interval_of):
15321 Declare arguments EMACS_INT.
15322
15323 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15324 EMACS_INT.
15325
15326 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15327
15328 * indent.c (Fvertical_motion): Local variable it_start is now
15329 EMACS_INT.
15330
15331 * regex.c (re_match, re_match_2, re_match_2_internal)
15332 (bcmp_translate, regcomp, regexec, print_double_string)
15333 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15334 (re_compile_pattern, re_exec): Declare arguments and local
15335 variables `size_t' and `ssize_t' and return values `regoff_t', as
15336 appropriate.
15337 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15338 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15339 <compile_stack_type>: `size' and `avail' are now `size_t'.
15340
15341 * regex.h <regoff_t>: Use ssize_t, not int.
15342 (re_search, re_search_2, re_match, re_match_2): Arguments that
15343 specify buffer/string position and length are now ssize_t and
15344 size_t. Return type is regoff_t.
15345
15346 2011-04-16 Ben Key <bkey76@gmail.com>
15347
15348 * nsfont.m: Fixed bugs in ns_get_family and
15349 ns_descriptor_to_entity that were caused by using free to
15350 deallocate memory blocks that were allocated by xmalloc (via
15351 xstrdup). This caused Emacs to crash when compiled with
15352 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15353 --enable-checking=xmallocoverrun). xfree is now used to
15354 deallocate these memory blocks.
15355
15356 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15357
15358 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15359
15360 emacs_write: Accept and return EMACS_INT for sizes.
15361 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15362 et seq.
15363 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15364 Accept and return EMACS_INT.
15365 (emacs_gnutls_write): Return the number of bytes written on
15366 partial writes.
15367 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15368 (emacs_read, emacs_write): Remove check for negative size, as the
15369 Emacs source code has been audited now.
15370 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15371 (emacs_read, emacs_write): Use it.
15372 * process.c (send_process): Adjust to the new signatures of
15373 emacs_write and emacs_gnutls_write. Do not attempt to store
15374 a byte offset into an 'int'; it might overflow.
15375 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15376
15377 * sound.c: Don't assume sizes fit in 'int'.
15378 (struct sound_device.period_size, alsa_period_size):
15379 Return EMACS_INT, not int.
15380 (struct sound_device.write, vox_write, alsa_write):
15381 Accept EMACS_INT, not int.
15382 (wav_play, au_play): Use EMACS_INT to store sizes and to
15383 record read return values.
15384
15385 2011-04-15 Ben Key <bkey76@gmail.com>
15386
15387 * keyboard.c (Qundefined): Don't declare static since it is used
15388 in nsfns.m.
15389 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15390 static since they are used in nsfont.m.
15391
15392 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15393
15394 * process.c (Qprocessp): Don't declare static.
15395 * lisp.h (Qprocessp): Declare again.
15396
15397 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15398
15399 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15400
15401 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15402
15403 Improve C-level modularity by making more things 'static'.
15404
15405 Don't publish debugger-only interfaces to other modules.
15406 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15407 (verify_bytepos, count_markers): Move decls to the only modules
15408 that need them.
15409 * region-cache.h (pp_cache): Likewise.
15410 * window.h (check_all_windows): Likewise.
15411 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15412
15413 * sysdep.c (croak): Now static, if
15414 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15415 * syssignal.h (croak): Declare only if not static.
15416
15417 * alloc.c (refill_memory_reserve): Now static if
15418 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15419 * lisp.h (refill_memory_reserve): Declare only if not static.
15420
15421 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15422 Define only if USE_LUCID.
15423
15424 * xrdb.c (x_customization_string, x_rm_string): Now static.
15425
15426 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15427 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15428
15429 * xdisp.c (draw_row_with_mouse_face): Now static.
15430 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15431
15432 * window.h (check_all_windows): Mark externally visible.
15433
15434 * window.c (window_deletion_count): Now static.
15435
15436 * undo.c: Make symbols static if they're not exported.
15437 (last_undo_buffer, last_boundary_position, pending_boundary):
15438 Now static.
15439
15440 * textprop.c (interval_insert_behind_hooks): Now static.
15441 (interval_insert_in_front_hooks): Likewise.
15442
15443 * term.c: Make symbols static if they're not exported.
15444 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15445 (max_frame_lines, tty_set_terminal_modes):
15446 (tty_reset_terminal_modes, tty_turn_off_highlight):
15447 (get_tty_terminal): Now static.
15448 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15449 * termhooks.h (term_mouse_moveto): Do not declare if
15450 HAVE_WINDOW_SYSTEM.
15451 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15452 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15453
15454 * sysdep.c: Make symbols static if they're not exported.
15455 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15456 Now static.
15457 (sigprocmask_set, full_mask): Remove; unused.
15458 (wait_debugging): Mark as visible.
15459 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15460 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15461
15462 * syntax.c (syntax_temp): Define only if !__GNUC__.
15463
15464 * sound.c (current_sound_device, current_sound): Now static.
15465
15466 * search.c (searchbufs, searchbuf_head): Now static.
15467
15468 * scroll.c (scroll_cost): Remove; unused.
15469 * dispextern.h (scroll_cost): Remove decl.
15470
15471 * region-cache.h (pp_cache): Mark as externally visible.
15472
15473 * process.c: Make symbols static if they're not exported.
15474 (process_tick, update_tick, create_process, chan_process):
15475 (Vprocess_alist, proc_buffered_char, datagram_access):
15476 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15477 (deactivate_process): Mark defn as static, as well as decl.
15478 * lisp.h (create_process): Remove decl.
15479 * process.h (chan_process, Vprocess_alist): Remove decls.
15480
15481 * print.c: Make symbols static if they're not exported.
15482 (print_depth, new_backquote_output, being_printed, print_buffer):
15483 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15484 (print_interval, print_number_index, initial_stderr_stream):
15485 Now static.
15486 * lisp.h (Fprinc): Remove decl.
15487 (debug_output_compilation_hack): Mark as externally visible.
15488
15489 * sysdep.c (croak): Move decl from here to syssignal.h.
15490 * syssignal.h (croak): Put it here, so the API can be checked when
15491 'croak' is called from dissociate_if_controlling_tty.
15492
15493 * minibuf.c: Make symbols static if they're not exported.
15494 (minibuf_save_list, choose_minibuf_frame): Now static.
15495 * lisp.h (choose_minibuf_frame): Remove decl.
15496
15497 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15498
15499 * lread.c: Make symbols static if they're not exported.
15500 (read_objects, initial_obarray, oblookup_last_bucket_number):
15501 Now static.
15502 (make_symbol): Remove; unused.
15503 * lisp.h (initial_obarray, make_symbol): Remove decls.
15504
15505 * keyboard.c: Make symbols static if they're not exported.
15506 (single_kboard, recent_keys_index, total_keys, recent_keys):
15507 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15508 (this_single_command_key_start, echoing, last_auto_save):
15509 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15510 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15511 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15512 (Vlispy_mouse_stem, double_click_count):
15513 Now static.
15514 (force_auto_save_soon): Define only if SIGDANGER.
15515 (ignore_mouse_drag_p): Now static if
15516 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15517 (print_help): Remove; unused.
15518 (stop_character, last_timer_event): Mark as externally visible.
15519 * keyboard.h (ignore_mouse_drag_p): Declare only if
15520 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15521 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15522 * lisp.h (echoing): Remove decl.
15523 (force_auto_save_soon): Declare only if SIGDANGER.
15524 * xdisp.c (redisplay_window): Simplify code, to make it more
15525 obvious that ignore_mouse_drag_p is not accessed if !defined
15526 USE_GTK && !defined HAVE_NS.
15527
15528 * intervals.c: Make symbols static if they're not exported.
15529 (merge_properties_sticky, merge_interval_right, delete_interval):
15530 Now static.
15531 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15532
15533 * insdel.c: Make symbols static if they're not exported.
15534 However, leave prepare_to_modify_buffer alone. It's never
15535 called from outside this function, but that appears to be a bug.
15536 (combine_after_change_list, combine_after_change_buffer):
15537 (adjust_after_replace, signal_before_change): Now static.
15538 (adjust_after_replace_noundo): Remove; unused.
15539 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15540 (signal_before_change): Remove decls.
15541
15542 * indent.c (val_compute_motion, val_vmotion): Now static.
15543
15544 * image.c: Make symbols static if they're not exported.
15545 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15546 if USE_GTK.
15547 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15548 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15549
15550 * fringe.c (standard_bitmaps): Now static.
15551 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15552
15553 * frame.c: Make symbols static if they're not exported.
15554 (x_report_frame_params, make_terminal_frame): Now static.
15555 (get_frame_param): Now static, unless HAVE_NS.
15556 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15557 (x_get_resource_string): Remove; not used.
15558 * frame.h (make_terminal_frame, x_report_frame_params):
15559 (x_get_resource_string); Remove decls.
15560 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15561 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15562
15563 * font.c, fontset.c: Make symbols static if they're not exported.
15564 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15565 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15566 * font.c (font_close_object): Now static.
15567 * font.h (font_close_object): Remove.
15568 * fontset.c (FONTSET_OBJLIST): Remove.
15569 (free_realized_fontset) #if-0 the body, which does nothing.
15570 (face_suitable_for_char_p): #if-0, as it's never called.
15571 * fontset.h (face_suitable_for_char_p): Remove decl.
15572 * xfaces.c (face_at_string_position):
15573 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15574 since 0 is always ASCII.
15575
15576 * fns.c (weak_hash_tables): Now static.
15577
15578 * fileio.c: Make symbols static if they're not exported.
15579 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15580 (Vwrite_region_annotation_buffers): Now static.
15581
15582 * eval.c: Make symbols static if they're not exported.
15583 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15584 * lisp.h (backtrace_list): Remove decl.
15585
15586 * emacs.c: Make symbols static if they're not exported.
15587 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15588 (fatal_error_code, fatal_error_signal_hook, standard_args):
15589 Now static.
15590 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15591 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15592 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15593 * lisp.h (fatal_error_signal_hook): Remove decl.
15594 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15595
15596 * editfns.c: Move a (normally-unused) function to its only use.
15597 * editfns.c, lisp.h (get_operating_system_release): Remove.
15598 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15599 worth the hassle of breaking this out.
15600
15601 * xterm.c: Make symbols static if they're not exported.
15602 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15603 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15604 (x_destroy_window, x_delete_display):
15605 Now static.
15606 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15607 (x_mouse_leave): Remove; unused.
15608 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15609 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15610 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15611 Remove decls.
15612 (x_mouse_leave): Declare only if WINDOWSNT.
15613 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15614 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15615 USE_X_TOOLKIT.
15616
15617 * ftxfont.c: Make symbols static if they're not exported.
15618 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15619 HAVE_FREETYPE.
15620 * font.h (ftxfont_driver): Likewise.
15621
15622 * xfns.c: Make symbols static if they're not exported.
15623 (x_last_font_name, x_display_info_for_name):
15624 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15625 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15626 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15627 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15628 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15629 (last_show_tip_args): Now static.
15630 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15631 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15632 (x_screen_planes): Remove; unused.
15633 * dispextern.h (x_screen_planes): Remove decl.
15634
15635 * dispnew.c: Make symbols static if they're not exported.
15636 * dispextern.h (redraw_garbaged_frames, scrolling):
15637 (increment_row_positions): Remove.
15638 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15639 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15640 Now static.
15641 (redraw_garbaged_frames): Remove; unused.
15642
15643 * xfaces.c: Make symbols static if they're not exported.
15644 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15645 Remove decls.
15646 * xterm.h (defined_color): Remove decls.
15647 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15648 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15649 (menu_face_changed_default, defined_color, free_realized_face):
15650 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15651 (ascii_face_of_lisp_face): Remove; unused.
15652
15653 * xdisp.c: Make symbols static if they're not exported.
15654 * dispextern.h (scratch_glyph_row, window_box_edges):
15655 (glyph_to_pixel_coords, set_cursor_from_row):
15656 (get_next_display_element, set_iterator_to_next):
15657 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15658 (show_mouse_face): Remove decls
15659 * frame.h (message_buf_print): Likewise.
15660 * lisp.h (pop_message, set_message, check_point_in_composition):
15661 Likewise.
15662 * xterm.h (set_vertical_scroll_bar): Likewise.
15663 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15664 (message_buf_print, scratch_glyph_row, displayed_buffer):
15665 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15666 (get_next_display_element, show_mouse_face, window_box_edges):
15667 (frame_to_window_pixel_xy, check_point_in_composition):
15668 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15669 (glyph_to_pixel_coords): Remove; unused.
15670
15671 * dired.c (file_name_completion): Now static.
15672
15673 * dbusbind.c (xd_in_read_queued_messages): Now static.
15674
15675 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15676 * data.c (circular_list_error): Remove.
15677
15678 * commands.h (last_point_position, last_point_position_buffer):
15679 (last_point_position_window): Remove decls.
15680 * keyboard.c: Make these variables static.
15681
15682 * coding.h (coding, code_convert_region, encode_coding_gap):
15683 Remove decls.
15684 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15685 (iso_code_class, detect_coding, code_convert_region): Now static.
15686 (encode_coding_gap): Remove; unused.
15687
15688 * chartab.c (chartab_chars, chartab_bits): Now static.
15689
15690 * charset.h (charset_iso_8859_1): Remove decl.
15691 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15692 Now static.
15693
15694 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15695 * ccl.c (Vccl_program_table): Now static.
15696 (check_ccl_update): Remove; unused.
15697
15698 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15699 * category.h: ... from here.
15700 * category.c (check_category_table, set_category_set): Now static.
15701
15702 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15703 * lisp.h: Remove these decls.
15704
15705 * buffer.c (buffer_count): Remove unused var.
15706
15707 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15708 so that it's not optimized away.
15709 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15710 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15711 exported only to the debugger.
15712
15713 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15714 * atimer.h (run_all_atimers): Remove; not exported.
15715
15716 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15717 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15718 was inaccessible from Lisp.
15719 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15720 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15721
15722 alloc.c: Import and export fewer symbols, and remove unused items.
15723 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15724 is defined.
15725 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15726 it's not optimized away by whole-program optimization.
15727 (message_enable_multibyte, free_misc): Remove.
15728 (catchlist, handlerlist, mark_backtrace):
15729 Declare only if BYTE_MARK_STACK.
15730 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15731 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15732 (message_enable_multibyte): Remove decl.
15733 (free_misc, interval_free_list, float_block, float_block_index):
15734 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15735 (cons_free_list, last_marked_index):
15736 Now static.
15737 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15738 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15739 (mark_backtrace): Define only if BYTE_MARK_STACK.
15740 * xdisp.c (message_enable_multibyte): Now static.
15741
15742 Declare Lisp_Object Q* variables to be 'static' if not exported.
15743 This makes it easier for human readers (and static analyzers)
15744 to see whether these variables are used from other modules.
15745 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15746 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15747 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15748 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15749 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15750 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15751 * xmenu.c, xselect.c:
15752 Declare Q* vars static if they are not used in other modules.
15753 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15754 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15755 Remove decls of unexported vars.
15756 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15757
15758 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15759
15760 Make Emacs functions such as Fatom 'static' by default.
15761 This makes it easier for human readers (and static analyzers)
15762 to see whether these functions can be called from other modules.
15763 DEFUN now defines a static function. To make the function external
15764 so that it can be used in other C modules, use the new macro DEFUE.
15765 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15766 (Finit_image_library):
15767 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15768 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15769 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15770 Remove decls, since these functions are now static.
15771 (Funintern, Fget_internal_run_time): New decls, since these functions
15772 were already external.
15773
15774 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15775 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15776 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15777 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15778 * keyboard.c, keymap.c, lread.c:
15779 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15780 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15781 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15782 Mark functions with DEFUE instead of DEFUN,
15783 if they are used in other modules.
15784 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15785 decls for now-static functions.
15786 * buffer.h (Fdelete_overlay): Remove decl.
15787 * callproc.c (Fgetenv_internal): Mark as internal.
15788 * composite.c (Fremove_list_of_text_properties): Remove decl.
15789 (Fcomposition_get_gstring): New forward static decl.
15790 * composite.h (Fcomposite_get_gstring): Remove decl.
15791 * dired.c (Ffile_attributes): New forward static decl.
15792 * doc.c (Fdocumntation_property): New forward static decl.
15793 * eval.c (Ffetch_bytecode): New forward static decl.
15794 (Funintern): Remove extern decl; now in .h file where it belongs.
15795 * fileio.c (Fmake_symbolic_link): New forward static decl.
15796 * image.c (Finit_image_library): New forward static decl.
15797 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15798 * intervals.h (Fprevious_property_change):
15799 (Fremove_list_of_text_properties): Remove decls.
15800 * keyboard.c (Fthis_command_keys): Remove decl.
15801 (Fcommand_execute): New forward static decl.
15802 * keymap.c (Flookup_key): New forward static decl.
15803 (Fcopy_keymap): Now static.
15804 * keymap.h (Flookup_key): Remove decl.
15805 * process.c (Fget_process): New forward static decl.
15806 (Fprocess_datagram_address): Mark as internal.
15807 * syntax.c (Fsyntax_table_p): New forward static decl.
15808 (skip_chars): Remove duplicate decl.
15809 * textprop.c (Fprevious_property_change): New forward static decl.
15810 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15811 Now internal.
15812 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15813 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15814
15815 * editfns.c (Fformat): Remove unreachable code.
15816
15817 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15818
15819 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15820 change. (Bug#8496)
15821
15822 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15823
15824 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15825 when at ZV. (Bug#8487)
15826
15827 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15828
15829 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15830 (Bug#8437)
15831 * keyboard.c (parse_tool_bar_item): Likewise.
15832 * sound.c (sound_cleanup, alsa_close): Likewise.
15833 * termcap.c (tgetent): Likewise.
15834 * xfns.c (x_default_font_parameter): Likewise.
15835 * xsettings.c (read_and_apply_settings): Likewise.
15836
15837 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15838 (overrun_check_free): Protoize.
15839
15840 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15841
15842 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15843 since callers should never pass a negative size.
15844 Change the signature to match that of plain 'read' and 'write'; see
15845 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15846 * lisp.h: Update prototypes of emacs_write and emacs_read.
15847
15848 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15849
15850 * xdisp.c (redisplay_window): Don't try to determine the character
15851 position of the scroll margin if the window start point w->startp
15852 is outside the buffer's accessible region. (Bug#8468)
15853
15854 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15855
15856 Fix write-region and its subroutines for buffers > 2GB.
15857 * fileio.c (a_write, e_write): Modify declaration of arguments and
15858 local variables to support buffers larger than 2GB.
15859 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15860
15861 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15862 argument, local variables, and return value.
15863
15864 * lisp.h: Update prototypes of emacs_write and emacs_read.
15865
15866 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15867
15868 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15869
15870 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15871
15872 Fix more problems found by GCC 4.6.0's static checks.
15873
15874 * xdisp.c (vmessage): Use a better test for character truncation.
15875
15876 * charset.c (load_charset_map): <, not <=, for optimization,
15877 and to avoid potential problems with integer overflow.
15878 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15879 * casetab.c (set_identity, shuffle): Likewise.
15880 * editfns.c (Fformat): Likewise.
15881 * syntax.c (skip_chars): Likewise.
15882
15883 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15884 This also lets GCC 4.6.0 generate slightly better loop code.
15885
15886 * callint.c (Fcall_interactively): <, not <=, for optimization.
15887 (Fcall_interactively): Count the number of arguments produced,
15888 not the number of arguments given. This is simpler and lets GCC
15889 4.6.0 generate slightly better code.
15890
15891 * ftfont.c: Distingish more carefully between FcChar8 and char.
15892 The previous code passed unsigned char * to a functions like
15893 strlen and xstrcasecmp that expect char *, which does not
15894 conform to the C standard.
15895 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15896 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15897 char * when the C standard requires it.
15898
15899 * keyboard.c (read_char): Remove unused var.
15900
15901 * eval.c: Port to Windows vsnprintf (Bug#8435).
15902 Include <limits.h>.
15903 (SIZE_MAX): Define if the headers do not.
15904 (verror): Do not give up if vsnprintf returns a negative count.
15905 Instead, grow the buffer. This ports to Windows vsnprintf, which
15906 does not conform to C99. Problem reported by Eli Zaretskii.
15907 Also, simplify the allocation scheme, by avoiding the need for
15908 calling realloc, and removing the ALLOCATED variable.
15909
15910 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15911
15912 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15913 But keep the doprint source code for now, as we might revamp it
15914 and use it again (Bug#8435).
15915 * lisp.h (doprnt): Remove.
15916 * Makefile.in (base_obj): Remove doprnt.o.
15917 * deps.mk (doprnt.o): Remove.
15918
15919 error: Print 32- and 64-bit integers portably (Bug#8435).
15920 Without this change, on typical 64-bit hosts error ("...%d...", N)
15921 was used to print both 32- and 64-bit integers N, which relied on
15922 undefined behavior.
15923 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15924 * lisp.h (error, verror): Mark as printf-like functions.
15925 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15926 Report overflow in size calculations when allocating printf buffer.
15927 Do not truncate output string at its first null byte.
15928 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15929 Truncate the output at a character boundary, since vsnprintf does not
15930 do that.
15931 * charset.c (check_iso_charset_parameter): Convert internal
15932 character to string before calling 'error', since %c now has the
15933 printf meaning.
15934 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15935 overflow when computing char to be passed to 'error'. Do not
15936 pass Lisp_Object to 'error'; pass the integer instead.
15937 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15938 formatted with plain %d.
15939
15940 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15941
15942 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15943
15944 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15945
15946 * xterm.c (x_catch_errors): Remove duplicate declaration.
15947
15948 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15949
15950 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15951
15952 2011-04-10 Jim Meyering <meyering@redhat.com>
15953
15954 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15955 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15956 return ssize_t not "int", and use size_t as the buffer length.
15957 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15958 * gnutls.h: Update declarations.
15959 * process.c (read_process_output): Use ssize_t, to match.
15960 (send_process): Likewise.
15961
15962 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15963
15964 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15965
15966 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15967
15968 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15969 Use unsigned char, to match FcChar8 type definition.
15970
15971 * xterm.c (handle_one_xevent):
15972 * xmenu.c (create_and_show_popup_menu):
15973 * xselect.c (x_decline_selection_request)
15974 (x_reply_selection_request): Avoid type-punned deref of X events.
15975
15976 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15977
15978 Fix some uses of `int' instead of EMACS_INT.
15979 * search.c (string_match_1, fast_string_match)
15980 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15981 (scan_buffer, find_next_newline_no_quit)
15982 (find_before_next_newline, search_command, Freplace_match)
15983 (Fmatch_data): Make some `int' variables be EMACS_INT.
15984
15985 * xdisp.c (display_count_lines): 3rd argument and return value now
15986 EMACS_INT. All callers changed.
15987 (pint2hrstr): Last argument is now EMACS_INT.
15988
15989 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15990 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15991 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15992 (decode_coding_utf_16, decode_coding_emacs_mule)
15993 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15994 (decode_coding_ccl, decode_coding_charset)
15995 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15996 (decode_coding_iso_2022, decode_coding_emacs_mule)
15997 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15998 <char_offset, last_offset>: Declare EMACS_INT.
15999 (encode_coding_utf_8, encode_coding_utf_16)
16000 (encode_coding_emacs_mule, encode_invocation_designation)
16001 (encode_designation_at_bol, encode_coding_iso_2022)
16002 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16003 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16004 Declare EMACS_INT.
16005 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16006 (encode_invocation_designation): Last argument P_NCHARS is now
16007 EMACS_INT.
16008 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16009 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16010
16011 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16012 All users changed.
16013
16014 * ccl.c (Fccl_execute_on_string): Declare some variables
16015 EMACS_INT.
16016
16017 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16018
16019 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16020
16021 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16022
16023 * process.c (Fformat_network_address): Doc fix.
16024
16025 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16026
16027 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16028
16029 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16030
16031 * keyboard.c (read_char): Call Lisp function help-form-show,
16032 instead of using internal_with_output_to_temp_buffer.
16033 (Qhelp_form_show): New var.
16034 (syms_of_keyboard): Use DEFSYM macro.
16035
16036 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16037
16038 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16039
16040 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16041
16042 * process.c (Flist_processes): Remove to Lisp.
16043 (list_processes_1): Delete.
16044
16045 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16046
16047 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16048
16049 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16050
16051 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16052
16053 Fix more problems found by GCC 4.6.0's static checks.
16054
16055 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16056
16057 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16058
16059 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16060
16061 * xdisp.c (vmessage): Mark as a printf-like function.
16062
16063 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16064
16065 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16066
16067 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16068 printf-like functions.
16069 (tiff_load): Add casts to remove these marks before passing them
16070 to system-supplied API.
16071
16072 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16073
16074 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16075 This avoids several warnings with gcc -Wstrict-overflow.
16076 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16077 directly, rather than having caller test rule sign. This avoids
16078 some unnecessary tests.
16079 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16080 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16081 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16082
16083 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16084 (xfont_open): Avoid unnecessary tests.
16085
16086 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16087
16088 * composite.h, composite.c (composition_gstring_put_cache):
16089 Use EMACS_INT, not int, for length.
16090
16091 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16092 breaking out part of COMPOSITION_DECODE_RULE.
16093 (COMPOSITION_DECODE_RULE): Use it.
16094 * composite.c (get_composition_id): Remove unused local vars,
16095 by using the new macro.
16096
16097 * textprop.c (set_text_properties_1): Change while to do-while,
16098 since the condition is always true at first.
16099
16100 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16101 (interval_deletion_adjustment): Return unsigned value.
16102 All uses changed.
16103
16104 * process.c (list_processes_1, create_pty, read_process_output):
16105 (exec_sentinel): Remove vars that were set but not used.
16106 (create_pty): Remove unnecessary "volatile"s.
16107 (Fnetwork_interface_info): Avoid possibility of int overflow.
16108 (read_process_output): Do adaptive read buffering even if carryover.
16109 (read_process_output): Simplify nbytes computation if buffered.
16110
16111 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16112
16113 * syntax.c (scan_words): Remove var that was set but not used.
16114 (update_syntax_table): Use unsigned instead of int.
16115
16116 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16117 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16118 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16119
16120 * print.c (print_error_message): Avoid int overflow.
16121
16122 * font.c (font_list_entities): Redo for clarity,
16123 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16124
16125 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16126 (font_score): Avoid potential overflow in diff calculation.
16127
16128 * fns.c (substring_both): Remove var that is set but not used.
16129 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16130
16131 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16132
16133 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16134 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16135 can always succeed if overflow has undefined behavior.
16136
16137 * search.c (boyer_moore, wordify): Remove vars set but not used.
16138 (wordify): Omit three unnecessary tests.
16139
16140 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16141 All callers changed. This avoids the need for an unused var.
16142
16143 * casefiddle.c (casify_region): Remove var that is set but not used.
16144
16145 * dired.c (file_name_completion): Remove var that is set but not used.
16146
16147 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16148
16149 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16150 (Finsert_file_contents): Remove unnecessary code checking fd.
16151
16152 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16153 Check for integer overflow on size calculations.
16154
16155 * buffer.c (Fprevious_overlay_change): Remove var that is set
16156 but not used.
16157
16158 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16159 Remove vars that are set but not used.
16160 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16161 (timer_check_2): Mark vars as initialized.
16162
16163 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16164
16165 * image.c (lookup_image): Remove var that is set but not used.
16166 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16167
16168 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16169 that are set but not used.
16170
16171 * xfns.c (make_invisible_cursor): Don't return garbage
16172 if XCreateBitmapFromData fails (Bug#8410).
16173
16174 * xselect.c (x_get_local_selection, x_handle_property_notify):
16175 Remove vars that are set but not used.
16176
16177 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16178 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16179
16180 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16181 Remove var that is set but not used.
16182 (scroll_bar_windows_size): Now size_t, not int.
16183 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16184 Check for overflow.
16185
16186 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16187 (map_tty_color) [!defined MSDOS]: Likewise.
16188
16189 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16190
16191 * coding.c: Remove vars that are set but not used.
16192 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16193 All callers changed.
16194 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16195 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16196 (decode_coding_charset): Remove vars that are set but not used.
16197
16198 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16199 that is set but not used.
16200
16201 * print.c (print_object): Remove var that is set but not used.
16202
16203 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16204 The gnulib version avoids calling malloc in the usual case,
16205 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16206 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16207 * filelock.c (current_lock_owner): Likewise.
16208 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16209 * sysdep.c: Include allocator.h, careadlinkat.h.
16210 (emacs_no_realloc_allocator): New static constant.
16211 (emacs_readlink): New function.
16212 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16213 ../lib/careadlinkat.h.
16214
16215 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16216
16217 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16218 first non-nil return value).
16219
16220 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16221
16222 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16223 if not defined (Bug#8403).
16224
16225 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16226
16227 * xdisp.c (display_count_lines): Remove parameter `start',
16228 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16229 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16230 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16231 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16232 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16233 and thereabouts. All callers changed.
16234 (get_per_char_metric): Remove parameter `f', unused since
16235 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16236
16237 2011-04-02 Jim Meyering <meyering@redhat.com>
16238
16239 do not dereference NULL upon failed strdup
16240 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16241 (ns_get_family): Likewise.
16242
16243 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16244
16245 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16246
16247 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16248
16249 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16250 later (Bug#8403).
16251
16252 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16253
16254 Add lexical binding.
16255
16256 * window.c (Ftemp_output_buffer_show): New fun.
16257 (Fsave_window_excursion):
16258 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16259
16260 * lread.c (lisp_file_lexically_bound_p): New function.
16261 (Fload): Bind Qlexical_binding.
16262 (readevalloop): Remove `evalfun' arg.
16263 Bind Qinternal_interpreter_environment.
16264 (Feval_buffer): Bind Qlexical_binding.
16265 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16266 Mark as dynamic.
16267 (syms_of_lread): Declare `lexical-binding'.
16268
16269 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16270
16271 * keyboard.c (eval_dyn): New fun.
16272 (menu_item_eval_property): Use it.
16273
16274 * image.c (parse_image_spec): Use Ffunctionp.
16275
16276 * fns.c (concat, mapcar1): Accept byte-code-functions.
16277
16278 * eval.c (Fsetq): Handle lexical vars.
16279 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16280 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16281 (FletX, Flet): Obey lexical binding.
16282 (Fcommandp): Handle closures.
16283 (Feval): New `lexical' arg.
16284 (eval_sub): New function extracted from Feval. Use it almost
16285 everywhere where Feval was used. Look up vars in lexical env.
16286 Handle closures.
16287 (Ffunctionp): Move from subr.el.
16288 (Ffuncall): Handle closures.
16289 (apply_lambda): Remove `eval_flags'.
16290 (funcall_lambda): Handle closures and new byte-code-functions.
16291 (Fspecial_variable_p): New function.
16292 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16293 but without exporting it to Lisp.
16294
16295 * doc.c (Fdocumentation, store_function_docstring):
16296 * data.c (Finteractive_form): Handle closures.
16297
16298 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16299 interactive spec.
16300
16301 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16302 New byte-codes.
16303 (exec_byte_code): New function extracted from Fbyte_code to handle new
16304 calling convention for byte-code-functions. Add new byte-codes.
16305
16306 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16307
16308 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16309
16310 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16311
16312 * xdisp.c (redisplay_internal): Fix prototype.
16313
16314 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16315
16316 * xdisp.c (SCROLL_LIMIT): New macro.
16317 (try_scrolling): Use it when setting scroll_limit.
16318 Limit scrolling to 100 screen lines.
16319 (redisplay_window): Even when falling back on "recentering",
16320 position point in the window according to scroll-conservatively,
16321 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16322
16323 (try_scrolling): When point is above the window, allow searching
16324 as far as scroll_max, or one screenful, to compute vertical
16325 distance from PT to the scroll margin position. This prevents
16326 try_scrolling from unnecessarily failing when
16327 scroll-conservatively is set to a value slightly larger than the
16328 window height. Clean up the case of PT below the margin at bottom
16329 of window: scroll_max can no longer be INT_MAX. When aggressive
16330 scrolling is in use, don't let point enter the opposite scroll
16331 margin as result of the scroll.
16332 (syms_of_xdisp) <scroll-conservatively>: Document the
16333 threshold of 100 lines for never-recentering scrolling.
16334
16335 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16336
16337 * dispextern.h (move_it_by_lines):
16338 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16339 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16340 (message_log_check_duplicate): Remove parameters `prev_bol' and
16341 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16342 (redisplay_internal): Remove parameter `preserve_echo_area',
16343 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16344
16345 * indent.c (Fvertical_motion):
16346 * window.c (window_scroll_pixel_based, Frecenter):
16347 Don't pass `need_y_p' to `move_it_by_lines'.
16348
16349 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16350
16351 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16352 steal a few bits to be more compact.
16353 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16354 Remove unneeded casts.
16355
16356 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16357
16358 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16359
16360 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16361 binding" message (bug#7967).
16362
16363 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16364
16365 Fix more problems found by GCC 4.6.0's static checks.
16366
16367 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16368 Remove unused local var.
16369
16370 * editfns.c (Fmessage_box): Remove unused local var.
16371
16372 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16373 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16374 Omit unused local vars.
16375 * window.c (shrink_windows): Omit unused local var.
16376 * menu.c (digest_single_submenu): Omit unused local var.
16377 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16378 Omit unused local var.
16379
16380 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16381 Don't assume string length fits in int.
16382 (keyremap_step, read_key_sequence): Use size_t for sizes.
16383 (read_key_sequence): Don't check last_real_key_start redundantly.
16384
16385 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16386 instead of alloca (Bug#8344).
16387
16388 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16389 (Fbacktrace_frame): Don't assume nframes fits in int.
16390
16391 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16392
16393 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16394 concerns.
16395
16396 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16397
16398 * cm.c (calccost): Turn while-do into do-while, for clarity.
16399
16400 * keyboard.c (syms_of_keyboard): Use the same style as later
16401 in this function when indexing through an array. This also
16402 works around GCC bug 48267.
16403
16404 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16405
16406 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16407
16408 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16409 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16410
16411 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16412 This avoids undefined behavior on integer overflow, and is a bit
16413 more convenient anyway since it is compared to a size_t variable.
16414
16415 Variadic C functions now count arguments with size_t, not int.
16416 This avoids an unnecessary limitation on 64-bit machines, which
16417 caused (substring ...) to crash on large vectors (Bug#8344).
16418 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16419 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16420 All variadic functions and their callers changed accordingly.
16421 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16422 * data.c (arith_driver, float_arith_driver): Likewise.
16423 * editfns.c (general_insert_function): Likewise.
16424 * eval.c (struct backtrace.nargs, interactive_p)
16425 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16426 (funcall_lambda, mark_backtrace): Likewise.
16427 * fns.c (concat): Likewise.
16428 * frame.c (x_set_frame_parameters): Likewise.
16429 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16430 0 if not found, not -1. All callers changed.
16431
16432 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16433 (stack_copy_size): Now size_t, not int.
16434 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16435
16436 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16437
16438 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16439 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16440 All callers changed.
16441
16442 * lisp.h (multibyte_char_to_unibyte):
16443 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16444 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16445 * character.h (CHAR_TO_BYTE8):
16446 * cmds.c (internal_self_insert):
16447 * editfns.c (general_insert_function):
16448 * keymap.c (push_key_description):
16449 * search.c (Freplace_match):
16450 * xdisp.c (message_dolog, set_message_1): All callers changed.
16451
16452 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16453
16454 * keyboard.c (safe_run_hook_funcall): New function.
16455 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16456 don't set the hook to nil, but remove the offending function instead.
16457 (Qcommand_hook_internal): Remove, unused.
16458 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16459 Vcommand_hook_internal.
16460
16461 * eval.c (enum run_hooks_condition): Remove.
16462 (funcall_nil, funcall_not): New functions.
16463 (run_hook_with_args): Call each function through a `funcall' argument.
16464 Remove `cond' argument, now redundant.
16465 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16466 (Frun_hook_with_args_until_failure): Adjust accordingly.
16467 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16468
16469 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16470
16471 * dispextern.h (string_buffer_position): Remove declaration.
16472
16473 * print.c (strout): Remove parameter `multibyte', unused since
16474 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16475
16476 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16477 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16478 All callers changed.
16479
16480 * w32.c (_wsa_errlist): Use braces for struct initializers.
16481
16482 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16483 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16484 All callers changed.
16485 (string_buffer_position): Likewise. Also, make static (it's never
16486 used outside xdisp.c).
16487 (cursor_row_p): Remove parameter `w', unused since
16488 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16489 (decode_mode_spec): Remove parameter `precision', introduced during
16490 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16491 All callers changed.
16492
16493 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16494
16495 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16496
16497 2011-03-27 Anders Lindgren <andlind@gmail.com>
16498
16499 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16500 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16501 (ns_update_auto_hide_menu_bar): New functions.
16502 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16503 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16504 ns_constrain_all_frames.
16505 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16506 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16507
16508 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16509
16510 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16511
16512 2011-03-27 Glenn Morris <rgm@gnu.org>
16513
16514 * syssignal.h: Replace RETSIGTYPE with void.
16515 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16516 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16517 Replace SIGTYPE with void everywhere.
16518 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16519 * s/template.h (SIGTYPE): Remove commented out definition.
16520
16521 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16522
16523 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16524 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16525
16526 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16527
16528 * w32.c (read_unc_volume): Use parameter `henum', instead of
16529 global variable `wget_enum_handle'.
16530
16531 * keymap.c (describe_vector): Remove parameters `indices' and
16532 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16533 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16534
16535 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16536
16537 * keyboard.c (timer_check): Remove parameter `do_it_now',
16538 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16539 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16540 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16541
16542 * keyboard.c (read_char):
16543 * w32menu.c (w32_menu_display_help):
16544 * xmenu.c (show_help_event, menu_help_callback):
16545 Adjust calls to `show_help_echo'.
16546
16547 * gtkutil.c (xg_maybe_add_timer):
16548 * keyboard.c (readable_events):
16549 * process.c (wait_reading_process_output):
16550 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16551
16552 * insdel.c (adjust_markers_gap_motion):
16553 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16554 (gap_left, gap_right): Don't call it.
16555
16556 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16557
16558 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16559 incurred during fontification.
16560
16561 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16562
16563 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16564 (DEFVAR_PER_BUFFER): Don't pass it.
16565
16566 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16567 (scrolling_window): Don't pass it.
16568
16569 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16570
16571 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16572
16573 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16574 and `suffix'.
16575 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16576 of variables specific to SELinux and computation of `encoded_absname'.
16577
16578 * image.c (XPutPixel): Remove unused variable `height'.
16579
16580 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16581
16582 * unexw32.c (get_section_info): Remove unused variable `section'.
16583
16584 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16585 (system_process_attributes): Remove unused variable `sess'.
16586 (sys_read): Remove unused variable `err'.
16587
16588 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16589 (w32_wnd_proc): Remove unused variable `isdead'.
16590 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16591 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16592 (x_create_tip_frame): Remove unused variable `tem'.
16593
16594 * w32inevt.c (w32_console_read_socket):
16595 Remove unused variable `no_events'.
16596
16597 * w32term.c (x_draw_composite_glyph_string_foreground):
16598 Remove unused variable `width'.
16599
16600 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16601
16602 * w32term.c (x_set_glyph_string_clipping):
16603 Don't pass uninitialized region to CombineRgn.
16604
16605 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16606
16607 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16608 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16609 (Fx_close_connection): Remove unused variable `i'.
16610
16611 * w32font.c (w32font_draw): Return number of glyphs.
16612 (w32font_open_internal): Remove unused variable `i'.
16613 (w32font_driver): Add missing initializer.
16614
16615 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16616 (fill_in_menu): Remove unused variable `items_added'.
16617
16618 * w32term.c (last_mouse_press_frame): Remove static global variable.
16619 (w32_clip_to_row): Remove unused variable `f'.
16620 (x_delete_terminal): Remove unused variable `i'.
16621
16622 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16623 (NOTHING): Remove unused static global variable.
16624 (uniscribe_check_otf): Remove unused variable `table'.
16625 (uniscribe_font_driver): Add missing initializers.
16626
16627 2011-03-23 Julien Danjou <julien@danjou.info>
16628
16629 * term.c (Fsuspend_tty, Fresume_tty):
16630 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16631 * window.c (temp_output_buffer_show):
16632 * insdel.c (signal_before_change):
16633 * frame.c (Fhandle_switch_frame):
16634 * fileio.c (Fdo_auto_save):
16635 * emacs.c (Fkill_emacs):
16636 * editfns.c (save_excursion_restore):
16637 * cmds.c (internal_self_insert):
16638 * callint.c (Fcall_interactively):
16639 * buffer.c (Fkill_all_local_variables):
16640 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16641 Use Frun_hooks.
16642 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16643 unconditionally since it does the check itself.
16644
16645 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16646
16647 Fix more problems found by GCC 4.5.2's static checks.
16648
16649 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16650 the first time through the loop, since we know p0 < p1 then.
16651 This also avoids a gcc -Wstrict-overflow warning.
16652
16653 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16654 leading to a memory leak, possible in functions like
16655 load_charset_map_from_file that can allocate an unbounded number
16656 of objects (Bug#8318).
16657
16658 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16659 that could (at least in theory) be that large.
16660
16661 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16662 This is less likely to overflow, and avoids undefined behavior if
16663 overflow does occur. All callers changed. Use strtoul to scan
16664 for the unsigned long integer.
16665 (pint2hrstr): Simplify and tune code slightly.
16666 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16667
16668 * scroll.c (do_scrolling): Work around GCC bug 48228.
16669 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16670
16671 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16672 This also avoids a warning with gcc -Wstrict-overflow.
16673 (validate_x_resource_name): Simplify count usage.
16674 This also avoids a warning with gcc -Wstrict-overflow.
16675
16676 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16677 fail (Bug#8306).
16678
16679 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16680
16681 * process.c (Fmake_network_process): Use socklen_t, not int,
16682 where POSIX says socklen_t is required in portable programs.
16683 This fixes a porting bug on hosts like 64-bit HP-UX, where
16684 socklen_t is wider than int (Bug#8277).
16685 (Fmake_network_process, server_accept_connection):
16686 (wait_reading_process_output, read_process_output):
16687 Likewise.
16688
16689 * process.c: Rename or move locals to avoid shadowing.
16690 (list_processes_1, Fmake_network_process):
16691 (read_process_output_error_handler, exec_sentinel_error_handler):
16692 Rename or move locals.
16693 (Fmake_network_process): Define label "retry_connect" only if needed.
16694 (Fnetwork_interface_info): Fix pointer signedness.
16695 (process_send_signal): Add cast to avoid pointer signedness problem.
16696 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16697 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16698
16699 Make tparam.h and terminfo.c consistent.
16700 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16701 Include tparam.h instead, since it declares them.
16702 * cm.h (PC): Remove extern decl; tparam.h now does this.
16703 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16704 * terminfo.c: Include tparam.h, to check interfaces.
16705 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16706 (tparam): Adjust signature to match interface in tparam.h;
16707 this removes some undefined behavior. Check that outstring and len
16708 are zero, which they always are with Emacs.
16709 * tparam.h (PC, BC, UP): New extern decls.
16710
16711 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16712 (xftfont_open): Rename locals to avoid shadowing.
16713
16714 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16715 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16716 (OTF_TAG_SYM): Omit macro if not needed.
16717 (ftfont_list): Remove unused local.
16718 (get_adstyle_property, ftfont_pattern_entity):
16719 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16720 Rename locals to avoid shadowing.
16721
16722 * xfont.c (xfont_list_family): Mark var as initialized.
16723
16724 * xml.c (make_dom): Now static.
16725
16726 * composite.c (composition_compute_stop_pos): Rename local to
16727 avoid shadowing.
16728 (composition_reseat_it): Remove unused locals.
16729 (find_automatic_composition, composition_adjust_point): Likewise.
16730 (composition_update_it): Mark var as initialized.
16731 (find_automatic_composition): Mark vars as initialized,
16732 with a FIXME (Bug#8290).
16733
16734 character.h: Rename locals to avoid shadowing.
16735 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16736 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16737 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16738 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16739 to avoid shadowing.
16740
16741 * textprop.c (property_change_between_p): Remove; unused.
16742
16743 * intervals.c (interval_start_pos): Now static.
16744
16745 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16746
16747 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16748 Rename locals to avoid shadowing.
16749
16750 * sound.c (wav_play, au_play, Fplay_sound_internal):
16751 Fix pointer signedness.
16752 (alsa_choose_format): Remove unused local var.
16753 (wav_play): Initialize a variable to 0, to prevent undefined
16754 behavior (Bug#8278).
16755
16756 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16757
16758 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16759
16760 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16761 clobbering (Bug#8298).
16762 * sysdep.c (sys_subshell): Likewise.
16763 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16764
16765 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16766 This should get cleaned up, so that child_setup has the
16767 same signature on all platforms.
16768
16769 * callproc.c (call_process_cleanup): Now static.
16770 (relocate_fd): Rename locals to avoid shadowing.
16771
16772 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16773
16774 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16775 not to be necessary, and produces flickering.
16776
16777 2011-03-20 Glenn Morris <rgm@gnu.org>
16778
16779 * config.in: Remove file.
16780
16781 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16782
16783 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16784 are now in src/globals.h.
16785 (syms_of_minibuf): Remove spurious & from previous change.
16786
16787 2011-03-20 Leo Liu <sdl.web@gmail.com>
16788
16789 * minibuf.c (completing-read-function): New variable.
16790 (completing-read-default): Rename from completing-read.
16791 (completing-read): Call completing-read-function.
16792
16793 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16794
16795 * xfaces.c (Fx_load_color_file):
16796 Read color file from absolute filename (bug#8250).
16797
16798 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16799
16800 * makefile.w32-in: Update dependencies.
16801
16802 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16803
16804 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16805
16806 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16807
16808 Fix more problems found by GCC 4.5.2's static checks.
16809
16810 * process.c (make_serial_process_unwind, send_process_trap):
16811 (sigchld_handler): Now static.
16812
16813 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16814 That way, the code declares only the vars that it needs.
16815 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16816 * s/cygwin.h (PTY_ITERATION): Likewise.
16817 * s/darwin.h (PTY_ITERATION): Likewise.
16818 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16819
16820 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16821 * process.c (allocate_pty): Don't declare stb unless it's needed.
16822
16823 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16824 (CONSTANTLIM): Remove; unused.
16825 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16826 Define only if needed.
16827
16828 * unexelf.c (unexec): Name an expression,
16829 to avoid gcc -Wbad-function-cast warning.
16830 Use a different way to cause a compilation error if anyone uses
16831 n rather than nn, a way that does not involve shadowing.
16832 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16833
16834 * deps.mk (unexalpha.o): Remove; unused.
16835
16836 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16837 * unexec.h: New file.
16838 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16839 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16840 Depend on unexec.h.
16841 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16842 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16843 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16844 Change as necessary to match prototype in unexec.h.
16845
16846 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16847 shadowing.
16848 (back_comment, skip_chars): Mark vars as initialized.
16849
16850 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16851 Rename locals to avoid shadowing.
16852
16853 * lread.c (read1): Rewrite so as not to use empty "else".
16854 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16855
16856 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16857
16858 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16859 warning when compiling print.c.
16860
16861 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16862 instead of using an uninitialized var.
16863 (font_sort_entities): Mark var as initialized.
16864
16865 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16866
16867 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16868 pointers to constants.
16869 (font_parse_fcname): Remove unused vars.
16870 (font_delete_unmatched): Now static.
16871 (font_get_spec): Remove; unused.
16872 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16873 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16874 Rename or move locals to avoid shadowing.
16875
16876 * fns.c (require_nesting_list, require_unwind): Now static.
16877 (Ffillarray): Rename locals to avoid shadowing.
16878
16879 * floatfns.c (domain_error2): Define only if needed.
16880 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16881
16882 * alloc.c (mark_backtrace): Move decl from here ...
16883 * lisp.h: ... to here, so that it can be checked.
16884
16885 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16886 (Fdefvar): Rewrite so as not to use empty "else".
16887 (lisp_indirect_variable): Name an expression,
16888 to avoid gcc -Wbad-function-cast warning.
16889 (Fdefvar): Rename locals to avoid shadowing.
16890
16891 * callint.c (quotify_arg, quotify_args): Now static.
16892 (Fcall_interactively): Rename locals to avoid shadowing.
16893 Use const pointer when appropriate.
16894
16895 * lisp.h (get_system_name, get_operating_system_release):
16896 Move decls here, to check interfaces.
16897 * process.c (get_operating_system_release): Move decl to lisp.h.
16898 * xrdb.c (get_system_name): Likewise.
16899 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16900 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16901 some of which prompt warnings from gcc -Wbad-function-cast.
16902 (Fformat_time_string, Fencode_time, Finsert_char):
16903 (Ftranslate_region_internal, Fformat):
16904 Rename or remove local vars to avoid shadowing.
16905 (Ftranslate_region_internal): Mark var as initialized.
16906
16907 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16908 avoid shadowing.
16909
16910 * lisp.h (eassert): Check that the argument compiles, even if
16911 ENABLE_CHECKING is not defined.
16912
16913 * data.c (Findirect_variable): Name an expression, to avoid
16914 gcc -Wbad-function-cast warning.
16915 (default_value, arithcompare, arith_driver, arith_error): Now static.
16916 (store_symval_forwarding): Rename local to avoid shadowing.
16917 (Fmake_variable_buffer_local, Fmake_local_variable):
16918 Mark variables as initialized.
16919 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16920
16921 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16922 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16923 Rename locals to avoid shadowing.
16924 (mark_stack): Move local variables into the #ifdef region where
16925 they're used.
16926 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16927 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16928 needed otherwise.
16929 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16930 (GC_STRING_CHARS): Remove; not used.
16931 (Fmemory_limit): Cast sbrk's returned value to char *.
16932
16933 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16934 avoids undefined behavior in theory.
16935
16936 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16937
16938 Use functions, not macros, for up- and down-casing (Bug#8254).
16939 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16940 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16941 to use the following functions instead of these macros.
16942 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16943 EMACS_INT, since callers assume the returned value fits in int.
16944 (upcase1): Likewise, for UPCASE_TABLE.
16945 (uppercasep, lowercasep, upcase): New static inline functions.
16946 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16947 the race-condition problem in the old DOWNCASE.
16948
16949 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16950 Rename locals to avoid shadowing.
16951 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16952 (regex_compile, re_search_2, re_match_2_internal):
16953 Remove unused local vars.
16954 (FREE_VAR): Rewrite so as not to use empty "else",
16955 which gcc can warn about.
16956 (regex_compile, re_match_2_internal): Mark locals as initialized.
16957 (RETALLOC_IF): Define only if needed.
16958 (WORDCHAR_P): Likewise. This one is never needed, but is used
16959 only in a comment talking about a compiler bug, so put inside
16960 the #if 0 of that comment.
16961 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16962 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16963 Remove; unused.
16964
16965 * search.c (boyer_moore): Rename locals to avoid shadowing.
16966 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16967 (PREV_CHAR_BOUNDARY): Likewise.
16968
16969 * search.c (simple_search): Remove unused var.
16970
16971 * dired.c (compile_pattern): Move decl from here ...
16972 * lisp.h: ... to here, so that it can be checked.
16973 (struct re_registers): New forward decl.
16974
16975 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16976
16977 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16978 All uses changed.
16979 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16980 Rename locals to avoid shadowing.
16981 (Fvertical_motion): Mark locals as initialized.
16982
16983 * casefiddle.c (casify_object, casify_region): Now static.
16984 (casify_region): Mark local as initialized.
16985
16986 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16987
16988 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16989 New macros, so that the caller can use some names other than
16990 gcpro1, gcpro2, etc.
16991 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16992 of the new macros.
16993 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16994 argument, for consistency with GCPRO2_VAR, etc: it is now the
16995 prefix of the variable, not the variable itself. All uses
16996 changed.
16997 * dired.c (directory_files_internal, file_name_completion):
16998 Rename locals to avoid shadowing.
16999
17000 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17001 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17002 dired.c's scmp function, had undefined behavior.
17003 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17004 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17005 * buffer.h: ... to here, because these macros use current_buffer,
17006 and the new implementation with inline functions needs to have
17007 current_buffer in scope now, rather than later when the macros
17008 are used.
17009 (downcase, upcase1): New static inline functions.
17010 (DOWNCASE, UPCASE1): Reimplement using these functions.
17011 This avoids undefined behavior in expressions like
17012 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17013 from race conditions in accessing the global variables
17014 case_temp1 and case_temp2.
17015 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17016 * lisp.h (case_temp1, case_temp2): Remove their decls.
17017 * character.h (ASCII_CHAR_P): Move from here ...
17018 * lisp.h: ... to here, so that the inline functions mentioned
17019 above can use them.
17020
17021 * dired.c (directory_files_internal_unwind): Now static.
17022
17023 * fileio.c (file_name_as_directory, directory_file_name):
17024 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17025 Now static.
17026 (file_name_as_directory): Use const pointers when appropriate.
17027 (Fexpand_file_name): Likewise. In particular, newdir might
17028 point at constant storage, so make it a const pointer.
17029 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17030 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17031 signedness issues.
17032 (Fset_file_times, Finsert_file_contents, auto_save_error):
17033 Rename locals to avoid shadowing.
17034
17035 * minibuf.c (choose_minibuf_frame_1): Now static.
17036 (Ftry_completion, Fall_completions): Rename or remove locals
17037 to avoid shadowing.
17038
17039 * marker.c (bytepos_to_charpos): Remove; unused.
17040
17041 * lisp.h (verify_bytepos, count_markers): New decls,
17042 so that gcc does not warn that these functions aren't declared.
17043
17044 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17045 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17046 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17047 (copy_text): Remove unused local var.
17048
17049 * filelock.c (within_one_second): Now static.
17050 (lock_file_1): Rename local to avoid shadowing.
17051
17052 * buffer.c (fix_overlays_before): Mark locals as initialized.
17053 (fix_start_end_in_overlays): Likewise. This function should be
17054 simplified by using pointers-to-pointers, but that's a different
17055 matter.
17056 (switch_to_buffer_1): Now static.
17057 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17058 (report_overlay_modification): Rename locals to avoid shadowing.
17059
17060 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17061 Fix pointer signedness issue.
17062 (sys_subshell): Mark local as volatile if checking for lint,
17063 to suppress a gcc -Wclobbered warning that does not seem to be right.
17064 (MAXPATHLEN): Define only if needed.
17065
17066 * process.c (serial_open, serial_configure): Move decls from here ...
17067 * systty.h: ... to here, so that they can be checked.
17068
17069 * fns.c (get_random, seed_random): Move extern decls from here ...
17070 * lisp.h: ... to here, so that they can be checked.
17071
17072 * sysdep.c (reset_io): Now static.
17073 (wait_for_termination_signal): Remove; unused.
17074
17075 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17076 (copy_keymap_item, append_key, push_text_char_description):
17077 Now static.
17078 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17079 (DENSE_TABLE_SIZE): Remove; unused.
17080 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17081 (describe_map_tree):
17082 Rename locals to avoid shadowing.
17083
17084 * keyboard.c: Declare functions static if they are not used elsewhere.
17085 (echo_char, echo_dash, cmd_error, top_level_2):
17086 (poll_for_input, handle_async_input): Now static.
17087 (read_char, kbd_buffer_get_event, make_lispy_position):
17088 (make_lispy_event, make_lispy_movement, apply_modifiers):
17089 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17090 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17091 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17092 (read_key_sequence, read_char): Mark locals as initialized.
17093 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17094
17095 * keyboard.h (make_ctrl_char): New decl.
17096 (mark_kboards): Move decl here ...
17097 * alloc.c (mark_kboards): ... from here.
17098
17099 * lisp.h (force_auto_save_soon): New decl.
17100
17101 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17102 (DEFINE_DUMMY_FUNCTION): New macro.
17103 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17104 Use it.
17105 (main): Add casts to avoid warnings
17106 if GCC considers string literals to be constants.
17107
17108 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17109
17110 * dbusbind.c: Pointer signedness fixes.
17111 (xd_signature, xd_append_arg, xd_initialize):
17112 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17113 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17114 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17115 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17116
17117 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17118 if GCC considers string literals to be constants.
17119 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17120
17121 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17122
17123 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17124 (print_preprocess, print_object): New macro to fix last change.
17125
17126 * print.c (print_preprocess): Don't forget font objects.
17127
17128 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17129
17130 * emacs.c (USAGE3): Doc fixes.
17131
17132 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17133
17134 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17135 structure.
17136
17137 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17138
17139 * lisp.h (VWindow_system, Qfile_name_history):
17140 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17141 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17142 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17143
17144 * w32select.c: Don't #include "keyboard.h".
17145 (run_protected): Add extern declaration for waiting_for_input.
17146
17147 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17148 * w32console.c (detect_input_pending, read_input_pending)
17149 (encode_terminal_code):
17150 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17151 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17152 (w32_system_caret_y, Qfile_name_history):
17153 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17154 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17155 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17156 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17157 * w32proc.c (Qlocal, report_file_error):
17158 * w32term.c (Vwindow_system, updating_frame):
17159 * w32uniscribe.c (initialized, uniscribe_font_driver):
17160 Remove unneeded extern declarations.
17161
17162 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17163
17164 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17165
17166 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17167
17168 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17169 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17170 These macros can no longer be used for assignment.
17171
17172 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17173 Assign struct members directly, instead of using BUF_BEGV etc.
17174 (record_buffer_markers, fetch_buffer_markers): New functions for
17175 recording and fetching special buffer markers.
17176 (set_buffer_internal_1, set_buffer_temp): Use them.
17177
17178 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17179
17180 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17181
17182 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17183 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17184
17185 * xdisp.c (hscroll_window_tree):
17186 (reconsider_clip_changes): Use PT instead of BUF_PT.
17187
17188 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17189
17190 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17191 $(EMACS_ROOT)/lib/intprops.h.
17192
17193 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17194
17195 Fix more problems found by GCC 4.5.2's static checks.
17196
17197 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17198 to unsigned char * to avoid compiler diagnostic.
17199 (xg_free_frame_widgets): Make it clear that a local variable is
17200 needed only if USE_GTK_TOOLTIP.
17201 (gdk_window_get_screen): Make it clear that this macro is needed
17202 only if USE_GTK_TOOLTIP.
17203 (int_gtk_range_get_value): New function, which avoids a diagnostic
17204 from gcc -Wbad-function-cast.
17205 (xg_set_toolkit_scroll_bar_thumb): Use it.
17206 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17207 diagnostic from gcc -Wbad-function-cast.
17208 (get_utf8_string, xg_get_file_with_chooser):
17209 Rename locals to avoid shadowing.
17210 (create_dialog): Move locals to avoid shadowing.
17211
17212 * xgselect.c (xg_select): Remove unused var.
17213
17214 * image.c (four_corners_best): Mark locals as initialized.
17215 (gif_load): Initialize transparent_p to zero (Bug#8238).
17216 Mark another local as initialized.
17217 (my_png_error, my_error_exit): Mark with NO_RETURN.
17218
17219 * image.c (clear_image_cache): Now static.
17220 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17221 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17222 (x_edge_detection): Remove unnecessary cast that
17223 gcc -Wbad-function-cast diagnoses.
17224 (gif_load): Fix pointer signedness.
17225 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17226 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17227
17228 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17229
17230 Improve quality of tests for time stamp overflow.
17231 For example, without this patch (encode-time 0 0 0 1 1
17232 1152921504606846976) returns the obviously-bogus value (-948597
17233 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17234 reports time overflow. See
17235 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17236 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17237 * editfns.c: Include limits.h and intprops.h.
17238 (TIME_T_MIN, TIME_T_MAX): New macros.
17239 (time_overflow): Move earlier, to before first use.
17240 (hi_time, lo_time): New functions, for an accurate test for
17241 out-of-range times.
17242 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17243 (Fget_internal_run_time): Don't assume time_t fits in int.
17244 (make_time): Use list2 instead of Fcons twice.
17245 (Fdecode_time): More accurate test for out-of-range times.
17246 (check_tm_member): New function.
17247 (Fencode_time): Use it, to test for out-of-range times.
17248 (lisp_time_argument): Don't rely on undefined left-shift and
17249 right-shift behavior when checking for time stamp overflow.
17250
17251 * editfns.c (time_overflow): New function, refactoring common code.
17252 (Fformat_time_string, Fdecode_time, Fencode_time):
17253 (Fcurrent_time_string): Use it.
17254
17255 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17256 * dired.c (make_time): Move to ...
17257 * editfns.c (make_time): ... here.
17258 * systime.h: Note the move.
17259
17260 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17261
17262 * fringe.c (update_window_fringes): Remove unused variables.
17263
17264 * unexmacosx.c (copy_data_segment): Also copy __got section.
17265 (Bug#8223)
17266
17267 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17268
17269 * termcap.c [MSDOS]: Include "msdos.h".
17270 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17271 Constify `char *' arguments and their references according to
17272 prototypes in tparam.h.
17273
17274 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17275
17276 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17277 Adapt all references accordingly.
17278
17279 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17280
17281 2011-03-11 Tom Tromey <tromey@redhat.com>
17282
17283 * buffer.c (syms_of_buffer): Remove obsolete comment.
17284
17285 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17286
17287 * termhooks.h (encode_terminal_code): Declare prototype.
17288
17289 * msdos.c (encode_terminal_code): Don't declare prototype.
17290
17291 * term.c (encode_terminal_code): Now external again, used by
17292 w32console.c and msdos.c.
17293
17294 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17295 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17296
17297 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17298
17299 Fix some minor problems found by GCC 4.5.2's static checks.
17300
17301 * fringe.c (update_window_fringes): Mark locals as initialized
17302 (Bug#8227).
17303 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17304
17305 * alloc.c (mark_fringe_data): Move decl from here ...
17306 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17307 to check its interface.
17308 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17309
17310 * fontset.c (free_realized_fontset): Now static.
17311 (Fset_fontset_font): Rename local to avoid shadowing.
17312 (fontset_font): Mark local as initialized.
17313 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17314
17315 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17316
17317 * xselect.c (x_disown_buffer_selections): Remove; not used.
17318 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17319 (x_own_selection, Fx_disown_selection_internal): Rename locals
17320 to avoid shadowing.
17321 (x_handle_dnd_message): Remove local to avoid shadowing.
17322
17323 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17324 so that the caller can use some name other than gcpro1.
17325 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17326 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17327 (Fx_backspace_delete_keys_p):
17328 Use them to avoid shadowing, and rename vars to avoid shadowing.
17329 (x_decode_color, x_set_name, x_window): Now static.
17330 (Fx_create_frame): Add braces to silence GCC warning.
17331 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17332 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17333 Remove unused locals.
17334 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17335 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17336 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17337 macros.
17338
17339 * xterm.h (x_mouse_leave): New decl.
17340
17341 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17342 Remove unused functions.
17343 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17344 (x_calc_absolute_position): Now static.
17345 (XTread_socket): Don't define label "out" unless it's used.
17346 Don't declare local "event" unless it's used.
17347 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17348 unless they are used.
17349 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17350 (x_fatal_error_signal): Remove; not used.
17351 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17352 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17353 (x_error_catcher, x_connection_closed, x_error_handler):
17354 (x_error_quitter, xembed_send_message, x_iconify_frame):
17355 (my_log_handler): Rename locals to avoid shadowing.
17356 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17357 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17358
17359 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17360 Rename or move locals to avoid shadowing.
17361 (tty_defined_color, merge_face_heights): Now static.
17362 (free_realized_faces_for_fontset): Remove; not used.
17363 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17364 does not deduce is never used uninitialized.
17365 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17366 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17367
17368 * terminal.c (store_terminal_param): Now static.
17369
17370 * xmenu.c (menu_highlight_callback): Now static.
17371 (set_frame_menubar): Remove unused local.
17372 (xmenu_show): Rename parameter to avoid shadowing.
17373 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17374 since they might point to immutable storage.
17375 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17376 since it's unused otherwise.
17377
17378 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17379 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17380 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17381 avoids a gcc -Wuninitialized diagnostic.
17382 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17383 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17384 does not deduce are never used uninitialized.
17385
17386 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17387
17388 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17389 * window.c (window_loop, size_window):
17390 (run_window_configuration_change_hook, enlarge_window): Likewise.
17391
17392 * window.c (display_buffer): Now static.
17393 (size_window): Mark variables that gcc -Wuninitialized
17394 does not deduce are never used uninitialized.
17395 * window.h (check_all_windows): New decl, to forestall
17396 gcc -Wmissing-prototypes diagnostic.
17397 * dispextern.h (bidi_dump_cached_states): Likewise.
17398
17399 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17400 shadowing.
17401 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17402 Include <limits.h>.
17403 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17404 and to avoid gcc -Wuninitialized warning.
17405 (load_charset_map): Mark variables that gcc -Wuninitialized
17406 does not deduce are never used uninitialized.
17407 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17408
17409 * coding.c (coding_set_source, coding_set_destination):
17410 Use "else { /* comment */ }" rather than "else /* comment */;"
17411 for clarity, and to avoid gcc -Wempty-body warning.
17412 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17413 a block, when the outer 'i' will do.
17414 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17415 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17416 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17417 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17418 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17419 Rename locals to avoid shadowing.
17420 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17421 * coding.c (emacs_mule_char, encode_invocation_designation):
17422 Now static, since they're not used elsewhere.
17423 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17424 (decode_coding_object, encode_coding_object, detect_coding_system):
17425 (decode_coding_emacs_mule): Mark variables that gcc
17426 -Wuninitialized does not deduce are never used uninitialized.
17427 (detect_coding_iso_2022): Initialize a local variable that might
17428 be used uninitialized. Leave a FIXME because it's not clear that
17429 this initialization is needed. (Bug#8211)
17430 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17431 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17432 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17433 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17434 Remove unused macros.
17435
17436 * category.c (hash_get_category_set): Remove unused local var.
17437 (copy_category_table): Now static, since it's not used elsewhere.
17438 * character.c (string_count_byte8): Likewise.
17439
17440 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17441 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17442
17443 * chartab.c (copy_sub_char_table): Now static, since it's not used
17444 elsewhere.
17445 (sub_char_table_ref_and_range, char_table_ref_and_range):
17446 Rename locals to avoid shadowing.
17447 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17448
17449 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17450 (BIDI_BOB): Remove unused macro.
17451
17452 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17453 deduce are never used uninitialized.
17454 * term.c (encode_terminal_code): Likewise.
17455
17456 * term.c (encode_terminal_code): Now static. Remove unused local.
17457
17458 * tparam.h: New file.
17459 * term.c, tparam.h: Include it.
17460 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17461 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17462 Move these decls to tparam.h, and make them agree with what
17463 is actually in tparam.c. The previous trick of using incompatible
17464 decls in different modules does not conform to the C standard.
17465 All callers of tparam changed to use tparam's actual API.
17466 * tparam.c (tparam1, tparam, tgoto):
17467 Use const pointers where appropriate.
17468
17469 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17470 * cm.h (struct cm): Likewise.
17471 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17472 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17473 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17474 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17475 (turn_on_face, init_tty): Likewise.
17476 * termchar.h (struct tty_display_info): Likewise.
17477
17478 * term.c (term_mouse_position): Rename local to avoid shadowing.
17479
17480 * alloc.c (mark_ttys): Move decl from here ...
17481 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17482
17483 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17484
17485 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17486
17487 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17488
17489 * search.c (compile_pattern_1): Remove argument regp, unused since
17490 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17491 (compile_pattern): Don't pass it.
17492
17493 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17494
17495 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17496 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17497 for ! HAVE_GTK3.
17498 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17499
17500 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17501
17502 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17503 gdk_window_get_screen, gdk_window_get_geometry,
17504 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17505 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17506 (xg_get_pixbuf_from_pixmap): New function.
17507 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17508 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17509 Call xg_get_pixbuf_from_pixmap instead of
17510 gdk_pixbuf_get_from_drawable.
17511 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17512 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17513 (xg_check_special_colors): Use GtkStyleContext and its functions
17514 for HAVE_GTK3.
17515 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17516 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17517 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17518 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17519 Call gtk_widget_get_preferred_size.
17520 (xg_frame_resized): gdk_window_get_geometry only takes 5
17521 parameters.
17522 (xg_win_to_widget, xg_event_is_for_menubar):
17523 Call gdk_x11_window_lookup_for_display.
17524 (xg_set_widget_bg): New function.
17525 (delete_cb): New function.
17526 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17527 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17528 (xg_set_background_color): Call xg_set_widget_bg.
17529 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17530 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17531 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17532 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17533 if ! HAVE_GTK3.
17534 (update_frame_tool_bar): Call gtk_widget_hide.
17535 (xg_initialize): Use GDK_KEY_g.
17536
17537 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17538 if ! HAVE_GTK3
17539 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17540
17541 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17542 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17543 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17544
17545 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17546
17547 * w32xfns.c (select_palette): Check success of RealizePalette against
17548 GDI_ERROR, not zero.
17549
17550 See ChangeLog.11 for earlier changes.
17551
17552 ;; Local Variables:
17553 ;; coding: utf-8
17554 ;; End:
17555
17556 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17557
17558 This file is part of GNU Emacs.
17559
17560 GNU Emacs is free software: you can redistribute it and/or modify
17561 it under the terms of the GNU General Public License as published by
17562 the Free Software Foundation, either version 3 of the License, or
17563 (at your option) any later version.
17564
17565 GNU Emacs is distributed in the hope that it will be useful,
17566 but WITHOUT ANY WARRANTY; without even the implied warranty of
17567 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17568 GNU General Public License for more details.
17569
17570 You should have received a copy of the GNU General Public License
17571 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.