]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Fix bugs #12447 and #12326 with infloop causes by idle timers, update docs.
[gnu-emacs] / src / ChangeLog
1 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2
3 * keyboard.c (timer_check_2): Move calculation of 'timers' and
4 'idle_timers' from here ...
5 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6 lists, to avoid infloops when the timer does something stupid,
7 like reinvoke itself with the same or smaller time-out.
8 (Bug#12447)
9
10 2012-09-22 Martin Rudalics <rudalics@gmx.at>
11
12 * window.c (Fsplit_window_internal): Handle only Qt value of
13 Vwindow_combination_limit separately.
14 (Qtemp_buffer_resize): New symbol.
15 (Vwindow_combination_limit): New default value. Rewrite
16 doc-string.
17
18 2012-09-22 Eli Zaretskii <eliz@gnu.org>
19
20 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
21 the new overlay string. (Bug#10159)
22
23 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
24
25 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
26 or that fprintf is async-signal-safe. POSIX doesn't require
27 either assumption.
28
29 2012-09-22 Chong Yidong <cyd@gnu.org>
30
31 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
32 (Bug#8207).
33
34 2012-09-22 Kenichi Handa <handa@gnu.org>
35
36 * composite.c (composition_reseat_it): Handle the case that a
37 grapheme cluster is not covered by a single font (Bug#12352).
38
39 2012-09-21 Chong Yidong <cyd@gnu.org>
40
41 * image.c (define_image_type): Avoid adding duplicate types to
42 image_types (Bug#12463). Suggested by Jörg Walter.
43
44 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
45
46 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
47 (print_load_command_name): Add case LC_DATA_IN_CODE.
48 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
49
50 2012-09-21 Glenn Morris <rgm@gnu.org>
51
52 * eval.c (Frun_hook_with_args_until_success)
53 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
54
55 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
56
57 * fileio.c (Ffile_selinux_context): Only call freecon when
58 lgetfilecon succeeded.
59 (Fset_file_selinux_context): Likewise. (Bug#12444)
60
61 2012-09-21 Eli Zaretskii <eliz@gnu.org>
62
63 * xdisp.c (try_window_reusing_current_matrix): Under bidi
64 reordering, locate the cursor by calling set_cursor_from_row; if
65 that fails, clear the desired glyph matrix before returning a
66 failure indication to the caller. Fixes leaving garbled display
67 when fast scrolling with a down-key. (Bug#12403)
68 (compute_stop_pos_backwards): Fix a typo that caused crashes while
69 scrolling through multibyte text.
70
71 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
72
73 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
74 calling mark_vectorlike since that's the one that marks the window.
75 (mark_discard_killed_buffers): Mark the final cdr.
76 * window.h (struct window): Move prev/next_buffers to the
77 non-standard fields.
78 * window.c (make_window): Initialize prev/next_buffers manually.
79
80 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
81
82 Omit unused arg EXPECTED from socket hooks.
83 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
84 * nsterm.m (ns_term_init):
85 * termhooks.h (struct terminal.read_socket_hook):
86 * w32inevt.c (w32_console_read_socket):
87 * w32term.c (w32_read_socket):
88 * xterm.c (XTread_socket):
89 Omit unused arg EXPECTED. All callers changed.
90 (store_user_signal_events): Return void, not int, since callers no
91 longer care about the return value. All uses changed.
92
93 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
94
95 * w32gui.h (XParseGeometry): Do not declare.
96
97 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
98
99 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
100 Ignore 'expected'. See Eli Zaretskii in
101 <http://bugs.gnu.org/12471#8> (last line).
102
103 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
104 (XParseGeometry): Now static. Substitute extremal values for
105 values that are out of range.
106
107 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
108
109 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
110
111 * nsfns.m (XParseGeometry): Remove.
112 (Fx_create_frame): Call x_set_offset to correctly interpret
113 top_pos in geometry.
114
115 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
116 (Fx_parse_geometry): If there is a space in string, call
117 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
118
119 2012-09-17 Eli Zaretskii <eliz@gnu.org>
120
121 * search.c (scan_buffer): Use character positions in calls to
122 region_cache_forward and region_cache_backward, not byte
123 positions. (Bug#12196)
124
125 * w32term.c (w32_read_socket): Set pending_signals to 1, like
126 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
127
128 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
129 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
130 emacs_blocked_malloc, now deleted.
131
132 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
133
134 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
135 The workaround was for improving performance on Solaris 2.4, but
136 is getting in the way now. Emacs will still work if someone is
137 still running Solaris 2.4 in a museum somewhere; Sun dropped
138 support for Solaris 2.4 in 2003.
139 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
140 * process.c (create_process) [HAVE_WORKING_VFORK]:
141 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
142 since Emacs no longer uses vfork on that platform.
143
144 2012-09-17 Glenn Morris <rgm@gnu.org>
145
146 * emacs.c: Use COPYRIGHT.
147
148 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
149
150 Remove configure's --without-sync-input option (Bug#12450).
151 When auditing signal-handling in preparation for cleaning it up,
152 I found that SYNC_INPUT has race conditions and would be a real
153 pain to fix. Since it's an undocumented and deprecated
154 configure-time option, now seems like a good time to remove it.
155 Also see <http://bugs.gnu.org/11080#16>.
156 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
157 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
158 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
159 (malloc_hysteresis):
160 (check_depth) [XMALLOC_OVERRUN_CHECK]:
161 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
162 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
163 (dont_register_blocks, bytes_used_when_reconsidered)
164 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
165 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
166 [!SYSTEM_MALLOC && !SYNC_INPUT]:
167 Remove. All uses removed.
168 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
169 implementation, one that depends on whether the new macro
170 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
171 is defined.
172 * atimer.c (run_timers, handle_alarm_signal):
173 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
174 (handle_async_input, process_pending_signals)
175 (handle_input_available_signal, init_keyboard):
176 * nsterm.m (ns_read_socket):
177 * process.c (wait_reading_process_output):
178 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
179 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
180 (emacs_write):
181 * xterm.c (XTread_socket):
182 Assume SYNC_INPUT.
183 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
184 * eval.c (handling_signal): Remove. All uses removed.
185 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
186 All uses replaced with the SYNC_INPUT version.
187 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
188 Remove decls.
189 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
190 Now static.
191
192 * font.c (Ffont_shape_gstring): Remove unused local.
193
194 2012-09-16 Glenn Morris <rgm@gnu.org>
195
196 * Makefile.in (clean): No longer run nextstep's clean.
197
198 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
199 (ns_frag): Remove.
200 (ns-app): Move here from ns.mk, and simplify.
201 (clean): Simplify nextstep entry.
202 * ns.mk: Remove file.
203
204 2012-09-17 Kenichi Handa <handa@gnu.org>
205
206 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
207 not covert the last few charactes.
208
209 2012-09-16 Kenichi Handa <handa@gnu.org>
210
211 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
212 here, but just check the validity of glyphs in the glyph-string.
213
214 2012-09-16 Martin Rudalics <rudalics@gmx.at>
215
216 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
217 any window as argument (Bug#12452).
218
219 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
220
221 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
222 to ns_term_init to avoid memory leak.
223
224 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
225 explicit retain/release.
226 (ns_term_init): Only allow one display. Initialize outerpool and
227 ns_*_types.
228
229 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
230
231 Port _setjmp fix to POSIXish hosts as well as Microsoft.
232 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
233 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
234 the Microsoft problem in a different way, by altering ../nt/config.nt.
235
236 2012-09-15 Eli Zaretskii <eliz@gnu.org>
237
238 * w32xfns.c:
239 * w32uniscribe.c:
240 * w32term.c:
241 * w32select.c:
242 * w32reg.c:
243 * w32proc.c:
244 * w32menu.c:
245 * w32inevt.c:
246 * w32heap.c:
247 * w32font.c:
248 * w32fns.c:
249 * w32console.c:
250 * w32.c:
251 * w16select.c: Remove inclusion of setjmp.h, as it is now included
252 by lisp.h. This completes removal of setjmp.h inclusion
253 erroneously announced in the previous commit. (Bug#12446)
254
255 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
256 more accurate.
257
258 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
259 not defined as a macro. The latter happens on MS-Windows.
260 (Bug#12446)
261
262 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
263
264 Port better to POSIX hosts lacking _setjmp (Bug#12446).
265 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
266 Some instances of '#include <setjmp.h>' removed, if the
267 only reason for the instance was because "lisp.h" was included.
268 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
269 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
270 and _longjmp with the new symbols. Emacs already uses _setjmp if
271 available, so this change affects only POSIXish hosts that have
272 sigsetjmp but not _setjmp, such as some versions of Solaris and
273 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
274 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
275 (png_load_body) [HAVE_PNG]:
276 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
277 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
278 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
279 since PNG requires jmp_buf. This is the only exception to the
280 general rule that we now use sys_setjmp and sys_longjmp.
281 This exception is OK since this code does not change the signal
282 mask or longjmp out of a signal handler.
283
284 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
285
286 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
287 Include "syssignal.h", for 'main_thread'.
288
289 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
290
291 Avoid out-of-range marker position (Bug#12426).
292 * insdel.c (replace_range, replace_range_2): Adjust
293 markers before overlays, as suggested by comments.
294 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
295 Remove redundant check before calling offset_intervals.
296
297 2012-09-14 Martin Rudalics <rudalics@gmx.at>
298
299 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
300 current buffer (Bug#12387).
301
302 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
303
304 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
305
306 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
307
308 Use a more backwards-compatible timer format (Bug#12430).
309 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
310 vector element, not from the 4th, since PSECS is now at the end.
311 (Fcurrent_idle_time): Doc fix.
312
313 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
314
315 Function to mark objects and remove killed buffers at once.
316 * alloc.c (discard_killed_buffers): Rename to ...
317 (mark_discard_killed buffers) ... new name. Add marking
318 of remaining objects. Fix comment. Adjust users.
319 (mark_object): Do not touch frame buffer lists here.
320 * frame.c (delete_frame): Reset frame buffer lists here.
321
322 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
323
324 Better workaround for GNOME bug when --enable-gcc-warnings.
325 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
326 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
327 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
328
329 Simplify SIGIO usage (Bug#12408).
330 The code that dealt with SIGIO was crufty and confusing, e.g., it
331 played tricks like "#undef SIGIO" but these tricks were not used
332 consistently. Simplify mostly by not #undeffing standard symbols,
333 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
334 or not as we please) rather than "defined SIGIO" (standard symbol
335 that we probably shouldn't #undef).
336 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
337 Modules that need it can include it.
338 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
339 * dispextern.h (ignore_sigio): New decl.
340 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
341 unconditionally, since it's now a no-op if !USABLE_SIGIO.
342 * emacs.c (shut_down_emacs):
343 * keyboard.c (kbd_buffer_store_event_hold):
344 Use ignore_sigio rather than invoking 'signal' directly.
345 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
346 for FIONREAD.
347 (FIONREAD, SIGIO): Do not #undef.
348 (tty_read_avail_input): Use #error rather than a syntax error.
349 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
350 for I_PIPE, used by SETUP_SLAVE_PTY.
351 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
352 * sysdep.c (croak): Remove; no longer needed. This bit of
353 temporary code, with Fred N. Fish's comment that it's temporary,
354 has been in Emacs since at least 1992!
355 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
356 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
357 * syssignal.h (croak): Remove decl.
358 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
359 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
360 now that we're termios-only.
361 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
362 * term.c (dissociate_if_controlling_tty): Use #error rather than
363 a run-time error.
364
365 Work around GCC and GNOME bugs when --enable-gcc-warnings.
366 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
367 to work around GNOME bug 683906.
368 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
369 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
370 This works around GCC bug 54561.
371
372 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
373
374 More fixes for 'volatile' and setjmp/longjmp.
375 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
376 * image.c (struct png_load_context) [HAVE_PNG]: New type.
377 (png_load_body) [HAVE_PNG]:
378 (jpeg_load_body) [HAVE_JPEG]:
379 New function, with most of the old parent function's body.
380 (png_load) [HAVE_PNG]:
381 (jpeg_load) [HAVE_JPEG]:
382 Invoke the new function, to avoid longjmp munging our locals.
383 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
384 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
385 longjmp is passed 2, as the C standard doesn't guarantee this.
386 Instead, store the failure code into mgr->failure_code.
387
388 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
389
390 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
391 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
392 (syms_of_keyboard): Remove support for unread-command-char.
393
394 2012-09-12 Eli Zaretskii <eliz@gnu.org>
395
396 * w32proc.c (sys_kill): If PID is our process ID and the signal is
397 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
398 violation. (Bug#12426)
399
400 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
401
402 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
403
404 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
405
406 * eval.c: Add `inhibit-debugger'.
407 (Qinhibit_debugger): New symbol.
408 (call_debugger): Bind it instead of Qdebug_on_error.
409 (maybe_call_debugger): Test Vinhibit_debugger.
410 (syms_of_eval): Define inhibit-debugger.
411 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
412 (syms_of_xdisp): Remove inhibit-debug-on-message.
413
414 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
415
416 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
417 If a nonvolatile local variable is written before a _longjmp to
418 the frame containing the variable, and is read after the _longjmp,
419 the value read is indeterminate. Some local variables of type
420 'struct handler' and 'struct catchtag' are used in this way, so
421 mark each of their slots as volatile if the slot can be set before
422 _longjmp and read afterwards.
423 * lisp.h (struct handler): var and chosen_clause are now volatile.
424 (struct catchtag): val, next, and pdlcount are now volatile.
425
426 * bidi.c (bidi_push_it, bidi_pop_it):
427 * fns.c (copy_hash_table):
428 * image.c (define_image_type):
429 * keyboard.c (kbd_buffer_store_event_hold):
430 * process.c (Fprocess_send_eof):
431 * xfaces.c (x_create_gc) [HAVE_NS]:
432 * xgselect.c (xg_select):
433 Prefer assignment to memcpy when either will do.
434
435 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
436 Use pointer-to-a-pointer to simplify and avoid a NILP check each
437 time an item is removed. No need to mark this function 'inline';
438 the compiler knows better than we do.
439
440 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
441
442 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
443 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
444 to change_frame_size (Bug#12388).
445 (windowDidResize:): Pass YES to updateFrameSize.
446
447 * nsterm.h: Add delay parameter to updateFrameSize.
448
449 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
450
451 Discard killed buffers from deleted window and frame objects.
452 This reduces an amount of references to killed buffers and
453 helps GC to reclaim them faster.
454 * alloc.c (discard_killed_buffers): New function.
455 (mark_object): Use it for deleted windows and frames.
456 (mark_object): If symbol's value is set up for a killed buffer
457 or deleted frame, restore it's global binding.
458 * data.c (swap_in_global_binding): Add GC notice.
459 (swap_in_symval_forwarding): Use convenient set_blv_where.
460 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
461 * window.h: ... to here.
462
463 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
464
465 Convenient macro to check whether the buffer is live.
466 * buffer.h (BUFFER_LIVE_P): New macro.
467 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
468 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
469
470 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
471
472 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
473 composition cases (Bug#12364).
474
475 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
476 overhang of succeeding glyphs overlapping box cursor.
477
478 * w32term.c (x_draw_glyph_string): Likewise.
479
480 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
481
482 Simplify, document, and port floating-point (Bug#12381).
483 The porting part of this patch fixes bugs on non-IEEE platforms
484 with frexp, ldexp, logb.
485 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
486 Now static.
487 * floatfns.c: Simplify discussion of functions that Emacs doesn't
488 support, by removing commented-out code and briefly listing the
489 C89 functions excluded. The commented-out stuff was confusing
490 maintenance, e.g., we thought we needed cbrt but it was commented out.
491 (logb): Remove decl; no longer needed.
492 (isfinite): New macro, if not already supplied.
493 (isnan): Don't replace any existing macro.
494 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
495 are present on all C89 platforms.
496 (Ffrexp): Do not special-case zero, as frexp does the right thing
497 for that case.
498 (Flogb): Do not use logb, as it doesn't have the desired meaning
499 on hosts that use non-base-2 floating point. Instead, stick with
500 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
501 frexp, to avoid getting an unspecified result.
502
503 * xdisp.c (Qinhibit_debug_on_message): Now static.
504
505 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
506
507 * nsterm.m (ns_update_begin): Set clip path to whole view by using
508 NSBezierPath (Bug#12131).
509
510 2012-09-10 Chong Yidong <cyd@gnu.org>
511
512 * fns.c (Fdelq, Fdelete): Doc fix.
513
514 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
515
516 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
517 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
518
519 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
520
521 * lisp.h (make_lisp_ptr): New macro to replace XSET.
522 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
523 Use it.
524
525 2012-09-09 Eli Zaretskii <eliz@gnu.org>
526
527 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
528 left fringe if the window has a left margin. This avoids leaving
529 traces of the cursor because its leftmost pixel is not drawn over.
530
531 * dispnew.c (update_window_line): When the left margin area of a
532 screen line is updated, set the redraw_fringe_bitmaps_p flag of
533 that screen line. (Bug#12277)
534
535 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
536
537 Assume C89 or later for math functions (Bug#12381).
538 This simplifies the code, and makes it a bit smaller and faster,
539 and (most important) makes it easier to clean up signal handling
540 since we can stop worring about floating-point exceptions in
541 library code. That was a problem before C89, but the problem
542 went away many years ago on all practical Emacs targets.
543 * data.c, image.c, lread.c, print.c:
544 Don't include <math.h>; no longer needed.
545 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
546 might be autoconfigured, as that never happens.
547 * data.c (fmod):
548 * doprnt.c (DBL_MAX_10_EXP):
549 * print.c (DBL_DIG):
550 Remove. C89 or later always defines these.
551 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
552 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
553 (arith_error, domain_error, domain_error2):
554 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
555 no longer needed -- we simply return what C returns. All uses removed.
556 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
557 the wrapped code.
558 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
559 Remove. All uses expanded, as these macros are no longer used
560 more than once and are now more trouble than they're worth.
561 (Ftan): Use tan, not sin / cos.
562 (Flogb): Assume C89 frexp.
563 (fmod_float): Assume C89 fmod.
564 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
565 (init_floatfns): Remove. All uses removed.
566
567 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
568
569 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
570 compositeToPoint for OSX < 10.6 (Bug#12390).
571
572 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
573
574 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
575 This produces more-accurate results.
576
577 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
578
579 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
580 changes (Bug#12088).
581
582 2012-09-08 Chong Yidong <cyd@gnu.org>
583
584 * syntax.c (Fstring_to_syntax): Doc fix.
585
586 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
587
588 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
589 in the internal border.
590 (x_set_window_size): Remove static variables and their usage.
591 (ns_redraw_scroll_bars): Fix NSTRACE arg.
592 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
593 fringe/internal border adjustment (Bug#11052).
594 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
595 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
596 (ns_fix_rect_ibw): Remove.
597 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
598 (ns_dumpglyphs_box_or_relief): Ditto.
599 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
600 adjustment.
601 (ns_dumpglyphs_image): Ditto.
602 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
603 border adjustment.
604 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
605 their usage. Add fringe_extended_p and its use as in other terms.
606 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
607 scroll bar was removed.
608 (updateFrameSize): New function.
609 (windowDidResize): Move code to updateFrameSize and call it.
610
611 * nsterm.h (EmacsView): Add updateFrameSize.
612
613 2012-09-07 Chong Yidong <cyd@gnu.org>
614
615 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
616
617 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
618
619 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
620
621 More signal-handler cleanup (Bug#12327).
622 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
623 Problem introduced when merging patches. Noted by Eli Zaretskii in
624 <http://bugs.gnu.org/12327#67>.
625 * floatfns.c: Comment fix.
626 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
627 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
628 and anyway the declaration is harmless even if SIGDANGER is not defined.
629 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
630 defined BROKEN_FIONREAD). systty.h formerly did this, but other
631 source files not surprisingly expected syssignal.h to define, or
632 not define, SIGIO, and it's cleaner to do it that way, for consistency.
633 Include <sys/ioctl.h>, for FIONREAD.
634 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
635 This eliminates a problem whereby other files mysteriously had
636 to include "syssignal.h" before including "systty.h" if they
637 wanted to use "#ifdef SIGIO".
638
639 2012-09-07 Eli Zaretskii <eliz@gnu.org>
640
641 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
642
643 * w32.c (sigemptyset): Empty the set.
644 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
645
646 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
647
648 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
649
650 * alloc.c (mark_buffer): Revert unsafe marking optimization.
651 (mark_object): Likewise for frame objects.
652
653 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
654
655 * syssignal.h (handle_on_main_thread): Always declare,
656 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
657 This ports to platforms without HAVE_PTHREAD.
658
659 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
660
661 Signal-handler cleanup (Bug#12327).
662 Emacs's signal handlers were written in the old 4.2BSD style with
663 sigblock and sigmask and so forth, and this led to some
664 inefficiencies and confusion. Rewrite these to use
665 pthread_sigmask etc. without copying signal sets around. Also,
666 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
667 'signal', and instead use functions that do not attempt to take
668 over the system name space. This patch causes Emacs's text
669 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
670 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
671 Do not include <signal.h> or "syssignal.h", as these
672 modules do not use signals.
673 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
674 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
675 Do not include <signal.h>, as "syssignal.h" does that for us now.
676 * atimer.c (sigmask_atimers): New function.
677 (block_atimers, unblock_atimers): New functions,
678 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
679 All uses replaced.
680 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
681 no longer needed here.
682 * emacs.c (main): Inspect existing signal handler with sigaction,
683 so that there's no need to block and unblock SIGHUP.
684 * sysdep.c (struct save_signal): New member 'action', replacing
685 old member 'handler'.
686 (save_signal_handlers, restore_signal_handlers):
687 Use sigaction instead of 'signal' to save and restore.
688 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
689 New function. All users of 'signal' modified to use set_sighandler
690 if they're writeonly, and to use sys_signal if they're read+write.
691 (emacs_sigaction_init, forwarded_signal): New functions.
692 (sys_signal): Remove. All uses replaced by calls to sigaction
693 and emacs_sigaction_init, or by direct calls to 'signal'.
694 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
695 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
696 all uses replaced by pthread_sigmask etc. calls.
697 * syssignal.h: Include <signal.h>.
698 (emacs_sigaction_init, forwarded_signal): New decls.
699 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
700 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
701 (sigmask, sys_sigmask): Remove; no longer needed.
702 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
703 (sigblock, sigunblock, sigfree):
704 (sigsetmask) [!defined sigsetmask]:
705 Remove. All uses replaced by pthread_sigmask.
706 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
707 no longer need to be replaced, and its typical old uses
708 are now done via emacs_sigaction_init and sigaction.
709 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
710 (sys_sigdel): Remove; unused.
711 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
712
713 2012-09-06 Eli Zaretskii <eliz@gnu.org>
714
715 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
716 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
717
718 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
719
720 Explicitly mark buffer_defaults and buffer_local_symbols.
721 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
722 mark_local_symbols here.
723 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
724 since special buffers aren't marked here any more.
725 (allocate_buffer): Chain new buffer with all_buffers here...
726 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
727 not here.
728 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
729 (syms_of_buffer): Remove staticpro of the above.
730 (init_buffer_once): Set names for buffer_defaults and
731 buffer_local_symbols.
732
733 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
734
735 Use bool for booleans in font-related modules.
736 * font.c (font_intern_prop, font_style_to_value)
737 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
738 (generate_otf_features, font_check_otf_features, font_check_otf)
739 (font_match_p, font_list_entities, font_at):
740 * fontset.c (fontset_id_valid_p, reorder_font_vector
741 (fontset_find_font, Fset_fontset_font)
742 (face_suitable_for_char_p) [0]:
743 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
744 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
745 (m17n_flt_initialized, ftfont_shape_by_flt):
746 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
747 * nsfont.m (nsfont_draw):
748 * w32font.c (w32font_draw):
749 * w32term.c (x_draw_glyphless_glyph_string_foreground):
750 Use bool for booleans.
751 * font.h: Adjust to above API changes.
752 (struct font, struct font_driver, struct font_driver_list):
753 Use bool for booleans.
754 (struct font): Remove useless member encoding_type.
755 All users removed.
756 * fontset.c, xftfont.c: Omit unnecessary static decls.
757
758 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
759
760 * alloc.c (mark_object): Revert window marking code
761 since it's unsafe for the Fset_window_configuration.
762
763 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
764
765 Fix race conditions with signal handlers and errno (Bug#12327).
766 Be more systematic about preserving errno whenever a signal
767 handler returns, even if it's not in the main thread. Do this by
768 renaming signal handlers to distinguish between signal delivery
769 and signal handling. All uses changed.
770 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
771 * data.c (deliver_arith_signal): Rename from arith_error.
772 * dispnew.c (deliver_window_change_signal): Rename from
773 window_change_signal.
774 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
775 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
776 * keyboard.c (deliver_input_available_signal): Rename from
777 input_available_signal.
778 (deliver_user_signal): Rename from handle_user_signal.
779 (deliver_interrupt_signal): Rename from interrupt_signal.
780 * process.c (deliver_pipe_signal): Rename from send_process_trap.
781 (deliver_child_signal): Rename from sigchld_handler.
782 * atimer.c (handle_alarm_signal):
783 * data.c (handle_arith_signal):
784 * dispnew.c (handle_window_change_signal):
785 * emacs.c (handle_fatal_signal, handle_danger_signal):
786 * keyboard.c (handle_input_available_signal):
787 * keyboard.c (handle_user_signal, handle_interrupt_signal):
788 * process.c (handle_pipe_signal, handle_child_signal):
789 New functions, with the actual signal-handling code taken from the
790 original respective signal handlers, sans the sporadic attempts to
791 preserve errno, since that's now done by handle_on_main_thread.
792 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
793 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
794 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
795 Move to sysdep.c.
796 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
797 Move initialization of main_thread to sysdep.c's init_signals.
798 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
799 our usage, and simplifies the mainline code.
800 (record_child_status_change): New static function, as a helper
801 for handle_child_signal, and with most of the old child handler's
802 contents.
803 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
804 (handle_child_signal): Use the above.
805 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
806 Moved here from emacs.c.
807 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
808 code moved here from emacs.c's main function.
809 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
810 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
811 lets callers save and restore errno properly.
812
813 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
814
815 Remove redundant or unused things here and there.
816 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
817 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
818 * editfns.c (Fcompare_buffer_substrings): Likewise.
819 * frame.h (struct terminal, struct font_driver_list):
820 Remove redundant declarations.
821 * window.h (Qleft, Qright): Likewise.
822
823 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
824
825 Do not mark objects from deleted buffers, windows and frames.
826 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
827 (mark_object): Likewise for windows and frames.
828
829 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
830
831 * alloc.c (valid_lisp_object_p): Treat killed buffers,
832 buffer_defaults and buffer_local_symbols as valid objects.
833 Return special value to denote them.
834
835 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
836
837 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
838 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
839 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
840 (file_name_absolute_p, Fsubstitute_in_file_name):
841 (check_executable, check_writable, Ffile_accessible_directory_p)
842 (Fset_file_selinux_context, Fdefault_file_modes)
843 (Finsert_file_contents, choose_write_coding_system)
844 (Fwrite_region, build_annotations, a_write, e_write)
845 (Fdo_auto_save):
846 * filelock.c (boot_time_initialized, get_boot_time)
847 (get_boot_time_1, lock_file_1, within_one_second):
848 * floatfns.c (in_float):
849 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
850 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
851 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
852 * lisp.h (struct Lisp_Hash_Table.cmpfn):
853 * window.c (compare_window_configurations):
854 Use bool for booleans.
855 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
856 (Fdefault_file_modes): Now mode_t, not int, for modes.
857 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
858 (internal_delete_file): Now returns void, not a (boolean) int,
859 since nobody was looking at the return value.
860 * lisp.h, window.h: Adjust to above API changes.
861
862 * xdisp.c (set_message): Simplify and reindent last change.
863
864 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
865
866 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
867
868 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
869
870 * eval.c (call_debugger): Make the function non-static so that we
871 can call it from set_message.
872
873 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
874 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
875
876 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
877
878 Give more-useful info on a fatal error (Bug#12328).
879 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
880 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
881 of doing the work ourselves.
882 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
883 do most of the work.
884 (fatal_error_backtrace): New function, taken from the guts
885 of the old fatal_error_signal, but with a new option to output
886 a backtrace.
887 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
888 info about the signal than just its number.
889 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
890 * sysdep.c: Include <execinfo.h>
891 (emacs_backtrace): New function, taken partly from the previous
892 code of the 'die' function.
893 (emacs_abort): Call fatal_error_backtrace rather than abort.
894
895 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
896
897 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
898 eager (load-time) macro-expansion.
899 * lisp.mk (lisp): Add macroexp.
900
901 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
902
903 Simplify redefinition of 'abort' (Bug#12316).
904 Do not try to redefine the 'abort' function. Instead, redo
905 the code so that it calls 'emacs_abort' rather than 'abort'.
906 This removes the need for the NO_ABORT configure-time macro
907 and makes it easier to change the abort code to do a backtrace.
908 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
909 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
910 Remove; sysdep.c's emacs_abort now takes its place.
911 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
912 'abort' changed to use 'emacs_abort'.
913 * msdos.c (dos_abort) [defined abort]: Remove; not used.
914 (abort) [!defined abort]: Rename to ...
915 (emacs_abort): ... new name.
916 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
917 the place of the old 'abort' in emacs.c.
918 * w32.c, w32fns.c (abort): Do not #undef.
919 * w32.c (emacs_abort): Rename from w32_abort.
920
921 2012-09-04 Eli Zaretskii <eliz@gnu.org>
922
923 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
924 offsets[j].dv, since the y axis of the screen coordinates points
925 down, while the y axis of the font definition coordinates points
926 up. This fixes display of Arabic diacritics such as KASRA and
927 KASRATAN. (Bug#11860)
928
929 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
930
931 Be more systematic about _setjmp vs setjmp.
932 * alloc.c (test_setjmp, mark_stack):
933 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
934 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
935 (png_load, my_error_exit, jpeg_load):
936 * process.c (send_process_trap, send_process):
937 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
938 The underscored versions are up to 30x faster on some hosts.
939 Formerly, the code used setjmp+longjmp sometimes and
940 _setjmp+_longjmp at other times, with no particular reason to
941 prefer setjmp+longjmp.
942
943 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
944
945 Fix minor problem found by static checking.
946 * buffer.c (Fdelete_all_overlays): Return nil.
947
948 2012-09-03 Martin Rudalics <rudalics@gmx.at>
949
950 * buffer.c (Fdelete_all_overlays): New function.
951
952 2012-09-03 Chong Yidong <cyd@gnu.org>
953
954 * gtkutil.c: Add extern decl for Qxft.
955
956 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
957
958 * emacs.c, eval.c: Use bool for boolean.
959 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
960 (malloc_using_checking) [DOUG_LEA_MALLOC]:
961 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
962 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
963 (main, decode_env_path, Fdaemon_initialized):
964 * eval.c (call_debugger, Finteractive_p, interactive_p):
965 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
966 (maybe_call_debugger, Fbacktrace):
967 * process.c (read_process_output, exec_sentinel):
968 Use bool for booleans.
969 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
970 All callers changed.
971 * eval.c (interactive_p): Omit always-true boolean argument
972 EXCLUDE_SUBRS_P. All callers changed.
973 * dispextern.h, lisp.h: Reflect above API changes.
974 * firstfile.c (dummy): Use the address of 'main', whose signature
975 won't change, instead of the address of 'initialize', whose
976 signature just changed from int to bool.
977 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
978 * msdos.c (fatal_error_in_progress): ... from here.
979 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
980 of incrementing it.
981 (redisplay_internal, unwind_redisplay): Simply clear
982 REDISPLAYING_P when unwinding, instead of saving its previous,
983 always-false value and then restoring it.
984
985 Clean up some extern decls.
986 Mostly, this hoists extern decls out of .c files and into .h files.
987 That way, we're more likely to catch errors if the interfaces change.
988 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
989 declare xg_mark_data.
990 * dispextern.h (x_frame_parm_handlers):
991 * font.h (Qxft):
992 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
993 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
994 (Qultra_bold, Qoblique, Qitalic):
995 Move extern decl here from .c file.
996 * alloc.c (xg_mark_data) [USE_GTK]:
997 * doc.c (Qclosure):
998 * eval.c (Qlexical_binding):
999 * fns.c (time) [!HAVE_UNISTD_H]:
1000 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1001 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1002 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1003 * lread.c (Qinternal_interpreter_environment):
1004 * minibuf.c (Qbuffer):
1005 * process.c (QCfamily, QCfilter):
1006 * widget.c (free_frame_faces):
1007 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1008 * xfont.c (x_clear_errors):
1009 * xterm.c (x_frame_parm_handlers):
1010 Remove now-redundant extern decls.
1011 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1012 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1013 Now static.
1014 * xfaces.c: Remove unnecessary static decls.
1015 * xterm.c (updating_frame): Remove decl of nonexistent object.
1016
1017 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1018 when building globals.h, as the objects that are not built on
1019 this host are not needed to compile C files on this host.
1020
1021 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1022
1023 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1024
1025 * frame.h: Add missing prototype for x_wm_set_size_hint.
1026
1027 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1028
1029 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1030 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1031 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1032 (Fsubstitute_command_keys):
1033 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1034 (save_excursion_save, save_excursion_restore)
1035 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1036 (format_time_string, general_insert_function)
1037 (make_buffer_string, make_buffer_string_both)
1038 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1039 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1040 (copy_text, insert_1, insert_1_both, insert_from_string)
1041 (insert_from_string_before_markers, insert_from_string_1)
1042 (insert_from_buffer, insert_from_buffer_1, replace_range)
1043 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1044 (del_range_2, modify_region):
1045 * intervals.c (intervals_equal, balance_possible_root_interval)
1046 (adjust_intervals_for_insertion, merge_properties_sticky)
1047 (graft_intervals_into_buffer, lookup_char_property)
1048 (adjust_for_invis_intang, set_point_both)
1049 (get_property_and_range, compare_string_intervals)
1050 (set_intervals_multibyte_1, set_intervals_multibyte):
1051 * keyboard.c (decode_timer):
1052 Use bool for boolean.
1053 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1054 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1055
1056 2012-09-02 Chong Yidong <cyd@gnu.org>
1057
1058 * keymap.c (push_key_description): Print M-TAB as C-M-i
1059 (Bug#11758).
1060
1061 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1062
1063 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1064 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1065 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1066 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1067 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1068 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1069 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1070
1071 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1072
1073 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1074 more than one grapheme cluster passed to the shaper: compute the
1075 offset adjustment values separately for each cluster. (Bug#11860)
1076
1077 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1078 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1079 about implicit conversions from integer to pointer.
1080
1081 2012-09-01 Daniel Colascione <dancol@dancol.org>
1082
1083 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1084 system used too early.
1085
1086 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1087
1088 Better seed support for (random).
1089 * emacs.c (main): Call init_random.
1090 * fns.c (Frandom): Set the seed from a string argument, if given.
1091 Remove long-obsolete Gentzel cruft.
1092 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1093 (init_random): New function.
1094
1095 2012-09-01 Daniel Colascione <dancol@dancol.org>
1096
1097 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1098 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1099 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1100 x_wm_set_size_hint, x_query_colors, x_real_positions,
1101 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1102 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1103 all of which have been moved to common code.
1104
1105 * xfaces.c: Include TERM_HEADER instead of listing all possible
1106 window-system headers.
1107
1108 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1109 to match header.
1110
1111 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1112 directly accessing frame internals.
1113
1114 * w32font.h: Include font.h. Define syms_of_w32font and
1115 globals_of_w32font.
1116
1117 * process.c: Include TERM_HEADER instead of listing all possible
1118 window-system headers.
1119
1120 * nsterm.h: Remove declarations now in frame.h. Define
1121 FRAME_X_SCREEN, FRAME_X_VISUAL.
1122
1123 * menu.c: Include TERM_HEADER instead of listing all possible
1124 window-system headers.
1125
1126 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1127 window system.
1128
1129 * keyboard.c: Include TERM_HEADER instead of listing all possible
1130 window-system headers.
1131
1132 * image.c: Include TERM_HEADER instead of listing all possible
1133 window-system headers. Declare Vlibrary_cache when compiling for
1134 Windows.
1135
1136 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1137 window system declarations.
1138
1139 * frame.h: Move common functions here: set_frame_menubar,
1140 x_set_window_size, x_sync, x_get_focus_frame,
1141 x_set_mouse_position, x_set_mouse_pixel_position,
1142 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1143 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1144 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1145 x_activate_menubar, x_real_positions, x_bitmap_icon,
1146 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1147 and x_query_colors.
1148
1149 * frame.c: Include TERM_HEADER instead of listing all possible
1150 window-system headers.
1151
1152 * font.c: Include TERM_HEADER instead of listing all possible
1153 window-system headers.
1154
1155 * emacs.c: Include TERM_HEADER.
1156
1157 * dispnew.c: Include TERM_HEADER instead of listing all possible
1158 window-system headers.
1159
1160 * ccl.h: Include character.h.
1161
1162 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1163 the current window system; include in list of objects to link into
1164 Emacs.
1165
1166 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1167
1168 Remove mark_ttys function and fix tty_display_info initialization.
1169 * lisp.h (mark_ttys): Remove prototype.
1170 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1171 to mark_ttys because all possible values of 'top_frame' slot are
1172 the frames which are reachable from Vframe_list.
1173 * term.c (mark_ttys): Remove.
1174 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1175
1176 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1177
1178 Change struct frame bitfields from unsigned char to unsigned.
1179 * frame.h (struct frame): Change type of 'display_preempted',
1180 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1181 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1182 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1183 bitfields from unsigned char to unsigned.
1184
1185 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1186
1187 Remove unused member of struct x_output and struct w32_output.
1188 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1189 * w32term.h (struct w32_output): Likewise.
1190
1191 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1192
1193 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1194 does not become zero (Bug#12234).
1195
1196 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1197
1198 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1199 for GCC 4.7.1 x86-64.
1200
1201 2012-08-30 Glenn Morris <rgm@gnu.org>
1202
1203 * lread.c (init_lread): For out-of-tree builds, only add the
1204 source directory's site-lisp dir to the load-path if it exists,
1205 consistent with in-tree builds. (Bug#12302)
1206
1207 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1208
1209 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1210 button_values to NULL. Call setStykeMask so dialogs get a close button.
1211 (windowShouldClose:): Set window_closed.
1212 (dealloc): New member, free button_values.
1213 (process_dialog:): Make member function. Remove window argument,
1214 replace window with self. Count buttons and allocate and store values
1215 in button_values.
1216 (addButton:value:row:): value is int with the name tag. Call setTag
1217 with tag. Remove return self, declare return value as void.
1218 (addString:row:): Remove return self, declare return value as void.
1219 (addSplit): Remove return self, declare return value as void.
1220 (clicked:): Remove return self, declare return value as void.
1221 Set dialog_return to button_values[seltag]. Code formatting change.
1222 (initFromContents:isQuestion:): Adjust call to process_dialog.
1223 Code formatting change.
1224 (timeout_handler:): Set timer_fired to YES.
1225 (runDialogAt:): Set timer_fired to NO.
1226 Handle click on close button as quit.
1227
1228 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1229 Add window_closed and button_values. Add void as return value for
1230 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1231 Add process_dialog as new member.
1232
1233 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1234
1235 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1236 is not one of the heaps we manage. (Bug#12242)
1237
1238 2012-08-28 Glenn Morris <rgm@gnu.org>
1239
1240 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1241
1242 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1243
1244 * window.c (Fset_window_configuration): Remove handling of
1245 auto-buffer-name window parameter. Install revision of reverted
1246 fix.
1247
1248 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1249
1250 Do not allow to set major mode for a dead buffer.
1251 * buffer.c (Fset_buffer_major_mode): Signal an error
1252 if the buffer is dead.
1253 (Fother_buffer, other_buffer_safely): Remove redundant
1254 nested declaration.
1255
1256 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1257
1258 Always use set_buffer_if_live to restore original buffer at unwind.
1259 * buffer.h (record_unwind_current_buffer): New function.
1260 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1261 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1262 * undo.c, window.c: Adjust users.
1263 * buffer.c (set_buffer_if_live): Fix comment.
1264
1265 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1266
1267 Fix usage of set_buffer_internal.
1268 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1269 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1270 * coding.c (decode_coding): Omit redundant test.
1271 * fileio.c (decide_coding_unwind): Likewise.
1272 * fns.c (secure_hash): Likewise.
1273 * insdel.c (modify_region): Likewise.
1274 * keyboard.c (command_loop_1): Likewise.
1275 * print.c (PRINTFINISH): Likewise.
1276 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1277
1278 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1279
1280 * dispnew.c: Use bool for boolean.
1281 (frame_garbaged, display_completed, delayed_size_change)
1282 (fonts_changed_p, add_window_display_history)
1283 (add_frame_display_history, verify_row_hash)
1284 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1285 (row_equal_p, realloc_glyph_pool)
1286 (allocate_matrices_for_frame_redisplay)
1287 (showing_window_margins_p)
1288 (adjust_frame_glyphs_for_frame_redisplay)
1289 (build_frame_matrix_from_leaf_window, make_current)
1290 (mirrored_line_dance, mirror_line_dance, update_frame)
1291 (update_window_tree, update_single_window)
1292 (check_current_matrix_flags, update_window, update_text_area)
1293 (update_window_line, set_window_update_flags, scrolling_window)
1294 (update_frame_1, scrolling, buffer_posn_from_coords)
1295 (do_pending_window_change, change_frame_size)
1296 (change_frame_size_1, sit_for):
1297 Use bool for boolean.
1298 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1299 and remove last int (actually boolean) argument, which was always 0.
1300 All callers changed.
1301 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1302 * dispextern.h (struct composition_it): Use bool for boolean.
1303 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1304 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1305 * dired.c (file_name_completion):
1306 Use bool for boolean. (This was missed in an earlier change.)
1307
1308 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1309
1310 * window.c (Fset_window_configuration): Revert first part of
1311 last change.
1312
1313 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1314
1315 * nsterm.h (NSPanel): New class variable dialog_return.
1316
1317 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1318 dialog_return.
1319 (windowShouldClose:): Use stop instead of stopModalWithCode.
1320 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1321 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1322 event.
1323 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1324 modal loop returns.
1325
1326 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1327
1328 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1329 * composite.c (find_composition, composition_gstring_p)
1330 (composition_reseat_it, find_automatic_composition):
1331 * data.c (let_shadows_buffer_binding_p)
1332 (let_shadows_global_binding_p, set_internal, make_blv)
1333 (Fmake_variable_buffer_local, Fmake_local_variable)
1334 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1335 (cons_to_signed, arith_driver):
1336 * dbusbind.c (xd_in_read_queued_messages):
1337 * dired.c (directory_files_internal, file_name_completion):
1338 Use bool for booleans.
1339 * dired.c (file_name_completion):
1340 * process.h (fd_callback):
1341 Omit int (actually boolean) argument. It wasn't being used.
1342 All uses changed.
1343 * composite.h, lisp.h: Reflect above API changes.
1344
1345 * cmds.c, coding.c: Use bool for booleans.
1346 * cmds.c (move_point, Fself_insert_command):
1347 * coding.h (struct composition status, struct coding_system):
1348 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1349 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1350 (emacs_mule_char, decode_coding_emacs_mule)
1351 (encode_coding_emacs_mule, detect_coding_iso_2022)
1352 (decode_coding_iso_2022, encode_invocation_designation)
1353 (encode_designation_at_bol, encode_coding_iso_2022)
1354 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1355 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1356 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1357 (encode_coding_raw_text, detect_coding_charset)
1358 (decode_coding_charset, encode_coding_charset, detect_eol)
1359 (detect_coding, get_translation_table, produce_chars)
1360 (consume_chars, reused_workbuf_in_use)
1361 (make_conversion_work_buffer, code_conversion_save)
1362 (decode_coding_object, encode_coding_object)
1363 (detect_coding_system, char_encodable_p)
1364 (Funencodable_char_position, code_convert_region)
1365 (code_convert_string, code_convert_string_norecord)
1366 (Fset_coding_system_priority):
1367 * fileio.c (Finsert_file_contents):
1368 Use bool for booleans.
1369 * coding.h, lisp.h: Reflect above API changes.
1370 * coding.c: Remove unnecessary static function decls.
1371 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1372 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1373 not a boolean 'int', since callers never look at the return value.
1374 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1375 * coding.h (decoding_buffer_size, encoding_buffer_size)
1376 (emacs_mule_string_char): Remove unused extern decls.
1377 (struct iso_2022_spec, struct coding_system):
1378 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1379 (struct emacs_mule_spec): Remove unused field 'full_support'.
1380 All initializations removed.
1381 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1382
1383 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1384
1385 Fix spare memory change (Bug#12286).
1386 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1387 (valid_lisp_object_p): Likewise.
1388
1389 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1390
1391 * window.c (Fset_window_configuration): Record any window's old
1392 buffer if it's replaced (see Bug#8789). If the new current
1393 buffer doesn't appear in the selected window, go to its old
1394 point (Bug#12208).
1395
1396 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1397
1398 Special MEM_TYPE_SPARE to denote reserved memory.
1399 * alloc.c (enum mem_type): New memory type.
1400 (refill_memory_reserve): Use new type for spare memory.
1401 This prevents live_cons_p and live_string_p from incorrect
1402 detection of uninitialized objects from spare memory as live.
1403
1404 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1405
1406 Spelling fixes.
1407 * Makefile.in (.PHONY): versioclean -> versionclean.
1408
1409 Remove unused external symbols.
1410 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1411 * window.c (Qwindow_valid_p, decode_valid_window):
1412 Now static, not extern.
1413 * data.c (Qinterval): Remove; unused.
1414 (syms_of_data): Do not define 'interval'.
1415 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1416 * window.h (decode_valid_window):
1417 Remove decls.
1418
1419 * character.c, charset.c, chartab.c: Use bool for booleans.
1420 * character.c (lisp_string_width, string_count_byte8)
1421 (string_escape_byte8):
1422 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1423 (load_charset_map_from_file, map_charset_chars)
1424 (Fdefine_charset_internal, define_charset_internal)
1425 (Fdeclare_equiv_charset, find_charsets_in_text)
1426 (Ffind_charset_region, char_charset, Fiso_charset):
1427 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1428 (sub_char_table_set, sub_char_table_set_range)
1429 (char_table_set_range, optimize_sub_char_table)
1430 (map_sub_char_table):
1431 Use bool for boolean.
1432 * character.c (str_to_unibyte): Omit last boolean argument; it was
1433 always 0. All callers changed.
1434 * character.h, charset.h: Adjust to match previous changes.
1435 * character.h (char_printable_p): Remove decl of nonexistent function.
1436 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1437 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1438 are all boolean, so make them single-bit bitfields.
1439
1440 * lisp.h (ASET): Remove attempt to detect side effects.
1441 It was meant to be temporary and it often doesn't work,
1442 because when IDX has side effects the behavior of IDX==IDX
1443 is undefined. See Stefan Monnier in
1444 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1445
1446 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1447
1448 * lisp.h (functionp): New function (extracted from Ffunctionp).
1449 (FUNCTIONP): Use it.
1450 * eval.c (Ffunctionp): Use it.
1451
1452 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1453
1454 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1455 as that's faster and simpler than static storage. Don't bother
1456 with the g_main_context_query overhead if g_main_context_pending
1457 says no events are pending.
1458 (gfds, gfds_size): Remove these static vars.
1459 (xgselect_initialize): Remove; no longer needed.
1460 All uses and decls removed.
1461
1462 * emacs.c (fatal_error_signal_hook): Remove.
1463 All uses removed. This leftover from old code was always 0.
1464
1465 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1466 * casefiddle.c (casify_object, casify_region):
1467 * casetab.c (set_case_table):
1468 * category.c, category.h (word_boundary_p):
1469 * category.h (CHAR_HAS_CATEGORY):
1470 Use bool for booleans, instead of int.
1471
1472 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1473
1474 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1475
1476 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1477
1478 On assertion failure, print backtrace if available.
1479 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1480 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1481 * Makefile.in (LIB_EXECINFO): New macro.
1482 (LIBES): Use it.
1483
1484 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1485 * bytecode.c (exec_byte_code):
1486 * callint.c (check_mark, Fcall_interactively):
1487 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1488 (getenv_internal, sync_process_alive, call_process_exited):
1489 * lisp.h (USE_SAFE_ALLOCA):
1490 Use bool for booleans, instead of int.
1491 * lisp.h, process.h: Adjust prototypes to match above changes.
1492 * callint.c (Fcall_interactively): Don't assume the mark's
1493 offset fits in 'int'.
1494
1495 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1496
1497 * buffer.c, buffer.h: Use bool for boolean.
1498 * buffer.c (reset_buffer_local_variables)
1499 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1500 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1501 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1502 (overlay_touches_p, overlay_strings, Foverlay_put)
1503 (report_overlay_modification, call_overlay_mod_hooks):
1504 (mmap_enlarge, mmap_set_vars):
1505 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1506 Use bool for booleans, instead of int.
1507 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1508 since the 1-or-0 return value is always ignored anyway.
1509 (mmap_initialized_p):
1510 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1511 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1512
1513 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1514
1515 * bidi.c: Use bool for boolean.
1516 This is a bit more readable, and makes the text segment of bidi.o
1517 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1518 Presumably it's faster too.
1519 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1520 Now bool.
1521 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1522 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1523 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1524 (bidi_explicit_dir_char, bidi_level_of_next_char)
1525 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1526 Use bool for booleans, instead of int.
1527 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1528 (bidi_unshelve_cache): Adjust decls to match code.
1529
1530 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1531
1532 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1533 argument.
1534
1535 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1536
1537 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1538 * atimer.h: Include <stdbool.h>.
1539
1540 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1541
1542 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1543 compile time tests instead of run time tests on systems that do
1544 not use them.
1545 (FRAME_MAC_P): Remove leftover from deleted code.
1546 * frame.c (syms_of_frame): Remove leftover from deleted code.
1547
1548 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1549
1550 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1551
1552 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1553
1554 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1555 Otherwise, the compiler complains about (A?B:C) where B is void
1556 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1557 (fontset_add): Return void, for FONTSET_ADD.
1558
1559 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1560
1561 * alloc.c: Use bool for booleans.
1562 (gc_in_progress, abort_on_gc)
1563 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1564 (dont_register_blocks) [GC_MALLOC_CHECK]:
1565 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1566 (check_string_bytes, make_specified_string, memory_full)
1567 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1568 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1569 (mark_stack, valid_pointer_p, make_pure_string)
1570 (Fgarbage_collect, survives_gc_p, gc_sweep):
1571 Use bool for booleans, instead of int.
1572 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1573 Remove unused local.
1574 * alloc.c (PURE_POINTER_P):
1575 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1576 * editfns.c (Fformat):
1577 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1578 (Fdo_auto_save):
1579 * fns.c (sweep_weak_table):
1580 * lisp.h (suppress_checking, push_message, survives_gc_p)
1581 (make_pure_string, gc_in_progress, abort_on_gc):
1582 * lread.c (readchar, read1):
1583 * print.c (Fprin1_to_string):
1584 * xdisp.c (push_message):
1585 Use bool for booleans affected directly or indirectly by
1586 alloc.c's changes.
1587
1588 Make recently-introduced setters macros.
1589 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1590 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1591 (set_fontset_default, set_fontset_fallback): Rename from their
1592 upper-case counterparts, and make them functions rather than macros.
1593 This is more consistent with the other recently-introduced setters.
1594 These don't need to be inline, since they're local.
1595
1596 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1597
1598 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1599 the loop (Bug#12247).
1600
1601 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1602
1603 * lisp.h (vcopy): Use memcpy rather than our own loop.
1604 This fixes a performance regression introduced by the recent
1605 addition of vcopy. This means 'vcopy' will need to be modified
1606 for a copying collector, but that's OK. Also, tighten the
1607 checking in the assertion.
1608
1609 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1610
1611 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1612 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1613 non-base glyph for the width of the base character, according to
1614 what x_draw_composite_glyph_string_foreground expects.
1615 Generate WADJUST value according to composition_gstring_width's
1616 expectations, to produce correct width of the composed character.
1617 Reverse the sign of the DU offset produced by ScriptPlace.
1618
1619 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1620
1621 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1622
1623 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1624
1625 Avoid direct writes to contents member of struct Lisp_Vector.
1626 * lisp.h (vcopy): New function to copy data into vector.
1627 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1628 * fns.c (Ffillarray): Use ASET.
1629 * keyboard.c (timer_check_2): Use AREF and ASET.
1630 (append_tool_bar_item, Frecent_keys): Use vcopy.
1631 * lread.c (read_vector): Use ASET.
1632 * msdos.c (Frecent_doskeys): Use vcopy.
1633 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1634 (Finternal_merge_in_global_face): Use ASET and vcopy.
1635 * xfont.c (xfont_list_pattern): Likewise.
1636
1637 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1638
1639 * window.c (Fwindow_point): For the selected window always return
1640 the position of its buffer's point.
1641 (Fset_window_point): For the selected window always go in its
1642 buffer to the specified position.
1643
1644 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1645
1646 Setter macros for fontsets.
1647 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1648 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1649 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1650 Adjust users.
1651
1652 2012-08-20 Glenn Morris <rgm@gnu.org>
1653
1654 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1655 Don't assume that `ln -f' works.
1656
1657 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1658
1659 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1660 and later about non-assignments with no effect. See discussion at
1661 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1662 details.
1663
1664 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1665
1666 Inline setter functions for Lisp_Objects slots of struct specbinding.
1667 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1668 Adjust users.
1669
1670 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1671
1672 * window.c (select_window): Always make selected window's buffer
1673 current.
1674
1675 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1676
1677 Use AREF and ASET for docstrings of category tables.
1678 * category.h (CATEGORY_DOCSTRING): Use AREF.
1679 (SET_CATEGORY_DOCSTRING): Use ASET.
1680 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1681
1682 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1683
1684 Inline setter functions for hash table members.
1685 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1686 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1687 (set_hash_key_and_value, set_hash_index, set_hash_next)
1688 (set_hash_hash): New functions.
1689 * charset.c, fns.c: Adjust users.
1690
1691 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1692
1693 Inline getter and setter functions for per-buffer values.
1694 * buffer.h (per_buffer_default, set_per_buffer_default)
1695 (per_buffer_value, set_per_buffer_value): New functions.
1696 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1697 * buffer.c, data.c: Adjust users.
1698
1699 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1700
1701 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1702
1703 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1704
1705 Rely on <config.h> + <unistd.h> to declare 'environ',
1706 as gnulib does this if the system doesn't.
1707 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1708 Remove declaration. MS-Windows declares it on stdlib.h which is
1709 included by conf_post.h.
1710 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1711 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1712 * vm-limit.c: Include <unistd.h>, for 'environ'.
1713
1714 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1715 (start_of_data): Remove decl; mem-limits.h provides it.
1716
1717 * xdisp.c (handle_invisible_prop): Make it a bit faster
1718 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1719
1720 2012-08-19 Chong Yidong <cyd@gnu.org>
1721
1722 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1723 ends (Bug#3874).
1724
1725 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1726
1727 * .gdbinit: Use call instead of set when calling a function in the
1728 inferior.
1729
1730 * data.c (set_internal): Don't use set_blv_found.
1731 (Fkill_local_variable): Likewise.
1732
1733 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1734
1735 * nsfont.m (ns_ascii_average_width): Ensure the string
1736 ascii_printable is initialized with a null-terminated character
1737 array. Otherwise, it can contain undesired extra characters.
1738
1739 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1740
1741 port new setting code to Sun C 5.8 2005/10/13
1742 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1743 Return void, not Lisp_Object. Otherwise, the compiler
1744 complains about (A?B:C) where B is void and C is Lisp_Object
1745 when compiling CHAR_TABLE_SET, due to the recent change to
1746 the API of sub_char_table_set_contents.
1747
1748 2012-08-18 Chong Yidong <cyd@gnu.org>
1749
1750 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1751 for the string case (Bug#3874).
1752
1753 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1754
1755 * buffer.h (BSET): Remove (Bug#12215).
1756 Replace all uses with calls to new setter functions.
1757 (bset_bidi_paragraph_direction, bset_case_canon_table)
1758 (bset_case_eqv_table, bset_directory, bset_display_count)
1759 (bset_display_time, bset_downcase_table)
1760 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1761 (bset_last_selected_window, bset_local_var_alist)
1762 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1763 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1764 (bset_width_table):
1765 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1766 (bset_auto_fill_function, bset_auto_save_file_format)
1767 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1768 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1769 (bset_cache_long_line_scans, bset_case_fold_search)
1770 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1771 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1772 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1773 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1774 (bset_header_line_format, bset_indicate_buffer_boundaries)
1775 (bset_indicate_empty_lines, bset_invisibility_spec)
1776 (bset_left_fringe_width, bset_major_mode, bset_mark)
1777 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1778 (bset_name, bset_overwrite_mode, bset_pt_marker)
1779 (bset_right_fringe_width, bset_save_length)
1780 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1781 (bset_scroll_up_aggressively, bset_selective_display)
1782 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1783 (bset_word_wrap, bset_zv_marker):
1784 * category.c (bset_category_table):
1785 * syntax.c (bset_syntax_table):
1786 New setter functions.
1787
1788 * process.h (PSET): Remove (Bug#12215).
1789 Replace all uses with calls to new setter functions.
1790 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1791 (PROCESS_INLINE): New macro.
1792 (pset_childp): New setter function.
1793 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1794 * process.c (PROCESS_INLINE):
1795 Define to EXTERN_INLINE, so that the corresponding functions
1796 are compiled into code.
1797 (pset_buffer, pset_command, pset_decode_coding_system)
1798 (pset_decoding_buf, pset_encode_coding_system)
1799 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1800 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1801 (pset_type, pset_write_queue): New setter functions.
1802
1803 * window.h (WSET): Remove (Bug#12215).
1804 Replace all uses with calls to new setter functions.
1805 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1806 (WINDOW_INLINE): New macro.
1807 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1808 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1809 (wset_total_lines, wset_vertical_scroll_bar)
1810 (wset_window_end_pos, wset_window_end_valid)
1811 (wset_window_end_vpos): New setter functions.
1812 * window.c (WINDOW_INLINE):
1813 Define to EXTERN_INLINE, so that the corresponding functions
1814 are compiled into code.
1815 (wset_combination_limit, wset_dedicated, wset_display_table)
1816 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1817 (wset_new_normal, wset_new_total, wset_next_buffers)
1818 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1819 (wset_prev_buffers, wset_right_fringe_width)
1820 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1821 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1822 (wset_window_parameters):
1823 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1824 (wset_column_number_displayed, wset_region_showing):
1825 New setter functions.
1826
1827 * termhooks.h (TSET): Remove (Bug#12215).
1828 Replace all uses with calls to new setter functions.
1829 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1830 (TERMHOOKS_INLINE): New macro.
1831 (tset_charset_list, tset_selection_alist): New setter functions.
1832 * terminal.c (TERMHOOKS_INLINE):
1833 Define to EXTERN_INLINE, so that the corresponding functions
1834 are compiled into code.
1835 (tset_param_alist): New setter function.
1836
1837 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1838
1839 * keyboard.h (KSET): Remove (Bug#12215).
1840 Replace all uses with calls to new setter functions.
1841 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1842 (KEYBOARD_INLINE): New macro.
1843 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1844 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1845 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1846 New setter functions.
1847 * keyboard.c (KEYBOARD_INLINE):
1848 Define to EXTERN_INLINE, so that the corresponding functions
1849 are compiled into code.
1850 (kset_echo_string, kset_kbd_queue)
1851 (kset_keyboard_translate_table, kset_last_prefix_arg)
1852 (kset_last_repeatable_command, kset_local_function_key_map)
1853 (kset_overriding_terminal_local_map, kset_real_last_command)
1854 (kset_system_key_syms): New setter functions.
1855
1856 * frame.h (FSET): Remove (Bug#12215).
1857 Replace all uses with calls to new setter functions.
1858 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1859 (FRAME_INLINE): New macro.
1860 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1861 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1862 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1863 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1864 (fset_param_alist, fset_root_window, fset_scroll_bars)
1865 (fset_selected_window, fset_title, fset_tool_bar_items)
1866 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1867 * frame.c (FRAME_INLINE):
1868 Define to EXTERN_INLINE, so that the corresponding functions
1869 are compiled into code.
1870 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1871
1872 A few more naming-convention fixes for getters and setters.
1873 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1874 and rename from buffer_overlays_set_before.
1875 (set_buffer_overlays_after): Move here from buffer.h, and rename
1876 from buffer_overlays_set_after.
1877 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1878 All uses changed.
1879 (set_buffer_intervals): Rename from buffer_set_intervals.
1880 * intervals.c (set_interval_object): Move here from intervals.h,
1881 and rename from interval_set_object.
1882 (set_interval_left): Move here from intervals.h, and rename from
1883 interval_set_left.
1884 (set_interval_right): Move here from intervals.h, and rename from
1885 interval_set_right.
1886 (copy_interval_parent): Move here from intervals.h, and rename from
1887 interval_copy_parent.
1888 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1889 (set_interval_plist): Rename from interval_set_plist.
1890 Return void, not Lisp_Object, since no caller uses the result.
1891 * lisp.h (string_intervals): Rename from string_get_intervals.
1892 (set_string_intervals): Rename from string_set_intervals.
1893
1894 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1895 (set_char_table_contents): Rename from char_table_set_contents.
1896 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1897 All uses changed. See the end of
1898 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1899
1900 * lisp.h (CSET): Remove (Bug#12215).
1901 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1902 (set_char_table_purpose): New functions,
1903 replacing CSET. All uses changed. For example, replace
1904 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1905 "set_char_table_parent (char_table, parent);".
1906 The old version was confusing because it used the same name
1907 'parent' for two different things.
1908
1909 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1910
1911 Functions to get and set Lisp_Object fields of buffer-local variables.
1912 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1913 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1914 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1915 * data.c, eval.c, frame.c: Adjust users.
1916
1917 2012-08-17 Chong Yidong <cyd@gnu.org>
1918
1919 * xfaces.c (merge_face_vectors): If the target font specfies a
1920 font spec, make the font's attributes take precedence over
1921 directly-specified attributes.
1922 (merge_face_ref): Recognize :font.
1923
1924 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1925
1926 Do not use memcpy for copying intervals.
1927 * intervals.c (reproduce_interval): New function.
1928 (reproduce_tree, reproduce_tree_obj): Use it.
1929 (reproduce_tree_obj): Remove prototype.
1930
1931 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1932
1933 * lisp.h (duration_to_sec_usec): Remove unused decl.
1934
1935 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1936
1937 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1938 to an allocated instance of NSString, not to the class itself.
1939
1940 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1941
1942 * makefile.w32-in (C_CTYPE_H): New macro.
1943 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1944 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1945 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1946
1947 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1948
1949 Use ASCII tests for character types.
1950 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1951 * xfns.c, xterm.c:
1952 Don't include <ctype.h>; was not needed.
1953 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1954 * sysdep.c, xfaces.c:
1955 Include <c-ctype.h> instead of <ctype.h>.
1956 * nsterm.m: Include <c-ctype.h>.
1957 * charset.c (read_hex):
1958 * doc.c (Fsnarf_documentation):
1959 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1960 (DRIVE_LETTER) [DOS_NT]:
1961 (Ffile_name_directory, Fexpand_file_name)
1962 (Fsubstitute_in_file_name):
1963 * font.c (font_parse_xlfd, font_parse_fcname):
1964 * frame.c (x_set_font_backend):
1965 * gtkutil.c (xg_get_font):
1966 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1967 * nsimage.m (hexchar):
1968 * nsterm.m (ns_xlfd_to_fontname):
1969 * sysdep.c (system_process_attributes):
1970 * xfaces.c (hash_string_case_insensitive):
1971 Use C-locale tests instead of locale-specific tests for character
1972 types, since we want the ASCII interpretation here, not the
1973 interpretation suitable for whatever happens to be the current locale.
1974
1975 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1976
1977 Consistently check windows for validity/liveness
1978 (Bug#11984, Bug#12025, Bug#12026).
1979 * lisp.h (CHECK_VALID_WINDOW): New macro.
1980 * window.c (decode_window): Rename to decode_live_window.
1981 (decode_valid_window, Fwindow_valid_p): New functions.
1982 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1983 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1984 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1985 (Fwindow_prev_sibling, Fwindow_combination_limit)
1986 (Fset_window_combination_limit, Fwindow_use_time)
1987 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1988 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1989 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1990 (Fwindow_hscroll, Fset_window_hscroll)
1991 (Fwindow_redisplay_end_trigger)
1992 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1993 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1994 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1995 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1996 (Fwindow_end, Fset_window_point, Fset_window_start)
1997 (Fpos_visible_in_window_p, Fwindow_line_height)
1998 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1999 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2000 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2001 (Fset_window_parameter, Fwindow_display_table)
2002 (Fset_window_display_table, Fdelete_other_windows_internal)
2003 (Fset_window_buffer, Fset_window_new_total)
2004 (Fset_window_new_normal, Fdelete_window_internal)
2005 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2006 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2007 (Fwindow_scroll_bars): Check whether argument window is a valid or
2008 live window. Update doc-strings.
2009 (syms_of_window): New symbol Qwindow_valid_p.
2010 * keyboard.c (Fposn_at_x_y): Check whether argument
2011 frame_or_window denotes a valid window.
2012
2013 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2014
2015 Fix previous char table change.
2016 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2017 * chartab.c (optimize_sub_char_table): Likewise.
2018
2019 2012-08-16 Chong Yidong <cyd@gnu.org>
2020
2021 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2022
2023 * xfont.c (xfont_open):
2024 * xftfont.c (xftfont_open): Set the font's max_width field.
2025
2026 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2027 min_width to space_width and average_width to the average over
2028 printable ASCII characters.
2029 (ns_char_width): Code cleanup.
2030 (ns_ascii_average_width): New utility function.
2031
2032 * font.h (struct font): Update comments.
2033
2034 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2035
2036 Simple interface to set Lisp_Object fields of character tables.
2037 * lisp.h (CSET): New macro.
2038 (char_table_set_extras, char_table_set_contents)
2039 (sub_char_table_set_contents): New function.
2040 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2041 * syntax.c: Adjust users.
2042
2043 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2044
2045 * eval.c (eval_sub): Bind lexical-binding.
2046 * lread.c (Qlexical_binding): Make non-static.
2047
2048 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2049
2050 * nsmenu.m (popupSession): Remove.
2051 (pop_down_menu): Remove endModalSession.
2052 (timeout_handler:): New method.
2053 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2054 Call runModalForWindow. Check timer_fired when it returns.
2055 If not set, cancel timer and break out of loop.
2056 Otherwise loop again, with a new timeout.
2057
2058 * nsterm.m: Include fcntl.h if present.
2059 (fd_entry, t_readfds, inNsSelect): Remove.
2060 (select_writefds, select_valid, select_timeout, selfds)
2061 (select_mutex, apploopnr): Add.
2062 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2063 Otherwise call kbd_buffer_store_event.
2064 (ns_send_appdefined): Remove release of fd_entry.
2065 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2066 Increment and decrement apploopnr.
2067 (ns_select): If no file descriptors, just do a NSTimer.
2068 Otherwise copy read/write masks and start select thread (fd_handler).
2069 Start main loop and wait for application defined event.
2070 Inform select thread to stop selecting after main loop is exited.
2071 (ns_term_init): Create selfds pipe and set non-blocking.
2072 Initialize select_mutex. Start the select thread (fd_handler).
2073 (fd_handler:): Loop forever, wait for info from the main thread
2074 to either start or stop selecting. When select returns, send
2075 and appdefined event.
2076 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2077 If not call kbd_buffer_store_event.
2078
2079 * nsterm.h (EmacsApp): fd_handler takes id argument.
2080 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2081
2082 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2083
2084 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2085
2086 * region-cache.c (move_cache_gap): Update gap_len using the actual
2087 growth of the boundaries array. Do not change cache_len.
2088 (Bug#12196)
2089
2090 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2091
2092 Generalize and cleanup font subsystem checks.
2093 * font.h (FONT_DEBUG, font_assert): Remove.
2094 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2095 Change font_assert to eassert. Use eassert where appropriate.
2096
2097 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2098
2099 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2100
2101 2012-08-15 Chong Yidong <cyd@gnu.org>
2102
2103 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2104 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2105 extract the font descriptor instead of just the font name.
2106 In that case, return a font spec instead of a string.
2107 (x_last_font_name): Move to this file from xfns.c.
2108
2109 * xfns.c (Fx_select_font): The return value can also be a font
2110 spec. Move x_last_font_name management to gtkutil.c.
2111
2112 * xfaces.c: Make font weight and style symbols non-static.
2113
2114 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2115
2116 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2117 (bug#12117).
2118
2119 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2120
2121 * alloc.c (Fgarbage_collect): Use plural form consistently.
2122
2123 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2124
2125 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2126 iteration through the command loop. Fixes a problem whereby mouse
2127 movements are ignored until the first mouse click.
2128
2129 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2130
2131 Use bool, not int, for Lisp booleans.
2132 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2133 makes Emacs a bit smaller and presumably a bit faster.
2134 * lisp.h: Include <stdbool.h>.
2135 (struct Lisp_Boolfwd, defvar_bool):
2136 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2137 * regex.c [!emacs]: Include <stdbool.h>.
2138 (false, true): Remove; <stdbool.h> does this for us now.
2139
2140 2012-08-14 Chong Yidong <cyd@gnu.org>
2141
2142 * character.c (Fcharacterp): Doc fix (Bug#12076).
2143
2144 * data.c (Findirect_variable): Doc fix (Bug#11040).
2145
2146 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2147
2148 * editfns.c (Fformat): Doc fix (Bug#12059).
2149 (Fsave_current_buffer): Doc fix (Bug#11542).
2150
2151 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2152
2153 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2154 (bug#12022).
2155
2156 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2157
2158 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2159 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2160 * minibuf.c (choose_minibuf_frame, read_minibuf):
2161 * w32fns.c (x_create_tip_frame):
2162 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2163 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2164
2165 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2166
2167 * intervals.c (offset_intervals): Remove obsolete comment.
2168
2169 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2170
2171 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2172
2173 2012-08-14 Gergely Risko <gergely@risko.hu>
2174
2175 * coding.c (decode_coding): Record buffer modification before
2176 disabling undo_list (Bug#11773).
2177
2178 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2179
2180 Revert and cleanup some recent overlay changes.
2181 * buffer.h (enum overlay_type): Remove.
2182 (buffer_get_overlays, buffer_set_overlays): Likewise.
2183 (buffer_set_overlays_before, buffer_set_overlays_after):
2184 New function. Adjust users.
2185 (unchain_both): Add eassert.
2186
2187 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2188
2189 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2190
2191 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2192
2193 * gtkutil.c (xg_mark_data): Don't assume C99.
2194
2195 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2196
2197 * gtkutil.c (xg_frame_tb_info): New struct.
2198 (TB_INFO_KEY): New define.
2199 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2200 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2201 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2202 if not present.
2203 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2204 is up to date. Otherwise store new data.
2205 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2206
2207 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2208
2209 Use KSET for write access to Lisp_Object members of struct kboard.
2210 * keyboard.h (KSET): New macro.
2211 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2212 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2213 * xterm.c: Adjust users.
2214
2215 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2216
2217 Use BSET for write access to Lisp_Object members of struct buffer.
2218 * buffer.h (BSET): New macro.
2219 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2220 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2221 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2222 * window.c, xdisp.c, xfns.c: Adjust users.
2223
2224 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2225
2226 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2227
2228 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2229
2230 * nsterm.m (not_in_argv): New function.
2231 (application:openFile, application:openTempFile:):
2232 (application:openFileWithoutUI:, application:openFiles:): Open file
2233 if not_in_argv returns non-zero (bug#12171).
2234
2235 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2236 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2237 Define for Gtk+ versions less than 3.2.
2238 (xg_get_font_name): Use those functions/macros here.
2239 Reported by Frans Oilinki <moilinki@gmail.com>.
2240
2241 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2242
2243 * unexmacosx.c (copy_data_segment): Copy initialized data in
2244 statically linked libraries from input file rather than memory.
2245
2246 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2247 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2248 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2249
2250 2012-08-10 Glenn Morris <rgm@gnu.org>
2251
2252 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2253 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2254
2255 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2256
2257 Fix last change to allow compilation with low optimization levels.
2258 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2259 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2260
2261 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2262
2263 Use common inline syntax in intervals.h.
2264 * intervals.h (INTERVALS_INLINE): New macro.
2265 Change all users from LISP_INLINE.
2266
2267 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2268
2269 Define Qnone once for all platforms.
2270 * frame.c (Qnone): Define here.
2271 (syms_of_frame): DEFSYM it.
2272 * lisp.h (Qnone): New declaration.
2273 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2274 * xfns.c: Remove duplication. Adjust users.
2275
2276 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2277
2278 Remove unused macros from intervals.h.
2279 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2280 * intervals.c: Adjust comment.
2281
2282 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2283
2284 * w32fns.c <w32_unicode_gui>: New static variable.
2285 (globals_of_w32fns): Initialize it according to os_subtype.
2286 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2287 testing os_subtype.
2288
2289 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2290 Eli Zaretskii <eliz@gnu.org>
2291
2292 Fix bug #10299 with Unicode characters sent by customized
2293 keyboards created by MSKLC.
2294 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2295 (w32_init_class): Use it to initialize the Emacs class with either
2296 ANSI or Unicode API calls.
2297 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2298 later.
2299 (w32_wnd_proc): If the character code sent by WM_CHAR or
2300 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2301 original message. Call DefWindowProcW on NT and later.
2302
2303 2012-08-10 Glenn Morris <rgm@gnu.org>
2304
2305 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2306
2307 * lisp.h (DIRECTORY_SEP): Let configure set it.
2308
2309 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2310
2311 Use TSET for write access to Lisp_Object slots of struct terminal.
2312 * termhooks.h (TSET): New macro.
2313 * coding.c, terminal.c, xselect.c: Adjust users.
2314
2315 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2316
2317 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2318 the failing expression, include them in the error message.
2319 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2320 * lisp.h (internal_condition_case_n): Update declaration.
2321
2322 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2323
2324 Inline functions to examine and change buffer overlays.
2325 * buffer.c (unchain_both): New function.
2326 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2327 (buffer_has_overlays): New function.
2328 (enum overlay_type): New enum.
2329 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2330 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2331
2332 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2333
2334 Inline functions to examine and change buffer intervals.
2335 * alloc.c (mark_interval_tree): Remove.
2336 (MARK_INTERVAL_TREE): Simplify.
2337 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2338 * intervals.c (buffer_balance_intervals): New function.
2339 (graft_intervals_into_buffer): Adjust indentation.
2340 (set_intervals_multibyte): Simplify.
2341 * buffer.h (BUF_INTERVALS): Remove.
2342 (buffer_get_intervals, buffer_set_intervals): New function.
2343 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2344 * intervals.c, textprop.c: Adjust users.
2345
2346 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2347
2348 Inline functions to examine and change string intervals.
2349 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2350 (string_get_intervals, string_set_intervals): New function.
2351 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2352 * lread.c, print.c, textprop.c: Adjust users.
2353
2354 2012-08-08 Glenn Morris <rgm@gnu.org>
2355
2356 * lisp.mk (lisp): Remove language/persian.elc.
2357
2358 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2359
2360 Cleanup intervals.
2361 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2362 (NULL_INTERVAL_P): Likewise. Adjust users.
2363 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2364 Adjust comment. Move under #if 0.
2365 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2366 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2367
2368 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2369
2370 Check total length of intervals with eassert.
2371 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2372 * intervals.c: Change all users to eassert.
2373
2374 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2375
2376 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2377 Rename fields to match removal of FGET and WGET and disuse of
2378 INTERNAL_FIELD in Lisp_Cons.
2379
2380 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2381
2382 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2383 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2384 name since all xname users are fixed long time ago. Do not
2385 use INTERNAL_FIELD.
2386 (set_symbol_name, set_symbol_function, set_symbol_plist):
2387 (set_symbol_next, set_overlay_plist): New function.
2388 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2389 (struct Lisp_Overlay): Likewise.
2390 (CVAR, MVAR, SVAR): Remove.
2391 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2392 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2393 * xterm.c: Adjust users.
2394 * .gdbinit: Change to use name field of struct Lisp_Symbol
2395 where appropriate.
2396
2397 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2398
2399 Basic functions to set Lisp_Object and pointer slots of intervals.
2400 * intervals.h (interval_set_parent, interval_set_object):
2401 (interval_set_left, interval_set_right, interval_set_plist):
2402 (interval_copy_parent): New function.
2403 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2404 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2405 Adjust indentation.
2406 (INTERVAL_SIZE): Remove. Adjust users.
2407 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2408
2409 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2410
2411 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2412 * process.h (PGET): Remove.
2413 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2414 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2415
2416 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2417
2418 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2419 * window.h (WGET): Remove.
2420 (struct window): Do not use INTERNAL_FIELD.
2421 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2422 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2423 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2424 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2425 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2426 Adjust users.
2427
2428 2012-08-07 Chong Yidong <cyd@gnu.org>
2429
2430 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2431 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2432 (Fdelete_window_internal): Signal an error if the window is not on
2433 a live frame (Bug#12025).
2434
2435 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2436
2437 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2438 * frame.h (FGET): Remove.
2439 (struct frame): Do not use INTERNAL_FIELD.
2440 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2441 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2442 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2443 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2444
2445 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2446
2447 * w32.c: Silence compiler warnings.
2448 (map_w32_filename): Remove unused variable `is_fat'.
2449 (chase_symlinks): Add parentheses around expression.
2450
2451 2012-08-06 Glenn Morris <rgm@gnu.org>
2452
2453 * sysdep.c: Respect BROKEN_GETWD.
2454
2455 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2456 Let configure handle it.
2457 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2458
2459 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2460
2461 Use GCALIGNMENT where appropriate.
2462 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2463 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2464 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2465
2466 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2467
2468 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2469 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2470
2471 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2472
2473 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2474 that should be sufficient for everyone.
2475
2476 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2477
2478 * keyboard.c (timer_check_2): Add break so timer_check returns next
2479 timeout.
2480
2481 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2482
2483 Fix Windows build errors introduced after converting to WGET and WSET.
2484 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2485 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2486
2487 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2488
2489 * nsterm.m (ns_frame_rehighlight): Use FSET.
2490
2491 * nsmenu.m (ns_update_menubar): Use FSET.
2492
2493 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2494
2495 Separate read and write access to Lisp_Object slots of Lisp_Process.
2496 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2497 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2498
2499 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2500
2501 Separate read and write access to Lisp_Object slots of struct window.
2502 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2503 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2504 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2505 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2506 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2507 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2508 Adjust users.
2509
2510 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2511
2512 Fix Windows build errors introduced after converting to FGET and FSET.
2513 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2514 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2515 (w32_judge_scroll_bars): Change to use FSET.
2516 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2517
2518 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2519
2520 Fix replacement typo.
2521 * window.c (replace_window): Set root_window instead of
2522 selected_window. This fixes a total window subsystem
2523 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2524
2525 2012-08-06 Glenn Morris <rgm@gnu.org>
2526
2527 * lisp.mk (lisp): Add language/persian.elc.
2528
2529 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2530
2531 Separate read and write access to Lisp_Object slots of struct frame.
2532 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2533 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2534 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2535 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2536 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2537
2538 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2539
2540 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2541
2542 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2543
2544 Generalize common compile-time constants.
2545 * lisp.h (header_size, bool_header_size, word_size): Now here.
2546 (struct Lisp_Vector): Add comment.
2547 (struct Lisp_Bool_Vector): Move up to define handy constants.
2548 (VECSIZE, PSEUDOVECSIZE): Simplify.
2549 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2550 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2551 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2552 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2553 * xfont.c, xmenu.c: Use word_size where appropriate.
2554
2555 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2556
2557 * search.c (Freplace_match): Treat \? in the replacement text
2558 literally (Bug#8161).
2559
2560 2012-08-05 Chong Yidong <cyd@gnu.org>
2561
2562 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2563 * frame.c (Vdelete_frame_functions):
2564 * emacs.c (Vkill_emacs_hook): Doc fix.
2565
2566 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2567
2568 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2569 --with-x-toolkit=no builds.
2570 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2571
2572 2012-08-04 Chong Yidong <cyd@gnu.org>
2573
2574 * syntax.c (Fmodify_syntax_entry): Doc fix.
2575
2576 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2577
2578 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2579 * w32.c (init_environment): Change the default values of many
2580 environment variables in dflt_envvars[] to NULL, to avoid pushing
2581 them into environment when they were not already defined.
2582 Remove the code that deletes site-lisp subdirectories from the default
2583 value of EMACSLOADPATH, as it is no longer needed.
2584 (check_windows_init_file): Now external, not static.
2585 Use Vload_path as is, without adding anything, as this function is now
2586 called when Vload_path is already set up.
2587
2588 * w32.h (check_windows_init_file): Add prototype.
2589
2590 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2591 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2592 compatibility with Posix platforms.
2593 (main): Move the call to check_windows_init_file to here from
2594 w32.c.
2595 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2596 any, in the DEFALT argument into the root of the Emacs build or
2597 installation tree, as appropriate.
2598
2599 * callproc.c (init_callproc_1): Call decode_env_path instead of
2600 doing its equivalent by hand.
2601 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2602 the code that sets Vexec_path run on MS-Windows.
2603
2604 * lread.c (init_lread): Add comments to #ifdef's.
2605
2606 * msdos.c (dos_set_window_size, IT_update_begin)
2607 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2608 instead of direct references.
2609
2610 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2611
2612 Export DEFAULT_REHASH_* to GDB.
2613 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2614 Now constants, not macros.
2615
2616 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2617
2618 Remove unnecessary casts involving pointers.
2619 These casts are no longer needed now that we assume C89 or later,
2620 since they involve casting to or from void *.
2621 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2622 (make_pure_float, make_pure_vector):
2623 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2624 * macros.c (Fstart_kbd_macro):
2625 * menu.c (find_and_return_menu_selection):
2626 * minibuf.c (read_minibuf_noninteractive):
2627 * sysdep.c (closedir):
2628 * xdisp.c (x_produce_glyphs):
2629 * xfaces.c (compare_fonts_by_sort_order):
2630 * xfns.c (x_real_positions, select_visual):
2631 * xselect.c (x_stop_queuing_selection_requests)
2632 (x_get_window_property, x_get_window_property_as_lisp_data):
2633 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2634 Remove unnecessary pointer casts.
2635 * alloc.c (record_xmalloc): New function.
2636 * lisp.h (record_xmalloc): New decl.
2637 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2638 more like a function. This is because the pointer cast is not
2639 needed. All uses changed.
2640 * print.c (print_string, print_error_message): Avoid length recalc.
2641
2642 Improve fix for macroexp crash with debugging (Bug#12118).
2643 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2644 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2645 not supposed to be invoked from the garbage collector.
2646 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2647 (gc_aset): New function, which is like ASET but can be
2648 used in the garbage collector.
2649 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2650 (set_hash_index): Use it instead of ASET.
2651
2652 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2653
2654 Support symlinks on latest versions of MS-Windows.
2655 * w32.c: Include winioctl.h and aclapi.h.
2656 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2657 (revert_to_self): Forward declarations of static functions.
2658 <static BOOL g_b_init_get_security_info>:
2659 <g_b_init_create_symbolic_link>: New static flags.
2660 (globals_of_w32): Initialize them to zero.
2661 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2662 (map_w32_filename): Improve commentary. Simplify switch.
2663 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2664 headers (most versions of MinGW w32api don't).
2665 (get_security_info, create_symbolic_link)
2666 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2667 New functions.
2668 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2669 in the argument file name.
2670 (sys_access): Call unc_volume_file_attributes only if
2671 GetFileAttributes fails with network-related error codes.
2672 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2673 have the required privileges.
2674 (get_file_security_desc_by_name): Rename from
2675 get_file_security_desc.
2676 (stat_worker): New function, with most of the guts of 'stat', and
2677 with addition of handling of symlinks and support for 'lstat'.
2678 If possible, get file's attributes and security information by
2679 handle, not by name. Produce S_IFLNK bit for symlinks, when
2680 called from 'lstat'.
2681 (stat, lstat): New functions, call 'stat_worker'.
2682 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2683 symlinks when the underlying filesystem supports them.
2684
2685 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2686
2687 Fix macroexp crash on Windows with debugging (Bug#12118).
2688 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2689 checking subscripts; problem introduced with the recent
2690 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2691 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2692 since it's used in non-static inline functions now.
2693
2694 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2695 Don't assume buffer size fits in 'int'. Remove unused local.
2696
2697 Use C99-style 'extern inline' if available.
2698 * buffer.h (BUFFER_INLINE):
2699 * category.h (CATEGORY_INLINE):
2700 * character.h (CHARACTER_INLINE):
2701 * charset.h (CHARSET_INLINE):
2702 * composite.h (COMPOSITE_INLINE):
2703 * dispextern.h (DISPEXTERN_INLINE):
2704 * lisp.h (LISP_INLINE):
2705 * systime.h (SYSTIME_INLINE):
2706 New macro, replacing 'static inline' in this header.
2707 * buffer.h, category.h, character.h, charset.h, composite.h:
2708 * dispextern.h, lisp.h, systime.h:
2709 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2710 * alloc.c (LISP_INLINE):
2711 * buffer.c (BUFFER_INLINE):
2712 * category.c (CATEGORY_INLINE):
2713 * character.c (CHARACTER_INLINE):
2714 * charset.c (CHARSET_INLINE):
2715 * composite.c (COMPOSITE_INLINE):
2716 * dispnew.c (DISPEXTERN_INLINE):
2717 * sysdep.c (SYSTIME_INLINE):
2718 Define to EXTERN_INLINE, so that the corresponding functions
2719 are compiled into code.
2720 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2721 (INLINE_HEADER_END): New macros.
2722 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2723 since it's used in non-static inline functions now.
2724 (VALMASK) [!USE_LSB_TAG]: Likewise.
2725
2726 2012-08-02 Glenn Morris <rgm@gnu.org>
2727
2728 * s/: Remove empty directory.
2729
2730 * s/ms-w32.h: Move to ../nt/inc.
2731 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2732 Update for new ms-w32.h location.
2733
2734 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2735
2736 Port to Solaris 8.
2737 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2738
2739 2012-08-02 Glenn Morris <rgm@gnu.org>
2740
2741 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2742 hard-coding the path separator.
2743
2744 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2745
2746 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2747 This how ASET and AREF are supposed to work, and makes
2748 it easier to think about future improvements. See
2749 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2750 * charset.h (set_charset_attr): New function.
2751 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2752 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2753 (aref_addr): New function. All uses of &AREF(...) changed.
2754 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2755 (set_hash_index): New functions. All lvalue-style uses of
2756 HASH_KEY etc. changed.
2757 * keyboard.c (set_prop): New function. All lvalue-style uses
2758 of PROP changed.
2759
2760 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2761
2762 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2763 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2764 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2765 * nsfns.m (ns_set_name_as_filename): Likewise.
2766 * nsmenu.m (ns_update_menubar): Likewise.
2767 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2768
2769 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2770
2771 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2772 Adapt to latest changes in field names of the corresponding Lisp
2773 objects.
2774
2775 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2776
2777 2012-08-01 Glenn Morris <rgm@gnu.org>
2778
2779 * s/msdos.h: Remove file.
2780 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2781 * Makefile.in (S_FILE): Remove.
2782 (config_h): Remove S_FILE.
2783
2784 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2785
2786 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2787 Remove; moved to nt/config.nt.
2788
2789 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2790
2791 Use INTERNAL_FIELD for conses and overlays.
2792 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2793 Remove obsolete comment.
2794 (MVAR): New macro.
2795 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2796 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2797
2798 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2799
2800 Use INTERNAL_FIELD for symbols.
2801 * lisp.h (SVAR): New macro. Adjust users.
2802 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2803 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2804
2805 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2806
2807 Use INTERNAL_FIELD for processes.
2808 * process.h (PVAR): New macro. Adjust style.
2809 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2810 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2811
2812 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2813
2814 Use INTERNAL_FIELD for windows.
2815 * window.h (WVAR): New macro.
2816 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2817 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2818 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2819 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2820 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2821 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2822
2823 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2824
2825 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2826
2827 2012-08-01 Glenn Morris <rgm@gnu.org>
2828
2829 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2830 Move to configure.ac.
2831
2832 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2833
2834 * makefile.w32-in (CONFIG_H): Update dependencies.
2835 (CONF_POST_H): New macro.
2836
2837 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2838
2839 2012-07-31 Glenn Morris <rgm@gnu.org>
2840
2841 * Makefile.in (S_FILE): No longer set by configure.
2842
2843 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2844 is available.
2845 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2846
2847 * process.h (NULL_DEVICE):
2848 * emacs.c (SEPCHAR):
2849 * editfns.c (USER_FULL_NAME): Let configure set them.
2850
2851 * s/README, s/template.h: Remove files.
2852
2853 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2854
2855 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2856 Move to configure.ac.
2857
2858 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2859
2860 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2861 resulting renaming of 'struct frame' members.
2862
2863 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2864
2865 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2866 after introduction of FVAR.
2867
2868 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2869
2870 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2871
2872 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2873 instead of compositeToPoint.
2874 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2875
2876 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2877
2878 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2879
2880 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2881 * lisp.h (INTERNAL_FIELD): New macro.
2882 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2883 (BVAR): Change to use INTERNAL_FIELD.
2884 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2885 (KVAR): Change to use INTERNAL_FIELD.
2886 * frame.h (FVAR): New macro.
2887 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2888 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2889 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2890 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2891 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2892
2893 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2894
2895 Miscellaneous fixes for non-default X toolkits.
2896 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2897 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2898 Move under #ifdef USE_LUCID.
2899 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2900 definition and usage to avoid warnings.
2901
2902 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2903
2904 * nsterm.m (openFiles): Fix previous checkin.
2905
2906 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2907
2908 * indent.c (compute_motion): Remove unused local.
2909
2910 2012-07-31 Glenn Morris <rgm@gnu.org>
2911
2912 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2913
2914 * conf_post.h [USG5_4]:
2915 Move remaining contents of s/usg5-4-common.h here.
2916 * s/usg5-4-common.h: Remove file.
2917
2918 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2919 * s/irix6-5.h: Remove file.
2920
2921 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2922 * s/darwin.h: Remove file.
2923
2924 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2925 * s/hpux10-20.h: Remove file, which is now empty.
2926
2927 2012-07-30 Glenn Morris <rgm@gnu.org>
2928
2929 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2930 * Makefile.in (config_h): Add conf_post.h.
2931 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2932
2933 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2934
2935 * nsterm.m (ns_do_open_file): New variable.
2936 (ns_term_init): Set ns_do_open_file to YES after run returns.
2937 (openFile, openTempFile, openFileWithoutUI, openFiles):
2938 Open files only if ns_do_open_file.
2939
2940 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2941
2942 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2943 This no-op macro hasn't been needed for many years.
2944 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2945
2946 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2947 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2948 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2949 gdb_make_enums_visible.
2950 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2951 (DIRECTORY_SEP): Now a constant, not a macro.
2952
2953 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2954
2955 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2956 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2957
2958 * w32term.c <w32_keyboard_codepage>: Renamed from
2959 keyboard_codepage and now external. All users changed.
2960
2961 * w32term.h: Add declaration of w32_keyboard_codepage.
2962
2963 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2964 the codepage to translate keys to Unicode. If this argument is
2965 -1, use the value returned by GetConsoleCP. All callers changed.
2966
2967 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2968
2969 Update .PHONY listings in makefiles.
2970 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2971 bootstrap-clean, distclean, maintainer-clean, versioclean,
2972 extraclean, frc.
2973
2974 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2975 This is a bit clearer. Fix some commentary typos.
2976
2977 2012-07-30 Glenn Morris <rgm@gnu.org>
2978
2979 * s/netbsd.h: Let configure include signal.h if needed.
2980 Remove file, which is now empty.
2981
2982 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2983 Let configure set them.
2984 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2985 No more need to undefine.
2986
2987 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2988
2989 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2990 non-single-byte char when adding meta modifier. (Bug#12090)
2991
2992 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2993
2994 Convert safe_call to use variable number of arguments.
2995 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2996 (safe_call2): Fix comment.
2997 * lisp.h (safe_call): Adjust prototype.
2998 * coding.c (encode_coding_object): Change to use safe_call2.
2999 * xfaces.c (merge_face_heights): Change to use safe_call1.
3000
3001 2012-07-30 Glenn Morris <rgm@gnu.org>
3002
3003 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3004 does that unconditionally. Remove file, which is now empty.
3005
3006 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3007 Remove empty files.
3008
3009 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3010
3011 Export to GDB most of lisp.h's remaining object-like macros.
3012 * lisp.h (min, max): Move earlier, because they're used earlier now.
3013 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3014 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3015 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3016 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3017 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3018 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3019 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3020 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3021 Now constants, for GDB. They need not be macros.
3022 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3023 Now constants, for GDB, as well as macros, for static initializers.
3024 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3025 Move to after the definition of struct Lisp_Char_Table,
3026 since the former now needs that type defined.
3027 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3028 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3029 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3030 New enums, for gdb_make_enums_visible.
3031 (GLYPH_MODE_LINE_FACE): Remove; unused.
3032 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3033 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3034 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3035 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3036 enum maxargs, enum MAX_ALLOCA.
3037 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3038 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3039 no longer needed, now that they are done in lisp.h.
3040
3041 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3042
3043 Cleanup string bytes checking.
3044 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3045 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3046 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3047 (check_sblock, compact_small_strings): Simplify.
3048
3049 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3050
3051 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3052 These macros are confusing and no longer need to be defined, as
3053 the enum values now suffice. All uses replaced with definiens.
3054 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3055
3056 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3057
3058 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3059 ($(BLD)/w32console.$(O)): Update dependencies.
3060
3061 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3062
3063 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3064 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3065 time. Adjust users.
3066 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3067
3068 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3069
3070 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3071 setting sitelisp (Bug#12010).
3072
3073 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3074
3075 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3076
3077 * w32heap.c (cache_system_info):
3078 * w32.c (sys_rename):
3079 * w32proc.c (find_child_console, sys_kill): All users changed.
3080
3081 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3082
3083 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3084
3085 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3086
3087 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3088
3089 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3090
3091 Cleanup statistics calculation in Fgarbage_collect.
3092 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3093 Fix zombies percentage calculation. Simplify elapsed time calculation.
3094
3095 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3096
3097 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3098 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3099 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3100 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3101 (replace_range, replace_range_2, del_range_2): Change to eassert.
3102 * marker.c (byte_char_debug_check): Adjust style.
3103
3104 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3105
3106 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3107 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3108 long-ago-commented-out code that talks about "WIN32".
3109 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3110 All uses changed.
3111
3112 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3113
3114 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3115 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3116 Simplify by using alignof.
3117 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3118 * lisp.h: Include <stdalign.h>.
3119 (GCALIGNMENT): New macro and constant.
3120 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3121 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3122 (stdalign): New macro, if not already defined.
3123
3124 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3125
3126 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3127 * w32inevt.c: Include w32inevt.h.
3128 (w32_read_console_input): New inline function, calls either
3129 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3130 w32_console_unicode_input.
3131 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3132 (w32_kbd_patch_key, key_event): Use the codepage returned by
3133 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3134 (key_event): use uChar.UnicodeChar only if
3135 w32_console_unicode_input is non-zero.
3136
3137 * w32console.c: Include w32heap.h.
3138 <w32_console_unicode_input>: New global variable.
3139 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3140 family of Windows, zero otherwise.
3141
3142 * w32inevt.h: Declare w32_console_unicode_input.
3143
3144 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3145 --without-x. (Bug#11742)
3146
3147 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3148
3149 Adjust GDB to reflect pvec_type changes (Bug#12036).
3150 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3151 2012-07-04 changes to pseudovector representation.
3152 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3153
3154 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3155
3156 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3157 bus address.
3158 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3159
3160 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3161
3162 * alloc.c (listn): Fix the order the arguments are consed onto the
3163 list.
3164
3165 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3166 enumeration constants, as PURE and HEAP are too general, and clash
3167 with other headers and sources, such as gmalloc.c and the
3168 MS-Windows system headers. All users changed.
3169
3170 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3171
3172 Revert last save_excursion_save and save_excursion_restore changes.
3173 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3174 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3175
3176 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3177
3178 Fix recently-introduced typos in Windows port.
3179 Reported by Martin Rudalics <rudalics@gmx.at>.
3180 * w32.c (init_environment): Replace comma with semicolon.
3181 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3182
3183 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3184
3185 Improve GDB symbol export (Bug#12036).
3186 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3187 arms of an 'if', not using conditional expressions; otherwise GDB
3188 complains about the types in the unevaluated arm when the argument
3189 is an integer literal.
3190 (xgetint): Simplify expression.
3191 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3192 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3193 Zaretskii in <http://bugs.gnu.org/12036#13>.
3194 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3195 needed now that we have gdb_make_enums_visible.
3196 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3197 (enum enum_USE_LSB_TAG):
3198 New enum types, packaging up enums that need to be exported to GDB.
3199
3200 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3201
3202 Utility function to make a list from specified amount of objects.
3203 * lisp.h (enum constype): New datatype.
3204 (listn): New prototype.
3205 * alloc.c (listn): New function.
3206 (Fmemory_use_count, syms_of_alloc): Use it.
3207 * buffer.c (syms_of_buffer): Likewise.
3208 * callint.c (syms_of_callint): Likewise.
3209 * charset.c (define_charset_internal): Likewise.
3210 * coding.c (syms_of_coding): Likewise.
3211 * keymap.c (syms_of_keymap): Likewise.
3212 * search.c (syms_of_search): Likewise.
3213 * syntax.c (syms_of_syntax): Likewise.
3214 * w32.c (init_environment): Likewise.
3215 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3216 * xdisp.c (syms_of_xdisp): Likewise.
3217 * xfns.c (syms_of_xfns): Likewise.
3218
3219 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3220
3221 Fast save_excursion_save and save_excursion_restore.
3222 * lisp.h (struct Lisp_Excursion): New data type.
3223 (PVEC_EXCURSION): New pseudovector type.
3224 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3225 to deal with it. Adjust comments.
3226 (init_marker, attach_marker): New prototype.
3227 (unchain_marker): Adjust prototype.
3228 * marker.c (attach_marker): Change to global.
3229 (init_marker): New function.
3230 * alloc.c (Fmake_marker, build_marker): Use it.
3231 (build_marker): More easserts.
3232 (mark_object): Handle struct Lisp_Excursion.
3233 * editfns.c (save_excursion_save, save_excursion_restore):
3234 Reimplement to use struct Lisp_Excursion. Add comments.
3235
3236 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3237
3238 Fix export of symbols to GDB (Bug#12036).
3239 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3240 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3241 emacs.c, as this is a more-suitable home. Had this been done earlier
3242 the fix for 12036 would have avoided some of the problems noted in
3243 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3244 would have been more obvious.
3245 * emacs.c: Do not include <verify.h>; no longer needed.
3246 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3247 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3248 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3249 Remove; now done in lisp.h.
3250 * lisp.h (PUBLISH_TO_GDB): New macro.
3251 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3252 (DATA_SEG_BITS): Use it.
3253 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3254 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3255 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3256 not be usable in #if. This simplifies things.
3257
3258 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3259
3260 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3261
3262 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3263
3264 Simplify export of symbols to GDB (Bug#12036).
3265 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3266 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3267 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3268 Adjust to changes in lisp.h and emacs.c, by using
3269 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3270 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3271 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3272 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3273 instead of gdb_valbits.
3274 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3275 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3276 instead of gdb_array_mark_flag.
3277 (xboolvector): Get size from $->size, not $->header.size.
3278 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3279 (xreload, hook-run, hookpost-run): Remove.
3280 * emacs.c: Include <verify.h>.
3281 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3282 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3283 Remove.
3284 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3285 (gdb_USE_LSB_TAG): New enum constants.
3286 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3287 Also define these as enum constants, so they're visible to GDB.
3288 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3289 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3290 as constants, so they're visible to GDB.
3291 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3292 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3293 Now enum constants, not macros, so they're visible to GDB.
3294 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3295 more convenient now. All uses changed.
3296 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3297 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3298
3299 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3300
3301 Explicitly free restriction data that are not needed anymore.
3302 * editfns.c (save_restriction_restore): Free restriction data.
3303
3304 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3305
3306 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3307 add argument, tune behavior, and adjust all callers.
3308
3309 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3310
3311 Use typedef for EMACS_INT, EMACS_UINT.
3312 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3313 than macros. This simplifies debugging in the usual case, since
3314 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3315 and it allows expressions involving EMACS_INT casts.
3316 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3317
3318 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3319
3320 * nsterm.m (ns_read_socket): Return early if there is a modal
3321 window (Bug#12043).
3322
3323 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3324
3325 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3326 that FOCUS-FRAME can be omitted.
3327
3328 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3329
3330 Adjust buffer text indirection counters at the end of Fkill_buffer.
3331 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3332 buffer is definitely dead. This should really fix an issue reported
3333 by Christoph Scholtes again. (Bug#12007).
3334 (init_buffer_once): Initialize indirection counters of
3335 buffer_defaults and buffer_local_symbols (for sanity and safety).
3336
3337 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3338
3339 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3340 and continuation glyphs on tooltip frames, leave them at zero.
3341 Avoids continued lines in tooltips. (Bug#11832)
3342
3343 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3344
3345 Simplify copy_overlay.
3346 * buffer.c (copy_overlay): Simplify. Use build_marker.
3347 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3348
3349 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3350
3351 * print.c (print_object): Don't crash when a frame's name is nil
3352 or invalid. (Bug#12025)
3353
3354 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3355 it signals an error when a tooltip frame is being created.
3356
3357 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3358
3359 Cleanup miscellaneous objects allocation and initialization.
3360 * alloc.c (allocate_misc): Change to static. Add argument to
3361 specify the subtype. Adjust comment and users.
3362 (build_overlay): New function.
3363 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3364 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3365 (allocate_misc): Remove prototype.
3366 (build_overlay): Add prototype.
3367
3368 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3369
3370 Swap buffer text indirection counters in Fbuffer_swap_text.
3371 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3372 This avoids crash reported by Christoph Scholtes at
3373 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3374
3375 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3376
3377 * nsmenu.m (Popdown_data): New struct.
3378 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3379 free Popdown_data.
3380 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3381 (initWithContentRect): Make imgView and contentView non-static
3382 and autorelease them. Also autorelease img and matrix (Bug#12005).
3383 (dealloc): Remove (Bug#12005).
3384
3385 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3386
3387 Adjust consing_since_gc when objects are explicitly freed.
3388 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3389 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3390 (free_cons, free_misc): Subtract object size from consing_since_gc.
3391
3392 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3393
3394 Simplify and cleanup markers positioning code.
3395 * marker.c (attach_marker): More useful eassert.
3396 (live_buffer, set_marker_internal): New function.
3397 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3398 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3399
3400 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3403 as it's limited by the amount of memory, not by INT_MAX.
3404
3405 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3406
3407 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3408 in special-event-map. See the discussion at
3409 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3410 for the reasons.
3411
3412 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3413 info.dwItemData. Fixes crashes on 64-bit Windows.
3414 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3415
3416 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3417
3418 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3419 (conversationIdentifier): Return value is NSInteger.
3420 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3421
3422 2012-07-21 Chong Yidong <cyd@gnu.org>
3423
3424 * window.c (decode_any_window): Signal an error if the window is
3425 on a dead frame (Bug#11984).
3426
3427 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3428
3429 Add indirection counting to speed up Fkill_buffer.
3430 * buffer.h (struct buffer): New member.
3431 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3432 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3433 base buffer indirection counter.
3434 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3435 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3436 through buffer list if indirection counter is 0.
3437
3438 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3439
3440 Extend the value returned by Fgarbage_collect with heap statistics.
3441 * alloc.c (Qheap): New symbol.
3442 (syms_of_alloc): DEFSYM it.
3443 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3444 (Fmemory_free): Remove.
3445 (syms_of_alloc): Don't defsubr it.
3446 * buffer.c (Fcompact_buffer): Remove.
3447 (syms_of_buffer): Don't defsubr it.
3448
3449 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3450
3451 Make maybe_gc inline.
3452 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3453 * lisp.h (consing_since_gc, gc_relative_threshold)
3454 (memory_full_cons_threshold): Revert declaration.
3455 (maybe_gc): Remove prototype, define as inline.
3456 * alloc.c: Remove old commented-out code.
3457 (consing_since_gc, gc_relative_threshold)
3458 (memory_full_cons_threshold): Revert to global.
3459 (maybe_gc): Remove.
3460
3461 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3462
3463 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3464 * lisp.h (build_unibyte_string): New function.
3465 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3466 * sysdep.c, w32fns.c, xfns.c: Use it.
3467 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3468 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3469 Adjust users accordingly.
3470 * font.h (font_open_by_name): Adjust prototype.
3471
3472 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3473
3474 Cleanup calls to Fgarbage_collect.
3475 * lisp.h (maybe_gc): New prototype.
3476 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3477 Remove declarations.
3478 * alloc.c (maybe_gc): New function.
3479 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3480 Make them static.
3481 * bytecode.c (MAYBE_GC): Use maybe_gc.
3482 * eval.c (eval_sub, Ffuncall): Likewise.
3483 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3484 to avoid dependency from auto-save feature.
3485
3486 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3487
3488 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3489 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3490 'for_each_per_buffer_object_at'.
3491 All uses changed. It's better to use upper-case for macros that
3492 cannot be implemented as functions, to give the reader a clue
3493 that they're special.
3494
3495 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3496
3497 * alloc.c (Fgarbage_collect): Tweak docstring.
3498
3499 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3500
3501 Tweak the value returned from Fgarbage_collect again.
3502 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3503 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3504 Adjust documentation.
3505 (total_vector_bytes): Rename to total_vector_slots, adjust
3506 accounting.
3507 (total_free_vector_bytes): Rename to total_free_vector_slots,
3508 adjust accounting.
3509 (Qstring_bytes, Qvector_slots): New symbols.
3510 (syms_of_alloc): DEFSYM them.
3511
3512 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3513
3514 Buffer compaction primitive which may be used from Lisp.
3515 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3516 (syms_of_buffer): Register Fcompact_buffer.
3517 * alloc.c (Fgarbage_collect): Use compact_buffer.
3518 * buffer.h (compact_buffer): New prototype.
3519 (struct buffer_text): New member.
3520
3521 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3522
3523 New macro to iterate over all buffers, miscellaneous cleanups.
3524 * lisp.h (all_buffers): Remove declaration.
3525 * buffer.h (all_buffers): Add declaration, with comment.
3526 (for_each_buffer): New macro.
3527 * alloc.c (Fgarbage_collect, mark_object): Use it.
3528 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3529 (init_buffer): Likewise.
3530 * data.c (Fset_default): Likewise.
3531 * coding.c (code_conversion_restore): Remove redundant check
3532 for dead buffer.
3533 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3534
3535 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3536
3537 Fix bug that created negative-length intervals.
3538 * intervals.c (merge_interval_right, merge_interval_left):
3539 Do not zero out this interval if it is absorbed by its children,
3540 as this interval's total length doesn't change in that case. See
3541 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3542
3543 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3544
3545 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3546 when invoking (make-bool-vector N t) and N is a positive
3547 multiple of 8 -- the last 8 bits were mistakenly cleared.
3548
3549 Remove some struct layout assumptions in bool vectors.
3550 * alloc.c (bool_header_size): New constant.
3551 (header_size, word_size): Move earlier, as they're now used earlier.
3552 Use 'word_size' in a few more places, where it's appropriate.
3553 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3554 padding before the data member of a bool vector.
3555 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3556 than doing the check by hand with an abort ().
3557
3558 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3559
3560 * eval.c (Fdefvar): Don't check constants since we only set the var if
3561 it's not yet defined anyway (bug#11904).
3562
3563 * lisp.h (last_undo_boundary): Declare new var.
3564 * keyboard.c (command_loop_1): Set it.
3565 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3566 were auto-added by the command loop (bug#11774).
3567
3568 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3569
3570 * w32font.c (Qsymbol): Remove local definition.
3571 (syms_of_w32font): Don't DEFSYM it.
3572
3573 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3574
3575 Fix sweep_vectors to handle large bool vectors correctly.
3576 * alloc.c (sweep_vectors): Account total_vector_bytes for
3577 bool vectors larger than VBLOCK_BYTES_MAX.
3578
3579 2012-07-18 Chong Yidong <cyd@gnu.org>
3580
3581 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3582 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3583
3584 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3585
3586 Return more descriptive data from Fgarbage_collect.
3587 Suggested by Stefan Monnier in
3588 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3589 * alloc.c (bounded_number): New function.
3590 (total_buffers, total_vectors): New variable.
3591 (total_string_size): Rename to total_string_bytes, adjust users.
3592 (total_vector_size): Rename to total_vector_bytes, adjust users.
3593 (sweep_vectors): Account total_vectors and total_vector_bytes.
3594 (Fgarbage_collect): New return value. Adjust documentation.
3595 (gc_sweep): Account total_buffers.
3596 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3597 (VECTOR_SIZE): Remove.
3598 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3599 (Qinterval, Qmisc): New symbols.
3600 (syms_of_data): Initialize them.
3601 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3602 (Qcons, Qbuffer): New declarations.
3603
3604 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3605
3606 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3607 Round up, not down. Improve doc.
3608
3609 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3610
3611 Restore old code in allocate_string_data to avoid Faset breakage.
3612 Reported by Julien Danjou <julien@danjou.info> in
3613 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3614 * alloc.c (allocate_string_data): Restore old code with minor
3615 adjustments, fix comment to explain this subtle issue.
3616
3617 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3618
3619 Remove FILE_SYSTEM_CASE.
3620 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3621
3622 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3623 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3624 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3625 call-process-region passes it through expand-file-name.
3626
3627 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3628
3629 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3630
3631 Fix crash when creating indirect buffer (Bug#11917)
3632 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3633 Don't handle unbound variables specially if non-zero.
3634 (Fbuffer_local_variables): Pass zero.
3635 (clone_per_buffer_values): Pass non-zero.
3636
3637 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3638
3639 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3640 to make the loop interruptible.
3641
3642 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3643
3644 * gnutls.c (emacs_gnutls_handshake): Only retry if
3645 GNUTLS_E_INTERRUPTED.
3646
3647 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3648
3649 Cleanup and convert miscellaneous checks to eassert.
3650 * alloc.c (mark_interval): Fix comment, partially rephrase
3651 old comment from intervals.h (see below).
3652 * intervals.c (find_interval, adjust_intervals_for_insertion)
3653 (delete_interval, adjust_intervals_for_deletion)
3654 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3655 Convert to eassert.
3656 (adjust_intervals_for_insertion, make_new_interval):
3657 Remove obsolete and unused code.
3658 * intervals.h (struct interval): Remove obsolete comment.
3659 * textprotp.c (erase_properties): Remove unused code.
3660 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3661 (Fremove_list_of_text_properties): Convert to eassert.
3662
3663 2012-07-17 Chong Yidong <cyd@gnu.org>
3664
3665 * editfns.c (Finsert_char): Doc fix.
3666
3667 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3668
3669 Fix previous change to make Fmemory_free always accurate.
3670 * alloc.c (make_interval): Update total_free_intervals.
3671 (make_float): Likewise for total_free_floats.
3672 (free_cons, Fcons): Likewise for total_free_conses.
3673 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3674 Likewise for total_free_vector_bytes.
3675 (Fmake_symbol): Likewise for total_free_symbols.
3676 (bytes_free): Remove.
3677
3678 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3679
3680 Simple free memory accounting feature.
3681 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3682 (sweep_vectors): Accumulate size of free vectors.
3683 (Fgarbage_collect): Setup bytes_free.
3684 (Fmemory_free): New function.
3685 (syms_of_alloc): Register it.
3686
3687 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3688
3689 Cleanup overlays checking.
3690 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3691 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3692 eassert and OVERLAYP.
3693 (sort_overlays): Change to use OVERLAYP.
3694
3695 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3696
3697 * editfns.c (Finsert_char): Make it interactive, and make the
3698 second arg optional. Copy interactive spec and docstring from
3699 ucs-insert.
3700
3701 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3702
3703 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3704 Unlike the other wrapped functions, fabs has an unspecified
3705 effect on errno.
3706
3707 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3708
3709 * nsterm.m (keyDown): Interpret flags without left/right bits
3710 as the left key (Bug#11670).
3711
3712 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3713
3714 Remove empty and useless init functions.
3715 * lisp.h (init_character_once, init_fns, init_image)
3716 (init_filelock, init_sound): Remove prototype.
3717 * character.c (init_character_once): Remove.
3718 * filelock.c (init_filelock): Likewise.
3719 * fns.c (init_fns): Likewise.
3720 * image.c (init_image): Likewise.
3721 * sound.c (init_sound): Likewise.
3722 * emacs.c (main): Adjust accordingly.
3723
3724 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3725
3726 * gtkutil.h: Tiny cleanups.
3727 (use_old_gtk_file_dialog): Remove useless declaration.
3728 (xg_uses_old_file_dialog): Add suggested const attribute.
3729
3730 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3731
3732 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3733 (bidi_paragraph_init): Use it to limit search forward for a strong
3734 directional character in abnormally large paragraphs full of
3735 neutral or weak characters. (Bug#11943)
3736
3737 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3738
3739 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3740 the toolbar (Bug#9451).
3741 (xg_make_tool_item): Give the widget event box a transparent
3742 background.
3743
3744 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3745
3746 Cleanup basic allocation variables and functions.
3747 * alloc.c (ignore_warnings, init_intervals, init_float)
3748 (init_cons, init_symbol, init_marker): Remove.
3749 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3750 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3751 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3752 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3753 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3754 (staticidx, init_alloc_once, init_strings, free_ablock):
3755 Remove redundant initialization.
3756 * fns.c (init_weak_hash_tables): Remove.
3757 * lisp.h (init_weak_hash_tables): Remove prototype.
3758
3759 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3760
3761 Use zero_vector where appropriate.
3762 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3763 accordingly.
3764 * lisp.h (zero_vector): New declaration.
3765 * font.c (null_vector): Remove.
3766 (syms_of_font): Remove initialization and staticpro.
3767 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3768 * keymap.c (Faccessible_keymaps): Likewise.
3769
3770 2012-07-15 Leo Liu <sdl.web@gmail.com>
3771
3772 * fringe.c: Fix typo in comments.
3773
3774 2012-07-14 Leo Liu <sdl.web@gmail.com>
3775
3776 * fringe.c: Add a new bitmap exclamation-mark.
3777
3778 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3779
3780 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3781
3782 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3783 (HAVE_MENUS): Don't define, defined by editing config.in with
3784 msdos/sed2v2.inp.
3785 (GMALLOC_INHIBIT_VALLOC): Don't define.
3786 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3787
3788 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3789
3790 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3791
3792 2012-07-14 Glenn Morris <rgm@gnu.org>
3793
3794 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3795 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3796 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3797
3798 2012-07-13 Glenn Morris <rgm@gnu.org>
3799
3800 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3801
3802 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3803 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3804
3805 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3806
3807 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3808 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3809 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3810 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3811 where appropriate.
3812 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3813 as boolean expression.
3814 (x_set_window_size): Remove unused variable toolbar.
3815 (ns_get_color_default, ns_mod_to_lisp): Remove.
3816 (ns_mouse_position): Remove unused variables xchar and ychar.
3817 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3818 (ns_set_vertical_scroll_bar): Remove unused variable count.
3819 (ns_delete_terminal): Remove unused variable i.
3820 (ns_term_init): Remove unused variables r, g and b.
3821 (mouseDown): Remove unused variable window.
3822 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3823 (initFrameFromEmacs): Remove unused variable vbextra.
3824 (mouseEntered): Remove unused variables p and dpyinfo.
3825 (mouseExited): Remove unused variables p and r.
3826 (ns_define_frame_cursor, ns_clear_frame_area)
3827 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3828 (menuDown): Assign [sender tag] to variable and cast the variable.
3829
3830 * nsterm.h (menuDown): Add id as type to argument sender.
3831 (ns_display_info_for_name): Add Lisp_Object argument.
3832 (ns_term_init): Add Lisp_Object argument.
3833 (ns_map_event_to_object): Add void argument.
3834 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3835 prototype with arguments and only declare if __OBJC__.
3836 (nxatoms_of_nsselect): Add void argument.
3837 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3838 (ns_alloc_autorelease_pool): Add void argument.
3839 (ns_release_autorelease_pool): Add void* argument.
3840 (ns_get_defaults_value): Add const char* argument.
3841
3842 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3843 (initFromContents): Use SSDATA where appropriate.
3844 (ns_update_menubar): Add braces to ambigous if-else.
3845 (initWithTitle): Put () around assignment in if statement.
3846 (ns_menu_show): Remove unused variables window and keymap.
3847 (update_frame_tool_bar): Remove unused variable selected_p.
3848 (initWithContentRect): Remove unused variable this_cmd_name.
3849
3850 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3851 appropriate.
3852 (setXBMColor): Remove unused variable len.
3853 (setPixmapData): Put () around assignment in loop statement.
3854
3855 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3856 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3857 where appropriate.
3858 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3859 around assignment in loop statement.
3860 (nsfont_open): Remove unused variable i.
3861 (nsfont_open): Remove unused variable len.
3862 (nsfont_draw): Remove unused variable cs.
3863
3864 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3865 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3866 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3867 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3868 (Fns_font_name, Fns_perform_service)
3869 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3870 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3871 (ns_set_name): Remove unused variable view.
3872 (x_set_menu_bar_lines): Remove unused variable olines.
3873 (x_set_tool_bar_lines): Remove unused variable root_window.
3874 (Fns_list_colors): Put () around assignment in while statement.
3875 (Fns_perform_service): Remove unused variable len.
3876 (Fns_display_usable_bounds): Remove unused variable top.
3877 (syms_of_nsfns): Remove unused variable i.
3878
3879 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3880 memcpy (Bug#11907).
3881
3882 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3883
3884 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3885 and free it with DestroyExceptionInfo (Bug#11558).
3886
3887 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3888
3889 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3890 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3891 Set here, not in nt/config.nt.
3892
3893 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3894
3895 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3896 cursor overflow into the last glyph on display line when the right
3897 fringe is off. (Bug#11832)
3898
3899 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3900
3901 * xdisp.c (produce_special_glyphs): Now static.
3902 * dispextern.h (produce_special_glyphs): Remove decl.
3903
3904 2012-07-13 Glenn Morris <rgm@gnu.org>
3905
3906 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3907 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3908
3909 * s/usg5-4-common.h (USG, USG5):
3910 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3911 * s/sol2-6.h (SOLARIS2):
3912 * s/irix6-5.h (IRIX6_5):
3913 * s/hpux10-20.h (USG, USG5, HPUX):
3914 * s/gnu-linux.h (USG, GNU_LINUX):
3915 * s/freebsd.h (BSD_SYSTEM):
3916 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3917 * s/cygwin.h (CYGWIN):
3918 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3919 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3920
3921 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3922
3923 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3924
3925 2012-07-13 Glenn Morris <rgm@gnu.org>
3926
3927 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3928
3929 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3930
3931 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3932 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3933
3934 2012-07-12 Glenn Morris <rgm@gnu.org>
3935
3936 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3937
3938 * process.c (init_process_emacs): Rename from init_process.
3939 The old name is also the name of a Mach system call.
3940 * lisp.h, emacs.c: Update for this name change.
3941 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3942 longer needed.
3943
3944 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3945
3946 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3947 memmove call that removes glyphs covered by the left truncation
3948 glyph. Improve commentary.
3949 (display_line): Fix display of continuation glyphs on GUI frames
3950 when the right fringe is turned off and variable-size fonts are
3951 used in the window. Move the code that appends a stretch glyph to
3952 produce_special_glyphs, so that it could be used for truncation
3953 and continuation glyphs alike.
3954 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3955 glyph of a suitably computed width, to align the special glyphs at
3956 the window margin. Code moved from display_line. (Bug#11832)
3957
3958 2012-07-12 Glenn Morris <rgm@gnu.org>
3959
3960 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3961
3962 * s/gnu-linux.h, s/hpux10-20.h:
3963 Do not unconditionally define HAVE_XRMSETDATABASE.
3964
3965 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3966
3967 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3968
3969 Fix typos that broke OS X build.
3970 Reported by Randal L. Schwartz in
3971 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3972 * nsterm.m (ns_timeout): Add missing local decl.
3973 (ns_get_color): snprintf -> sprintf, to fix typo.
3974
3975 2012-07-12 Glenn Morris <rgm@gnu.org>
3976
3977 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3978 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3979 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3980 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3981
3982 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3983 Move PTY_OPEN to configure.
3984
3985 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3986 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3987 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3988
3989 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3990
3991 Use empty_unibyte_string where applicable.
3992 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3993 * lread.c (read1): Likewise.
3994 * xsettings.c (syms_of_xsettings): Likewise.
3995
3996 2012-07-12 Glenn Morris <rgm@gnu.org>
3997
3998 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3999 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4000 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4001 * s/hpux10-20.h (RUN_TIME_REMAP):
4002 * s/bsd-common.h (TABDLY): Move to configure.
4003
4004 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4005
4006 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4007
4008 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4009 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4010
4011 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4012
4013 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4014 * s/template.h: Move NARROWPROTO to configure.
4015
4016 2012-07-11 Glenn Morris <rgm@gnu.org>
4017
4018 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4019 unused since 2011-01-17 change to systty.h.
4020
4021 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4022 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4023 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4024
4025 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4026
4027 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4028
4029 2012-07-11 Glenn Morris <rgm@gnu.org>
4030
4031 * s/darwin.h, s/gnu-linux.h, s/template.h:
4032 Move INTERRUPT_INPUT to configure.
4033
4034 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4035
4036 Minor adjustments to interning code.
4037 * lisp.h (intern, intern_c_string): Redefine as static inline
4038 wrappers for intern_1 and intern_c_string_1, respectively.
4039 (intern_1, intern_c_string_1): Rename prototypes.
4040 * lread.c (intern_1, intern_c_string_1, oblookup):
4041 Simplify Vobarray checking.
4042 * font.c (font_intern_prop): Likewise. Adjust comment.
4043 * w32font.c (intern_font_name): Likewise.
4044
4045 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4046
4047 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4048
4049 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4050 of Fcar/Fcdr if possible.
4051 * font.c (check_otf_features): Likewise.
4052 * fontset.c (Fnew_fontset): Likewise.
4053 * gnutls.c (Fgnutls_boot): Likewise.
4054 * minibuf.c (read_minibuf): Likewise.
4055 * msdos.c (IT_set_frame_parameters): Likewise.
4056 * xmenu.c (Fx_popup_dialog): Likewise.
4057 * w32menu.c (Fx_popup_dialog): Likewise.
4058
4059 2012-07-11 Glenn Morris <rgm@gnu.org>
4060
4061 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4062 since nothing has defined it on these platforms.
4063
4064 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4065 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4066
4067 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4068 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4069 Move CLASH_DETECTION to configure.
4070
4071 * s/gnu.h: Remove file, which is now empty.
4072
4073 * s/gnu.h, s/gnu-linux.h:
4074 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4075
4076 2012-07-11 John Wiegley <johnw@newartisans.com>
4077
4078 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4079 function attribute, so we only use it if it exists in the
4080 compiler.
4081
4082 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4083
4084 Avoid call to strlen in fast_c_string_match_ignore_case.
4085 * search.c (fast_c_string_match_ignore_case): Change to use
4086 length argument. Adjust users accordingly.
4087 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4088
4089 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4090
4091 Assume mkdir, rmdir.
4092 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4093 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4094
4095 Assume rename.
4096 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4097
4098 Assume perror.
4099 * s/hpux10-20.h (HAVE_PERROR): Remove.
4100 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4101 Remove dummy definition, as this problem was obsolete long ago.
4102
4103 Assume strerror.
4104 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4105
4106 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4107
4108 Avoid calls to strlen in font processing functions.
4109 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4110 (font_open_by_name): Change to use length argument.
4111 Adjust users accordingly.
4112 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4113 Adjust prototypes.
4114 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4115 Change to return ptrdiff_t.
4116 (xfont_list_pattern, xfont_match): Use length returned by
4117 xfont_decode_coding_xlfd.
4118 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4119
4120 2012-07-11 Glenn Morris <rgm@gnu.org>
4121
4122 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4123 Move DONT_REOPEN_PTY to configure.
4124
4125 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4126 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4127
4128 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4129
4130 Remove "#define unix" that is no longer needed (Bug#11905).
4131 * s/aix4-2.h (unix): Remove; no longer needed.
4132
4133 EMACS_TIME simplification (Bug#11875).
4134 This replaces macros (which typically do not work in GDB)
4135 with functions, typedefs and enums, making the code easier to debug.
4136 The functional style also makes code easier to read and maintain.
4137 * systime.h: Include <sys/time.h> on all hosts, not just if
4138 WINDOWSNT, since 'struct timeval' is needed in general.
4139 (EMACS_TIME): Now a typedef, not a macro.
4140 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4141 not macros.
4142 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4143 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4144 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4145 (EMACS_TIME_LE): Now functions, not macros.
4146 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4147 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4148 which are not functions. All uses rewritten to use:
4149 (make_emacs_time): New function.
4150 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4151 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4152 not functions. All uses rewritten to use the following, respectively:
4153 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4154 (add_emacs_time, sub_emacs_time): New functions.
4155 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4156 * fileio.c (Fcopy_file):
4157 * xterm.c (XTflash): Get the current time closer to when it's used.
4158 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4159
4160 * bytecode.c (targets): Suppress -Woverride-init warnings.
4161
4162 Simplify by avoiding confusing use of strncpy etc.
4163 * doc.c (Fsnarf_documentation):
4164 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4165 * frame.c (Fmake_terminal_frame):
4166 * gtkutil.c (get_utf8_string):
4167 * lread.c (openp):
4168 * nsmenu.m (ns_update_menubar):
4169 * regex.c (regerror):
4170 Prefer memcpy to strncpy and strncat when either will do.
4171 * fileio.c (Fsubstitute_in_file_name):
4172 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4173 (menu_separator_name_p):
4174 * nsmenu.m (ns_update_menubar):
4175 Prefer memcmp to strncmp when either will do.
4176 * nsterm.m: Include <ftoastr.h>.
4177 (ns_get_color):
4178 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4179 Prefer snprintf to strncpy.
4180 * nsterm.m (ns_term_init):
4181 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4182 * nsterm.m (ns_term_init):
4183 Avoid the need for strncpy, by using build_string or
4184 make_unibyte_string directly. Use dtoastr, not snprintf.
4185 * process.c (Fmake_network_process): Diagnose service names that
4186 are too long, rather than silently truncating them or creating
4187 non-null-terminated names.
4188 (Fnetwork_interface_info): Likewise, for interface names.
4189 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4190 Prefer sprintf to strncat.
4191 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4192 Prefer vsnprintf to vsprintf + strncpy.
4193
4194 2012-07-10 Glenn Morris <rgm@gnu.org>
4195
4196 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4197 Clarify fallback case.
4198
4199 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4200
4201 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4202 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4203 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4204 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4205 where argument type is known to be a Lisp_Cons.
4206
4207 2012-07-10 Tom Tromey <tromey@redhat.com>
4208
4209 * bytecode.c (BYTE_CODE_THREADED): New macro.
4210 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4211 (enum byte_code_op): New type.
4212 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4213 (exec_byte_code): Use them. Use token threading when applicable.
4214
4215 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4216
4217 Optimize pure C strings initialization.
4218 * lisp.h (make_pure_string): Fix prototype.
4219 (build_pure_c_string): New function, defined as static inline. This
4220 provides a better opportunity to optimize away calls to strlen when
4221 the function is called with compile-time constant argument.
4222 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4223 argument, adjust users accordingly. Use build_pure_c_string where
4224 appropriate.
4225 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4226 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4227 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4228
4229 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4230
4231 Avoid calls to strlen in miscellaneous functions.
4232 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4233 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4234 * lread.c (openp): Likewise.
4235
4236 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4237
4238 Avoid calls to strlen in path processing functions.
4239 * fileio.c (file_name_as_directory): Add comment. Change to add
4240 srclen argument and return the length of result. Adjust users
4241 accordingly.
4242 (directory_file_name): Fix comment. Change to add srclen argument,
4243 swap 1st and 2nd arguments to obey the common convention.
4244 Adjust users accordingly.
4245 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4246
4247 2012-07-10 Glenn Morris <rgm@gnu.org>
4248
4249 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4250 Move PENDING_OUTPUT_COUNT definition to configure.
4251
4252 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4253 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4254 * s/gnu.h (DATA_START): Move definitions to configure.
4255
4256 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4257 We include usg5-4-common.h, which defines them both.
4258
4259 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4260 O_RDONLY already includes it).
4261
4262 Stop ns builds setting the EMACSLOADPATH environment variable.
4263 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4264 Now it does not set EMACSLOADPATH, just returns the load-path string.
4265 * nsterm.h: Update accordingly.
4266 * lread.c [HAVE_NS]: Include nsterm.h.
4267 (init_lread) [HAVE_NS]: Use ns_load_path.
4268 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4269
4270 2012-07-09 Glenn Morris <rgm@gnu.org>
4271
4272 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4273 since the included bsd-common.h does so.
4274
4275 Stop ns builds setting the EMACSPATH environment variable.
4276 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4277 (ns_init_paths): Do not set EMACSPATH.
4278 * nsterm.h (ns_exec_path): Add it.
4279 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4280 Use ns_exec_path.
4281
4282 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4283
4284 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4285
4286 * process.c (wait_reading_process_output): 'waitchannels' was unset
4287 when read_kbd || !NILP (wait_for_cell); fix this.
4288
4289 Add GCC-style 'const' attribute to functions that can use it.
4290 * character.h (char_resolve_modifier_mask):
4291 * keyboard.h (make_ctrl_char):
4292 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4293 (init_character_once, next_almost_prime, init_fns, init_image)
4294 (flush_pending_output, init_sound):
4295 * mem-limits.h (start_of_data):
4296 * menu.h (finish_menu_items):
4297 Add ATTRIBUTE_CONST.
4298 * emacs.c (DEFINE_DUMMY_FUNCTION):
4299 Declare the dummy function with ATTRIBUTE_CONST.
4300 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4301 Add decls with ATTRIBUTE_CONST.
4302
4303 Minor improvements to make_formatted_string.
4304 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4305 where int is good enough, as vsprintf returns an int.
4306 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4307
4308 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4309
4310 Use make_formatted_string to avoid double length calculation.
4311 * lisp.h (make_formatted_string): New prototype.
4312 * alloc.c (make_formatted_string): New function.
4313 * buffer.c (Fgenerate_new_buffer_name): Use it.
4314 * dbus.c (syms_of_dbusbind): Likewise.
4315 * editfns.c (Fcurrent_time_zone): Likewise.
4316 * filelock.c (get_boot_time): Likewise.
4317 * frame.c (make_terminal_frame, set_term_frame_name)
4318 (x_report_frame_params): Likewise.
4319 * image.c (gs_load): Likewise.
4320 * minibuf.c (get_minibuffer): Likewise.
4321 * msdos.c (dos_set_window_size): Likewise.
4322 * process.c (make_process): Likewise.
4323 * xdisp.c (ensure_echo_area_buffers): Likewise.
4324 * xsettings.c (apply_xft_settings): Likewise.
4325
4326 2012-07-09 Glenn Morris <rgm@gnu.org>
4327
4328 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4329 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4330 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4331 * nsterm.h (ns_etc_directory): Add it.
4332 * callproc.c [HAVE_NS]: Include nsterm.h.
4333 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4334
4335 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4336
4337 Move marker debugging code under MARKER_DEBUG.
4338 * marker.c (MARKER_DEBUG): Move marker debugging code under
4339 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4340 for bootstrap with --enable-checking (~3x slowdown reported
4341 by Juanma Barranquero <lekktu@gmail.com>).
4342 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4343
4344 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4345
4346 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4347 See <http://bugs.gnu.org/11825#29>.
4348
4349 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4350
4351 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4352 has no font, use the frame's font. (Bug#11813)
4353 (display_line): Add commentary about displaying truncation glyphs
4354 on GUI frames.
4355 (produce_special_glyphs): Move here from term.c.
4356
4357 * term.c (produce_special_glyphs): Move to xdisp.c.
4358
4359 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4360 section.
4361
4362 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4363
4364 * xdisp.c (display_line): Avoid warning about implicit declaration
4365 of FRAME_FONT.
4366
4367 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4368
4369 * lisp.h: Remove empty conditional.
4370
4371 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4372
4373 * lread.c (load_path_check): Now static.
4374
4375 Fix some minor --with-ns problems found by static checking.
4376 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4377 (x_set_font) [!HAVE_X_WINDOWS]:
4378 * image.c (xpm_load_image) [HAVE_NS]:
4379 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4380 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4381 Remove unused local.
4382 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4383 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4384 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4385 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4386 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4387 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4388 Fix pointer signedness problem.
4389 * xfaces.c (FRAME_X_FONT_TABLE):
4390 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4391
4392 2012-07-07 Glenn Morris <rgm@gnu.org>
4393
4394 * lread.c (load_path_check): New function, split from init_lread.
4395 (init_lread): Reorganize. Motivation:
4396 If EMACSLOADPATH is set, check/warn about that rather than the
4397 defaults, which we are not going to use. Hence we can remove
4398 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4399 Don't warn if site-lisp directories are missing.
4400 If not installed, start from a blank load-path, since
4401 PATH_LOADSEARCH refers to the eventual installation directories.
4402
4403 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4404
4405 Support truncation and continuation glyphs on GUI frames, when
4406 fringes are disabled. (Bug#11832)
4407 * xdisp.c (init_iterator): Get dimensions of truncation and
4408 continuation glyphs even if on GUI frames.
4409 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4410 or both, are absent.
4411 (start_display, move_it_in_display_line_to): Handle the case of a
4412 GUI frame without a fringe to display continuation or truncation
4413 glyphs.
4414 (insert_left_trunc_glyphs): Support GUI frames: make sure
4415 truncation glyphs overwrite enough glyphs from the current line to
4416 have sufficient space in pixels.
4417 (display_line): Support truncation and continuation glyphs on GUI
4418 frames. If some spare pixels are left on the line after inserting
4419 the truncation glyphs, fill that space with a stretch glyph of a
4420 suitably computed width.
4421
4422 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4423 produce_glyphs, to support GUI sessions.
4424
4425 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4426
4427 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4428
4429 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4430
4431 Do not require float-time's arg to fit in time_t (Bug#11825).
4432 This works better on hosts where time_t is unsigned, and where
4433 float-time is applied to the (negative) difference between two times.
4434 * editfns.c (decode_time_components): Last arg is now double *,
4435 not int *, and means to store all the result as a double, without
4436 worrying about whether the seconds part fits in time_t.
4437 All callers changed.
4438 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4439 All callers changed.
4440 (Ffloat_time): Do not fail merely because the specified time falls
4441 outside of time_t range.
4442
4443 2012-07-07 Glenn Morris <rgm@gnu.org>
4444
4445 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4446 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4447 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4448
4449 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4450
4451 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4452 Update dependencies.
4453
4454 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4455
4456 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4457
4458 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4459 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4460 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4461 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4462 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4463 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4464
4465 * xfont.c (compare_font_names): Redo to omit the need for casts.
4466
4467 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4468
4469 * xfns.c (Fx_change_window_property): Doc fix.
4470 * w32fns.c (Fx_change_window_property): Doc fix.
4471
4472 * w32fns.c (Fx_window_property): Accept the same arguments as the
4473 X Windows version. Doc fix.
4474 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4475
4476 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4477 Eli Zaretskii <eliz@gnu.org>
4478
4479 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4480 Windows-specific code from nt/config.nt moved here.
4481 Obsolete settings removed.
4482
4483 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4484
4485 * process.c: Avoid unnecessary calls to gettime.
4486 (wait_reading_process_output): Don't get the time of day
4487 when gobbling data immediately and not waiting, as there's no need
4488 for it in that case. This removes a FIXME.
4489
4490 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4491
4492 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4493 is defined (Bug#11768).
4494
4495 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4496
4497 Fix marker debugging code.
4498 * marker.c (byte_char_debug_check): Do not perform the check
4499 if buffer is not multibyte.
4500 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4501 Call byte_char_debug_check with correct arguments.
4502
4503 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4504
4505 Compile marker debugging code only if ENABLE_CHECKING is defined.
4506 * marker.c (byte_char_debug_check, count_markers):
4507 Use only if ENABLE_CHECKING is defined.
4508 (byte_debug_flag): Remove.
4509 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4510 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4511
4512 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4513
4514 Avoid code repetition in marker-related functions.
4515 * marker.c (attach_marker): New function.
4516 (Fset_marker, set_marker_restricted, set_marker_both)
4517 (set_marker_restricted_both): Use it.
4518 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4519 Consistently rename charno to charpos.
4520 (marker_position): Add eassert.
4521 (marker_byte_position): Convert to eassert.
4522
4523 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4524
4525 Simplify list operations in unchain_overlay and unchain_marker.
4526 * buffer.c (unchain_overlay): Simplify. Add comment.
4527 * marker.c (unchain_marker): Simplify. Fix comments.
4528
4529 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4530
4531 Introduce fast path for the widely used marker operation.
4532 * alloc.c (build_marker): New function.
4533 * lisp.h (build_marker): New prototype.
4534 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4535 * composite.c (autocmp_chars): Likewise.
4536 * editfns.c (buildmark): Remove.
4537 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4538 (save_restriction_save): Use build_marker.
4539 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4540 * window.c (save_window_save): Likewise.
4541
4542 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4543
4544 Do not use Fdelete_overlay in delete_all_overlays
4545 to avoid redundant calls to unchain_overlay.
4546 * buffer.c (drop_overlay): New function.
4547 (delete_all_overlays, Fdelete_overlay): Use it.
4548 * minibuf.c (get_minibuffer): Fix comment.
4549
4550 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4551
4552 Port to OpenBSD 5.1 amd64.
4553 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4554 This is needed for OpenBSD, and should be harmless on all BSD systems.
4555 Also, include <sys/sysctl.h>, as it should be available on all
4556 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4557 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4558 use p_pid member, not kp_proc.pid.
4559
4560 2012-07-06 Glenn Morris <rgm@gnu.org>
4561
4562 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4563
4564 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4565
4566 More xmalloc and related cleanup.
4567 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4568 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4569 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4570 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4571 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4572 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4573 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4574 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4575 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4576 * xterm.c:
4577 Omit needless casts involving void * pointers and allocation.
4578 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4579 as the former is more robust if P's type is changed.
4580 Prefer xzalloc to xmalloc + memset 0.
4581 Simplify malloc-or-realloc to realloc.
4582 Don't worry about xmalloc returning a null pointer.
4583 Prefer xstrdup to xmalloc + strcpy.
4584 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4585 growing it.
4586 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4587 alloca of a constant.
4588
4589 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4590
4591 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4592 hscroll is larger than the line width. Fixes long and futile
4593 looping inside extend_face_to_end_of_line (on a TTY) producing
4594 glyphs that are not needed and thrown away.
4595
4596 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4597
4598 * marker.c (set_marker_restricted_both): Simplify by using
4599 clip_to_bounds.
4600
4601 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4602
4603 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4604
4605 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4606
4607 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4608 not defined (Bug#11768).
4609 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4610 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4611 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4612 followed by gtk_box_set_homogeneous (Bug#11768).
4613 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4614 (update_theme_scrollbar_width, xg_create_scroll_bar):
4615 Use gtk_scrollbar_new (Bug#11768).
4616 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4617 (is_box_type): New function (Bug#11768).
4618 (xg_tool_item_stale_p): Call is_box_type.
4619 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4620 with default display (Bug#11768).
4621
4622 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4623
4624 * xdisp.c (window_hscroll_limited): New function.
4625 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4626 coordinates when window's hscroll is set to insanely large
4627 values. (Bug#11857)
4628
4629 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4630
4631 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4632 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4633
4634 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4635
4636 Cleanup xmalloc.
4637 * lisp.h (xzalloc): New prototype. Omit needless casts.
4638 * alloc.c (xzalloc): New function. Omit needless casts.
4639 * charset.c: Omit needless casts. Convert all calls to
4640 xmalloc with following memset to xzalloc.
4641 * dispnew.c: Likewise.
4642 * fringe.c: Likewise.
4643 * image.c: Likewise.
4644 * sound.c: Likewise.
4645 * term.c: Likewise.
4646 * w32fns.c: Likewise.
4647 * w32font.c: Likewise.
4648 * w32term.c: Likewise.
4649 * xfaces.c: Likewise.
4650 * xfns.c: Likewise.
4651 * xterm.c: Likewise.
4652 * atimer.c: Omit needless casts.
4653 * buffer.c: Likewise.
4654 * callproc.c: Likewise.
4655 * ccl.c: Likewise.
4656 * coding.c: Likewise.
4657 * composite.c: Likewise.
4658 * doc.c: Likewise.
4659 * doprnt.c: Likewise.
4660 * editfns.c: Likewise.
4661 * emacs.c: Likewise.
4662 * eval.c: Likewise.
4663 * filelock.c: Likewise.
4664 * fns.c: Likewise.
4665 * gtkutil.c: Likewise.
4666 * keyboard.c: Likewise.
4667 * lisp.h: Likewise.
4668 * lread.c: Likewise.
4669 * minibuf.c: Likewise.
4670 * msdos.c: Likewise.
4671 * print.c: Likewise.
4672 * process.c: Likewise.
4673 * region-cache.c: Likewise.
4674 * search.c: Likewise.
4675 * sysdep.c: Likewise.
4676 * termcap.c: Likewise.
4677 * terminal.c: Likewise.
4678 * tparam.c: Likewise.
4679 * w16select.c: Likewise.
4680 * w32.c: Likewise.
4681 * w32reg.c: Likewise.
4682 * w32select.c: Likewise.
4683 * w32uniscribe.c: Likewise.
4684 * widget.c: Likewise.
4685 * xdisp.c: Likewise.
4686 * xmenu.c: Likewise.
4687 * xrdb.c: Likewise.
4688 * xselect.c: Likewise.
4689
4690 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4691
4692 * fileio.c (time_error_value): Check the right error number.
4693 Problem reported by Troels Nielsen in
4694 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4695
4696 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4697
4698 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4699 This should be fixed in a better way; see Eli Zaretskii in
4700 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4701 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4702
4703 * fileio.c (time_error_value): Rename from special_mtime.
4704 The old name's problems were noted by Eli Zaretskii in
4705 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4706
4707 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4708 This variable's comment says Emacs needs at least one GDB-visible
4709 symbol of type enum pvec_type, to work around GDB problems.
4710 The symbol's value doesn't matter.
4711
4712 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4713 that causes compilation to fail on pre-C99 compilers.
4714
4715 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4716
4717 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4718 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4719
4720 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4721
4722 * buffer.c (init_buffer_once): Fix initialization of
4723 headers for buffer_defaults and buffer_local_symbols.
4724 Reported by Juanma Barranquero <lekktu@gmail.com>.
4725
4726 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4727
4728 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4729 * lisp.h (enum pvec_type): Use fewer bits.
4730 (PSEUDOVECTOR_SIZE_BITS): New constant.
4731 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4732 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4733 change in pvec_type.
4734 (PSEUDOVECTOR_TYPEP): New macro.
4735 (TYPED_PSEUDOVECTORP): Use it.
4736 * fns.c (internal_equal): Adapt code to extract pvectype.
4737 * emacs.c (gdb_pvec_type): Update type.
4738 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4739 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4740 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4741 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4742 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4743 abusing vector->header.next.nbytes.
4744 (live_vector_p): Use PVEC_TYPE.
4745 (mark_object): Adapt code to extract pvectype. Use switch.
4746
4747 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4748
4749 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4750 Tighten new eassert a bit.
4751
4752 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4753
4754 Fix compilation with --enable-gcc-warnings and -O1
4755 optimization level.
4756 * doprnt.c (doprnt): Change type of tem to int, initialize
4757 to avoid compiler warning. Add eassert.
4758 * search.c (simple_search): Initialize match_byte to avoid
4759 compiler warning. Add eassert.
4760
4761 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4762
4763 Avoid weird behavior with large horizontal scrolls.
4764 Without this change, for example, large hscroll values would
4765 mess up Emacs's display on Fedora 15 x86, presumably due to
4766 overflows in int calculations in the display code.
4767 Also, if buffers had long lines, Emacs would freeze.
4768 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4769 (set_window_hscroll): New function, containing the old guts of
4770 Fset_window_hscroll. Return the clipped value.
4771 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4772 This avoids the need to check against PTRDIFF_MAX.
4773
4774 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4775
4776 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4777
4778 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4779
4780 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4781
4782 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4783 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4784 since GCC 4.4.6 issues a bogus warning for them.
4785
4786 Fix bugs in file timestamp newness comparisons.
4787 * fileio.c (Ffile_newer_than_file_p):
4788 * lread.c (Fload): Use full timestamp resolution of files,
4789 not just the 1-second resolution, so that files that are only
4790 slightly newer still count as newer.
4791 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4792 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4793
4794 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4795
4796 * fileio.c: Improve handling of file time marker. (Bug#11852)
4797 (special_mtime): New function.
4798 (Finsert_file_contents, Fverify_visited_file_modtime):
4799 Use it to set special mtime values consistently.
4800
4801 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4802
4803 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4804 marker for non-existing file. (Bug#11852)
4805
4806 2012-07-03 Glenn Morris <rgm@gnu.org>
4807
4808 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4809 and did not make it into globals.h).
4810
4811 2012-07-03 Tom Tromey <tromey@redhat.com>
4812
4813 * window.c (Fset_window_margins, Fset_window_fringes)
4814 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4815 * textprop.c (Fprevious_property_change): No longer static.
4816 * syntax.c (Fsyntax_table_p): No longer static.
4817 * process.c (Fget_process, Fprocess_datagram_address): No longer
4818 static.
4819 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4820 * keyboard.c (Fcommand_execute): No longer static.
4821 Remove EXFUN.
4822 * insdel.c (Fcombine_after_change_execute): No longer static.
4823 * image.c (Finit_image_library): No longer static.
4824 * fileio.c (Fmake_symbolic_link): No longer static.
4825 * eval.c (Ffetch_bytecode): No longer static.
4826 * editfns.c (Fuser_full_name): No longer static.
4827 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4828 No longer static.
4829 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4830 static.
4831 * dired.c (Ffile_attributes): No longer static.
4832 * composite.c (Fcomposition_get_gstring): No longer static.
4833 * callproc.c (Fgetenv_internal): No longer static.
4834
4835 * ccl.h: Remove EXFUNs.
4836 * buffer.h: Remove EXFUNs.
4837 * dispextern.h: Remove EXFUNs.
4838 * intervals.h: Remove EXFUNs.
4839 * fontset.h: Remove EXFUN.
4840 * font.h: Remove EXFUNs.
4841 * dosfns.c (system_process_attributes): Remove EXFUN.
4842 * keymap.h: Remove EXFUNs.
4843 * lisp.h: Remove EXFUNs.
4844 * w32term.h: Remove EXFUNs.
4845 * window.h: Remove EXFUNs.
4846 * xsettings.h: Remove EXFUN.
4847 * xterm.h: Remove EXFUN.
4848
4849 2012-07-03 Glenn Morris <rgm@gnu.org>
4850
4851 * lisp.h (Frandom): Make it visible to C.
4852 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4853 buffer for invisible buffers. (Bug#1229)
4854
4855 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4856
4857 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4858 values which aren't power of 2.
4859 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4860 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4861 accordingly.
4862
4863 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4864
4865 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4866
4867 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4868
4869 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4870
4871 * alloc.c (allocate_vector_block): Remove redundant
4872 calls to mallopt if DOUG_LEA_MALLOC is defined.
4873 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4874 avoid calls to mallopt if zero_vector is returned.
4875
4876 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4877
4878 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4879 is enabled, avoid dereferencing NULL current_sblock if
4880 running undumped.
4881
4882 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4883
4884 Cleanup basic buffer management.
4885 * buffer.h (struct buffer): Change layout to use generic vector
4886 marking code. Fix some comments. Change type of 'clip_changed'
4887 to bitfield. Remove unused #ifndef old.
4888 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4889 (GET_OVERLAYS_AT): Fix indentation.
4890 (for_each_per_buffer_object_at): New macro.
4891 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4892 (Fbuffer_local_variables): Use it.
4893 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4894 * alloc.c (allocate_buffer): Adjust to match new layout of
4895 struct buffer. Fix comment.
4896 (mark_overlay): New function.
4897 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4898 Lisp area of struct buffer.
4899 (mark_object): Use it. Adjust marking of misc objects
4900 and related comments.
4901
4902 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4903
4904 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4905 wrapper that is not needed because the wrapped code is a no-op (zero
4906 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4907 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4908
4909 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4910
4911 * alloc.c (mark_buffer): Simplify. Remove prototype.
4912 (mark_object): Add comment. Reorganize marking of vector-like
4913 objects. Use CHECK_LIVE for all vector-like objects except buffers
4914 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4915 Avoid redundant calls to mark_vectorlike for bool vectors.
4916
4917 2012-06-30 Glenn Morris <rgm@gnu.org>
4918
4919 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4920
4921 * epaths.in (PATH_SITELOADSEARCH): New.
4922 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4923 This is rather than relying on --enable-locallisppath elements
4924 having "site-lisp" in their names. (Bug#10208#25, 11658)
4925
4926 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4927
4928 * w32proc.c (sys_select): Accept and ignore one more argument.
4929
4930 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4931
4932 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4933 (pselect) [!MS_DOS]: Redirect to sys_select.
4934
4935 * sysdep.c: Don't include dos.h and dosfns.h.
4936
4937 * process.c (sys_select):
4938 * msdos.c (sys_select): Accept one more argument and ignore it.
4939
4940 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4941 adapt data types and code to that.
4942
4943 * dosfns.c:
4944 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4945 which clashes with the gnulib function of the same name.
4946
4947 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4948
4949 * font.c (font_style_to_value, font_style_symbolic)
4950 (font_prop_validate_style): Add type checks for values in
4951 font_style_table.
4952
4953 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4954 argument.
4955 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4956 uses.
4957
4958 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4959
4960 * xdisp.c (try_window_id): Undo last change.
4961
4962 * w32.c (getwd): Adjust commentary about startup_dir.
4963 (init_environment): Always call sys_access, even in non-MSVC
4964 builds. Don't chdir to the directory of the Emacs executable.
4965 This undoes code from 1997 which was justified by the need to
4966 "avoid conflicts when removing and renaming directories". But its
4967 downside was that every relative file name was being interpreted
4968 relative to the directory of the Emacs executable, which can never
4969 be TRT. In particular, it broke sys_access when called with
4970 relative file names.
4971 (sys_access): Map GetLastError to errno.
4972
4973 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4974
4975 * window.h (struct window): Change type of 'fringes_outside_margins'
4976 to bitfield. Fix comment. Adjust users accordingly.
4977 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4978 Adjust comment.
4979 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4980 to ptrdiff_t.
4981
4982 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4983
4984 * gnutls.c (emacs_gnutls_handshake):
4985 Add QUIT to make the loop interruptible.
4986
4987 2012-06-29 Glenn Morris <rgm@gnu.org>
4988
4989 * charset.c (init_charset): Make lack of etc/charsets fatal.
4990
4991 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4992
4993 * editfns.c (region_limit): Fix type mismatch.
4994
4995 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4996
4997 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4998 undefined. Convert from xassert to eassert.
4999 * nsmenu.m: Convert from xassert to eassert.
5000 * nsterm.m: Likewise.
5001
5002 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5003
5004 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5005
5006 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5007
5008 Avoid integer overflow on scroll-left and scroll-right.
5009 * window.c (HSCROLL_MAX): New macro.
5010 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5011 overflow when requested scroll falls outside ptrdiff_t range.
5012
5013 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5014
5015 * window.h (struct window): Change type of 'hscroll',
5016 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5017 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5018 Adjust users accordingly.
5019 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5020 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5021 from EMACS_INT to ptrdiff_t.
5022 (make_window): Omit redundant initialization.
5023
5024 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5025
5026 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5027
5028 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5029
5030 * window.h (struct window): Change type of 'use_time' and
5031 'sequence_number' from Lisp_Object to int.
5032 * frame.c (make_frame): Adjust users accordingly.
5033 * print.c (print_object): Likewise.
5034 * window.c (select_window, Fwindow_use_time, make_parent_window)
5035 (make_window): Likewise.
5036
5037 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5038
5039 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5040 enabled with --enable-checking=[all,glyphs] configure option.
5041 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5042 adjust comments accordingly.
5043 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5044 undefined, adjust comments accordingly.
5045 * image.c: Likewise.
5046 * scroll.c: Likewise.
5047 * w32fns.c: Likewise.
5048 * w32term.c: Likewise.
5049 * xdisp.c: Likewise.
5050 * xfaces.c: Likewise.
5051 * xfns.c: Likewise.
5052 * xterm.c: Likewise.
5053
5054 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5055
5056 Generalize run-time debugging checks.
5057 * dispextern.h (XASSERTS): Remove.
5058 * fontset.c (xassert): Remove.
5059 Convert from xassert to eassert.
5060 * alloc.c: Convert from xassert to eassert.
5061 * bidi.c: Likewise.
5062 * dispnew.c: Likewise.
5063 * fns.c: Likewise.
5064 * fringe.c: Likewise.
5065 * ftfont.c: Likewise.
5066 * gtkutil.c: Likewise.
5067 * image.c: Likewise.
5068 * keyboard.c: Likewise.
5069 * menu.c: Likewise.
5070 * process.c: Likewise.
5071 * scroll.c: Likewise.
5072 * sound.c: Likewise.
5073 * term.c: Likewise.
5074 * w32console.c: Likewise.
5075 * w32fns.c: Likewise.
5076 * w32term.c: Likewise.
5077 * window.c: Likewise.
5078 * xdisp.c: Likewise.
5079 * xfaces.c: Likewise.
5080 * xfns.c: Likewise.
5081 * xselect.c: Likewise.
5082 * xterm.c: Likewise.
5083
5084 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5085
5086 * fns.c (maybe_resize_hash_table): Output message when growing the
5087 purify-hashtable.
5088
5089 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5090
5091 * alloc.c (allocate_string_data): Remove dead code.
5092 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5093 avoid GCC warning about unused macro.
5094
5095 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5096
5097 * alloc.c (allocate_string): Omit intervals initialization.
5098 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5099 as in make_pure_string and make_pure_c_string.
5100
5101 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5102
5103 * alloc.c (allocate_string): Fix last change.
5104
5105 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5106
5107 * alloc.c (allocate_string): Remove two redundant calls
5108 to memset, add explicit initialization where appropriate.
5109
5110 2012-06-27 Glenn Morris <rgm@gnu.org>
5111
5112 * lisp.mk (lisp): Remove paths.elc.
5113
5114 2012-06-27 Chong Yidong <cyd@gnu.org>
5115
5116 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5117
5118 2012-06-26 John Wiegley <johnw@newartisans.com>
5119
5120 * unexmacosx.c (copy_data_segment): Add two section names used
5121 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5122
5123 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5124 when building with Clang.
5125
5126 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5127
5128 * eval.c (Fapply): Allow calling it with a single argument.
5129
5130 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5131
5132 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5133 _stricmp and _strnicmp.
5134 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5135
5136 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5137
5138 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5139 allocated window.
5140 (allocate_process): Likewise for new process.
5141 (allocate_terminal): Change to use offsetof.
5142 (allocate_frame): Likewise.
5143 * frame.c (make_frame): Omit redundant initialization.
5144 * window.c (make_parent_window): Use memset.
5145 (make_window): Omit redundant initialization.
5146 * process.c (make_process): Omit redundant initialization.
5147 * terminal.c (create_terminal): Likewise.
5148
5149 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5150
5151 * term.c (delete_tty): Remove redundant call to memset.
5152
5153 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5154
5155 * alloc.c: Remove build_string.
5156 * lisp.h: Define build_string as static inline. This provides
5157 a better opportunity to optimize away calls to strlen when the
5158 function is called with compile-time constant argument.
5159 * image.c (imagemagick_error): Convert to build_string.
5160 * w32proc.c (sys_spawnve): Likewise.
5161 * xterm.c (x_term_init): Likewise.
5162
5163 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5164
5165 Use sprintf return value instead of invoking strlen on result.
5166 In the old days this wasn't portable, since some sprintf
5167 implementations returned char *. But they died out years ago and
5168 Emacs already assumes sprintf returns int.
5169 Similarly for float_to_string.
5170 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5171 * ccl.c (ccl_driver):
5172 * character.c (string_escape_byte8):
5173 * data.c (Fnumber_to_string):
5174 * doprnt.c (doprnt):
5175 * print.c (print_object):
5176 * xdisp.c (message_dolog):
5177 * xfns.c (syms_of_xfns):
5178 Use sprintf or float_to_string result to avoid need to call strlen.
5179 * data.c (Fnumber_to_string):
5180 Use make_unibyte_string, since the string must be ASCII.
5181 * lisp.h, print.c (float_to_string): Now returns int length.
5182 * term.c (produce_glyphless_glyph):
5183 Use sprintf result rather than recomputing it.
5184
5185 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5186 * Makefile.in (ALL_CFLAGS):
5187 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5188 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5189
5190 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5191
5192 * dispextern.h (xstrcasecmp): Define to library function
5193 strcasecmp if available.
5194 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5195
5196 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5197
5198 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5199 Avoid comma operator.
5200 * menu.c (push_submenu_start, push_submenu_end)
5201 (push_left_right_boundary, push_menu_pane): Likewise.
5202 * msdos.c (dos_rawgetc): Likewise.
5203
5204 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5205
5206 * xfns.c (xic_create_fontsetname): Remove redundant calls
5207 to memset.
5208
5209 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5210
5211 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5212 sprintf already null-terminates its output.
5213
5214 * xfns.c (x_window): Remove redundant cast.
5215
5216 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5217
5218 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5219 `const char *' to `char *' to avoid compiler warning.
5220
5221 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5222
5223 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5224 instead of truncating it to 63 (admittedly a generous limit).
5225
5226 * process.c: Fix spelling and caps in comments.
5227
5228 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5229
5230 * emacs.c (setpgrp): Remove definition, unused.
5231 * sysdep.c (setpgrp): Remove definition, not used in this file.
5232
5233 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5234
5235 * makefile.w32-in: Update dependencies.
5236
5237 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5238
5239 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5240 (SYSTIME_H): Add nt/inc/sys/time.h.
5241
5242 * systime.h [WINDOWSNT]: Include sys/time.h.
5243
5244 * s/ms-w32.h (struct timespec): Definition moved from
5245 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5246
5247 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5248
5249 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5250 * buffer.h (buffer_slot_type_mismatch):
5251 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5252 * eval.c (unwind_to_catch):
5253 * image.c (my_png_error, my_error_exit):
5254 * keyboard.c (quit_throw_to_read_char, user_error)
5255 (Fexit_recursive_edit, Fabort_recursive_edit):
5256 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5257 (wrong_type_argument, buffer_overflow, __executable_start)
5258 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5259 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5260 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5261 (fatal):
5262 (child_setup) [!DOS_NT]:
5263 * lread.c (end_of_file_error, invalid_syntax):
5264 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5265 * puresize.h (pure_write_error):
5266 * search.c (matcher_overflow):
5267 * sound.c (sound_perror, alsa_sound_perror):
5268 * sysdep.c, syssignal.h (croak):
5269 * term.c (maybe_fatal, vfatal):
5270 * textprop.c (text_read_only):
5271 * undo.c (user_error):
5272 * unexmacosx.c (unexec_error):
5273 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5274 Use _Noreturn rather than NO_RETURN.
5275 No need for separate decl merely because of _Noreturn.
5276 * sound.c (sound_warning, parse_sound):
5277 Remove unnecessary forward decls.
5278
5279 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5280
5281 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5282 * lisp.h (WAIT_READING_MAX): New macro.
5283 * dispnew.c (Fsleep_for, sit_for):
5284 * keyboard.c (kbd_buffer_get_event):
5285 * process.c (Faccept_process_output):
5286 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5287 This improves on the previous patch, which introduced a bug
5288 when time_t is unsigned and as wide as intmax_t.
5289 See <http://bugs.gnu.org/9000#51>.
5290
5291 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5292
5293 * dispnew.c (sit_for, Fsleep_for):
5294 * keyboard.c (kbd_buffer_get_event):
5295 * process.c (Faccept_process_output): Avoid compiler warnings when
5296 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5297
5298 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5299
5300 * makefile.w32-in: Update dependencies.
5301
5302 * w32.c (ltime): Add return type and declare static.
5303 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5304
5305 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5306
5307 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5308 Privately reported by Herbert J. Skuhra.
5309 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5310 All uses changed.
5311 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5312 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5313
5314 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5315
5316 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5317 last argument of make_unibyte_string.
5318
5319 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5320 language ID in the event parameters.
5321
5322 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5323 event.code, not the obscure "character set ID".
5324
5325 2012-06-23 Chong Yidong <cyd@gnu.org>
5326
5327 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5328
5329 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5330
5331 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5332 * w32.c (fdutimens): New function.
5333
5334 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5335
5336 * s/ms-w32.h (pselect): Redirect to sys_select.
5337
5338 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5339
5340 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5341 in the logic of incrementing and decrementing the value of
5342 use_relocatable_buffers.
5343
5344 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5345
5346 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5347 Privately reported by Herbert J. Skuhra.
5348 [__FreeBSD__]: Remove "*/" typo after "#include".
5349 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5350 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5351 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5352 Don't assume EMACS_TIME and struct timeval are the same type.
5353
5354 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5355
5356 Support higher-resolution time stamps (Bug#9000).
5357 The time stamps are only nanosecond-resolution at the C level,
5358 since that's the best that any real-world system supports now.
5359 But they are picosecond-resolution at the Lisp level, as that's
5360 easy, and leaves room for future OS improvements.
5361
5362 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5363 (LIBES): Use it.
5364
5365 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5366 Don't get current time unless it's needed.
5367
5368 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5369 now provides it if it's absent.
5370 (start_atimer): Port to higher-res time stamps.
5371 Check for time stamp overflow. Don't get current time more
5372 often than is needed.
5373
5374 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5375 Include systime.h, not time.h.
5376 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5377
5378 * dired.c: Include stat-time.h.
5379 (Ffile-attributes): File times now have higher resolution.
5380
5381 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5382 (struct image): Timestamp now has higher resolution.
5383
5384 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5385 has at least microseconds now. All uses removed.
5386 (update_frame, update_single_window, update_window, update_frame_1)
5387 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5388 (duration_to_sec_usec): Remove; no longer needed.
5389
5390 * editfns.c (time_overflow): Now extern.
5391 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5392 (float-time, Fformat_time_string, Fcurrent_time_string)
5393 (Fcurrent_time_zone): Accept and generate higher-resolution
5394 time stamps.
5395 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5396 (decode_time_components, lisp_seconds_argument): New functions.
5397 (make_time): Now static.
5398 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5399 Report an error if the time is invalid, rather than having the caller
5400 do that.
5401
5402 * fileio.c: Include <stat-time.h>
5403 (Fcopy_file): Copy higher-resolution time stamps.
5404 Prefer to set the time stamp via a file descriptor if that works.
5405 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5406 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5407 (Fvisited_file_modtime, Fset_visited_file_modtime):
5408 Support higher-resolution time stamps.
5409
5410 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5411
5412 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5413
5414 * image.c (prepare_image_for_display, clear_image_cache)
5415 (lookup_image): Port to higer-resolution time stamps.
5416
5417 * keyboard.c (start_polling, bind_polling_period):
5418 Check for time stamp overflow.
5419 (read_char, kbd_buffer_get_event, timer_start_idle)
5420 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5421 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5422 Port to higher-resolution time stamps. Do not assume time_t is signed.
5423 (decode_timer): New function. Timers are now vectors of length 9,
5424 not 8, to accommodate the picosecond component.
5425 (timer_check_2): Use it.
5426
5427 * nsterm.m (select_timeout, timeval_subtract): Remove.
5428 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5429 as they're a bit more accurate and handle overflow better.
5430 (ns_select): Change prototype to be compatible with pselect.
5431 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5432 * nsterm.h (ns_select): Adjust prototype.
5433
5434 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5435 us-resolution time stamps.
5436 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5437
5438 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5439
5440 * lisp.h (time_overflow): New decl.
5441 (wait_reading_process_output): First arg is now intmax_t, not int,
5442 to accommodate larger waits.
5443
5444 * process.h (struct Lisp_Process.read_output_delay):
5445 Now counts nanoseconds, not microseconds.
5446 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5447 EMACS_HAS_USECS.
5448 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5449 (wait_reading_process_output):
5450 Port to ns-resolution time stamps.
5451 (Faccept_process_output, wait_reading_process_output):
5452 Check for time stamp overflow. Do not assume time_t is signed.
5453 (select_wrapper): Remove; we now use pselect.
5454 (Fprocess_attributes): Now generates ns-resolution time stamps.
5455
5456 * sysdep.c: Include utimens.h. Don't include utime.h
5457 or worry about struct utimbuf; gnulib does that for us now.
5458 (gettimeofday): Remove; gnulib provides a substitute.
5459 (make_timeval): New function.
5460 (set_file_times): Now sets ns-resolution time stamps.
5461 New arg FD; all uses changed.
5462 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5463 (system_process_attributes):
5464 Now returns ns-resolution time stamp. All uses changed.
5465 Check for time stamp overflow.
5466
5467 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5468 provides a substitute now.
5469
5470 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5471 since it guarantees struct timespec.
5472 (EMACS_TIME): Now struct timespec, so that we can support
5473 ns-resolution time stamps.
5474 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5475 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5476 (EMACS_USECS): Remove.
5477 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5478 so multiply the arg by 1000 before storing it.
5479 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5480 New macros.
5481 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5482 Port to ns-resolution time stamps.
5483 (EMACS_TIME_NEG_P): Remove; replaced by....
5484 (EMACS_TIME_SIGN): New macro.
5485 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5486 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5487 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5488 (make_timeval, make_lisp_time, decode_time_components): New decls.
5489 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5490 that it mishandled time_t overflow. You can't compare by subtracting!
5491 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5492 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5493
5494 * term.c: Include <sys/time.h>.
5495 (timeval_to_Time): New function, for proper overflow wraparound.
5496 (term_mouse_position, term_mouse_click): Use it.
5497
5498 * undo.c (record_first_change): Support higher-resolution time stamps
5499 in the undo buffer.
5500 (Fprimitive_undo): Use them when restoring time stamps.
5501
5502 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5503 (w32_get_internal_run_time):
5504 Port to higher-resolution Emacs time stamps.
5505 (ltime): Now accepts single 64-bit integer, as that's more convenient
5506 for callers.
5507
5508 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5509
5510 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5511 for compatibility with pselect. Support ns-resolution time stamps.
5512
5513 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5514
5515 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5516 Check for time stamp overflow, and support ns-resolution time stamps.
5517
5518 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5519 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5520 (timeval_subtract): Remove; no longer needed.
5521 (XTflash, XTring_bell, x_wait_for_event):
5522 Port to ns-resolution time stamps. Don't assume time_t is signed.
5523
5524 2012-06-22 Chong Yidong <cyd@gnu.org>
5525
5526 * xdisp.c (x_consider_frame_title): Revert last change.
5527
5528 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5529
5530 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5531 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5532 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5533 staticidx goes up to 1597 out of 1600 = 0x640.)
5534
5535 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5536
5537 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5538 Otherwise, the umask might be mistakenly 0 while handling input signals.
5539
5540 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5541
5542 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5543
5544 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5545
5546 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5547 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5548 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5549 access to `contents' member of Lisp_Vector objects with AREF and ASET
5550 where appropriate.
5551
5552 2012-06-19 Chong Yidong <cyd@gnu.org>
5553
5554 * frame.c (delete_frame): When selecting a frame on a different
5555 text terminal, do not alter the terminal's top-frame.
5556
5557 * xdisp.c (format_mode_line_unwind_data): Record the target
5558 frame's selected window and its terminal's top-frame.
5559 (unwind_format_mode_line): Restore them.
5560 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5561 Callers changed.
5562 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5563 since tty frames can be explicitly named.
5564 (prepare_menu_bars): Likewise.
5565
5566 * term.c (Ftty_top_frame): New function.
5567
5568 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5569
5570 Port byte-code-meter to modern targets.
5571 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5572 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5573 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5574 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5575 (METER_1, METER_2): Simplify.
5576
5577 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5578
5579 * data.c (Fdefalias): Return `symbol' (bug#11686).
5580
5581 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5582
5583 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5584 gets killed during executing of this function (Bug#11665).
5585 Try to always return Qt when the buffer has been actually killed.
5586 (Vkill_buffer_query_functions): In doc-string say that functions
5587 run by this hook should not change the current buffer.
5588
5589 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5590
5591 Fix recently-introduced process.c problems found by static checking.
5592 * process.c (write_queue_push, write_queue_pop, send_process):
5593 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5594 (write_queue_pop): Fix pointer signedness problem.
5595 (send_process): Remove unused local.
5596
5597 2012-06-17 Chong Yidong <cyd@gnu.org>
5598
5599 * xdisp.c (redisplay_internal): No need to redisplay terminal
5600 frames that are not on top.
5601
5602 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5603
5604 * process.c (make_process): Initialize write_queue.
5605 (write_queue_push, write_queue_pop): New functions.
5606 (send_process): Use them to maintain correct ordering of process
5607 writes (Bug#10815).
5608
5609 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5610
5611 * lisp.h (eassert): Assume C89 or later.
5612 This removes the need for CHECK.
5613 (CHECK): Remove. Its comments about always evaluating its
5614 argument were confusing, as 'eassert' typically does not evaluate
5615 its argument.
5616
5617 * coding.c (produce_chars): Use ptrdiff_t, not int.
5618
5619 * xterm.c (x_draw_underwave): Check for integer overflow.
5620 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5621
5622 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5623
5624 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5625 referenced (Bug#11583).
5626
5627 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5628
5629 Implement wave-style variant of underlining.
5630 * dispextern.h (face_underline_type): New enum.
5631 (face): Add field for underline type.
5632 * nsterm.m (ns_draw_underwave): New function.
5633 (ns_draw_text_decoration): Use it.
5634 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5635 New functions.
5636 (x_draw_glyph_string): Use them.
5637 * xfaces.c (Qline, Qwave): New Lisp objects.
5638 (check_lface_attrs, merge_face_ref)
5639 (Finternal_set_lisp_face_attribute, realize_x_face):
5640 Handle wave-style underline face attributes.
5641 * xterm.c (x_draw_underwave): New function.
5642 (x_draw_glyph_string): Use it.
5643
5644 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5645
5646 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5647 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5648 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5649 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5650 ($(BLD)/w32select.$(O)): Update dependencies.
5651
5652 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5653
5654 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5655 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5656 * character.c (_fetch_multibyte_char_p): Remove.
5657 * alloc.c: Include "character.h" before "buffer.h".
5658 * bidi.c: Likewise.
5659 * buffer.c: Likewise.
5660 * bytecode.c: Likewise.
5661 * callint.c: Likewise.
5662 * callproc.c: Likewise.
5663 * casefiddle.c: Likewise.
5664 * casetab.c: Likewise.
5665 * category.c: Likewise.
5666 * cmds.c: Likewise.
5667 * coding.c: Likewise.
5668 * composite.c: Likewise.
5669 * dired.c: Likewise.
5670 * dispnew.c: Likewise.
5671 * doc.c: Likewise.
5672 * dosfns.c: Likewise.
5673 * editfns.c: Likewise.
5674 * emacs.c: Likewise.
5675 * fileio.c: Likewise.
5676 * filelock.c: Likewise.
5677 * font.c: Likewise.
5678 * fontset.c: Likewise.
5679 * fringe.c: Likewise.
5680 * indent.c: Likewise.
5681 * insdel.c: Likewise.
5682 * intervals.c: Likewise.
5683 * keyboard.c: Likewise.
5684 * keymap.c: Likewise.
5685 * lread.c: Likewise.
5686 * macros.c: Likewise.
5687 * marker.c: Likewise.
5688 * minibuf.c: Likewise.
5689 * nsfns.m: Likewise.
5690 * nsmenu.m: Likewise.
5691 * print.c: Likewise.
5692 * process.c: Likewise.
5693 * regex.c: Likewise.
5694 * region-cache.c: Likewise.
5695 * search.c: Likewise.
5696 * syntax.c: Likewise.
5697 * term.c: Likewise.
5698 * textprop.c: Likewise.
5699 * undo.c: Likewise.
5700 * unexsol.c: Likewise.
5701 * w16select.c: Likewise.
5702 * w32fns.c: Likewise.
5703 * w32menu.c: Likewise.
5704 * window.c: Likewise.
5705 * xdisp.c: Likewise.
5706 * xfns.c: Likewise.
5707 * xmenu.c: Likewise.
5708 * xml.c: Likewise.
5709 * xselect.c: Likewise.
5710
5711 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5712
5713 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5714 If all the glyphs of the glyph row came from strings, and we have no
5715 cursor positioning clues, put the cursor on the first glyph of the
5716 row.
5717 (handle_face_prop): Use chunk-relative overlay string index when
5718 indexing into it->string_overlays array. (Bug#11653)
5719 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5720 the rightmost. (Bug#11720)
5721
5722 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5723
5724 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5725 (CATEGORY_MEMBER): Enforce 1/0 value.
5726 * category.c (_temp_category_set): Remove.
5727
5728 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5729
5730 * window.c (Fdelete_other_windows_internal)
5731 (Fdelete_window_internal): Don't access frame's mouse highlight
5732 info of the initial frame. (Bug#11677)
5733
5734 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5735
5736 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5737 Assume USE_2_TAGS_FOR_INTS.
5738 (xreload): Adjust $tagmask width to match recent lisp.h change.
5739
5740 Simplify lisp.h in minor ways that should not affect code.
5741 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5742 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5743 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5744 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5745 (INTTYPEBITS): New macro, for clarity.
5746 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5747 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5748 Simplify now that USE_LSB_TAG is always defined.
5749 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5750 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5751
5752 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5753
5754 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5755
5756 2012-06-13 Glenn Morris <rgm@gnu.org>
5757
5758 * s/bsd-common.h (BSD4_3):
5759 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5760
5761 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5762
5763 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5764 instead of union.
5765 (XLI, XIL): Define.
5766 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5767 Use them.
5768 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5769 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5770 * alloc.c (widen_to_Lisp_Object): Remove.
5771 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5772 * frame.c (delete_frame): Remove outdated comment.
5773 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5774 USE_LISP_UNION_TYPE.
5775 (Fw32_unregister_hot_key): Likewise.
5776 (Fw32_toggle_lock_key): Likewise.
5777 * w32menu.c (add_menu_item): Likewise.
5778 (w32_menu_display_help): Use XIL instead of checking
5779 USE_LISP_UNION_TYPE.
5780 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5781 (init_heap): Likewise.
5782 * w32term.c (w32_read_socket): Update comment.
5783
5784 2012-06-13 Glenn Morris <rgm@gnu.org>
5785
5786 * s/usg5-4-common.h, src/s/unixware.h:
5787 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5788
5789 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5790
5791 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5792
5793 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5794 * alloc.c (make_number) [!defined make_number]:
5795 Remove, as lisp.h always defines this now.
5796 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5797 (roundup_size): Verify that it is a power of 2.
5798 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5799 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5800 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5801 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5802 USE_LSB_TAG now is always defined to be either 0 or 1.
5803 All uses changed.
5804 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5805 code works fine either way, and efficiency is not a concern here,
5806 as the union type is for debugging, not for production.
5807 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5808 Use an inline function on all platforms when using the union type,
5809 since this is simpler and 'static inline' can be used portably
5810 within Emacs now.
5811 (LISP_INITIALLY_ZERO): New macro.
5812 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5813 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5814
5815 2012-06-12 Glenn Morris <rgm@gnu.org>
5816
5817 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5818
5819 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5820
5821 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5822 Move BROKEN_SIGIO to configure.
5823
5824 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5825 Move NO_TERMIO to configure.
5826
5827 2012-06-12 Chong Yidong <cyd@gnu.org>
5828
5829 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5830 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5831 MagickExportImagePixels is undefined.
5832
5833 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5834
5835 * image.c (imagemagick_load_image): Remove unused label.
5836
5837 2012-06-11 Glenn Morris <rgm@gnu.org>
5838
5839 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5840 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5841 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5842 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5843
5844 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5845
5846 * alloc.c (make_byte_code): New function.
5847 (Fmake_byte_code): Use it. Don't purify here.
5848 * lread.c (read1): Use it as well to avoid extra allocation.
5849
5850 2012-06-11 Chong Yidong <cyd@gnu.org>
5851
5852 * image.c (imagemagick_load_image): Implement transparency.
5853
5854 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5855
5856 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5857 account for preceding backslashes. (Bug#11663)
5858
5859 2012-06-09 Chong Yidong <cyd@gnu.org>
5860
5861 * term.c: Support italics in capable terminals (Bug#9652).
5862 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5863 (turn_on_face): Output using TS_enter_italic_mode if available.
5864 Don't handle unused blinking and alt-charset cases.
5865 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5866 and tty_alt_charset_p cases.
5867 (tty_capable_p, init_tty): Support italics.
5868
5869 * termchar.h (struct tty_display_info): Add field for italics.
5870 Remove unused blink field.
5871
5872 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5873 Handle slant.
5874
5875 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5876 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5877 tty_alt_charset_p. Add tty_italic_p.
5878
5879 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5880
5881 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5882 dbus_type_is_basic if available.
5883 (xd_extract_signed, xd_extract_unsigned): Rename from
5884 extract_signed and extract_unsigned, respectively. Adapt callers.
5885
5886 2012-06-09 Chong Yidong <cyd@gnu.org>
5887
5888 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5889
5890 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5891 case (Bug#9752).
5892
5893 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5894
5895 * xdisp.c (vmessage): Treat frame message as multibyte.
5896 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5897 would generate the diagnostic "Making \302\247 buffer-local while
5898 let-bound!".
5899
5900 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5901
5902 * dispnew.c (showing_window_margins_p): Undo last change, which
5903 was done due to an inadvertent commit.
5904 (adjust_frame_glyphs_for_frame_redisplay): Do call
5905 showing_window_margins_p.
5906
5907 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5908
5909 * eval.c (Fmake_var_non_special): New primitive.
5910 (syms_of_eval): Defsubr it.
5911 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5912
5913 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5914
5915 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5916 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5917
5918 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5919
5920 * alloc.c (allocate_vectorlike): Fix last change.
5921
5922 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5923
5924 Block-based vector allocation of small vectors.
5925 * lisp.h (struct vectorlike_header): New field `nbytes',
5926 adjust comment accordingly.
5927 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5928 to denote vector blocks. Adjust users (live_vector_p,
5929 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5930 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5931 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5932 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5933 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5934 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5935 (roundup_size): New constant.
5936 (struct vector_block): New data type.
5937 (vector_blocks, vector_free_lists, zero_vector): New variables.
5938 (all_vectors): Rename to `large_vectors'.
5939 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5940 (sweep_vectors): New functions.
5941 (allocate_vectorlike): Return `zero_vector' as the only vector of
5942 0 items. Allocate new vector from block if vector size is less than
5943 or equal to VBLOCK_BYTES_MAX.
5944 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5945 (init_alloc_once): Add call to init_vectors.
5946
5947 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5948
5949 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5950
5951 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5952
5953 * doprnt.c (doprnt): Truncate multibyte char correctly.
5954 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5955 would mishandle a string argument "Xc" if X was a multibyte
5956 character of length 2: it would truncate after X's first byte
5957 rather than including all of X.
5958
5959 2012-06-06 Chong Yidong <cyd@gnu.org>
5960
5961 * buffer.c (word_wrap): Doc fix.
5962
5963 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5964
5965 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5966
5967 2012-06-03 Glenn Morris <rgm@gnu.org>
5968
5969 * xdisp.c (tool-bar-style): Doc fix.
5970
5971 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5972
5973 * Makefile.in (PAXCTL): Define.
5974 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5975 binary via PaX flags if the paxctl utility is available.
5976 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5977 Restore PaX flags to their default. (Bug#11398)
5978
5979 2012-06-03 Chong Yidong <cyd@gnu.org>
5980
5981 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5982 buffer (Bug#11226).
5983
5984 2012-06-03 Chong Yidong <cyd@gnu.org>
5985
5986 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5987 (note_mode_line_or_margin_highlight): If there is no help echo,
5988 use mode-line-default-help-echo. Handle the case where the mouse
5989 position is past the end of the mode line string.
5990
5991 * buffer.c (buffer_local_value_1): New function, split from
5992 Fbuffer_local_value; can return Qunbound.
5993 (Fbuffer_local_value): Use it.
5994 (Vmode_line_format): Docstring tweaks.
5995
5996 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5997
5998 * sysdep.c (system_process_attributes): Improve comment.
5999
6000 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6001
6002 * keyboard.c: Export real-this-command to Elisp.
6003 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6004 and DEFVAR it. Update all users.
6005
6006 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6007
6008 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6009
6010 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6011 Convert pctcpu and pctmem to Lisp float properly.
6012 Let the compiler fold better, as 100.0/0x8000 is exact.
6013
6014 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6015
6016 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6017 cons_block.
6018
6019 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6020
6021 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6022
6023 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6024
6025 For a 'struct window', replace some Lisp_Object fields to
6026 bitfields where appropriate, remove unused fields.
6027 * window.h (struct window): Remove unused 'last_mark_x' and
6028 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6029 change it's type from Lisp_Object to bitfield.
6030 Change type of 'force_start', 'optional_new_start',
6031 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6032 fields from Lisp_Object to bitfield. Adjust users accordingly.
6033
6034 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6035
6036 Pacify gcc -Wdouble-precision when using Xaw.
6037 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6038 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6039 Use 'float' consistently, rather than 'float' in most places
6040 and 'double' in a couple of places.
6041
6042 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6043
6044 * xdisp.c (handle_stop): Detect whether we have overlay strings
6045 loaded by testing it->current.overlay_string_index to be
6046 non-negative, instead of checking whether n_overlay_strings is
6047 positive. (Bug#11587)
6048
6049 2012-05-31 Chong Yidong <cyd@gnu.org>
6050
6051 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6052
6053 * doc.c (Fsubstitute_command_keys): Doc fix.
6054
6055 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6056
6057 * search.c (search_buffer): Remove calls to
6058 r_alloc_inhibit_buffer_relocation, as it is now called by
6059 maybe_unify_char, which was the cause of relocation of buffer text
6060 in bug#11519.
6061
6062 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6063
6064 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6065 for the duration of call to load_charset, to avoid problems with
6066 callers of maybe_unify_char that access buffer text through C
6067 pointers.
6068
6069 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6070 decrement the inhibition flag, instead of just setting or
6071 resetting it.
6072
6073 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6074
6075 Remove obsolete '#define static' cruft.
6076 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6077 This #undef was "temporary" in 2000; it is no longer needed
6078 now that '#define static' has gone away.
6079 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6080 (gray_bitmap_bits): Remove; no longer needed.
6081 All uses replaced with definiens.
6082 * xterm.c: Include "bitmaps/gray.xbm".
6083
6084 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6085
6086 Clean up __executable_start, monstartup when --enable-profiling.
6087 The following changes affect the code only when profiling.
6088 * dispnew.c (__executable_start): Rename from safe_bcopy.
6089 Define only on platforms that need it.
6090 * emacs.c: Include <sys/gmon.h> when profiling.
6091 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6092 (__executable_start): Remove decl, since lisp.h does it now.
6093 (safe_bcopy): Remove decl; no longer has that name.
6094 (main): Coalesce #if into single bit of code, for simplicity.
6095 Cast pointers to uintptr_t, since standard libraries want integers
6096 and not pointers.
6097 * lisp.h (__executable_start): New decl.
6098
6099 2012-05-31 Glenn Morris <rgm@gnu.org>
6100
6101 * image.c (Fimagemagick_types): Doc fix.
6102
6103 2012-05-30 Jim Meyering <meyering@redhat.com>
6104
6105 * callproc.c (Fcall_process_region): Include directory component
6106 in mkstemp error message (Bug#11586).
6107
6108 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6109
6110 * alloc.c, lisp.h (make_pure_vector): Now static.
6111
6112 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6113
6114 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6115 Move to byte-run.el.
6116 (Fautoload): Do the hash-doc more carefully.
6117 * data.c (Fdefalias): Purify definition, except for keymaps.
6118 (Qdefun): Move from eval.c.
6119 * lisp.h (Qdefun): Remove.
6120 * lread.c (read1): Tiny simplification.
6121
6122 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6123
6124 Do not create empty overlays with the evaporate property (Bug#9642).
6125 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6126 Bug#9642, but explicitly check that the buffer the overlay would
6127 be moved to is live and rearrange lines to make sure that errors
6128 will not put the overlay in an inconsistent state.
6129 (Fdelete_overlay): Cosmetics.
6130
6131 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6132
6133 * w32term.c (my_bring_window_to_top): New function.
6134 (x_raise_frame): Use handle returned by DeferWindowPos, which
6135 could be different from the original one.
6136 Call my_bring_window_to_top instead of my_set_foreground_window.
6137 (Bug#11513)
6138
6139 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6140 by calling BringWindowToTop.
6141
6142 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6143 (WM_EMACS_END): Increase by one.
6144
6145 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6146
6147 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6148 This avoids undefined behavior that might cause the eassert
6149 to not catch an out-of-range value.
6150
6151 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6152
6153 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6154 Update dependencies.
6155
6156 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6157
6158 * bidi.c (bidi_mirror_char): Fix last change.
6159
6160 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6161
6162 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6163 when referring to sectname field in printf format.
6164
6165 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6166
6167 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6168 Only r_alloc_inhibit_buffer_relocation needed to be added;
6169 the others were already declared.
6170
6171 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6172 before checking whether it's out of range. Put the check inside
6173 eassert. See
6174 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6175
6176 2012-05-27 Ken Brown <kbrown@cornell.edu>
6177
6178 * callproc.c (Fcall_process): Restore a line that was accidentally
6179 commented out in the 2011-02-13 change (bug#11547).
6180
6181 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6182
6183 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6184 defined on ralloc.c.
6185
6186 * buffer.c [REL_ALLOC]: Remove prototypes of
6187 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6188 they are now on lisp.h.
6189
6190 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6191
6192 * search.c (search_buffer): Use it to inhibit relocation of buffer
6193 text while re_search_2 is doing its job, because re_search_2 is
6194 passed C pointers to buffer text. (Bug#11519)
6195
6196 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6197 Update value to 24.
6198
6199 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6200 state after an additional call to move_it_in_display_line_to, keep
6201 the values of it->max_ascent and it->max_descent found for the
6202 entire line.
6203 (pos_visible_p): Revert the comparison against bottom_y to what it
6204 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6205 (Bug#11464)
6206
6207 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6208
6209 Fix coding-related core dumps with gcc -ftrapv.
6210 The code was computing A - B, where A and B are pointers, and B is
6211 random garbage. This can lead to core dumps on platforms that
6212 have special pointer registers, and it also leads to core dumps on
6213 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6214 A - B only when B is initialized properly.
6215 * coding.c (coding_set_source, coding_set_destination): Return void.
6216 (coding_change_source, coding_change_destinations): New functions,
6217 with the old behaviors of coding_set_source and coding_set_destination.
6218 All callers that need an offset changed to use these new functions.
6219
6220 2012-05-26 Glenn Morris <rgm@gnu.org>
6221
6222 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6223
6224 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6225
6226 Extend mouse support on W32 text-mode console.
6227 * xdisp.c (draw_row_with_mouse_face):
6228 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6229
6230 * w32console.c: Include window.h.
6231 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6232 New functions.
6233 (initialize_w32_display): Initialize mouse-highlight data.
6234
6235 * w32inevt.c: Include termchar.h and window.h.
6236 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6237 moves, call note_mouse_highlight. If help_echo changed, call
6238 gen_help_event to produce help-echo message in the echo area.
6239 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6240 highlight info.
6241
6242 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6243
6244 * lread.c (read1): Simplify slightly to avoid an overflow warning
6245 with GCC 4.7.0 on x86-64.
6246
6247 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6248
6249 * bidi.c (bidi_mirror_char): Revert last change: an int is
6250 definitely wide enough here.
6251
6252 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6253
6254 Fix integer width and related bugs (Bug#9874).
6255 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6256 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6257 (string_bytes, check_sblock, allocate_string_data):
6258 (compact_small_strings, Fmake_bool_vector, make_string)
6259 (make_unibyte_string, make_multibyte_string)
6260 (make_string_from_bytes, make_specified_string)
6261 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6262 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6263 (mark_vectorlike):
6264 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6265 (allocate_pseudovector):
6266 Use int, not EMACS_INT, where int is wide enough.
6267 (inhibit_garbage_collection, Fgarbage_collect):
6268 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6269 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6270 int might not be wide enough.
6271 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6272 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6273 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6274 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6275 (bidi_level_of_next_char, bidi_move_to_visually_next):
6276 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6277 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6278 (Fkill_buffer, Fset_buffer_major_mode)
6279 (advance_to_char_boundary, Fbuffer_swap_text)
6280 (Fset_buffer_multibyte, overlays_at, overlays_in)
6281 (overlay_touches_p, struct sortvec, record_overlay_string)
6282 (overlay_strings, recenter_overlay_lists)
6283 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6284 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6285 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6286 (Foverlay_recenter, last_overlay_modification_hooks_used)
6287 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6289 (validate_region): Omit unnecessary test for b <= e,
6290 since that's guaranteed by the previous test.
6291 (adjust_overlays_for_delete): Avoid pos + length overflow.
6292 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6293 (report_overlay_modification):
6294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6295 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6296 Omit pointer cast, which isn't needed anyway, and doesn't work
6297 after the EMACS_INT -> ptrdiff_t change.
6298 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6299 * buffer.h: Adjust decls to match defn changes elsewhere.
6300 (struct buffer_text, struct buffer):
6301 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6302 Use EMACS_INT, not int, where int might not be wide enough.
6303 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6304 not int, to avoid needless 32-bit limit on 64-bit hosts.
6305 (exec_byte_code): Use tighter memory-full test, one that checks
6306 for alloca overflow. Don't compute the address of the object just
6307 before an array, as that's not portable. Use EMACS_INT, not
6308 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6309 * callint.c (Fcall_interactively):
6310 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6311 * callproc.c (call_process_kill, Fcall_process):
6312 Don't assume pid_t fits into an Emacs fixnum.
6313 (call_process_cleanup, Fcall_process, child_setup):
6314 Don't assume pid_t fits into int.
6315 (call_process_cleanup, Fcall_process, delete_temp_file)
6316 (Fcall_process_region):
6317 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6318 (Fcall_process): Simplify handling of volatile integers.
6319 Use int, not EMACS_INT, where int will do.
6320 * casefiddle.c (casify_object, casify_region, operate_on_word)
6321 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6322 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6323 (casify_object): Avoid integer overflow when overallocating buffer.
6324 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6325 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6326 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6327 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6328 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6329 integers are now checked earlier. All uses replaced with XINT.
6330 (ccl_driver):
6331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6332 For CCL_MapSingle, check that content and value are in int range.
6333 (ccl_driver, Fregister_code_conversion_map):
6334 Check that Vcode_version_map_vector is a vector.
6335 (resolve_symbol_ccl_program): Check that vector header is in range.
6336 Always copy the vector, so that we can check its contents reliably
6337 now rather than having to recheck each instruction as it's being
6338 executed. Check that vector words fit in 'int'.
6339 (ccl_get_compiled_code, Fregister_ccl_program)
6340 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6341 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6342 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6343 contents are in range.
6344 (Fccl_execute_on_string): Check that status is in range.
6345 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6346 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6347 Accept and return EMACS_INT, not int, because callers can pass values
6348 out of 'int' range.
6349 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6350 (multibyte_chars_in_text, parse_str_as_multibyte)
6351 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6352 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6353 (string_escape_byte8, Fget_byte):
6354 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6355 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6356 avoid mishandling large integers.
6357 * character.h: Adjust decls to match defn changes elsewhere.
6358 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6359 (Ffind_charset_region):
6360 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6361 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6362 (load_charset_map_from_vector, Fdefine_charset_internal):
6363 Don't assume fixnum fits in int.
6364 (load_charset_map_from_vector, Fmap_charset_chars):
6365 Remove now-unnecessary CHECK_NATNUMs.
6366 (Fdefine_charset_internal): Check ranges here, more carefully.
6367 Don't rely on undefined behavior with signed left shift overflow.
6368 Don't assume unsigned int fits into fixnum, or that fixnum fits
6369 into unsigned int. Don't require max_code to be a valid fixnum;
6370 that's not true for gb10830 4-byte on a 32-bit host. Allow
6371 invalid_code to be a cons, for the same reason. Require code_offset
6372 to be a character. Avoid int overflow if max_char is close
6373 to INT_MAX.
6374 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6375 this is intended anyway and avoids some undefined behavior.
6376 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6377 INDEX_TO_CODE_POINT, as that's what it expects.
6378 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6379 * charset.h (DECODE_CHAR): Return int, not unsigned;
6380 this is what was intended anyway, and it avoids undefined behavior.
6381 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6382 integer-overflow issues.
6383 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6384 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6385 where the argument is EMACS_INT, and this behavior is not intended.
6386 * chartab.c (Fmake_char_table, Fset_char_table_range)
6387 (uniprop_get_decoder, uniprop_get_encoder):
6388 Don't assume fixnum fits in int.
6389 * cmds.c (move_point): New function, that does the gist of
6390 Fforward_char and Fbackward_char, but does so while checking
6391 for integer overflow more accurately.
6392 (Fforward_char, Fbackward_char): Use it.
6393 (Fforward_line, Fend_of_line, internal_self_insert)
6394 (internal_self_insert):
6395 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6396 Fix a FIXME, by checking for integer overflow when calculating
6397 target_clm and actual_clm.
6398 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6399 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6400 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6401 (coding_alloc_by_making_gap, alloc_destination)
6402 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6403 (encode_coding_utf_16, detect_coding_emacs_mule)
6404 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6405 (detect_coding_iso_2022, decode_coding_iso_2022)
6406 (encode_invocation_designation, encode_designation_at_bol)
6407 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6408 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6409 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6410 (encode_coding_ccl, encode_coding_raw_text)
6411 (detect_coding_charset, decode_coding_charset)
6412 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6413 (produce_composition, produce_charset, produce_annotation)
6414 (decode_coding, handle_composition_annotation)
6415 (handle_charset_annotation, consume_chars, decode_coding_gap)
6416 (decode_coding_object, encode_coding_object, detect_coding_system)
6417 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6418 (code_convert_region, code_convert_string)
6419 (Fdefine_coding_system_internal)
6420 (coding_set_source, coding_set_destination):
6421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6422 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6423 (Fdefine_coding_system_internal):
6424 Don't assume fixnums fit in int.
6425 (decode_coding_gap, decode_coding_object, encode_coding_object)
6426 (Fread_coding_system, Fdetect_coding_region)
6427 (Funencodable_char_position, Fcheck_coding_systems_region)
6428 (get_translation, handle_composition_annotation, consume_chars):
6429 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6430 (consume_chars): Rewrite to not calculate an address outside buffer.
6431 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6432 Don't access memory outside of the args array.
6433 (Fdefine_coding_system_internal): Check for charset-id overflow.
6434 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6435 result of ENCODE_CHAR.
6436 * coding.h: Adjust decls to match defn changes elsewhere.
6437 (struct coding_system):
6438 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6439 * composite.c (get_composition_id, find_composition)
6440 (run_composition_function, update_compositions)
6441 (compose_text, composition_gstring_put_cache)
6442 (composition_gstring_p, composition_gstring_width)
6443 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6444 (composition_compute_stop_pos, composition_reseat_it)
6445 (composition_update_it, struct position_record)
6446 (find_automatic_composition, composition_adjust_point)
6447 (Fcomposition_get_gstring, Ffind_composition_internal):
6448 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6449 (update_compositions):
6450 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6451 * composite.h: Adjust decls to match defn changes elsewhere.
6452 (struct composition):
6453 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6454 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6455 Do not attempt to compute the address of the object just before a
6456 buffer; this is not portable.
6457 (Faref, Faset):
6458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6459 (Faset): Use int, not EMACS_INT, where int is wide enough.
6460 (Fstring_to_number): Don't assume fixnums fit in int.
6461 (Frem): Don't assume arg is nonnegative.
6462 * dbusbind.c (xd_append_arg): Check for integers out of range.
6463 (Fdbus_call_method): Don't overflow the timeout int.
6464 (extract_signed, extract_unsigned): New functions.
6465 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6466 (xd_get_connection_references): Return ptrdiff_t, not int.
6467 All uses changed.
6468 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6469 (xd_read_message_1):
6470 Use int, not unsigned, where the dbus API uses int.
6471 (Fdbus_message_internal): Don't overflow mtype.
6472 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6473 * dired.c (directory_files_internal, file_name_completion, scmp)
6474 (file_name_completion_stat):
6475 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6476 (file_name_completion): Don't overflow matchcount.
6477 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6478 * dispextern.h: Adjust decls to match defn changes elsewhere.
6479 (struct text_pos, struct glyph, struct bidi_saved_info)
6480 (struct bidi_string_data, struct bidi_it, struct composition_it)
6481 (struct it):
6482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6483 (struct display_pos, struct composition_it, struct it):
6484 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6485 * dispnew.c (increment_matrix_positions)
6486 (increment_row_positions, mode_line_string)
6487 (marginal_area_string):
6488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6489 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6490 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6491 (duration_to_sec_usec): New function, to check for overflow better.
6492 (Fsleep_for, sit_for): Use it.
6493 * doc.c (get_doc_string, store_function_docstring):
6494 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6495 (get_doc_string, Fsnarf_documentation):
6496 Use int, not EMACS_INT, where int is wide enough.
6497 (get_doc_string):
6498 Use SAFE_ALLOCA, not alloca.
6499 Check for overflow when converting EMACS_INT to off_t.
6500 * doprnt.c (doprnt):
6501 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6502 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6503 Don't assume uid_t fits into fixnum.
6504 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6505 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6506 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6507 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6508 (general_insert_function)
6509 (Finsert_char, make_buffer_string, make_buffer_string_both)
6510 (update_buffer_properties, Fbuffer_substring)
6511 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6512 (Fsubst_char_in_region, check_translation)
6513 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6514 (transpose_markers, Ftranspose_regions):
6515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6516 (clip_to_bounds): Move to lisp.h as an inline function).
6517 (Fconstrain_to_field): Don't assume integers are nonnegative.
6518 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6519 (Fsubst_char_in_region, Fsave_restriction):
6520 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6521 (Femacs_pid): Don't assume pid_t fits into fixnum.
6522 (lo_time): Use int, not EMACS_INT, when int suffices.
6523 (lisp_time_argument): Check for usec out of range.
6524 (Fencode_time): Don't assume fixnum fits in int.
6525 (Fuser_login_name, Fuser_full_name): Signal an error
6526 if a uid argument is out of range, rather than relying on
6527 undefined behavior.
6528 (Fformat_time_string): Remove now-unnecessary check.
6529 lisp_time_argument checks for out-of-range usec now.
6530 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6531 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6532 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6533 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6534 (init_cmdargs, Fdump_emacs):
6535 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6536 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6537 the bottom (typically) 32 bits of the fixnum.
6538 * eval.c (specpdl_size, call_debugger):
6539 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6540 (when_entered_debugger, Fbacktrace_debug):
6541 Don't assume fixnum can fit in int.
6542 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6543 the object just before a buffer; this is not portable.
6544 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6545 (grow_specpdl, unbind_to):
6546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6547 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6548 (grow_specpdl): Simplify allocation by using xpalloc.
6549 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6550 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6551 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6552 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6553 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6554 (a_write, e_write):
6555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6556 (Fcopy_file, non_regular_nbytes, read_non_regular)
6557 (Finsert_file_contents):
6558 Use int, not EMACS_INT, where int is wide enough.
6559 (READ_BUF_SIZE): Verify that it fits in int.
6560 (Finsert_file_contents): Check that counts are in proper range,
6561 rather than assuming fixnums fit into ptrdiff_t etc.
6562 Don't assume fixnums fit into int.
6563 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6564 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6565 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6566 (string_char_to_byte, string_byte_to_char)
6567 (string_make_multibyte, string_to_multibyte)
6568 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6569 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6570 (substring_both, Fdelete, internal_equal, Ffillarray)
6571 (Fclear_string, mapcar1)
6572 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6573 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6574 (larger_vector, make_hash_table, maybe_resize_hash_table)
6575 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6576 (Fmaphash, secure_hash):
6577 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6578 (concat): Check for string index and length overflow.
6579 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6580 (Frequire):
6581 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6582 (larger_vector): New API (vec, incr_min, size_max) replaces old
6583 one (vec, new_size, init). This catches size overflow.
6584 INIT was removed because it was always Qnil.
6585 All callers changed.
6586 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6587 the upper bound on a hash table index size.
6588 (make_hash_table, maybe_resize_hash_table): Use it.
6589 (secure_hash): Computer start_byte and end_byte only after
6590 they're known to be in ptrdiff_t range.
6591 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6592 (Ffont_get_glyphs, Ffont_at):
6593 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6594 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6595 (Flist_fonts, Fopen_font):
6596 Don't assume fixnum can fit in int.
6597 (check_gstring): Don't assume index can fit in int.
6598 (font_match_p): Check that fixnum is a character, not a nonnegative
6599 fixnum, since the later code needs to stuff it into an int.
6600 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6601 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6602 conversion overflow issues.
6603 (Fopen_font): Check for integer out of range.
6604 (Ffont_get_glyphs): Don't assume index can fit in int.
6605 * font.h: Adjust decls to match defn changes elsewhere.
6606 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6607 integer overflow.
6608 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6609 printmax_t, where ptrdiff_t is wide enough.
6610 (Finternal_char_font):
6611 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6612 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6613 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6614 (Fset_frame_position, x_set_frame_parameters)
6615 (x_set_line_spacing, x_set_border_width)
6616 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6617 Check that fixnums are in proper range for system types.
6618 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6620 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6621 Use SAFE_ALLOCA_LISP, not alloca.
6622 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6623 intptr_t is wide enough.
6624 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6625 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6626 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6627 Check for fixnum out of range.
6628 * ftfont.c (ftfont_list): Don't assume index fits in int.
6629 Check that fixnums are in proper range for system types.
6630 (ftfont_shape_by_flt):
6631 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6632 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6633 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6634 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6635 Check that fixnums are in proper range for system types.
6636 * gnutls.h: Adjust decls to match defn changes elsewhere.
6637 * gtkutil.c (xg_dialog_run):
6638 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6639 (update_frame_tool_bar):
6640 Check that fixnums are in proper range for system types.
6641 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6642 (lookup_image): Check that fixnums are in range for system types.
6643 * indent.c (last_known_column, last_known_column_point):
6644 (current_column_bol_cache):
6645 (skip_invisible, current_column, check_display_width):
6646 (check_display_width, scan_for_column, current_column_1)
6647 (Findent_to, Fcurrent_indentation, position_indentation)
6648 (indented_beyond_p, Fmove_to_column, compute_motion):
6649 (Fcompute_motion, Fvertical_motion):
6650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6651 (last_known_column_modified): Use EMACS_INT, not int.
6652 (check_display_width):
6653 (Fcompute_motion):
6654 Check that fixnums and floats are in proper range for system types.
6655 (compute_motion): Don't assume index or fixnum fits in int.
6656 (compute_motion, Fcompute_motion):
6657 Use int, not EMACS_INT, when it is wide enough.
6658 (vmotion): Omit local var start_hpos that is always 0; that way
6659 we don't need to worry about overflow in expressions involving it.
6660 * indent.h: Adjust decls to match defn changes elsewhere.
6661 (struct position):
6662 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6663 Use int, not EMACS_INT, where int is wide enough.
6664 Remove unused members ovstring_chars_done and tab_offset;
6665 all uses removed.
6666 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6667 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6668 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6669 (make_gap, copy_text, insert, insert_and_inherit)
6670 (insert_before_markers, insert_before_markers_and_inherit)
6671 (insert_1, count_combining_before, count_combining_after)
6672 (insert_1_both, insert_from_string)
6673 (insert_from_string_before_markers, insert_from_string_1)
6674 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6675 (adjust_after_replace, adjust_after_insert, replace_range)
6676 (replace_range_2, del_range, del_range_1, del_range_byte)
6677 (del_range_both, del_range_2, modify_region)
6678 (prepare_to_modify_buffer, signal_before_change)
6679 (signal_after_change, Fcombine_after_change_execute):
6680 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6681 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6682 (balance_an_interval, split_interval_right, split_interval_left)
6683 (find_interval, next_interval, update_interval)
6684 (adjust_intervals_for_insertion, delete_node, delete_interval)
6685 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6686 (static_offset_intervals, offset_intervals)
6687 (merge_interval_right, merge_interval_left, make_new_interval)
6688 (graft_intervals_into_buffer, temp_set_point_both)
6689 (temp_set_point, set_point, adjust_for_invis_intang)
6690 (set_point_both, move_if_not_intangible, get_property_and_range)
6691 (get_local_map, copy_intervals, copy_intervals_to_string)
6692 (compare_string_intervals, set_intervals_multibyte_1):
6693 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6694 * intervals.h: Adjust decls to match defn changes elsewhere.
6695 (struct interval):
6696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6697 * keyboard.c (this_command_key_count, this_single_command_key_start)
6698 (before_command_key_count, before_command_echo_length, echo_now)
6699 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6700 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6701 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6702 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6704 (last_non_minibuf_size, last_point_position, echo_truncate)
6705 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6706 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6707 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6708 (stuff_buffered_input):
6709 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6710 (last_auto_save, command_loop_1, read_char):
6711 Use EMACS_INT, not int, to avoid integer overflow.
6712 (record_char): Avoid overflow in total_keys computation.
6713 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6714 * keyboard.h: Adjust decls to match defn changes elsewhere.
6715 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6716 (Fkey_description, Fdescribe_vector, Flookup_key):
6717 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6718 (click_position): New function, to check that positions are in range.
6719 (Fcurrent_active_maps):
6720 (describe_command):
6721 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6722 (Faccessible_keymaps, Fkey_description):
6723 (preferred_sequence_p):
6724 Don't assume fixnum can fit into int.
6725 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6726 Check for integer overflow in size calculations.
6727 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6728 avoid mishandling large integers.
6729 * lisp.h: Adjust decls to match defn changes elsewhere.
6730 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6731 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6732 (struct Lisp_Marker):
6733 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6734 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6735 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6736 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6737 All callers changed.
6738 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6739 Assume the arg has valid form, since it always does.
6740 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6741 unsigned integer system type.
6742 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6743 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6745 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6746 (duration_to_sec_usec): New decl.
6747 * lread.c (read_from_string_index, read_from_string_index_byte)
6748 (read_from_string_limit, readchar, unreadchar, openp)
6749 (read_internal_start, read1, oblookup):
6750 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6751 (Fload, readevalloop, Feval_buffer, Feval_region):
6752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6753 (openp): Check for out-of-range argument to 'access'.
6754 (read1): Use int, not EMACS_INT, where int is wide enough.
6755 Don't assume fixnum fits into int.
6756 Fix off-by-one error that can read outside a buffer.
6757 (read_filtered_event): Use duration_to_sec_usec
6758 to do proper overflow checking on durations.
6759 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6760 in size calculation.
6761 (Fexecute_kbd_macro):
6762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6763 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6764 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6765 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6766 (set_marker_both, set_marker_restricted_both, marker_position)
6767 (marker_byte_position, Fbuffer_has_markers_at):
6768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6769 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6770 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6771 It now merely ensures that the menu is large enough, without
6772 necessarily growing it, as this avoids some integer overflow issues.
6773 All callers changed.
6774 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6775 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6776 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6777 Use SAFE_ALLOCA_LISP, not alloca.
6778 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6779 to EMACS_INT. Check that fixnums are in proper range for system types.
6780 * minibuf.c (minibuf_prompt_width, string_to_object)
6781 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6782 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6783 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6784 (get_minibuffer, read_minibuf_unwind):
6785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6786 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6787 this simplifies overflow checking. All callers changed.
6788 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6789 (Ftest_completion):
6790 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6791 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6792 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6793 Check that fixnums are in proper range for system types.
6794 (Fx_create_frame, Fx_show_tip):
6795 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6796 * nsfont.m (ns_findfonts, nsfont_list_family):
6797 Don't assume fixnum fits in long.
6798 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6800 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6801 wide enough.
6802 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6803 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6804 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6805 (PRINTDECLARE, PRINTPREPARE):
6806 (strout, print_string):
6807 (print, print_preprocess, print_check_string_charset_prop)
6808 (print_object):
6809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6810 (PRINTDECLARE):
6811 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6812 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6813 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6814 (printchar, strout): Use xpalloc to catch size calculation overflow.
6815 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6816 (print_error_message): Use SAFE_ALLOCA, not alloca.
6817 (print_object): Use int, not EMACS_INT, where int is wide enough.
6818 (print_depth, new_backquote_output, print_number_index):
6819 Use ptrdiff_t, not int, where int might not be wide enough.
6820 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6821 (Fset_process_window_size, Fformat_network_address)
6822 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6823 (sigchld_handler):
6824 Check that fixnums are in proper range for system types.
6825 (Fsignal_process): Simplify by avoiding a goto.
6826 Check for process-ids out of pid_t range rather than relying on
6827 undefined behavior.
6828 (process_tick, update_tick): Use EMACS_INT, not int.
6829 (Fformat_network_address, read_process_output, send_process)
6830 (Fprocess_send_region, status_notify):
6831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6832 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6833 (wait_reading_process_output, read_process_output, exec_sentinel):
6834 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6835 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6836 (Faccept_process_output): Use duration_to_sec_usec to do proper
6837 overflow checking on durations.
6838 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6839 Don't assume pid_t fits in int.
6840 * process.h (struct Lisp_Process): Members tick and update_tick
6841 are now of type EMACS_INT, not int.
6842 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6843 configured --with-wide-int.
6844 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6845 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6846 * search.c (looking_at_1, string_match_1):
6847 (fast_string_match, fast_c_string_match_ignore_case)
6848 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6849 (scan_newline, find_before_next_newline, search_command)
6850 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6851 (set_search_regs, wordify):
6852 (Freplace_match):
6853 (Fmatch_data):
6854 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6855 (string_match_1, search_buffer, set_search_regs):
6856 (Fmatch_data):
6857 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6858 (wordify): Check for overflow in size calculation.
6859 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6860 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6861 Check that fixnums are in proper range for system types.
6862 * sound.c (struct sound_device)
6863 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6865 (Fplay_sound_internal):
6866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6867 * syntax.c (struct lisp_parse_state, find_start_modiff)
6868 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6869 (Fparse_partial_sexp):
6870 Don't assume fixnums can fit in int.
6871 (struct lisp_parse_state, find_start_pos, find_start_value)
6872 (find_start_value_byte, find_start_begv)
6873 (update_syntax_table, char_quoted, dec_bytepos)
6874 (find_defun_start, prev_char_comend_first, back_comment):
6875 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6876 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6877 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6878 (Finternal_describe_syntax_value): Check that match_lisp is a
6879 character, not an integer, since the code stuffs it into int.
6880 (scan_words, scan_sexps_forward):
6881 Check that fixnums are in proper range for system types.
6882 (Fforward_word):
6883 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6884 (scan_sexps_forward):
6885 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6886 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6887 * syntax.h: Adjust decls to match defn changes elsewhere.
6888 (struct gl_state_s):
6889 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6890 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6891 MOST_POSITIVE_FIXNUM.
6892 * sysdep.c (wait_for_termination_1, wait_for_termination)
6893 (interruptible_wait_for_termination, mkdir):
6894 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6895 (emacs_read, emacs_write):
6896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6897 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6898 and double all fit in int.
6899 * term.c (set_tty_color_mode):
6900 Check that fixnums are in proper range for system types.
6901 * termhooks.h (struct input_event):
6902 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6903 * textprop.c (validate_interval_range, interval_of)
6904 (Fadd_text_properties, set_text_properties_1)
6905 (Fremove_text_properties, Fremove_list_of_text_properties)
6906 (Ftext_property_any, Ftext_property_not_all)
6907 (copy_text_properties, text_property_list, extend_property_ranges)
6908 (verify_interval_modification):
6909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6910 (Fnext_single_char_property_change)
6911 (Fprevious_single_char_property_change):
6912 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6913 (copy_text_properties):
6914 Check for integer overflow in index calculation.
6915 * undo.c (last_boundary_position, record_point, record_insert)
6916 (record_delete, record_marker_adjustment, record_change)
6917 (record_property_change):
6918 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6919 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6921 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6922 (Fx_hide_tip, Fx_file_dialog):
6923 * w32menu.c (set_frame_menubar):
6924 Use ptrdiff_t, not int, for consistency with rest of code.
6925 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6926 (select_window, Fdelete_other_windows_internal)
6927 (window_scroll_pixel_based, window_scroll_line_based)
6928 (Frecenter, Fset_window_configuration):
6929 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6930 (Fset_window_hscroll, run_window_configuration_change_hook)
6931 (set_window_buffer, temp_output_buffer_show, scroll_command)
6932 (Fscroll_other_window, Frecenter):
6933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6934 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6935 Don't assume fixnum fits in int.
6936 (Fset_window_scroll_bars):
6937 Check that fixnums are in proper range for system types.
6938 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6939 (string_pos, c_string_pos, number_of_chars, init_iterator)
6940 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6941 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6942 (compute_display_string_end, handle_face_prop)
6943 (face_before_or_after_it_pos, handle_invisible_prop)
6944 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6945 (display_prop_intangible_p, string_buffer_position_lim)
6946 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6947 (get_overlay_strings_1, get_overlay_strings)
6948 (iterate_out_of_display_property, forward_to_next_line_start)
6949 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6950 (get_next_display_element, set_iterator_to_next)
6951 (get_visually_first_element, compute_stop_pos_backwards)
6952 (handle_stop_backwards, next_element_from_buffer)
6953 (move_it_in_display_line_to, move_it_in_display_line)
6954 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6955 (add_to_log, message_dolog, message_log_check_duplicate)
6956 (message2, message2_nolog, message3, message3_nolog
6957 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6958 (current_message_1, truncate_echo_area, truncate_message_1)
6959 (set_message, set_message_1, store_mode_line_noprop)
6960 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6961 (text_outside_line_unchanged_p, check_point_in_composition)
6962 (reconsider_clip_changes)
6963 (redisplay_internal, set_cursor_from_row, try_scrolling)
6964 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6965 (redisplay_window, find_last_unchanged_at_beg_row)
6966 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6967 (trailing_whitespace_p, find_row_edges, display_line)
6968 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6969 (display_mode_element, store_mode_line_string)
6970 (pint2str, pint2hrstr, decode_mode_spec)
6971 (display_count_lines, display_string, draw_glyphs)
6972 (x_produce_glyphs, x_insert_glyphs)
6973 (rows_from_pos_range, mouse_face_from_buffer_pos)
6974 (fast_find_string_pos, mouse_face_from_string_pos)
6975 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6976 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6977 (safe_call, init_from_display_pos, handle_fontified_prop)
6978 (handle_single_display_spec, load_overlay_strings)
6979 (with_echo_area_buffer, setup_echo_area_for_printing)
6980 (display_echo_area, echo_area_display)
6981 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6982 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6983 (redisplay_window, dump_glyph_row, display_mode_line)
6984 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6985 (handle_display_spec, display_prop_string_p):
6986 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6987 (handle_single_display_spec, build_desired_tool_bar_string)
6988 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6989 (get_specified_cursor_type):
6990 Check that fixnums are in proper range for system types.
6991 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6992 (Flookup_image_map):
6993 Don't assume fixnums fit in int.
6994 (compare_overlay_entries):
6995 Avoid mishandling comparisons due to subtraction overflow.
6996 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6997 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6998 (handle_tool_bar_click):
6999 Use int, not unsigned, since we prefer signed and the signedness
7000 doesn't matter here.
7001 (get_next_display_element, next_element_from_display_vector):
7002 Use int, not EMACS_INT, when int is wide enough.
7003 (start_hourglass): Use duration_to_sec_usec to do proper
7004 overflow checking on durations.
7005 * xfaces.c (Fbitmap_spec_p):
7006 Check that fixnums are in proper range for system types.
7007 (compare_fonts_by_sort_order):
7008 Avoid mishandling comparisons due to subtraction overflow.
7009 (Fx_family_fonts, realize_basic_faces):
7010 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7011 (Fx_family_fonts):
7012 Don't assume fixnum fits in int.
7013 Use SAFE_ALLOCA_LISP, not alloca.
7014 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7015 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7016 (face_at_buffer_position, face_for_overlay_string)
7017 (face_at_string_position):
7018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7019 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7020 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7021 (Fx_show_tip):
7022 Check that fixnums are in proper range for system types.
7023 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7024 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7025 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7026 (Fx_change_window_property): Don't assume fixnums fit in int.
7027 * xfont.c (xfont_chars_supported):
7028 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7029 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7030 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7031 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7032 * xml.c (parse_region):
7033 * xrdb.c (magic_file_p):
7034 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7035 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7036 (x_get_local_selection, x_reply_selection_request)
7037 (x_handle_selection_request, wait_for_property_change):
7038 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7039 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7040 short is wide enough.
7041 (x_send_client_event): Don't assume fixnum fits in int.
7042 * xterm.c (x_x_to_emacs_modifiers):
7043 Don't assume EMACS_INT overflows nicely into int.
7044 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7045 may come from Lisp.
7046 (handle_one_xevent): NATNUMP can eval its arg twice.
7047 (x_connection_closed):
7048 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7049 * xterm.h: Adjust decls to match defn changes elsewhere.
7050 (struct scroll_bar): Use struct vectorlike_header
7051 rather than rolling our own approximation.
7052 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7053
7054 2012-05-25 Glenn Morris <rgm@gnu.org>
7055
7056 * lisp.mk (lisp): Update for more files being compiled now.
7057
7058 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7059
7060 * lread.c: Remove `read_pure' which makes no difference.
7061 (read_pure): Remove var.
7062 (unreadpure): Remove function.
7063 (readevalloop): Don't call read_list with -1 flag.
7064 (read1, read_vector): Don't test read_pure any more.
7065 (read_list): Simplify.
7066
7067 * fileio.c, character.h: Minor style tweaks.
7068
7069 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7070
7071 * window.h (clip_changed): Remove useless declaration.
7072
7073 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7074
7075 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7076 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7077
7078 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7079
7080 Remove src/m/*.
7081 This directory predates autoconf and is no longer needed nowadays.
7082 Move its few remaining bits of functionality to where they're needed.
7083 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7084 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7085 * m/template.h: Remove.
7086 * Makefile.in (M_FILE): Remove. All uses removed.
7087 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7088 * lisp.h (USE_LSB_TAG):
7089 * mem-limits.h (EXCEEDS_LISP_PTR):
7090 Use VAL_MAX, not VALBITS, in #if.
7091 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7092 (EMACS_UINT): Define unconditionally now.
7093 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7094 (BITS_PER_EMACS_INT): New constants, replacing
7095 what used to be in config.h, but not useful in #if.
7096 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7097 define them any more.
7098 (VAL_MAX): New macro.
7099 (VALMASK): Use it.
7100 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7101 BITS_PER_EMACS_INT, in #if.
7102 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7103 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7104 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7105 * s/ms-w32.h (DATA_START):
7106 Move here from removed file m/intel386.h.
7107 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7108 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7109
7110 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7111
7112 Assume C89 or later.
7113 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7114 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7115 (xrealloc):
7116 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7117 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7118 * textprop.c, tparam.c (NULL): Remove.
7119 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7120 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7121 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7122 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7123 * xterm.c (input_signal_count): Assume volatile works.
7124
7125 2012-05-21 Ken Brown <kbrown@cornell.edu>
7126
7127 * xgselect.c (xg_select): Fix first argument in call to 'select'
7128 (bug#11508).
7129
7130 2012-05-20 Ken Brown <kbrown@cornell.edu>
7131
7132 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7133 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7134
7135 2012-05-19 Ken Brown <kbrown@cornell.edu>
7136
7137 * xfns.c (x_in_use): Remove `static' qualifier.
7138 * xterm.h (x_in_use): Declare.
7139 * xgselect.c: Include xterm.h.
7140 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7141 and `display_arg' (bug#9754).
7142
7143 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7144
7145 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7146
7147 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7148 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7149
7150 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7151
7152 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7153
7154 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7155 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7156
7157 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7158 reference to image_cache->refcount.
7159 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7160
7161 2012-05-17 Juri Linkov <juri@jurta.org>
7162
7163 * search.c (Fword_search_regexp, Fword_search_backward)
7164 (Fword_search_forward, Fword_search_backward_lax)
7165 (Fword_search_forward_lax): Move functions to isearch.el
7166 (bug#10145, bug#11381).
7167
7168 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7169
7170 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7171
7172 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7173
7174 * lread.c (init_obarray): Declare Qt and Qnil as special.
7175
7176 2012-05-14 Glenn Morris <rgm@gnu.org>
7177
7178 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7179 Put "libexec" before "bin", for the sake of init_callproc_1.
7180
7181 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7182
7183 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7184
7185 * unexaix.c: Port to more-recent AIX compilers.
7186 (report_error, report_error_1, make_hdr, copy_sym)
7187 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7188 Make arguments const char *, not char *, to avoid violations of C
7189 standard and to fix some AIX warnings reported by Gilles Pion.
7190
7191 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7192
7193 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7194 already have overlays loaded.
7195 (handle_single_display_spec): Before returning without displaying
7196 fringe bitmap, synchronize the bidi iterator with the main display
7197 iterator, by calling iterate_out_of_display_property.
7198 (iterate_out_of_display_property): Detect buffer iteration by
7199 testing that it->string is a Lisp string.
7200 (get_next_display_element): When the current object is exhausted,
7201 and there's something on it->stack, call set_iterator_to_next to
7202 proceed with what's on the stack, instead of returning zero.
7203 (set_iterator_to_next): If called at the end of a Lisp string,
7204 proceed to consider_string_end without incrementing string
7205 position. Don't increment display vector index past the end of
7206 the display vector. (Bug#11417)
7207 (pos_visible_p): Don't report a position visible when move_it_to
7208 stopped at the last line of window, which happens to be scanned
7209 backwards by the bidi iteration. (Bug#11464)
7210
7211 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7212
7213 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7214 and right-margin display specs even if the spec is invalid or we
7215 are on a TTY, and thus unable to display on the fringes.
7216 That's because the text with the property will not be displayed anyway,
7217 so we need to signal to the caller that this is a "replacing"
7218 display spec. This fixes display when the spec is invalid or we
7219 are on a TTY.
7220
7221 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7222
7223 * unexaix.c (make_hdr): Fix typo in prototype.
7224 This bug broke the build on AIX. Problem reported by Gilles Pion.
7225
7226 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7227
7228 * keyboard.c (kbd_buffer_get_event): Read special events also in
7229 batch mode. (Bug#11415)
7230
7231 2012-05-12 Glenn Morris <rgm@gnu.org>
7232
7233 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7234
7235 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7236
7237 * lisp.mk (lisp): Add newcomment.elc.
7238
7239 2012-05-12 Glenn Morris <rgm@gnu.org>
7240
7241 * Makefile.in (MKDIR_P): New, set by configure.
7242 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7243
7244 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7245
7246 Remove unused function hourglass_started.
7247 * dispextern.h (hourglass_started):
7248 * w32fns.c (hourglass_started):
7249 * xdisp.c (hourglass_started): Remove.
7250
7251 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7252
7253 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7254 Update dependencies.
7255
7256 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7257
7258 * xgselect.c (xg_select): Put maxfds+1 into a var.
7259 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7260
7261 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7262
7263 2012-05-10 Dave Abrahams <dave@boostpro.com>
7264
7265 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7266 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7267
7268 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7269
7270 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7271 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7272 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7273 Initialize xd_registered_buses.
7274
7275 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7276
7277 Untag more efficiently if USE_LSB_TAG.
7278 This is based on a proposal by YAMAMOTO Mitsuharu in
7279 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7280 For an admittedly artificial (nth 8000 longlist) benchmark on
7281 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7282 Emacs's overall text size by 1%.
7283 * lisp.h (XUNTAG): New macro.
7284 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7285 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7286 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7287 * eval.c (Fautoload):
7288 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7289 * frame.h (XFRAME): Use XUNTAG.
7290
7291 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7292 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7293 Remove unportable assumptions about print widths of types like
7294 dbus_uint32_t.
7295 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7296 intptr_t when converting between pointer and integer, to avoid GCC
7297 warnings about wrong width.
7298
7299 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7300
7301 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7302 stack for each reader_thread, instead of defaulting to 8MB
7303 determined by the linker. This avoids failures in creating
7304 subprocesses on Windows 7, see the discussion in this thread:
7305 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7306
7307 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7308
7309 Fix up display of the *Minibuf-0* buffer in the mini window.
7310 * keyboard.c (read_char): Don't clear the echo area if there's no
7311 message to clear.
7312 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7313 contents of *Minibuf-0*) if there's no message displayed in its stead.
7314
7315 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7316
7317 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7318 batch mode.
7319
7320 2012-05-06 Chong Yidong <cyd@gnu.org>
7321
7322 * lisp.mk (lisp): Update.
7323
7324 2012-05-05 Jim Meyering <meyering@redhat.com>
7325
7326 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7327
7328 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7329
7330 * data.c (PUT_ERROR): New macro.
7331 (syms_of_data): Use it. Add new error type `user-error'.
7332 * undo.c (user_error): New function.
7333 (Fprimitive_undo): Use it.
7334 * print.c (print_error_message): Adjust print style for `user-error'.
7335 * keyboard.c (user_error): New function.
7336 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7337
7338 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7339
7340 Do not limit current-time-string to years 1000..9999.
7341 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7342 (Fcurrent_time_string): Support any year that is supported by the
7343 underlying localtime representation. Don't use asctime, as it
7344 has undefined behavior for years outside the range -999..9999.
7345
7346 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7347
7348 Fix race conditions involving setenv, gmtime, localtime, asctime.
7349 Without this fix, interrupts could mess up code that uses these
7350 nonreentrant functions, since setting TZ invalidates existing
7351 tm_zone or tzname values, and since most of these functions return
7352 pointers to static storage.
7353 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7354 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7355 Grow the critical sections to include not just invoking
7356 localtime/gmtime, but also accessing these functions' results
7357 including their tm_zone values if any, and any related TZ setting.
7358 (format_time_string): Last arg is now struct tm *, not struct tm **,
7359 so that the struct tm is saved in the critical section.
7360 All callers changed. Simplify allocation of initial buffer, partly
7361 motivated by the fact that memory allocation needs to be outside
7362 the critical section.
7363
7364 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7365
7366 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7367 with RESET_INTERVAL.
7368
7369 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7370 Remove duplicated buffer name initialization.
7371
7372 2012-05-02 Jim Meyering <jim@meyering.net>
7373
7374 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7375
7376 * xfns.c (x_window): Use xstrdup (Bug#11375).
7377
7378 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7379
7380 * xdisp.c (pos_visible_p): If already at a newline from the
7381 display string before the 'while' loop, don't walk back the glyphs
7382 from it3.glyph_row. Solves assertion violation when the display
7383 string begins with a newline (egg.el). (Bug#11367)
7384
7385 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7386
7387 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7388 Move to simple.el.
7389
7390 2012-05-01 Glenn Morris <rgm@gnu.org>
7391
7392 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7393 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7394 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7395 All were removed before 23.1.
7396
7397 * dispnew.c: Remove HAVE_LIBNCURSES test;
7398 it is always true on relevant platforms.
7399
7400 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7401 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7402
7403 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7404
7405 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7406
7407 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7408 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7409 Remove.
7410
7411 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7412
7413 Do not avoid creating empty evaporating overlays (Bug#9642).
7414 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7415 That is, do not delete an evaporating overlay if it becomes
7416 empty after its bounds are adjusted to fit within its buffer.
7417 This fix caused other problems, and I'm reverting it until we get
7418 to the bottom of them.
7419
7420 2012-04-27 Chong Yidong <cyd@gnu.org>
7421
7422 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7423
7424 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7425
7426 * xdisp.c (pos_visible_p): If the window start position is beyond
7427 ZV, start the display from buffer beginning. Prevents assertion
7428 violation in init_iterator when the minibuffer window is scrolled
7429 via the scroll bar.
7430
7431 * window.c (window_scroll_pixel_based): Likewise.
7432
7433 2012-04-27 Chong Yidong <cyd@gnu.org>
7434
7435 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7436
7437 2012-04-27 Glenn Morris <rgm@gnu.org>
7438
7439 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7440 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7441
7442 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7443
7444 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7445 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7446
7447 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7448
7449 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7450 display element, check also the underlying string or buffer
7451 character. (Bug#11341)
7452
7453 * w32menu.c: Include w32heap.h.
7454 (add_menu_item): If the call to AppendMenuW (via
7455 unicode_append_menu) fails, disable Unicode menus only if we are
7456 running on Windows 9X/Me.
7457
7458 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7459
7460 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7461 (xgetint): Add missing shift for LSB tags.
7462
7463 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7464
7465 * keyboard.c (read_char): Don't wipe echo area for select window
7466 events: These might get delayed via `mouse-autoselect-window'
7467 (Bug#11304).
7468
7469 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7470
7471 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7472 manipulation of :loaded-from data.
7473
7474 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7475
7476 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7477 now a cons (bug#11311).
7478
7479 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7480
7481 Do not create empty overlays with the evaporate property (Bug#9642).
7482 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7483 if it becomes empty after its bounds are adjusted to fit within
7484 its buffer. Without this fix, in a nonempty buffer (let ((o
7485 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7486 yields an empty overlay that has the evaporate property, which is
7487 not supposed to happen.
7488
7489 Fix minor GTK3 problems found by static checking.
7490 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7491 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7492 (struct _EmacsFixedClass, emacs_fixed_get_type):
7493 Move decls here from emacsgtkfixed.h, since they needn't be public.
7494 (emacs_fixed_get_type): Now static.
7495 (emacs_fixed_class_init): Omit unused local.
7496 (emacs_fixed_child_type): Remove; unused.
7497 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7498 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7499 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7500 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7501 (EMACS_FIXED_GET_CLASS): Remove; unused.
7502 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7503
7504 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7505 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7506
7507 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7508
7509 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7510 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7511 (__malloc_size_t, __malloc_ptrdiff_t):
7512 Remove. All uses removed, replaced by the definiens if needed,
7513 since we can assume C89 or better now.
7514 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7515 (protect_malloc_state, align, get_contiguous_space)
7516 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7517 (malloc_atfork_handler_child, malloc_enable_thread)
7518 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7519 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7520 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7521 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7522 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7523 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7524 Define using prototypes, not old style.
7525 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7526 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7527 (align): Don't assume that signed integer overflow wraps around.
7528 Omit unused local var.
7529 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7530 (_free_internal_nolock, memalign, mallochook, reallochook):
7531 Omit no-longer-needed casts.
7532 (valloc): Use getpagesize, not __getpagesize.
7533 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7534 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7535
7536 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7537
7538 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7539
7540 Move functions from C to Lisp. Make non-blocking method calls
7541 the default. Implement further D-Bus standard interfaces.
7542
7543 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7544 (QCdbus_request_name_allow_replacement)
7545 (QCdbus_request_name_replace_existing)
7546 (QCdbus_request_name_do_not_queue)
7547 (QCdbus_request_name_reply_primary_owner)
7548 (QCdbus_request_name_reply_in_queue)
7549 (QCdbus_request_name_reply_exists)
7550 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7551 (QCdbus_registered_serial, QCdbus_registered_method)
7552 (QCdbus_registered_signal): New Lisp objects.
7553 (XD_DEBUG_MESSAGE): Use sizeof.
7554 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7555 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7556 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7557 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7558 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7559 (xd_signature, xd_append_arg): Allow float for integer types.
7560 (xd_get_connection_references): New function.
7561 (xd_get_connection_address): Rename from xd_initialize.
7562 Return cached address.
7563 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7564 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7565 level.
7566 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7567 Return number of refcounts.
7568 (Fdbus_get_unique_name): Make stronger parameter check.
7569 (Fdbus_message_internal): New defun.
7570 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7571 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7572 (Fdbus_send_signal, Fdbus_register_service)
7573 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7574 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7575 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7576 (Vdbus_compiled_version, Vdbus_runtime_version)
7577 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7578 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7579 (Vdbus_message_type_signal): New defvars.
7580 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7581 Adapt docstring.
7582
7583 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7584
7585 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7586 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7587 Do not assume ptrdiff_t is the same width as 'int'.
7588
7589 * alloc.c: Handle unusual debugging option combinations.
7590 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7591 since the two debugging options are incompatible.
7592 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7593 is defined.
7594 (mem_init, mem_insert, mem_insert_fixup):
7595 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7596 (NEED_MEM_INSERT): Remove; no longer needed.
7597
7598 2012-04-22 Leo Liu <sdl.web@gmail.com>
7599
7600 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7601
7602 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7603
7604 * sysdep.c [__FreeBSD__]: Minor cleanups.
7605 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7606 Use Emacs indenting style more consistently. Avoid some casts.
7607 Use 'double' consistently rather than mixing 'float' and 'double'.
7608
7609 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7610
7611 * sysdep.c (list_system_processes, system_process_attributes):
7612 Add implementation for FreeBSD (Bug#5243).
7613
7614 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7615
7616 * lisp.mk (lisp): Update.
7617
7618 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7619
7620 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7621 It is never used otherwise.
7622
7623 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7624
7625 * print.c (print_preprocess): Only check print_depth if print-circle
7626 is nil.
7627 (print_object): Check for cycles even when print-circle is nil and
7628 print-gensym is t, but only check print_depth if print-circle is nil.
7629
7630 2012-04-20 Chong Yidong <cyd@gnu.org>
7631
7632 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7633 set the status to "failed" and ensure that sentinel is run.
7634
7635 2012-04-20 Glenn Morris <rgm@gnu.org>
7636
7637 * process.c (Fset_process_inherit_coding_system_flag)
7638 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7639 (Fmake_network_process, Fmake_serial_process): Doc fix.
7640
7641 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7642
7643 * xdisp.c (string_buffer_position_lim): Limit starting position to
7644 BEGV.
7645 (set_cursor_from_row): If called for a mode-line or header-line
7646 row, return zero immediately.
7647 (try_cursor_movement): If inside continuation line, don't back up
7648 farther than the first row after the header line, if any.
7649 Don't consider the header-line row as "partially visible", even if
7650 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7651
7652 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7653
7654 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7655 (bug#11238).
7656
7657 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7658 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7659
7660 configure: new option --enable-gcc-warnings (Bug#11207)
7661 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7662 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7663 (ALL_CFLAGS): Use new macros rather than old.
7664 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7665 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7666 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7667 -Wunused-result, -Wunused-variable. This should go away once
7668 the Emacs and Gnulib regex code is merged.
7669 (xmalloc, xrealloc): Now static.
7670
7671 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7672
7673 * dired.c (Fsystem_groups): Remove unused local.
7674
7675 2012-04-17 Glenn Morris <rgm@gnu.org>
7676
7677 * dired.c (Fsystem_users): Doc fix.
7678
7679 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7680
7681 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7682 (syms_of_dired): Add them.
7683
7684 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7685
7686 Fix minor alloc.c problems found by static checking.
7687 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7688 New extern decls, to avoid calling undeclared functions.
7689 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7690 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7691 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7692 (NEED_MEM_INSERT): New macro.
7693 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7694 Remove one incorrect comment and fix another.
7695
7696 Fix minor ralloc.c problems found by static checking.
7697 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7698 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7699 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7700 (r_alloc_sbrk): Now static.
7701
7702 Improve ralloc.c interface checking.
7703 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7704 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7705 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7706 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7707 [REL_ALLOC]: ... to here, to check interface.
7708 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7709 Remove decls. This fixes an "It stinks!".
7710
7711 * alloc.c (which_symbols): Fix alignment issue / type clash.
7712
7713 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7714
7715 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7716 (struct Lisp_Misc_Any): Likewise.
7717 (struct Lisp_Free): Likewise.
7718 * alloc.c (union aligned_Lisp_Symbol): Define.
7719 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7720 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7721 (union aligned_Lisp_Misc): Define.
7722 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7723 aligned_Lisp_Misc instead of union Lisp_Misc.
7724 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7725
7726 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7727
7728 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7729 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7730 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7731 * s/netbsd.h, s/sol2-6.h:
7732 Remove definition of GC_MARK_STACK, since the default now works.
7733 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7734 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7735 no longer the default.
7736 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7737
7738 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7739
7740 * lread.c (lisp_file_lexically_bound_p):
7741 Fix hang at ";-*-\n" (bug#11238).
7742
7743 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7744
7745 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7746 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7747
7748 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7749
7750 * nsterm.m (constrainFrameRect): Always constrain when there is only
7751 one screen (Bug#10962).
7752
7753 2012-04-13 Ken Brown <kbrown@cornell.edu>
7754
7755 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7756
7757 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7758
7759 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7760
7761 2012-04-11 Daniel Colascione <dancol@dancol.org>
7762
7763 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7764 against is gone. It's better to use vfork now so that when Cygwin
7765 gains a new, working vfork, we use it automatically (bug#10398).
7766
7767 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7768
7769 * window.c (save_window_save): Obey window-point-insertion-type.
7770
7771 2012-04-11 Glenn Morris <rgm@gnu.org>
7772
7773 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7774
7775 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7776
7777 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7778
7779 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7780
7781 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7782 (force_quit_count): New var.
7783 (handle_interrupt): Use it.
7784
7785 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7786
7787 * w32.c (w32_delayed_load): Record the full path of the library
7788 being loaded (bug#10424).
7789
7790 2012-04-09 Glenn Morris <rgm@gnu.org>
7791
7792 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7793 not just in the obarray, before snarfing them. (Bug#11036)
7794
7795 * Makefile.in ($(leimdir)/leim-list.el):
7796 Pass EMACS rather than BUILT_EMACS.
7797
7798 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7799
7800 * process.c (make_process):
7801 * process.h: Add integer `gnutls_handshakes_tried' member to
7802 process struct.
7803
7804 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7805 Add convenience `GNUTLS_LOG2i' macro.
7806
7807 * gnutls.c (gnutls_log_function2i): Convenience log function.
7808 (emacs_gnutls_read): Use new log functions,
7809 `gnutls_handshakes_tried' process member, and
7810 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7811 attempts per process (connection).
7812
7813 2012-04-09 Chong Yidong <cyd@gnu.org>
7814
7815 * eval.c (Fuser_variable_p, user_variable_p_eh)
7816 (lisp_indirect_variable): Functions deleted.
7817 (Fdefvar): Caller changed.
7818
7819 * callint.c (Finteractive, Fcall_interactively):
7820 * minibuf.c (Fread_variable): Callers changed.
7821
7822 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7823
7824 * xdisp.c (set_cursor_from_row): If the display string appears in
7825 the buffer at position that is closer to point than the position
7826 after the display string, display the cursor on the first glyph of
7827 the display string. Fixes cursor display when a 'display' text
7828 property immediately follows invisible text. (Bug#11094)
7829
7830 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7831
7832 composite.c: use 'double' consistently
7833 * composite.c (get_composition_id): Use 'double' consistently
7834 instead of converting 'float' to 'double' and vice versa; this is
7835 easier to understand and avoids a GCC warning.
7836
7837 2012-04-09 Glenn Morris <rgm@gnu.org>
7838
7839 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7840 preparation for dumping it with emacs. (Bug#4789)
7841 (leimdir): New variable.
7842 ($(leimdir)/leim-list.el): New rule.
7843 (emacs$(EXEEXT)): Depend on leim-list.el.
7844
7845 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7846 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7847 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7848
7849 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7850
7851 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7852 proper alignment.
7853
7854 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7855
7856 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7857 Remove unused local variable.
7858
7859 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7862 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7863 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7864 objects, as mark_maybe_pointer will catch them otherwise.
7865 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7866 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7867
7868 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7869
7870 Fix typo that broke non-Windows builds.
7871 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7872
7873 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7874
7875 Support building on MS-Windows with libxml2.
7876
7877 * makefile.w32-in (OBJ2): Add xml.$(O).
7878 (GLOBAL_SOURCES): Add xml.c.
7879 ($(BLD)/xml.$(O)): New dependency list.
7880
7881 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7882 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7883 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7884 [!WINDOWSNT]: New macros.
7885 (init_libxml2_functions, libxml2_loaded_p): New functions.
7886 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7887 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7888 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7889 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7890 linked in).
7891 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7892 Call init_libxml2_functions before calling libxml2 functions.
7893 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7894
7895 * emacs.c: Don't include libxml/parser.h.
7896 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7897 xmlCleanupParser directly.
7898
7899 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7900
7901 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7902
7903 * indent.c (Fvertical_motion): If there is a display string at
7904 point, use it.vpos to compute how many lines to backtrack after
7905 move_it_to point. (Bug#11133)
7906
7907 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7908
7909 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7910 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7911 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7912 macros related to unification of CJK characters. For the details,
7913 see the discussion following the message here:
7914 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7915
7916 2012-04-04 Chong Yidong <cyd@gnu.org>
7917
7918 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7919
7920 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7921
7922 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7923 instead of alloca. (Bug#11138)
7924
7925 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7926
7927 * w32menu.c (is_simple_dialog): Properly check lisp types.
7928 (Bug#11141)
7929
7930 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7931
7932 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7933 position we get to after a call to move_it_to fails the
7934 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7935 only if we wind up in a string from display property. (Bug#11063)
7936
7937 * window.c (Fdelete_other_windows_internal): Invalidate the row
7938 and column information about mouse highlight, so that redisplay
7939 restores it after reallocating the glyph matrices. (Bug#7464)
7940
7941 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7942 string comes from a `display' text property, use the buffer
7943 position of that property as if we actually saw that position in
7944 the row's glyphs.
7945 (move_it_by_lines): Remove the assertion that
7946 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7947 violated when there's a before-string at the beginning of a line.
7948 (Bug#11063)
7949
7950 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7951
7952 * xdisp.c (append_space_for_newline): If the default face was
7953 remapped, use the remapped face for the appended newline.
7954 (extend_face_to_end_of_line): Use the remapped default face for
7955 extending the face to the end of the line.
7956 (display_line): Call extend_face_to_end_of_line when the default
7957 face was remapped. (Bug#11068)
7958
7959 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7960
7961 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7962
7963 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7964
7965 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7966
7967 2012-03-27 Glenn Morris <rgm@gnu.org>
7968
7969 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7970 Doc fixes.
7971
7972 2012-03-26 Kenichi Handa <handa@m17n.org>
7973
7974 * dispextern.h (struct glyph): Fix previous change. Change the
7975 bit length of glyphless.ch to 25 (Bug#11082).
7976
7977 2012-03-26 Chong Yidong <cyd@gnu.org>
7978
7979 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7980 (command_loop_1): Use it; inhibit selection update for
7981 handle-select-window too (Bug#8996).
7982
7983 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7984
7985 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7986
7987 2012-03-25 Kenichi Handa <handa@m17n.org>
7988
7989 * dispextern.h (struct glyph): Change the bit length of
7990 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7991
7992 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7993
7994 * s/ms-w32.h (tzname): Include time.h before redirecting to
7995 _tzname. Fixes the MSVC build. (Bug#9960)
7996
7997 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7998
7999 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8000 characters.
8001
8002 * xterm.c (XTread_socket): Only modify handling_signal if
8003 !SYNC_INPUT. (Bug#11080)
8004
8005 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8006
8007 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8008 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8009 when fetching a multibyte character consumes more bytes than
8010 CHAR_BYTES returns, due to unification of CJK characters in
8011 string_char. (Bug#11073)
8012
8013 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8014
8015 * process.c (wait_reading_process_output): Handle pty disconnect
8016 by refraining from sending oneself a SIGCHLD (bug#10933).
8017
8018 2012-03-22 Chong Yidong <cyd@gnu.org>
8019
8020 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8021
8022 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8023 Mark string as coming from a prefix property.
8024 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8025 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8026
8027 2012-03-21 Chong Yidong <cyd@gnu.org>
8028
8029 * xfaces.c (Vface_remapping_alist): Doc fix.
8030
8031 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8032
8033 * w32proc.c (Fw32_set_console_codepage)
8034 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8035 Doc fixes.
8036
8037 2012-03-20 Chong Yidong <cyd@gnu.org>
8038
8039 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8040 to reflect default non-nil value of redisplay-dont-pause.
8041
8042 2012-03-19 Kenichi Handa <handa@m17n.org>
8043
8044 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8045 it fit in a valid range (Bug#11003).
8046
8047 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8048
8049 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8050 that is not from display property, accept the row as a "cursor
8051 row" if one of the string's character has a non-nil `cursor'
8052 property. Fixes cursor positioning when there are newlines in
8053 overlay strings, e.g. in icomplete.el. (Bug#11035)
8054
8055 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8056
8057 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8058
8059 2012-03-12 Chong Yidong <cyd@gnu.org>
8060
8061 * eval.c (inhibit_lisp_code): Rename from
8062 inhibit_window_configuration_change_hook; move from window.c.
8063
8064 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8065 * window.c (run_window_configuration_change_hook)
8066 (syms_of_window): Callers changed.
8067
8068 2012-03-11 Chong Yidong <cyd@gnu.org>
8069
8070 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8071
8072 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8073
8074 2012-03-10 Chong Yidong <cyd@gnu.org>
8075
8076 * frame.c (other_visible_frames): Don't assume the selected frame
8077 is visible (Bug#10955).
8078
8079 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8080
8081 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8082
8083 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8084
8085 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8086 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8087 zero (Bug#10954).
8088
8089 2012-03-03 Glenn Morris <rgm@gnu.org>
8090
8091 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8092
8093 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8094
8095 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8096 position past the first glyph_row that ends at ZV. (Bug#10902)
8097 (redisplay_window, next_element_from_string): Fix typos in
8098 comments.
8099 (redisplay_window): Pass to move_it_vertically the margin in
8100 pixels, not in screen lines.
8101
8102 2012-03-02 Glenn Morris <rgm@gnu.org>
8103
8104 * buffer.c (buffer-list-update-hook): Doc fix.
8105
8106 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8107
8108 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8109 push_it before setting up the iterator for the first overlay
8110 string, even if we have an empty string loaded.
8111 (next_overlay_string): If there's an empty string on the iterator
8112 stack, pop the stack. (Bug#10903)
8113
8114 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8115
8116 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8117 Suggested by Stefan Monnier in
8118 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8119 * alloc.c (widen_to_Lisp_Object): New static function.
8120 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8121 and widening them to Lisp_Objects. This would work even if
8122 USE_LSB_TAG is defined and wide integers are used, which might
8123 happen in a future version of Emacs.
8124
8125 2012-02-25 Chong Yidong <cyd@gnu.org>
8126
8127 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8128 Doc fix.
8129
8130 * xselect.c (Fx_selection_exists_p): Doc fix.
8131 (x_clipboard_manager_save_all): Print an informative message
8132 before saving to clipboard manager.
8133
8134 2012-02-24 Chong Yidong <cyd@gnu.org>
8135
8136 * keyboard.c (process_special_events): Handle all X selection
8137 requests in kbd_buffer, not just the next one (Bug#8869).
8138
8139 2012-02-23 Chong Yidong <cyd@gnu.org>
8140
8141 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8142 call when setting menu-bar-lines and tool-bar-lines parameters.
8143 (unwind_create_frame_1): New helper function.
8144
8145 * window.c (inhibit_window_configuration_change_hook): New var.
8146 (run_window_configuration_change_hook): Obey it.
8147 (syms_of_window): Initialize it.
8148
8149 2012-02-22 Chong Yidong <cyd@gnu.org>
8150
8151 * xterm.c (x_draw_image_relief): Add missing type check for
8152 Vtool_bar_button_margin (Bug#10743).
8153
8154 2012-02-21 Chong Yidong <cyd@gnu.org>
8155
8156 * fileio.c (Vfile_name_handler_alist): Doc fix.
8157
8158 * buffer.c (Fget_file_buffer): Protect against invalid file
8159 handler return value.
8160
8161 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8162
8163 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8164 when computing $valmask.
8165
8166 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8167 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8168 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8169 It's useless in that case, and it can cause problems on hosts
8170 that allocate halves of EMACS_INT values separately.
8171 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8172 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8173 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8174 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8175 it avoids undefined behavior on hosts where shifting right by more
8176 than the word width has undefined behavior.
8177
8178 2012-02-19 Chong Yidong <cyd@gnu.org>
8179
8180 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8181 (Funhandled_file_name_directory, Ffile_name_as_directory)
8182 (Fdirectory_file_name, Fexpand_file_name)
8183 (Fsubstitute_in_file_name): Protect against invalid file handler
8184 return values (Bug#10845).
8185
8186 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8187
8188 * .gdbinit (pitx): Fix incorrect references to fields of the
8189 iterator stack.
8190
8191 2012-02-17 Chong Yidong <cyd@gnu.org>
8192
8193 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8194
8195 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8196
8197 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8198 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8199
8200 2012-02-15 Chong Yidong <cyd@gnu.org>
8201
8202 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8203 marked as special. Also, starting docstrings with * is obsolete.
8204
8205 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8206
8207 * gnutls.c (emacs_gnutls_write): Fix last change.
8208
8209 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8210
8211 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8212 send_process.
8213
8214 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8215
8216 * keymap.c (Fsingle_key_description): Handle char ranges.
8217
8218 2012-02-12 Chong Yidong <cyd@gnu.org>
8219
8220 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8221 as that creates a dangerous corner case.
8222
8223 * window.c (Fdelete_window_internal): Invalidate the mouse
8224 highlight (Bug#9904).
8225
8226 2012-02-12 Glenn Morris <rgm@gnu.org>
8227
8228 * xselect.c (Fx_own_selection_internal)
8229 (Fx_get_selection_internal, Fx_disown_selection_internal)
8230 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8231 * nsselect.m (Fx_own_selection_internal)
8232 (Fx_disown_selection_internal, Fx_selection_exists_p)
8233 (Fx_selection_owner_p, Fx_get_selection_internal):
8234 Sync docs and argument specs with the xselect.c versions.
8235
8236 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8237
8238 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8239
8240 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8241
8242 * w32select.c (Fx_selection_exists_p): Sync doc string and
8243 argument list with xselect.c. (Bug#10783)
8244
8245 * w16select.c (Fx_selection_exists_p): Sync doc string and
8246 argument list with xselect.c. (Bug#10783)
8247
8248 2012-02-10 Glenn Morris <rgm@gnu.org>
8249
8250 * fns.c (Fsecure_hash): Doc fix.
8251
8252 2012-02-09 Kenichi Handa <handa@m17n.org>
8253
8254 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8255
8256 2012-02-07 Chong Yidong <cyd@gnu.org>
8257
8258 * buffer.c (Fbuffer_local_variables)
8259 (buffer_lisp_local_variables): Handle unbound vars correctly;
8260 don't let Qunbound leak into Lisp.
8261
8262 2012-02-07 Glenn Morris <rgm@gnu.org>
8263
8264 * image.c (Fimagemagick_types): Doc fix.
8265
8266 * image.c (imagemagick-render-type): Change it from a lisp object
8267 to an integer. Move the doc here from the lisp manual.
8268 Treat all values not equal to 0 the same.
8269
8270 2012-02-06 Chong Yidong <cyd@gnu.org>
8271
8272 * doc.c (store_function_docstring): Avoid applying docstring of
8273 alias to base function (Bug#2603).
8274
8275 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8276
8277 * .gdbinit (pp1, pv1): Remove redundant defines.
8278 (pr): Use pp.
8279
8280 2012-02-04 Chong Yidong <cyd@gnu.org>
8281
8282 * nsterm.m: Declare a global (Bug#10694).
8283
8284 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8285
8286 * w32.c (get_emacs_configuration_options):
8287 Include --enable-checking, if specified, in the return value.
8288
8289 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8290
8291 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8292 after rounding frame sizes. (Bug#9723)
8293
8294 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8295
8296 * keyboard.c (adjust_point_for_property): Don't position point
8297 before BEGV. (Bug#10696)
8298
8299 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8300
8301 Handle overflow when computing char display width (Bug#9496).
8302 * character.c (char_width): Return EMACS_INT, not int.
8303 (char_width, c_string_width): Check for overflow when
8304 computing the width; this is possible now that individual
8305 characters can have unbounded width. Problem introduced
8306 by merge from Emacs 23 on 2012-01-19.
8307
8308 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8309
8310 * dbusbind.c (Fdbus_register_method): Mention the return value
8311 :ignore in the docstring.
8312
8313 2012-02-02 Glenn Morris <rgm@gnu.org>
8314
8315 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8316
8317 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8318 Unconditionally set to t. (Bug#10673)
8319 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8320 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8321 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8322
8323 2012-02-02 Kenichi Handa <handa@m17n.org>
8324
8325 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8326 0, do not call append_composite_glyph.
8327
8328 2012-02-02 Kenichi Handa <handa@m17n.org>
8329
8330 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8331 NULL (Bug#6988).
8332 (x_produce_glyphs): If the component of a composition is a null
8333 string, set it->pixel_width to 1 to avoid zero-width glyph.
8334
8335 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8336
8337 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8338 first 2 arguments are identical. This makes inserting large
8339 output from a subprocess an order of magnitude faster on
8340 MS-Windows, where all sbrk'ed memory is always contiguous.
8341
8342 2012-01-31 Glenn Morris <rgm@gnu.org>
8343
8344 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8345 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8346 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8347
8348 2012-01-29 Glenn Morris <rgm@gnu.org>
8349
8350 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8351
8352 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8353
8354 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8355
8356 2012-01-28 Chong Yidong <cyd@gnu.org>
8357
8358 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8359
8360 2012-01-26 Chong Yidong <cyd@gnu.org>
8361
8362 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8363
8364 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8365 repeat counts (Bug#10507).
8366
8367 2012-01-26 Glenn Morris <rgm@gnu.org>
8368
8369 * lread.c (syms_of_lread): Doc fix.
8370
8371 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8372
8373 * coding.c (encode_designation_at_bol): Change return value to
8374 EMACS_INT.
8375
8376 2012-01-25 Chong Yidong <cyd@gnu.org>
8377
8378 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8379
8380 2012-01-21 Chong Yidong <cyd@gnu.org>
8381
8382 * floatfns.c (Fcopysign): Make the second argument non-optional,
8383 since nil is not allowed anyway.
8384
8385 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8386
8387 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8388 (send_process): Likewise.
8389
8390 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8391
8392 * window.c (save_window_save, Fcurrent_window_configuration)
8393 (Vwindow_persistent_parameters): Do not use Qstate.
8394 Rewrite doc-strings.
8395
8396 2012-01-19 Kenichi Handa <handa@m17n.org>
8397
8398 * character.c (char_width): New function.
8399 (Fchar_width, c_string_width, lisp_string_width):
8400 Use char_width (Bug#9496).
8401
8402 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8403
8404 * window.c (Vwindow_persistent_parameters): New variable.
8405 (Fset_window_configuration, save_window_save): Handle persistent
8406 window parameters.
8407
8408 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8409
8410 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8411 thrashing the stack of the thread. (Bug#9087)
8412
8413 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8414
8415 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8416
8417 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8418
8419 * xdisp.c (rows_from_pos_range): Handle the case where the
8420 highlight ends on a newline. (Bug#10464)
8421 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8422 he end column for display of highlight that ends on a newline
8423 before a R2L line.
8424
8425 2012-01-11 Glenn Morris <rgm@gnu.org>
8426
8427 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8428 from load-path also when installation-directory is nil. (Bug#10208)
8429
8430 2012-01-10 Glenn Morris <rgm@gnu.org>
8431
8432 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8433
8434 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8435 Update template values to be closer to their typical values these days.
8436
8437 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8438
8439 * xdisp.c (rows_from_pos_range): Accept additional argument
8440 DISP_STRING, and accept any glyph in a row whose object is that
8441 string as eligible for mouse highlight. Fixes mouse highlight of
8442 display strings from overlays. (Bug#10464)
8443
8444 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8445
8446 emacs: fix an auto-save permissions race condition (Bug#10400)
8447 * fileio.c (auto_saving_dir_umask): New static var.
8448 (Fmake_directory_internal): Use it.
8449 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8450 creating the directory. The old code temporarily assigns
8451 too-generous permissions to the directory.
8452 (do_auto_save_eh): Clear it.
8453 (Fdo_auto_save): Catch all errors, not just file errors, so
8454 that the var is always cleared.
8455
8456 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8457
8458 * search.c (scan_buffer): Pass character positions to
8459 know_region_cache, not byte positions. (Bug#6540)
8460
8461 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8462
8463 * w32.c (sys_rename): Report EXDEV when rename of a directory
8464 fails because the target is on another logical disk. (Bug#10284)
8465
8466 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8467
8468 * xterm.c (x_embed_request_focus): New function.
8469
8470 * xterm.h: Add prototype.
8471
8472 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8473
8474 2012-01-05 Glenn Morris <rgm@gnu.org>
8475
8476 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8477
8478 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8479
8480 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8481 Load gnutls_transport_set_lowat only if GnuTLS version is below
8482 2.11.1.
8483 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8484 GnuTLS versions below 2.11.1.
8485
8486 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8487
8488 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8489 to the doc string advising against its use for altering the way
8490 windows are scrolled.
8491
8492 2011-12-28 Kenichi Handa <handa@m17n.org>
8493
8494 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8495 coding-system ASCII compatible only when it does not produce BOM
8496 on encoding (Bug#10383).
8497
8498 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8499
8500 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8501 can scroll.
8502 (create_and_show_popup_menu): Always use menu_position_func for
8503 Gtk3 (Bug#10361).
8504
8505 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8506
8507 * callint.c (Fcall_interactively): Don't truncate prompt string.
8508
8509 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8510
8511 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8512 property that ends at ZV, so that the bidi iteration could be
8513 resumed from there (after widening). (Bug#10360)
8514
8515 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8516
8517 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8518
8519 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8520
8521 * nsterm.m (x_free_frame_resources):
8522 Release f->output_data.ns->miniimage.
8523 (ns_index_color): Fix indentation. Do not retain
8524 color_table->colors[i].
8525
8526 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8527 before returning.
8528
8529 * nsfns.m (x_set_background_color): Assign return value from
8530 ns_index_color to face-background instead of NSColor*.
8531 (ns_implicitly_set_icon_type): Fix indentation.
8532 Change assignment in for loop to comparison.
8533
8534 * emacs.c (ns_pool): New variable.
8535 (main): Assign ns_pool.
8536 (Fkill_emacs): Call ns_release_autorelease_pool.
8537
8538 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8539 autorelease fdesc, release fdAttrs and tdict.
8540 (ns_get_covering_families): Release charset.
8541 (ns_findfonts): Release NSFontDescriptor created with new.
8542 (ns_uni_to_glyphs): Fix indentation.
8543 (setString): Release attrStr before assigning new value.
8544
8545 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8546
8547 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8548 and NS_IMPL_COCOA.
8549 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8550 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8551
8552 2011-12-18 David Reitter <reitter@cmu.edu>
8553
8554 * nsterm.m (ns_term_init): Subscribe for notifications
8555 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8556 to method trackingNotification in EmacsMenu.
8557
8558 * nsmenu.m (trackingMenu): New variable.
8559 (trackingNotification): New method (from Aquamacs).
8560 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8561 from Aquamacs (Bug#7030).
8562
8563 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8564
8565 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8566 (symbol_to_nsstring): Fix indentation.
8567 (ns_symbol_to_pb): New function.
8568 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8569 (Fns_rotate_cut_buffers_internal): Remove.
8570 (Fns_store_selection_internal): Rename from
8571 Fns_store_cut_buffer_internal.
8572 (ns_get_foreign_selection, Fx_own_selection_internal)
8573 (Fx_disown_selection_internal, Fx_selection_exists_p)
8574 (Fns_get_selection_internal, Fns_store_selection_internal):
8575 Use ns_symbol_to_pb and check if return value is nil.
8576 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8577 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8578 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8579 renamed to Sns_store_selection_internal.
8580 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8581 and remove this function.
8582 (ns_handle_selection_clear): Remove, never used.
8583 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8584 here.
8585
8586 2011-12-17 Ken Brown <kbrown@cornell.edu>
8587
8588 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8589 GID is unknown (Bug#10257).
8590
8591 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8592
8593 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8594 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8595 which caused a build failure on GNU/Linux IA-64. This problem was
8596 introduced by my 2011-10-07 patch.
8597
8598 2011-12-15 Juri Linkov <juri@jurta.org>
8599
8600 * image.c (imagemagick_error): New function. (Bug#10112)
8601 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8602 Use `imagemagick_error' where ImageMagick functions return
8603 `MagickFalse'.
8604 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8605 proper order.
8606
8607 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8608
8609 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8610 fill background (Bug#8992).
8611
8612 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8613
8614 * window.c (Vwindow_combination_resize)
8615 (Vwindow_combination_limit): Use t instead of non-nil in
8616 doc-strings.
8617 (Vrecenter_redisplay): Add first sentence of doc-string on
8618 separate line.
8619 (Frecenter): Fix doc-string typo.
8620
8621 2011-12-11 Kenichi Handa <handa@m17n.org>
8622
8623 * coding.c (Funencodable_char_position): Pay attention to the
8624 buffer text relocation (Bug#9389).
8625
8626 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8627
8628 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8629 gtk_init (Bug#10100).
8630
8631 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8632
8633 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8634 IT->string is nil. (Bug#10263)
8635
8636 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8637
8638 * nsterm.h (x_free_frame_resources): Declare.
8639
8640 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8641 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8642
8643 * nsterm.h (ns_get_defaults_value): Declare.
8644
8645 * nsterm.m (ns_default): Call ns_get_defaults_value.
8646
8647 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8648
8649 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8650 (Bug#10170)
8651
8652 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8653
8654 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8655 that where the value of an _OBJC_* symbol points to is in the .bss
8656 section (Bug#10240).
8657
8658 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8659
8660 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8661 after the loop to call ccl_driver at least once (Bug#8619).
8662
8663 2011-12-08 Kenichi Handa <handa@m17n.org>
8664
8665 * ftfont.c (get_adstyle_property): Fix previous change
8666 (Bug#10233).
8667
8668 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8669
8670 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8671 dirs from the default value of EMACSLOADPATH (bug#10208).
8672
8673 2011-12-07 Glenn Morris <rgm@gnu.org>
8674
8675 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8676 installation and source directories as well. (Bug#10208)
8677
8678 2011-12-06 Chong Yidong <cyd@gnu.org>
8679
8680 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8681
8682 2011-12-06 Glenn Morris <rgm@gnu.org>
8683
8684 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8685 as an error, not just -1. (Bug#10217)
8686
8687 2011-12-05 Chong Yidong <cyd@gnu.org>
8688
8689 * keyboard.c (process_special_events): New function.
8690 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8691
8692 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8693
8694 * coding.c (encode_designation_at_bol): Don't use uninitialized
8695 local variable (Bug#9318).
8696
8697 2011-12-05 Kenichi Handa <handa@m17n.org>
8698
8699 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8700 return Qnil (Bug#8046, Bug#10193).
8701
8702 2011-12-05 Kenichi Handa <handa@m17n.org>
8703
8704 * coding.c (encode_designation_at_bol): New args charbuf_end and
8705 dst. Return the number of produced bytes. Callers changed.
8706 (coding_set_source): Return how many bytes coding->source was
8707 relocated.
8708 (coding_set_destination): Return how many bytes
8709 coding->destination was relocated.
8710 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8711 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8712
8713 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8714
8715 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8716 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8717 macro (Bug#9318).
8718
8719 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8720
8721 The following changes are to fix Bug#9318.
8722
8723 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8724 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8725 (encode_coding_iso_2022, encode_coding_sjis)
8726 (encode_coding_big5, encode_coding_charset): Use the above macros.
8727
8728 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8729
8730 * lisp.h (process_quit_flag): Fix external declaration.
8731
8732 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8733
8734 Don't macro-inline non-performance-critical code.
8735 * eval.c (process_quit_flag): New function.
8736 * lisp.h (QUIT): Use it.
8737
8738 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8739
8740 * nsfns.m (get_geometry_from_preferences): New function.
8741 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8742
8743 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8744
8745 * emacs.c (Qkill_emacs): Define.
8746 (syms_of_emacs): Initialize it.
8747 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8748 Qquit_flag to `kill-emacs' instead.
8749 (quit_throw_to_read_char): Add parameter `from_signal'.
8750 All callers changed. Call Fkill_emacs if requested and safe.
8751 * lisp.h (QUIT): Call Fkill_emacs if requested.
8752
8753 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8754
8755 * widget.c (update_wm_hints): Return if wmshell is null.
8756 (widget_update_wm_size_hints): New function.
8757
8758 * widget.h (widget_update_wm_size_hints): Declare.
8759
8760 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8761 widget_update_wm_size_hints (Bug#10104).
8762
8763 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8764
8765 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8766 before a newline, prepare the bidi iterator for consuming the
8767 newline, and keep the current paragraph direction. (Bug#10183)
8768 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8769
8770 2011-12-02 Juri Linkov <juri@jurta.org>
8771
8772 * search.c (Fword_search_regexp): New Lisp function created from
8773 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8774 (Fword_search_backward, Fword_search_forward)
8775 (Fword_search_backward_lax, Fword_search_forward_lax):
8776 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8777 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8778
8779 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8780
8781 * fileio.c (Finsert_file_contents): Move after-change-function call
8782 to before the "handled:" label, since all "goto handled" appear in
8783 cases where the *-change-functions have already been properly called
8784 (bug#10117).
8785
8786 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8787
8788 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8789 waiting for input. (Bug#10169)
8790
8791 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8792
8793 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8794 verifies glyph row's hash code--we have just reallocated the
8795 glyphs, so their contents can be complete garbage. (Bug#10164)
8796
8797 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8798
8799 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8800
8801 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8802
8803 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8804 attributes are tested _before_ calling verify_row_hash, to protect
8805 against GCC re-ordering of the tests. (Bug#10164)
8806
8807 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8808
8809 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8810
8811 * xterm.c (handle_one_xevent): Only set async_visible and friends
8812 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8813 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8814 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8815
8816 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8817
8818 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8819 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8820 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8821 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8822 All uses changed to use GCPRO1 etc.
8823 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8824 Revert to old implementation (i.e., before 2011-03-11).
8825
8826 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8827
8828 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8829 of scroll runs so as to avoid assigning disabled bogus rows and
8830 unnecessary graphics copy operations.
8831
8832 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8833
8834 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8835 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8836 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8837 (malloc, free, realloc, calloc): Redirect to e_* only when
8838 compiling Emacs.
8839
8840 * lisp.h (GCTYPEBITS): Move before first use.
8841 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8842 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8843 this macro definition.
8844
8845 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8846 _MSC_VER.
8847
8848 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8849
8850 * gtkutil.c (xg_create_frame_widgets):
8851 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8852 present with Gtk+ 2.0.
8853
8854 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8855
8856 * fileio.c (Finsert_file_contents): Undo previous change; see
8857 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8858
8859 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8860
8861 Rename locals to avoid shadowing.
8862 * fileio.c (Finsert_file_contents):
8863 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8864 * process.c (wait_reading_process_output):
8865 Rename inner 'proc' to 'p' to avoid shadowing.
8866 Indent for consistency with usual Emacs style.
8867
8868 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8869
8870 * xdisp.c (redisplay_window): If cursor row is not fully visible
8871 after recentering, and scroll-conservatively is set to a large
8872 number, scroll window by a few more lines to make the cursor fully
8873 visible and out of scroll-margin. (Bug#10105)
8874 (start_display): Don't move to the next line if the display should
8875 start at a newline that is part of a display vector or an overlay
8876 string. (Bug#10119)
8877
8878 2011-11-24 Juri Linkov <juri@jurta.org>
8879
8880 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8881 after the `MagickPingImage' call. (Bug#10112)
8882
8883 2011-11-23 Chong Yidong <cyd@gnu.org>
8884
8885 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8886
8887 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8888
8889 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8890 making another buffer current. (Bug#10114)
8891
8892 2011-11-23 Glenn Morris <rgm@gnu.org>
8893
8894 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8895
8896 2011-11-23 Chong Yidong <cyd@gnu.org>
8897
8898 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8899 using it (Bug#5984).
8900
8901 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8902
8903 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8904 and header-lines, as they don't have one computed for them.
8905 (Bug#10098)
8906
8907 * .gdbinit (prow): Make displayed values more self-explaining.
8908 Add row's hash code.
8909
8910 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8911
8912 * process.c (wait_reading_process_output): Fix asynchrounous
8913 GnuTLS socket handling on some versions of the GnuTLS library.
8914 (wait_reading_process_output): Add comment and URL.
8915
8916 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8917
8918 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8919
8920 2011-11-21 Chong Yidong <cyd@gnu.org>
8921
8922 * window.c (Fnext_window, Fprevious_window): Doc fix.
8923
8924 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8925
8926 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8927
8928 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8929
8930 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8931
8932 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8933
8934 * window.c (Fset_window_combination_limit): Rename argument
8935 STATUS to LIMIT.
8936 (Vwindow_combination_limit): Remove "status" from doc-string.
8937
8938 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8939
8940 * m/ibms390.h: Remove.
8941 * m/ibms390x.h: Don't include "ibms390.h".
8942
8943 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8944
8945 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8946 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8947
8948 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8949
8950 * casetab.c (Fset_case_table):
8951 * charset.c (Fcharset_after): Fix typos.
8952
8953 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8954
8955 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8956 Otherwise, valgrind does not work on some platforms.
8957 Problem reported by Andreas Schwab in
8958 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8959 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8960 is set, removing the need for VIRT_ADDRESS_VARIES.
8961 (PURE_P): Use a more-efficient implementation that needs just one
8962 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8963 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8964 to 4 (xorl, subq, cmpq, setbe).
8965 * alloc.c (pure): Always extern now, since that's the
8966 VIRT_ADDR_VARIES behavior.
8967 (PURE_POINTER_P): Use a single comparison, not two, for
8968 consistency with the new puresize.h.
8969 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8970 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8971 Remove VIRT_ADDR_VARIES no longer needed.
8972
8973 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8974
8975 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8976 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8977 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8978 behave as if the cursor position were at the window margin.
8979
8980 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8981 and the cursor position is out of bounds, behave as if the cursor
8982 position were at the window margin. (Bug#10075)
8983
8984 2011-11-18 Chong Yidong <cyd@gnu.org>
8985
8986 * window.c (Fwindow_combination_limit): Make first argument
8987 non-optional, since it is meaningless for live windows like the
8988 selected window.
8989
8990 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8991
8992 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8993
8994 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8995
8996 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8997 (graft_intervals_into_buffer): Simplify.
8998
8999 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9000
9001 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9002 hash values of the two rows.
9003 (copy_row_except_pointers): Preserve the used[] arrays and the
9004 hash values of the two rows. (Bug#10035)
9005 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9006
9007 * xdisp.c (row_hash): New function, body extracted from
9008 compute_line_metrics.
9009 (compute_line_metrics): Call row_hash, instead of computing the
9010 hash code inline.
9011
9012 * dispnew.c (verify_row_hash): Call row_hash for computing the
9013 hash code of a row, instead of duplicating code from xdisp.c.
9014
9015 * dispextern.h (row_hash): Add prototype.
9016
9017 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9018
9019 * frame.c (delete_frame): Don't delete the terminal when the last
9020 X frame is closed if emacs is built with GTK toolkit.
9021
9022 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9023
9024 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9025
9026 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9027
9028 * window.c (Vwindow_splits): Rename to
9029 Vwindow_combination_resize. Suggested by Juri Linkov.
9030 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9031 of Vwindow_splits.
9032
9033 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9034
9035 * nsfns.m (Fns_font_name):
9036 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9037
9038 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9039
9040 * window.h (window): Rename slot "nest" to "combination_limit".
9041 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9042 (Fset_window_nest): Rename to Fset_window_combination_limit.
9043 (Vwindow_nest): Rename to Vwindow_combination_limit.
9044 (recombine_windows, make_parent_window, make_window)
9045 (Fsplit_window_internal, saved_window)
9046 (Fset_window_configuration, save_window_save): Rename all
9047 occurrences of window_nest to window_combination_limit.
9048
9049 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9050
9051 * image.c (imagemagick_load_image): Fix typo.
9052
9053 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9054
9055 * xdisp.c (display_line): Move the call to
9056 highlight_trailing_whitespace before the call to
9057 compute_line_metrics, since the latter needs to see the final
9058 faces of all the glyphs to compute ROW's hash value.
9059 Fixes assertion violations in row_equal_p. (Bug#10035)
9060
9061 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9062
9063 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9064 just return (bug#10044).
9065
9066 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9067
9068 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9069 with user-defined heap size. Bump the default size of the temacs
9070 heap to 27MB, to avoid memory warning when running temacs.
9071 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9072
9073 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9074 current_matrix and desired_matrix. (Bug#9990)
9075 (verify_row_hash) [XASSERTS]: New function.
9076 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9077 that the hash value of glyph rows is correct.
9078
9079 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9080
9081 * window.h (window): Remove splits slot.
9082 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9083 (Fdelete_other_windows_internal, make_parent_window)
9084 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9085 (Fset_window_configuration, save_window_save): Don't deal with
9086 split status of windows.
9087 (saved_window): Remove splits slot.
9088 (Vwindow_splits): Rewrite doc-string.
9089
9090 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9091
9092 * xfns.c (unwind_create_frame):
9093 * nsfns.m (unwind_create_frame):
9094 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9095 Vframe_list (Bug#9999).
9096
9097 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9098
9099 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9100
9101 2011-11-11 Kenichi Handa <handa@m17n.org>
9102
9103 * callproc.c (Fcall_process): Set the member dst_multibyte of
9104 process_coding.
9105
9106 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9107
9108 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9109 avoid a crash (bug#9496).
9110
9111 2011-11-09 Chong Yidong <cyd@gnu.org>
9112
9113 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9114 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9115
9116 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9117
9118 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9119
9120 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9121
9122 Avoid some portability problems by eschewing 'extern inline' functions.
9123 The trivial performance wins aren't worth the portability hassles; see
9124 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9125 et seq.
9126 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9127 (window_box_width, window_box_left, window_box_left_offset)
9128 (window_box_right, window_box_right_offset): Undo previous change,
9129 by removing the "extern"s.
9130 * intervals.c (adjust_intervals_for_insertion)
9131 (adjust_intervals_for_deletion): Undo previous change,
9132 making these static again.
9133 (offset_intervals, temp_set_point_both, temp_set_point)
9134 (copy_intervals_to_string): No longer inline.
9135 * xdisp.c (window_text_bottom_y, window_box_width)
9136 (window_box_height, window_box_left_offset)
9137 (window_box_right_offset, window_box_left, window_box_right)
9138 (window_box): No longer inline.
9139
9140 2011-11-08 Chong Yidong <cyd@gnu.org>
9141
9142 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9143 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9144 Signal an error if not a live window.
9145 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9146 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9147
9148 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9149
9150 * lisp.h (syms_of_abbrev): Remove declaration.
9151 Reported by CHENG Gao <chenggao@royau.me>.
9152
9153 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9154
9155 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9156 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9157 of temacs in GUI mode.
9158
9159 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9160
9161 * window.h: Declare delete_all_child_windows instead of
9162 delete_all_subwindows.
9163 * window.c (Fwindow_nest, Fset_window_nest)
9164 (Fset_window_new_total, Fset_window_new_normal)
9165 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9166 (delete_all_subwindows): Rename to delete_all_child_windows.
9167 (Fdelete_other_windows_internal, Fset_window_configuration):
9168 Call delete_all_child_windows instead of delete_all_subwindows.
9169 * frame.c (delete_frame): Call delete_all_child_windows instead
9170 of delete_all_subwindows.
9171
9172 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9173
9174 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9175 This is also needed for porting to any host where GC_MARK_STACK is
9176 not GC_MAKE_GCPROS_NOOPS.
9177 (which_symbols): Use it.
9178
9179 2011-11-07 Kenichi Handa <handa@m17n.org>
9180
9181 * coding.c (coding_set_destination): Check coding->src_pos only
9182 when coding->src_object is a buffer (bug#9910).
9183
9184 * process.c (send_process): Set the member src_multibyte of coding
9185 to 0 (bug#9911) when sending a unibyte text.
9186
9187 * callproc.c (Fcall_process): Set the member src_multibyte of
9188 process_coding to 0 (bug#9912).
9189
9190 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9191
9192 * xmenu.c (cleanup_widget_value_tree): New function.
9193 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9194 calling free_menubar_widget_value_tree directly (Bug#9830).
9195
9196 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9197
9198 Fix some portability problems with 'inline'.
9199 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9200 (window_box_width, window_box_left, window_box_left_offset)
9201 (window_box_right, window_box_right_offset): Declare extern.
9202 Otherwise, these inline functions do not conform to C99 and
9203 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9204 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9205 * intervals.c (adjust_intervals_for_insertion)
9206 (adjust_intervals_for_deletion): Now extern, because otherwise the
9207 extern inline functions 'offset_intervals' couldn't refer to it.
9208 (static_offset_intervals): Remove.
9209 (offset_intervals): Rewrite using the old contents of
9210 static_offset_intervals. The old version didn't conform to C99
9211 because an extern inline function contained a reference to an
9212 identifier with static linkage.
9213
9214 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9215
9216 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9217 GC.
9218
9219 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9220
9221 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9222 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9223 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9224 return Qleft_to_right.
9225
9226 2011-11-06 Chong Yidong <cyd@gnu.org>
9227
9228 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9229 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9230 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9231 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9232 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9233 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9234 (Fwindow_vscroll): Doc fix.
9235 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9236 argument, since it makes no sense to pass a live window and for
9237 consistency with window-child.
9238
9239 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9240
9241 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9242 support MSVC.
9243
9244 2011-11-05 Jason Rumney <jasonr@gnu.org>
9245
9246 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9247 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9248 fonts (Bug#6029).
9249 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9250 bitwise arithmetic preventing use of unicode-sip and non-truetype
9251 opentype fonts.
9252
9253 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9254
9255 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9256 "emacs"-only part.
9257
9258 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9259 initialization code to keep similarity to xfns.c after changes
9260 from 2011-11-05.
9261
9262 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9263
9264 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9265 (unwind_create_frame): New function (Bug#9943).
9266 (Fx_create_frame): Restructure code to be more similar to the one in
9267 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9268 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9269 Move terminal->reference_count++ just before making the frame official
9270 (Bug#9943).
9271
9272 * nsterm.m (x_free_frame_resources): New function.
9273 (x_destroy_window): Move code to x_free_frame_resources.
9274
9275 * xfns.c (unwind_create_frame): Fix comment.
9276 (Fx_create_frame, x_create_tip_frame):
9277 Move terminal->reference_count++ just before making the frame
9278 official. Move initialization of image_cache_refcount and
9279 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9280
9281 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9282
9283 Support MSVC build with newer versions of Visual Studio.
9284 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9285 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9286 nt/gmake.defs.
9287
9288 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9289 which are not supported by MSVC.
9290 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9291 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9292 bitfields.
9293 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9294 types in bitfields.
9295 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9296
9297 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9298
9299 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9300
9301 Support MSVC build with newer versions of Visual Studio.
9302 * w32.c: Don't include w32api.h for MSVC.
9303 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9304
9305 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9306 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9307 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9308 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9309 e_* cousins.
9310 (alloca) [_MSC_VER]: Define to _alloca.
9311
9312 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9313
9314 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9315
9316 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9317
9318 * xdisp.c (note_mouse_highlight): If either of
9319 previous/next-single-property-change returns nil, treat that as
9320 the beginning or the end of the buffer. (Bug#9955)
9321
9322 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9323
9324 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9325 label is not null (Bug#9951).
9326 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9327 may be NULL.
9328
9329 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9330
9331 * window.c (Fwindow_body_size): Mention in the doc string that the
9332 return value is in frame's canonical units. (Bug#9949)
9333
9334 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9335
9336 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9337
9338 * w32fns.c (unwind_create_frame): If needed, free the glyph
9339 matrices of the partially constructed frame. (Bug#9943)
9340 * xfns.c (unwind_create_frame): Likewise.
9341
9342 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9343
9344 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9345 Don't stop backward scan on the continuation glyph, even though
9346 its CHARPOS is positive.
9347 (mouse_face_from_buffer_pos, note_mouse_highlight):
9348 Rename cover_string to disp_string.
9349
9350 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9351
9352 * window.c (temp_output_buffer_show): Don't use
9353 Vtemp_buffer_show_specifiers.
9354 (Vtemp_buffer_show_specifiers): Remove unused variable.
9355
9356 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9357
9358 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9359 past the beginning of the current glyph matrix.
9360
9361 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9362
9363 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9364 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9365 HAVE_GTK3 (Bug#9869).
9366
9367 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9368 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9369
9370 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9371
9372 * xterm.c: Declare x_handle_net_wm_state to return int.
9373 (handle_one_xevent): Check if we are iconified but don't have
9374 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9375 (get_current_wm_state): Return non-zero if not hidden,
9376 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9377 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9378 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9379 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9380
9381 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9382
9383 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9384 so that this new function doesn't get optimized away by a
9385 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9386
9387 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9388
9389 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9390
9391 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9392
9393 Fix the `xbytecode' command.
9394 * .gdbinit (xprintbytestr): New command.
9395 (xwhichsymbols): Rename from `which'; all callers changed.
9396 (xbytecode): Print the byte-code string as well.
9397
9398 2011-10-29 Kim Storm <storm@cua.dk>
9399
9400 * alloc.c (which_symbols): New function.
9401
9402 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9403
9404 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9405 line. (Bug#9903)
9406
9407 2011-10-29 Glenn Morris <rgm@gnu.org>
9408
9409 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9410 Not clear what it was for, and it causes various bugs. (Bug#9839)
9411
9412 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9413
9414 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9415 possible random value that matches one of those tested as
9416 condition to clear the mouse face.
9417
9418 2011-10-28 Chong Yidong <cyd@gnu.org>
9419
9420 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9421
9422 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9423
9424 * window.c (make_window): Initialize phys_cursor_on_p.
9425
9426 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9427
9428 * lisp.h (struct Lisp_Symbol): Update comments.
9429
9430 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9431
9432 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9433
9434 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9435
9436 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9437 <oslsachem@gmail.com> for helping to debug this.
9438
9439 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9440 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9441 (g_b_init_get_glyph_outline_w): New static variables.
9442 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9443 (GetGlyphOutlineW_Proc): New typedefs.
9444 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9445 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9446 New functions.
9447 (w32font_open_internal, compute_metrics):
9448 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9449 instead of calling the "wide" APIs directly.
9450
9451 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9452
9453 * w32.h (syms_of_w32font): Add prototype.
9454
9455 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9456
9457 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9458 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9459 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9460 (Fmove_to_window_line): Doc fix.
9461
9462 2011-10-27 Chong Yidong <cyd@gnu.org>
9463
9464 * process.c (make_process): Set gnutls_state to NULL.
9465
9466 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9467 non-NULL, regardless of GNUTLS_INITSTAGE.
9468 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9469 an error. Set process slots as soon as we allocate them.
9470
9471 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9472
9473 2011-10-27 Chong Yidong <cyd@gnu.org>
9474
9475 * gnutls.c (emacs_gnutls_deinit): New function.
9476 Deallocate credentials structures as well as calling gnutls_deinit.
9477 (Fgnutls_deinit, Fgnutls_boot): Use it.
9478
9479 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9480 (deactivate_process): Call emacs_gnutls_deinit.
9481
9482 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9483
9484 * image.c (x_create_x_image_and_pixmap):
9485 * w32.c (sys_rename, w32_delayed_load):
9486 * w32font.c (fill_in_logfont):
9487 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9488
9489 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9490
9491 * w32fns.c (w32_default_color_map): New function,
9492 extracted from Fw32_default_color_map.
9493 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9494
9495 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9496
9497 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9498
9499 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9500
9501 * keyboard.c (test_undefined): New function (bug#9751).
9502 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9503
9504 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9505
9506 * sysdep.c (init_sys_modes): Fix the check for the controlling
9507 terminal (Bug#6649).
9508
9509 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9510
9511 * dispextern.h (struct bidi_it): New member next_en_type.
9512
9513 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9514 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9515 current character, check also for next_en_type being WEAK_EN.
9516 (bidi_resolve_weak): Don't enter the expensive loop if the current
9517 position is before next_en_pos. Record the bidi type of the first
9518 non-ET, non-BN character we find, in addition to its position.
9519 (bidi_level_of_next_char): Invalidate next_en_type when
9520 next_en_pos is over-stepped.
9521
9522 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9523
9524 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9525 * editfns.c: Rewrite current-time-zone so that it invokes
9526 the equivalent of (format-time-string "%Z") to get the time zone name.
9527 This fixes a bug when the time zone name contains characters that
9528 need converting from the system time locale to Emacs internal format.
9529 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9530 that patch fixed format-time-string to do the conversion, but
9531 I forgot to fix current-time-zone.
9532 (format_time_string): New function, containing most of
9533 what Fformat_time_string used to contain.
9534 (Fformat_time_string): Rewrite in terms of format_time_string.
9535 This doesn't change this function's behavior.
9536 (current-time-zone): Rewrite to use format_time_string.
9537 This fixes the bug reported by Michael Schierl in
9538 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9539 Jason Rumney's 2007-06-07 change worked around this bug, but
9540 didn't fix it.
9541 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9542
9543 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9544
9545 * xdisp.c (start_display): If the character at POS is displayed
9546 via a display vector, reset IT->current.dpvec_index to zero.
9547 (try_window_reusing_current_matrix): If a line ends in a display
9548 vector or the next line starts in a display vector, continue
9549 redrawing the window even though the character position of
9550 start_row was reached.
9551 (Bug#9771, part 2)
9552
9553 2011-10-18 Chong Yidong <cyd@gnu.org>
9554
9555 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9556 with nobreak-char-display too.
9557
9558 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9559
9560 Fix part 3 of bug#9771.
9561 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9562 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9563 non-neutral characters if the current character is a paragraph
9564 separator (a.k.a. Newline). This avoids running the same
9565 expensive loop twice, once when we consume the preceding newline
9566 and the other time when the line actually needs to be displayed.
9567 Avoid the loop when we see neutrals on the base embedding level
9568 following a character whose directionality is the same as the
9569 paragraph's. This avoids running the expensive loop when a line
9570 ends in a long sequence of neutrals, like control characters.
9571 Add assertion against STRONG_AL type. Slightly rearrange code
9572 that determines the type of a neutral given the first non-neutral
9573 that follows it.
9574 (bidi_level_of_next_char): Set next_en_pos to zero when
9575 invalidating its info.
9576
9577 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9578
9579 * xdisp.c (push_display_prop): Determine whether to record string
9580 or buffer position by IT->string, not by IT->method. Allow
9581 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9582 (move_it_vertically_backward): Don't look for character position
9583 immediately after the newline when in a continuation line.
9584 (Bug#9771, part 1)
9585
9586 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9587
9588 * window.c (coordinates_in_window): Rewrite and delabelize
9589 vertical border check. (Bug#5357) (Bug#9618)
9590
9591 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9592
9593 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9594 errors in XSetWindowBorder (bug#9310).
9595
9596 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9597
9598 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9599 avoid crash when xmalloc overrun checking is enabled.
9600
9601 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9602
9603 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9604 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9605 cursor motion with <left> and <right> arrow keys.
9606
9607 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9608 some callers set that themselves.
9609
9610 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9611
9612 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9613 display string and the previous row comes from the same string and
9614 is empty. (Bug#9739) (Bug#9738)
9615
9616 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9617
9618 * doc.c (get_doc_string): Encode file name (bug#9735).
9619
9620 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9621
9622 * bidi.c (bidi_level_of_next_char):
9623 * xdisp.c (get_visually_first_element): Remove old incorrect
9624 comments regarding the Unicode Line Separator character.
9625
9626 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9627
9628 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9629
9630 * alloc.c (Fgc_status): Do not access beyond zombies array
9631 boundary if nzombies > MAX_ZOMBIES.
9632 * alloc.c (dump_zombies): Add missing format specifier.
9633
9634 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9635
9636 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9637 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9638
9639 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9640 Some packages use them to denote characters with modifiers.
9641
9642 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9643
9644 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9645 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9646 matching a pp-number. Rename parameter var to var1.
9647
9648 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9649
9650 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9651
9652 2011-10-08 Glenn Morris <rgm@gnu.org>
9653
9654 * callint.c (Fcall_interactively): Give a more explicit error for the
9655 'c' case with a non-character input. (Bug#8479)
9656
9657 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9658
9659 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9660 lines.
9661 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9662 lines that are hscrolled on the left.
9663
9664 * dispnew.c (buffer_posn_from_coords): Account for a possible
9665 presence of header-line. (Bug#4426)
9666
9667 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9668
9669 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9670 Don't advertise functionality which we discourage or doesn't work.
9671
9672 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9673
9674 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9675 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9676 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9677 this makes Emacs dump core during garbage collection on rare
9678 occasions. sizeof is obviously inferior to offsetof here, so
9679 stick with offsetof.
9680 (GC_POINTER_ALIGNMENT): New macro.
9681 (mark_memory): Omit 3rd (offset) arg; caller changed.
9682 Don't assume EMACS_INT alignment is the same as pointer alignment.
9683
9684 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9685
9686 * keyboard.c (read_key_sequence_remapped): New var.
9687 (read_key_sequence): Compute remapping in the right buffer.
9688 (command_loop_1): Use read_key_sequence's remapping directly.
9689
9690 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9691
9692 * dired.c (file_name_completion): Don't expand file name.
9693 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9694 before checking file name handler.
9695
9696 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9697 they've been requested explicitly (bug#9591).
9698
9699 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9700
9701 * keymap.c (Fsingle_key_description): Use make_specified_string
9702 instead of build_string to build string from push_key_description.
9703 (Bug#5193)
9704
9705 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9706
9707 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9708 This fixes a Y2038 bug on 64-bit hosts.
9709 * buffer.c (reset_buffer):
9710 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9711 (Fclear_buffer_auto_save_failure):
9712 Use 0, not -1, to represent an unset failure time, since time_t
9713 might not be signed.
9714
9715 Remove dependency on glibc malloc internals.
9716 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9717 Move back here from lisp.h, but with their new implementations.
9718 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9719 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9720 * charset.c (charset_table_init): New static var.
9721 (syms_of_charset): Use it instead of xmalloc. This removes a
9722 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9723 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9724 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9725 Move back to alloc.c.
9726 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9727 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9728
9729 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9730
9731 * nsterm.m (windowDidResize): Call x_set_window_size only when
9732 ns_in_resize is true. Otherwise set pixelwidth/height and
9733 call change_frame_size (Bug#9628).
9734
9735 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9736
9737 Port --enable-checking=all to Fedora 14 x86-64.
9738 * charset.c (syms_of_charset): Also account for glibc malloc's
9739 internal overhead when calculating the initial malloc maximum.
9740
9741 Port --enable-checking=all to Fedora 14 x86.
9742 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9743 Move to lisp.h.
9744 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9745 (overrun_check_realloc, overrun_check_free):
9746 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9747 That way, xmalloc returns a properly-aligned pointer even if
9748 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9749 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9750 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9751 into account when calculating the initial malloc maximum.
9752 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9753 Move here from alloc.c, so that charset.c can use it too.
9754 Properly align; the old code wasn't right for common 32-bit hosts
9755 when configured with --enable-checking=all.
9756 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9757 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9758
9759 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9760
9761 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9762 use EDOM.
9763
9764 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9765
9766 * xdisp.c (compute_display_string_end): If there's no display
9767 string at CHARPOS, return -1.
9768
9769 * bidi.c (bidi_fetch_char): When compute_display_string_end
9770 returns a negative value, treat the character as a normal
9771 character not covered by a display string. (Bug#9624)
9772
9773 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9774
9775 * lread.c (Fread_from_string): Fix typo in docstring.
9776
9777 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9778
9779 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9780 newline, reseat the iterator instead of bidi-iterating there one
9781 character at a time. (Bug#9610)
9782 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9783 TO_CHARPOS if the bidi iterator is at base embedding level.
9784
9785 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9786
9787 * lread.c (readevalloop): Use correct code for NBSP.
9788 (read1): Likewise. (Bug#9608)
9789
9790 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9791
9792 * dbusbind.c (Fdbus_register_signal): When service is not
9793 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9794
9795 2011-09-25 Glenn Morris <rgm@gnu.org>
9796
9797 * buffer.c (truncate-lines): Doc fix.
9798
9799 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9800
9801 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9802 (Fset_window_next_buffers): Doc fix.
9803
9804 2011-09-24 Glenn Morris <rgm@gnu.org>
9805
9806 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9807
9808 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9809
9810 Fix minor problems found by static checking.
9811 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9812 * indent.c (Fvertical_motion): Fix == vs = typo.
9813
9814 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9815
9816 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9817 Default value is now t. Doc fix.
9818
9819 * indent.c (Fvertical_motion): Compute and apply the overshoot
9820 logic when moving up, not only when moving down. Fix the
9821 confusing name and values of the it_overshoot_expected variable;
9822 logic changes accordingly. (Bug#9254) (Bug#9549)
9823
9824 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9825 CHARPOS is covered by a display string which includes newlines.
9826 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9827 is covered by a display string with embedded newlines.
9828
9829 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9830
9831 * dbusbind.c (Fdbus_register_signal): Add match rule to
9832 Vdbus_registered_objects_table. (Bug#9581)
9833 (Fdbus_register_method, Vdbus_registered_objects_table):
9834 Fix docstring.
9835
9836 2011-09-24 Jim Meyering <meyering@redhat.com>
9837
9838 do not ignore write error for any output size
9839 The previous change was incomplete.
9840 While it makes emacs --batch detect the vast majority of stdout
9841 write failures, errors were still ignored whenever the output size is
9842 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9843 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9844 && echo FAIL: ignored write error
9845 FAIL: ignored write error
9846 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9847 && echo FAIL: ignored write error
9848 FAIL: ignored write error
9849 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9850
9851 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9852
9853 * emacs.c (Fkill_emacs): In noninteractive mode exit
9854 non-successfully if a write error occurred on stdout. (Bug#9574)
9855
9856 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9857
9858 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9859 the xassert test.
9860
9861 * dispextern.h (struct it): Update the comment documenting what
9862 can it->OBJECT be.
9863
9864 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9865
9866 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9867 a display string, extend search for cursor position to end of row.
9868 (find_row_edges): If the row ends in a newline from a display
9869 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9870 Handle the case of a display string with multiple newlines.
9871 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9872 non-empty line. Fixes confusing cursor motion with arrow keys at
9873 the beginning of a line that starts with whitespace.
9874
9875 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9876
9877 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9878 (bug#9493).
9879
9880 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9881
9882 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9883 boolean (Bug#9154).
9884
9885 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9886
9887 * xdisp.c (display_line): Record maximum and minimum buffer
9888 positions even if no glyphs were produced (e.g., by a zero-width
9889 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9890 buffer positions that will be removed from the glyph row because
9891 they don't fit.
9892 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9893 column is beyond frame width: don't subtract 1 "pixel" when
9894 computing width of the stretch.
9895 (reseat_at_next_visible_line_start): Undo the change made on
9896 2011-09-17 that saved paragraph information and restored it after
9897 the call to `reseat'. (Bug#9545)
9898
9899 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9900
9901 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9902 and turn window cursor on if cleared (Bug#9415).
9903
9904 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9905
9906 * search.c (boyer_moore): Take unibyte characters from pattern
9907 literally. (Bug#9458)
9908
9909 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9910
9911 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9912
9913 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9914
9915 Fix minor problem found by static checking.
9916 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9917 initialized, to pacify gcc -Wuninitialized.
9918
9919 * fileio.c: Report proper errno when syscall falls.
9920 (Finsert_file_contents): Save and restore errno,
9921 so that report_file_error outputs the correct diagnostic.
9922 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9923
9924 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9925
9926 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9927
9928 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9929
9930 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9931 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9932
9933 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9934
9935 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9936 about the current paragraph and restore it after the call to reseat.
9937
9938 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9939 (bidi_find_paragraph_start): Search back for paragraph beginning
9940 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9941 (bidi_move_to_visually_next): Only trigger paragraph-related
9942 computations when the last character is a newline or at EOB, not
9943 just any NEUTRAL_B. (Bug#9470)
9944
9945 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9946 truncated lines if point is covered by a display string. (Bug#9524)
9947
9948 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9949
9950 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9951 (cons_to_x_long): New function.
9952 (lisp_data_to_selection_data): Use it. Correct the test for
9953 short-versus-long data; it was negated. Break out of vector
9954 loop, for efficiency, when a long datum is discovered.
9955
9956 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9957
9958 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9959
9960 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9961
9962 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9963 GCC PR/17406) by declaring this function with external scope.
9964
9965 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9966
9967 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9968 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9969
9970 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9971
9972 * editfns.c (Fformat): Correctly handle text properties on "%%".
9973
9974 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9975
9976 * xterm.c (x_draw_composite_glyph_string_foreground):
9977 * w32term.c (x_draw_composite_glyph_string_foreground):
9978 * term.c (encode_terminal_code):
9979 * composite.c (composition_update_it, get_composition_id):
9980 * xdisp.c (get_next_display_element)
9981 (fill_composite_glyph_string): Add comments about special meaning
9982 of TAB characters in a composition.
9983
9984 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9985
9986 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9987 This occurs when processing a multibyte format.
9988 Problem reported by Wolfgang Jenker.
9989
9990 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9991
9992 * xdisp.c (try_cursor_movement): Only check for exact match if
9993 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9994
9995 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9996
9997 Remove unused external symbols.
9998 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9999 * xdisp.c (calc_pixel_width_or_height): Now static.
10000 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10001 * indent.c (check_display_width):
10002 * w32term.c: Fix comment to match code.
10003 * xterm.c, xterm.h (x_catching_errors): Remove.
10004
10005 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10006
10007 * xselect.c: Use signed conversions more consistently (Bug#9498).
10008 (selection_data_to_lisp_data): Assume incoming selection data are
10009 signed integers, not unsigned. This is to be consistent with
10010 outgoing selection data, which was modified to use signed integers
10011 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10012 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10013 expects long, not unsigned long.
10014
10015 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10016
10017 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10018 computation of loop end. Reported by Johan Bockgård
10019 <bojohan@gnu.org>.
10020
10021 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10022
10023 * frame.c (Fother_visible_frames_p): Function deleted.
10024
10025 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10026
10027 * indent.c (compute_motion): Process display vector front to back
10028 rather than the other way around. (Bug#2496)
10029
10030 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10031
10032 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10033
10034 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10035
10036 * minibuf.c (Fread_from_minibuffer): Doc fix.
10037
10038 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10039
10040 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10041 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10042
10043 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10044
10045 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10046 value for non-existent files.
10047
10048 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10049
10050 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10051 set its "size" to -1. This will set the modtime_size field of
10052 the corresponding buffer to -1, which is what
10053 verify-visited-file-modtime expects for files that do not exist.
10054 (Bug#9139)
10055
10056 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10057
10058 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10059 here ...
10060 * lisp.h: ... from here. push_key_description is no longer
10061 defined in keyboard.c, so its declaration should not be in
10062 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10063 logically belongs with push_key_description.
10064
10065 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10066
10067 * buffer.h: Include <sys/types.h> instead of <time.h>.
10068 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10069 Problem reported by Herbert J. Skuhra.
10070
10071 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10072
10073 * xml.c (parse_region): Make the parsing work for
10074 non-comment-starting XML files again (bug#9144).
10075
10076 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10077
10078 * image.c (gif_load): Fix calculation of bottom and right corner.
10079 (Bug#9468)
10080
10081 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10082
10083 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10084 redisplay in small windows.
10085
10086 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10087
10088 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10089
10090 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10091
10092 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10093 Operate on live windows only.
10094
10095 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10096
10097 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10098
10099 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10100
10101 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10102 only under bidi iteration.
10103
10104 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10105
10106 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10107
10108 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10109
10110 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10111 Without this fix, the command to link temacs failed due to an
10112 undefined symbol __builtin_isnan. This is because
10113 /usr/include/iso/math_c99.h #defines isnan(x) to
10114 __builtin_isnan(x), but the bundled gcc, which identifies itself
10115 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10116 a __builtin_isnan.
10117 * floatfns.c (isnan): #undef, and then #define to a clone of
10118 what's in data.c.
10119 (Fisnan): Always define, since it's always available now.
10120 (syms_of_floatfns): Always define isnan at the Lisp level.
10121
10122 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10123
10124 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10125
10126 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10127
10128 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10129 The previous code assumed that file offsets (off_t values) fit in
10130 EMACS_INT variables, which is not true on typical 32-bit hosts.
10131 The code messed up by falsely reporting buffer overflow in cases
10132 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10133 when "big" contains more than 2**29 bytes, even though this
10134 inserts just one byte and does not overflow the buffer.
10135 (Finsert_file_contents): Store file offsets as off_t
10136 values, not as EMACS_INT values. Check for overflow when
10137 converting between EMACS_INT and off_t. When checking for
10138 buffer overflow or for overlap, take the offsets into account.
10139 Don't use EMACS_INT for small values where int suffices.
10140 When checking for overlap, fix a typo: ZV was used where
10141 ZV_BYTE was intended.
10142 (Fwrite_region): Don't assume off_t fits into 'long'.
10143 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10144
10145 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10146
10147 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10148
10149 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10150
10151 sprintf-related integer and memory overflow issues (Bug#9412).
10152
10153 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10154 (esprintf, exprintf, evxprintf): New functions.
10155 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10156 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10157 (modify_event_symbol): Do not assume that the length of
10158 name_alist_or_stem is safe to alloca and fits in int.
10159 (Fexecute_extended_command): Likewise for function name and binding.
10160 (Frecursion_depth): Wrap around reliably on integer overflow.
10161 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10162 since some callers pass EMACS_INT values.
10163 (Fsingle_key_description): Don't crash if symbol name contains more
10164 than MAX_ALLOCA bytes.
10165 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10166 (get_minibuffer): Arg is now EMACS_INT, not int.
10167 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10168 (esprintf, exprintf, evxprintf): New decls.
10169 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10170
10171 * dbusbind.c (signature_cat): New function.
10172 (xd_signature, Fdbus_register_signal):
10173 Do not overrun buffer; instead, report string overflow.
10174
10175 * dispnew.c (add_window_display_history): Don't overrun buffer.
10176 Truncate instead; this is OK since it's just a log.
10177
10178 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10179 even if the time zone offset is outlandishly large.
10180 Don't mishandle offset == INT_MIN.
10181
10182 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10183 when creating daemon; the previous buffer-overflow check was incorrect.
10184
10185 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10186 which has the guts of the old verror function.
10187
10188 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10189 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10190
10191 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10192 (font_unparse_xlfd): Don't blindly alloca long strings.
10193 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10194 fits in int, when using sprintf. Use single snprintf to count
10195 length of string rather than counting it via multiple sprintfs;
10196 that's simpler and more reliable.
10197 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10198 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10199 sprintf, in case result does not fit in int.
10200
10201 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10202 (fontset_from_font): Print it.
10203
10204 * frame.c (tty_frame_count): Now printmax_t, not int.
10205 (make_terminal_frame, set_term_frame_name): Print it.
10206 (x_report_frame_params): In X, window IDs are unsigned long,
10207 not signed long, so print them as unsigned.
10208 (validate_x_resource_name): Check for implausibly long names,
10209 and don't assume name length fits in 'int'.
10210 (x_get_resource_string): Don't blindly alloca invocation name;
10211 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10212 not fit in int.
10213
10214 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10215 (xg_check_special_colors, xg_set_geometry):
10216 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10217
10218 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10219 Use esprintf, not sprintf, in case result does not fit in int.
10220
10221 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10222 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10223 it as a large positive number.
10224 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10225 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10226
10227 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10228 in case result does not fit in int.
10229
10230 * print.c (float_to_string): Detect width overflow more reliably.
10231 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10232 buffer overrun. Don't assume list length fits in 'int'. Treat
10233 print length of 0 as 0, not as infinity; to be consistent with other
10234 uses of print length in this function. Don't overflow print length
10235 index. Don't assume hash table size fits in 'long', or that
10236 vectorlike size fits in 'unsigned long'.
10237
10238 * process.c (make_process): Use printmax_t, not int, to format
10239 process-name gensyms.
10240
10241 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10242
10243 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10244 to avoid potential buffer overrun.
10245
10246 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10247 if X resource line is longer than 512 bytes.
10248
10249 * xfns.c (x_window): Make sprintf buffer a bit bigger
10250 to avoid potential buffer overrun.
10251
10252 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10253
10254 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10255
10256 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10257
10258 Integer overflow fixes for scrolling, etc.
10259 Without these, Emacs silently mishandles large integers sometimes.
10260 For example, "C-u 4294967297 M-x recenter" was treated as if
10261 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10262
10263 * xdisp.c (try_window_id): Check Emacs fixnum range before
10264 converting to 'int'.
10265
10266 * window.c (window_scroll_line_based, Frecenter):
10267 Check that an Emacs fixnum is in range before assigning it to 'int'.
10268 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10269 values converted from Emacs fixnums.
10270 (Frecenter): Don't wrap around a line count if it is out of 'int'
10271 range; instead, treat it as an extreme value.
10272 (Fset_window_configuration, compare_window_configurations):
10273 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10274
10275 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10276 that can exceed INT_MAX. Check that EMACS_INT value is in range
10277 before assigning it to the (possibly-narrower) index.
10278 (match_limit): Don't assume that a fixnum can fit in 'int'.
10279
10280 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10281 exceed INT_MAX.
10282
10283 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10284 (Fvertical_motion): Don't wrap around LINES values that don't fit
10285 in 'int'. Instead, treat them as extreme values. This is good
10286 enough for windows, which can't have more than INT_MAX lines anyway.
10287
10288 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10289
10290 * Require libxml/parser.h to avoid compilation warning.
10291
10292 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10293
10294 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10295 since this reportedly can destroy thread storage.
10296
10297 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10298
10299 * syntax.c (find_defun_start): Update all cache variables if
10300 exiting early (Bug#9401).
10301
10302 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10303
10304 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10305
10306 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10307 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10308 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10309
10310 * term.c (tty_append_glyph): New function.
10311 (produce_stretch_glyph): Static function and its prototype deleted.
10312
10313 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10314 Add prototypes.
10315
10316 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10317
10318 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10319 when checking :margin (Bug#9390).
10320 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10321 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10322 so that the name doesn't mislead. All uses changed.
10323
10324 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10325
10326 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10327 set_tty_hooks.
10328
10329 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10330
10331 * xdisp.c (move_it_to): Don't bail out early when reaching
10332 position beyond to_charpos, if we are scanning backwards.
10333 (move_it_vertically_backward): When DY == 0, make sure we get to
10334 the first character in the line after the newline.
10335
10336 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10337
10338 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10339 (ccl_driver): Do not generate an out-of-range pointer.
10340 (Fccl_execute_on_string): Remove unnecessary check for
10341 integer overflow, noted by Stefan Monnier in
10342 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10343 Remove a FIXME that didn't need fixing.
10344 Simplify the newly-introduced buffer reallocation code.
10345
10346 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10347
10348 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10349
10350 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10351
10352 Integer and memory overflow issues (Bug#9196).
10353
10354 * doc.c (get_doc_string): Rework so that
10355 get_doc_string_buffer_size is the actual buffer size, rather than
10356 being 1 less than the actual buffer size; this makes xpalloc more
10357 convenient.
10358
10359 * image.c (x_allocate_bitmap_record, cache_image):
10360 * xselect.c (Fx_register_dnd_atom):
10361 Simplify previous changes by using xpalloc.
10362
10363 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10364 since either will do and ptrdiff_t is convenient with xpalloc.
10365
10366 * charset.c (charset_table_size)
10367 (struct charset_sort_data.priority): Now ptrdiff_t.
10368 (charset_compare): Don't overflow if priorities differ greatly.
10369 (Fsort_charsets): Don't assume list length fits in int.
10370 Check for size-calculation overflow when allocating sort data.
10371 (syms_of_charset): Allocate an initial charset table that is
10372 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10373
10374 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10375
10376 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10377 The actual value is always <= INT_MAX, and leaving it unsigned made
10378 overflow checking harder.
10379
10380 * dispextern.h (struct glyph_matrix.rows_allocated)
10381 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10382 with xpalloc. The values are still always <= INT_MAX.
10383
10384 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10385
10386 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10387 (SAFE_NALLOCA): New macro.
10388
10389 * region-cache.c (struct boundary.pos, find_cache_boundary)
10390 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10391 (set_cache_region, invalidate_region_cache)
10392 (revalidate_region_cache, know_region_cache, region_cache_forward)
10393 (region_cache_backward, pp_cache):
10394 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10395 so that ptrdiff_t * can be passed to xpalloc.
10396 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10397 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10398 (pp_cache): Don't assume cache_len fits in int.
10399 * region-cache.h: Adjust extern decls to match.
10400
10401 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10402 EMACS_INT, since either will do, for xpalloc.
10403
10404 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10405 (xnmalloc, xnrealloc, xpalloc): New functions.
10406
10407 * bidi.c (bidi_shelve_header_size): New constant.
10408 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10409 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10410
10411 * bidi.c (bidi_cache_shrink):
10412 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10413 (overlay_strings):
10414 Don't update size of array until after memory allocation succeeds,
10415 because xmalloc/xrealloc may not return.
10416 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10417 now that we have proper integer overflow checking.
10418 (record_overlay_string, overlay_strings): Catch overflows when
10419 calculating size of overlay_str_buf.
10420
10421 * callproc.c (Fcall_process): Check for size overflow when
10422 calculating size of args2.
10423 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10424 Normally we prefer signed values, but sticking with ptrdiff_t would
10425 require adding more-complicated checks.
10426
10427 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10428 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10429 Redo buffer-overflow calculations to avoid integer overflow.
10430 Add a FIXME comment where memory seems to be over-allocated.
10431
10432 * character.c (Fstring): Check for size-calculation overflow.
10433
10434 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10435 unnecessary integer overflow. Check for size overflow.
10436 (encode_coding_object): Don't update size until xmalloc succeeds.
10437
10438 * composite.c (get_composition_id): Check for overflow in glyph
10439 length calculations.
10440
10441 Integer and memory overflow fixes for display code.
10442 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10443 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10444 (scrolling_window): Check for overflow in size calculations.
10445 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10446 Don't assume glyph table len fits in int.
10447 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10448 (row_table_size): Now ptrdiff_t, not int.
10449 (scrolling_window): Avoid overflow in size calculations.
10450 Don't update size until allocation succeeds.
10451 * fns.c (concat): Check for overflow in size calculations.
10452 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10453 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10454 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10455
10456 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10457 (get_doc_string): Check for size calculation overflow.
10458 Don't update size until allocation succeeds.
10459 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10460 EMACS_INT, where ptrdiff_t will do.
10461 (Fsubstitute_command_keys): Check for string overflow.
10462
10463 * editfns.c (set_time_zone_rule): Don't assume environment length
10464 fits in int.
10465 (message_length): Now ptrdiff_t, not int.
10466 (Fmessage_box): Don't update size until allocation succeeds.
10467 Don't assume message length fits in int.
10468 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10469
10470 * emacs.c (main): Do not reallocate argv, since there is a null at
10471 the end that can be overwritten, and this way there's no need to
10472 worry about size-calculation overflow.
10473 (sort_args): Check for size-calculation overflow.
10474
10475 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10476 alloc succeeds.
10477 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10478
10479 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10480 (x_set_scroll_bar_width, x_figure_window_size):
10481 Check for integer overflow.
10482 (x_set_alpha): Do not assume XINT fits in int.
10483
10484 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10485 This is for the members text_lines, text_cols, total_lines, total_cols,
10486 where the system imposes an 'int' limit.
10487
10488 * fringe.c (Fdefine_fringe_bitmap):
10489 Don't update size until alloc works.
10490
10491 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10492 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10493
10494 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10495 Check for size-calculation overflow.
10496 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10497 do, as we prefer signed integers.
10498 (id_to_widget.max_size, id_to_widget.used)
10499 (xg_store_widget_in_map, xg_remove_widget_from_map)
10500 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10501 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10502 Use and return ptrdiff_t, not int.
10503 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10504 * gtkutil.h: Change prototypes to match the above.
10505
10506 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10507 are duplicate now that they've been promoted to lisp.h.
10508 (x_allocate_bitmap_record, x_alloc_image_color)
10509 (make_image_cache, cache_image, xpm_load):
10510 Don't update size until alloc is done.
10511 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10512 (x_detect_edges):
10513 Check for size calculation overflow.
10514 (ct_colors_allocated_max): New constant.
10515 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10516 overflow.
10517
10518 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10519 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10520 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10521 Use ptrdiff_t, not int, to count maps.
10522 (read_char_minibuf_menu_prompt): Check for overflow in size
10523 calculations. Don't update size until allocation succeeds.
10524 Redo calculations to avoid overflow.
10525 * keyboard.h: Change prototypes to match the above.
10526
10527 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10528 to count maps.
10529 (current_minor_maps): Check for size calculation overflow.
10530 * keymap.h: Change prototypes to match the above.
10531
10532 * lread.c (read1, init_obarray): Don't update size until alloc done.
10533
10534 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10535 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10536
10537 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10538 Now ptrdiff_t, not int.
10539 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10540 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10541
10542 * process.c (Fnetwork_interface_list): Check for overflow
10543 in size calculation.
10544
10545 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10546
10547 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10548 overflow. Don't bother calling xmalloc when xrealloc will do.
10549
10550 * search.c (Freplace_match): Check for size calculation overflow.
10551 (Fset_match_data): Don't assume list lengths fit in 'int'.
10552
10553 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10554 for command line length. Do not attempt to address one before the
10555 beginning of an array, as that's not portable.
10556
10557 * term.c (max_frame_lines): Remove; unused.
10558 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10559 not int.
10560 (encode_terminal_code, calculate_costs): Check for size
10561 calculation overflow.
10562 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10563 table lengths and related sizes. Don't update size until alloc
10564 done. Redo calculations to avoid overflow.
10565 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10566
10567 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10568 subtracting pointers.
10569 (gobble_line): Check for overflow more carefully. Don't update size
10570 until alloc done.
10571
10572 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10573 Don't update size until alloc done.
10574 Redo size calculations to avoid overflow.
10575 Check for size calculation overflow.
10576 (main) [DEBUG]: Fix typo in invoking tparam1.
10577
10578 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10579 Use ptrdiff_t, not int, for sizes.
10580 (store_mode_line_noprop_char): Don't update size until alloc done.
10581
10582 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10583 Use ptrdiff_t, not int, for sizes.
10584 (Finternal_make_lisp_face, cache_face):
10585 Check for size calculation overflow.
10586 (cache_face): Treat size calculation overflows as if they were
10587 memory exhaustion (the usual treatment), rather than aborting.
10588
10589 * xfns.c (x_encode_text, x_set_name_internal)
10590 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10591 sizes, since they can exceed INT_MAX in size. Check for size
10592 calculation overflow.
10593
10594 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10595 (xg_select): Check for size calculation overflow.
10596 Don't update size until alloc done.
10597
10598 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10599 as sprintf is limited to int lengths.
10600
10601 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10602 (X_LONG_MIN): New macros.
10603 Use them to make the following changes clearer.
10604 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10605 This change doesn't affect the value now, but it may help remind
10606 future maintainers not to raise the value too much later.
10607 (SELECTION_QUANTUM): Remove, replacing with ...
10608 (selection_quantum): ... new function, which avoids overflow.
10609 All uses changed.
10610 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10611 assumption that selection length fits in 'int'.
10612 (x_reply_selection_request, x_handle_selection_request)
10613 (x_get_window_property, receive_incremental_selection)
10614 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10615 (lisp_data_to_selection_data, clean_local_selection_data):
10616 Use ptrdiff_t, not int, to record length of selection.
10617 (x_reply_selection_request, x_get_window_property)
10618 (receive_incremental_selection, x_property_data_to_lisp):
10619 Redo calculations to avoid overflow.
10620 (x_reply_selection_request): When sending hint, ceiling it at
10621 X_LONG_MAX rather than relying on wraparound overflow to send
10622 something.
10623 (x_get_window_property, receive_incremental_selection)
10624 (lisp_data_to_selection_data, x_property_data_to_lisp):
10625 Check for size-calculation overflow.
10626 (x_get_window_property, receive_incremental_selection)
10627 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10628 Don't store size until memory allocation succeeds.
10629 (x_get_window_property): Plug memory leak on memory exhaustion.
10630 Don't double-block input; malloc is safe here. Don't assume 2**34
10631 - 4 fits in unsigned long. Add an xassert to check
10632 XGetWindowProperty overflow. Be more careful about overflow
10633 calculations, and distinguish size from memory overflow better.
10634 (receive_incremental_selection): When tracing, don't assume
10635 unsigned int is less than INT_MAX.
10636 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10637 harmful) conversions of unsigned short to int.
10638 (lisp_data_to_selection_data): Don't assume that integers
10639 in the range -65535 through -1 fit in an X unsigned short.
10640 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10641 result parameters unless successful. Rely on cons_to_unsigned
10642 to report problems with elements; the old code wasn't right anyway.
10643 (x_check_property_data): Check for int overflow; we cannot use
10644 a wider type due to X limits.
10645 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10646
10647 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10648
10649 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10650 (x_term_init): Check for size calculation overflow.
10651 (x_color_cells): Don't store size until memory allocation succeeds.
10652 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10653 Don't assume alloca size is less than MAX_ALLOCA.
10654 (x_term_init): Don't assume length fits in int (sprintf is limited
10655 to int size).
10656
10657 Use ptrdiff_t for composition IDs.
10658 * character.c (lisp_string_width):
10659 * composite.c (composition_table_size, n_compositions)
10660 (get_composition_id, composition_gstring_from_id):
10661 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10662 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10663 * window.c (Frecenter):
10664 Use ptrdiff_t, not int, for composition IDs.
10665 * composite.c (get_composition_id): Check for integer overflow.
10666 * composite.h: Adjust prototypes to match the above changes.
10667
10668 Use ptrdiff_t for hash table indexes.
10669 * category.c (hash_get_category_set):
10670 * ccl.c (ccl_driver):
10671 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10672 * coding.c (coding_system_charset_list, detect_coding_system):
10673 * coding.h (struct coding_system.id):
10674 * composite.c (get_composition_id, gstring_lookup_cache):
10675 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10676 * image.c (xpm_get_color_table_h):
10677 * lisp.h (hash_lookup, hash_put):
10678 * minibuf.c (Ftest_completion):
10679 Use ptrdiff_t for hash table indexes, not int (which is too
10680 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10681 32-bit --with-wide-int hosts).
10682
10683 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10684 Add a FIXME comment about memory leaks.
10685 (syms_of_charset): Don't assume xmalloc returns.
10686
10687 Don't assume that stated character widths fit in int.
10688 * character.c (Fchar_width, c_string_width, lisp_string_width):
10689 * character.h (CHAR_WIDTH):
10690 * indent.c (MULTIBYTE_BYTES_WIDTH):
10691 Use sanitize_char_width to avoid undefined and/or bad behavior
10692 with outlandish widths.
10693 * character.h (sanitize_tab_width): Rename from sanitize_width,
10694 now that we have two such functions. All uses changed.
10695 (sanitize_char_width): New inline function.
10696
10697 Don't assume that tab-width fits in int.
10698 * character.h (sanitize_width): New inline function.
10699 (SANE_TAB_WIDTH): New macro.
10700 (ASCII_CHAR_WIDTH): Use it.
10701 * indent.c (sane_tab_width): Remove. All uses replaced by
10702 SANE_TAB_WIDTH (current_buffer).
10703 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10704
10705 * fileio.c: Integer overflow issues with file modes.
10706 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10707
10708 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10709 Remove unreachable code.
10710 (read_hex, load_charset_map_from_file): Check for integer overflow.
10711
10712 * xterm.c: Don't go over XClientMessageEvent limit.
10713 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10714 (x_send_scroll_bar_event): Likewise. Check that the size does not
10715 exceed limits imposed by XClientMessageEvent, as well as the usual
10716 ptrdiff_t and size_t limits.
10717
10718 * keyboard.c: Overflow, signedness and related fixes.
10719 (make_lispy_movement): Use same integer type in forward decl
10720 that is used in the definition.
10721 (read_key_sequence, keyremap_step):
10722 Change bufsize argument back to int, undoing my 2011-03-30 change.
10723 We prefer signed types, and int is wide enough here.
10724 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10725 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10726 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10727 length, not size_t. Use ptrdiff_t for index, not int.
10728 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10729 possibility of integer overflow.
10730
10731 Overflow, signedness and related fixes for images.
10732
10733 * dispextern.h (struct it.stack[0].u.image.image_id)
10734 (struct_it.image_id, struct image.id, struct image_cache.size)
10735 (struct image_cache.used, struct image_cache.ref_count):
10736 * gtkutil.c (update_frame_tool_bar):
10737 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10738 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10739 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10740 * nsmenu.m (update_frame_tool_bar):
10741 * xdisp.c (calc_pixel_width_or_height):
10742 * xfns.c (image_cache_refcount):
10743 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10744 on typical 64-bit hosts.
10745
10746 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10747 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10748 Omit unnecessary casts to int.
10749 (parse_image_spec): Check that integers fall into 'int' range
10750 when the callers expect that.
10751 (image_ascent): Redo ascent calculation to avoid int overflow.
10752 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10753 (lookup_image): Remove unnecessary tests.
10754 (xbm_image_p): Locals are now of int, not EMACS_INT,
10755 since parse_image_check makes sure they fit into int.
10756 (png_load, gif_load, svg_load_image):
10757 Prefer int to unsigned where either will do.
10758 (tiff_handler): New function, combining the cores of the
10759 old tiff_error_handler and tiff_warning_handler.
10760 This function is rewritten to use vsnprintf and thereby avoid
10761 stack buffer overflows. It uses only the features of vsnprintf
10762 that are common to both POSIX and native Microsoft.
10763 (tiff_error_handler, tiff_warning_handler): Use it.
10764 (tiff_load, gif_load, imagemagick_load_image):
10765 Don't assume :index value fits in 'int'.
10766 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10767 (imagemagick_load_image): Check that crop parameters fit into
10768 the integer types that MagickCropImage accepts. Don't assume
10769 Vimagemagick_render_type has a nonnegative value. Don't assume
10770 size_t fits in 'long'.
10771 (gs_load): Use printmax_t to print the widest integers possible.
10772 Check for integer overflow when computing image height and width.
10773
10774 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10775
10776 * xdisp.c (redisplay_window): Don't force window start if point
10777 will be invisible in the resulting window. (Bug#9324)
10778
10779 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10780
10781 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10782 the display spec is of the form `(space ...)'.
10783 (handle_display_spec): Return the value returned by
10784 handle_single_display_spec, not just 1 or zero.
10785 (handle_single_display_spec): If the display spec is of the form
10786 `(space ...)', and specifies display in the text area, return 2
10787 rather than 1.
10788 (try_cursor_movement): Check for the need to scroll more
10789 accurately, and prefer exact match for point under bidi.
10790 Don't advance `row' beyond the last row of the window.
10791
10792 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10793 into disp_prop; all users changed.
10794
10795 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10796 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10797 for the text covered by the display property.
10798
10799 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10800
10801 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10802 Change return value to nil.
10803 (Frecord_buffer): Delete unused function.
10804
10805 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10806
10807 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10808 buffers, return left-to-right.
10809 (set_cursor_from_row): Consider candidate row a win if its glyph
10810 represents a newline and point is on that newline. Fixes cursor
10811 positioning on the newline at EOL of R2L text within L2R
10812 paragraph, and vice versa.
10813 (try_cursor_movement): Check continued rows, in addition to
10814 continuation rows. Fixes unwarranted scroll when point enters a
10815 continued line of R2L text within an L2R paragraph, or vice versa.
10816 (cursor_row_p): Consider the case of point being equal to
10817 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10818 from the end of a short line to the beginning of a continued line
10819 of R2L text within L2R paragraph.
10820 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10821 composed characters.
10822
10823 * bidi.c (bidi_check_type): Use xassert.
10824 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10825 members.
10826
10827 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10828
10829 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10830 a character.
10831
10832 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10833
10834 * nsfont.m (ns_otf_to_script): Fix typo.
10835
10836 2011-08-22 Kenichi Handa <handa@m17n.org>
10837
10838 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10839 extra slot even if the purpose is char-code-property-table.
10840
10841 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10842
10843 * xdisp.c (redisplay_window): When computing centering_position,
10844 account for the height of the header line. (Bug#8874)
10845
10846 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10847 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10848 candidate is selected by the mouse, and that candidate has a
10849 composed character under the mouse.
10850
10851 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10852 coordinates reported by pos-visible-in-window-p for a composed
10853 character in column zero.
10854
10855 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10856
10857 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10858
10859 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10860
10861 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10862 consider it a hit if to_charpos is anywhere in the range of the
10863 composed buffer positions.
10864
10865 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10866
10867 * image.c (gif_load): Don't assume that each subimage has the same
10868 dimensions as the base image. Handle disposal method that is
10869 "undefined" by the gif spec (Bug#9335).
10870
10871 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10872
10873 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10874 (Fcondition_case): Document `debug' symbol in error handler.
10875
10876 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10877
10878 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10879 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10880 from an Org mode buffer to a Speedbar frame.
10881
10882 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10883 a composition, take its buffer position from IT->cmp_it.charpos.
10884 Fixes cursor positioning at the beginning of a line that begins
10885 with a composed character.
10886
10887 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10888
10889 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10890 character bidirectional type, use STRONG_L instead. Fixes crashes
10891 in a buffer produced by `describe-categories'.
10892
10893 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10894 members before the level stack, so they would be saved and
10895 restored when copying iterator state. Fixes incorrect reordering
10896 around TABs covered by display properties.
10897
10898 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10899
10900 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10901
10902 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10903
10904 * eval.c (internal_condition_case, internal_condition_case_1)
10905 (internal_condition_case_2, internal_condition_case_n):
10906 Remove unnecessary aborts (Bug#9081).
10907
10908 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10909
10910 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10911 has no `load' handler, try opening the file locally. (Bug#9311)
10912
10913 2011-08-16 Ken Brown <kbrown@cornell.edu>
10914
10915 * gmalloc.c: Expand comment.
10916
10917 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10918
10919 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10920 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10921
10922 2011-08-16 Ken Brown <kbrown@cornell.edu>
10923
10924 Fix memory allocation problems in Cygwin build (Bug#9273).
10925
10926 * unexcw.c ( __malloc_initialized): Declare external variable.
10927 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10928
10929 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10930 New variables.
10931 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10932 dumped emacs.
10933 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10934 in the static heap.
10935 [CYGWIN] (special_realloc): New function.
10936 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10937 requests to realloc storage in the static heap.
10938
10939 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10940
10941 * bidi.c (bidi_initialize): Remove unused local.
10942
10943 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10944
10945 * bidimirror.h:
10946 * biditype.h: Remove file.
10947 * makefile.w32-in ($(BLD)/bidi.$(O)):
10948 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10949
10950 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10951
10952 * chartab.c: Improve commentary for the uniprop_table API.
10953
10954 * bidi.c (bidi_paragraph_init): Support zero value of
10955 bidi_ignore_explicit_marks_for_paragraph_level.
10956 (bidi_initialize): Use uniprop_table instead of including
10957 biditype.h and bidimirror.h.
10958
10959 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10960 coordinates of the iterator when restoring from ppos_it.
10961 (Bug#9296)
10962
10963 2011-08-14 Kenichi Handa <handa@m17n.org>
10964
10965 * process.c (create_process): Call setup_process_coding_systems
10966 after the pid of the process is set to -1 (Bug#8162).
10967
10968 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10969
10970 * xdisp.c (move_it_in_display_line_to): Don't invoke
10971 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10972 ppos_it. Fixes vertical cursor motion when line beginning is
10973 covered by an image. (Bug#9296)
10974
10975 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10976
10977 * nsterm.h (ns_run_ascript): Declare.
10978 (NSAPP_DATA2_RUNASSCRIPT): Define.
10979
10980 * nsfns.m (as_script, as_result, as_status): New static variables.
10981 (ns_run_ascript): New function.
10982 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10983 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10984 the event loop. Get status from as_status (Bug#7276).
10985
10986 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10987 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10988 the event loop (Bug#7276).
10989
10990 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10991
10992 * gnutls.c (QCgnutls_bootprop_priority)
10993 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10994 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10995 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10996 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10997 (QCgnutls_bootprop_verify_hostname_error)
10998 (QCgnutls_bootprop_callbacks_verify): Rename from
10999 Qgnutls_bootprop_..., all uses changed.
11000
11001 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11002 uses changed.
11003
11004 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11005
11006 * xfaces.c (Qframe_set_background_mode): Now static.
11007 * dispextern.h (Qframe_set_background_mode): Remove decl.
11008
11009 * process.c (Fnetwork_interface_info): Declare local only if needed.
11010
11011 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11012
11013 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11014 (Fnetwork_interface_list): Allocate in increments of bytes instead
11015 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11016 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11017 sockaddr.
11018 (struct ifflag_def): notrailers is smart on OSX.
11019 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11020 Get hardware address with getifaddrs if available.
11021
11022 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11023
11024 * xdisp.c (iterate_out_of_display_property): xassert that
11025 IT->position is set to within IT->object's boundaries. Break from
11026 the loop as soon as EOB is reached; avoids infloops in redisplay
11027 when IT->position is set up wrongly due to some bug.
11028 Set IT->current to match the bidi iterator unconditionally.
11029 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11030 entry. Force push_it to save on the stack the current
11031 buffer/string position, to be restored by pop_it. Fix flags in
11032 the iterator structure wrt the object coming from a display
11033 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11034 properties. (Bug#9284)
11035
11036 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11037
11038 * fontset.c (fontset_get_font_group): Add proper type checks.
11039 (Bug#9172)
11040
11041 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11042
11043 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11044 and LC_VERSION_MIN_MACOSX.
11045 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11046 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11047
11048 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11049
11050 * xdisp.c (forward_to_next_line_start): Allow to use the
11051 no-display-properties-and-no-overlays under bidi display.
11052 Set disp_pos in the bidi iterator to avoid searches for display
11053 properties and overlays.
11054
11055 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11056
11057 * editfns.c (Fset_time_zone_rule): Document relationship with the
11058 setenv function.
11059
11060 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11061 the font entity extracted from the cache (Bug#8109).
11062
11063 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11064
11065 * composite.c (autocmp_chars): Don't reset point. That is done by
11066 restore_point_unwind (Bug#5984).
11067
11068 2011-08-07 Juri Linkov <juri@jurta.org>
11069
11070 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11071 to show the arg `TIME' instead of `TIMEVAL'.
11072
11073 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11074
11075 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11076 display property strides EOL and includes a newline, as in
11077 longlines-mode. (Bug#9254)
11078 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11079 word-wrap under bidirectional display. (Bug#9224)
11080
11081 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11082 is non-zero, even if the data buffer is NULL. Fixes a crash in
11083 vertical-motion with longlines-mode. (Bug#9254)
11084
11085 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11086
11087 * bidi.c <bidi_cache_total_alloc>: Now static.
11088 (bidi_initialize): Initialize bidi_cache_total_alloc.
11089
11090 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11091 cache. (Bug#9221)
11092
11093 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11094 amount allocated this far in `bidi_cache_total_alloc'.
11095 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11096 non-zero, only free the data buffer without restoring the cache
11097 contents. All callers changed.
11098
11099 * dispextern.h (bidi_unshelve_cache): Update prototype.
11100
11101 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11102 (move_it_in_display_line, move_it_to)
11103 (move_it_vertically_backward, move_it_by_lines): Replace the call
11104 to xfree to an equivalent call to bidi_unshelve_cache.
11105 (move_it_in_display_line_to): Fix logic of returning
11106 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11107
11108 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11109
11110 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11111 came from a string character with a `cursor' property. (Bug#9229)
11112
11113 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11114
11115 * Makefile.in (LIB_PTHREAD): New variable.
11116 (LIBES): Add LIB_PTHREAD (Bug#9216).
11117
11118 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11119 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11120
11121 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11122
11123 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11124
11125 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11126
11127 * xterm.c (x_find_topmost_parent): New function.
11128 (x_set_frame_alpha): Find topmost parent window with
11129 x_find_topmost_parent and set the property there also (bug#9181).
11130 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11131
11132 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11133
11134 * callproc.c (Fcall_process): Avoid vfork clobbering
11135 the local vars buffer, coding_systems, current_dir.
11136
11137 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11138
11139 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11140
11141 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11142
11143 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11144 so that it is not optimized away.
11145
11146 * xdisp.c (compute_display_string_pos): Remove unused local.
11147
11148 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11149
11150 Fix slow cursor motion and scrolling in large buffers with
11151 selective display, like Org Mode buffers. (Bug#9218)
11152
11153 * dispextern.h (struct bidi_it): New member disp_prop_p.
11154
11155 * xdisp.c: Remove one-slot cache of display string positions.
11156 (compute_display_string_pos): Accept an additional argument
11157 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11158 for a display string or property. If found, set DISP_PROP_P
11159 non-zero.
11160
11161 * bidi.c (bidi_fetch_char): Accept an additional argument
11162 DISP_PROP_P, and pass it to compute_display_string_pos.
11163 Only handle text covered by a display string if DISP_PROP_P is returned
11164 non-zero. All callers of bidi_fetch_char changed.
11165
11166 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11167
11168 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11169
11170 2010-12-03 Don March <don@ohspite.net>
11171
11172 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11173 last character M-[char] is translated to ESC [char] (bug#7541).
11174
11175 2011-08-02 Kenichi Handa <handa@m17n.org>
11176
11177 * lisp.h (uniprop_table): Extern it.
11178
11179 * chartab.c (uniprop_table): Make it non-static.
11180
11181 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11182
11183 * xdisp.c (forward_to_next_line_start): Accept additional argument
11184 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11185 on the newline.
11186 (reseat_at_next_visible_line_start): Use the bidi iterator state
11187 returned by forward_to_next_line_start to restore the state of
11188 it->bidi_it after backing up to previous newline. (Bug#9212)
11189
11190 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11191
11192 * regex.c (re_comp): Protoize.
11193 (re_exec): Fix return type.
11194 (regexec): Fix type of `ret'. (Bug#9203)
11195
11196 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11197
11198 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11199 This is needed if max-image-size is a floating-point number.
11200
11201 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11202
11203 * print.c (print_object): Print empty symbol as ##.
11204
11205 * lread.c (read1): Read ## as empty symbol.
11206
11207 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11208
11209 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11210 setting frame foreground color (Bug#9175).
11211 (x_set_background_color): Likewise.
11212
11213 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11214 contents (Bug#9176).
11215 (EmacsTooltip -init): Remove bezels and add shadows to
11216 tooltip windows.
11217
11218 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11219 or scroll bar (Bug#8470).
11220
11221 * nsfont.m (nsfont_open): Remove assignment to voffset and
11222 unnecessary vars hshink, expand, hd, full_height, min_height.
11223 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11224
11225 * nsterm.h (nsfont_info): Remove voffset field.
11226
11227 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11228
11229 Implement strike-through and overline on NextStep (Bug#8863).
11230
11231 * nsfont.m (nsfont_open): Use underline position provided by font,
11232 instead of hard-coded value of 2.
11233 (nsfont_draw): Call ns_draw_text_decoration instead.
11234
11235 * nsterm.h: Add declaration for ns_draw_text_decoration.
11236
11237 * nsterm.m (ns_draw_text_decoration): New function for drawing
11238 underline, overline, and strike-through.
11239 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11240 ns_draw_text_decoration. Change treatment of cursor drawing to
11241 accommodate underlining, etc.
11242
11243 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11244
11245 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11246 default.
11247
11248 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11249
11250 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11251 Without this fix, if a signal arrives just after memory fills up,
11252 'malloc' might be invoked reentrantly.
11253
11254 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11255 In other words, assume that every image size is allowed, on non-X
11256 hosts. This assumption is probably wrong, but it lets Emacs compile.
11257
11258 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11259
11260 * regex.c (re_iswctype): Convert return values to boolean.
11261
11262 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11263
11264 * xdisp.c (compute_display_string_pos): Don't use cached display
11265 string position if the buffer had its restriction changed.
11266 (Bug#9184)
11267
11268 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11269
11270 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11271
11272 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11273
11274 Integer signedness and overflow and related fixes. (Bug#9079)
11275
11276 * bidi.c: Integer size and overflow fixes.
11277 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11278 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11279 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11280 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11281 (bidi_find_other_level_edge):
11282 Use ptrdiff_t instead of EMACS_INT where either will do.
11283 This works better on 32-bit hosts configured --with-wide-int.
11284 (bidi_cache_ensure_space): Check for size-calculation overflow.
11285 Use % rather than repeated addition, for better worst-case speed.
11286 Don't set bidi_cache_size until after xrealloc returns, because it
11287 might not return.
11288 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11289 (bidi_cache_ensure_space): Also check that the bidi cache size
11290 does not exceed that of the largest Lisp string or buffer. See Eli
11291 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11292
11293 * alloc.c (__malloc_size_t): Remove.
11294 All uses replaced by size_t. See Andreas Schwab's note
11295 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11296
11297 * image.c: Improve checking for integer overflow.
11298 (check_image_size): Assume that f is nonnull, since
11299 it is always nonnull in practice. This is one less thing to
11300 worry about when checking for integer overflow later.
11301 (x_check_image_size): New function, which checks for integer
11302 overflow issues inside X.
11303 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11304 This removes the need for a memory_full check.
11305 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11306 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11307 (xbm_read_bitmap_data): Change locals back to 'int', since
11308 their values must fit in 'int'.
11309 (xpm_load_image, png_load, tiff_load):
11310 Invoke x_create_x_image_and_pixmap earlier,
11311 to avoid much needless work if the image is too large.
11312 (tiff_load): Treat overly large images as if
11313 x_create_x_image_and_pixmap failed, not as malloc failures.
11314 (gs_load): Use x_check_image_size.
11315
11316 * gtkutil.c: Omit integer casts.
11317 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11318 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11319
11320 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11321
11322 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11323 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11324 would wrongly return t on a 64-bit host.
11325
11326 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11327 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11328 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11329 and therefore cause GCC to emit a bogus diagnostic in some cases.
11330
11331 * image.c: Integer signedness and overflow and related fixes.
11332 This is not an exhaustive set of fixes, but it's time to
11333 record what I've got.
11334 (lookup_pixel_color, check_image_size): Remove redundant decls.
11335 (check_image_size): Don't assume that arbitrary EMACS_INT values
11336 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11337 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11338 (tiff_load, imagemagick_load_image):
11339 Check for overflow in size calculations.
11340 (x_create_x_image_and_pixmap): Remove unnecessary test for
11341 xmalloc returning NULL; that can't happen.
11342 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11343 (xpm_color_bucket): Use better integer hashing function.
11344 (xpm_cache_color): Don't possibly over-allocate memory.
11345 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11346 (gif_memory_source):
11347 Use ptrdiff_t, not int or size_t, to record sizes.
11348 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11349 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11350 either works, as we prefer signed integers.
11351 (tiff_read_from_memory, tiff_write_from_memory):
11352 Return tsize_t, not size_t, since that's what the TIFF API wants.
11353 (tiff_read_from_memory): Don't fail simply because the read would
11354 go past EOF; instead, return a short read.
11355 (tiff_load): Omit no-longer-needed casts.
11356 (Fimagemagick_types): Don't assume size fits into 'int'.
11357
11358 Improve hashing quality when configured --with-wide-int.
11359 * fns.c (hash_string): New function, taken from sxhash_string.
11360 Do not discard information about ASCII character case; this
11361 discarding is no longer needed.
11362 (sxhash-string): Use it. Change sig to match it. Caller changed.
11363 * lisp.h: Declare it.
11364 * lread.c (hash_string): Remove, since we now use fns.c's version.
11365 The fns.c version returns a wider integer if --with-wide-int is
11366 specified, so this should help the quality of the hashing a bit.
11367
11368 * emacs.c: Integer overflow minor fix.
11369 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11370 Define only if GNU_LINUX.
11371 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11372
11373 * dispnew.c: Integer signedness and overflow fixes.
11374 Remove unnecessary forward decls, that were a maintenance hassle.
11375 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11376 All uses changed.
11377 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11378 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11379 (prepare_desired_row, line_draw_cost):
11380 Use int, not unsigned, where either works.
11381 (save_current_matrix, restore_current_matrix):
11382 Use ptrdiff_t, not size_t, where either works.
11383 (init_display): Check for overflow more accurately, and without
11384 relying on undefined behavior.
11385
11386 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11387 Remove, replacing with the new symbols in lisp.h. All uses changed.
11388 * fileio.c (make_temp_name):
11389 * filelock.c (lock_file_1, lock_file):
11390 * xdisp.c (message_dolog):
11391 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11392 Use pMd etc. instead.
11393 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11394 replacing the pWIDE etc. symbols removed from editfns.c.
11395
11396 * keyboard.h (num_input_events): Now uintmax_t.
11397 This is (very slightly) less likely to mess up due to wraparound.
11398 All uses changed.
11399
11400 * buffer.c: Integer signedness fixes.
11401 (alloc_buffer_text, enlarge_buffer_text):
11402 Use ptrdiff_t rather than size_t when either will do, as we prefer
11403 signed integers.
11404
11405 * alloc.c: Integer signedness and overflow fixes.
11406 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11407 (__malloc_size_t): Default to size_t, not to int.
11408 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11409 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11410 Prefer ptrdiff_t to size_t when either would do, as we prefer
11411 signed integers.
11412 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11413 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11414 Now const. Initialize with values that are in range even if char
11415 is signed.
11416 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11417 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11418 These functions do the right thing with sizes > 2**32.
11419 (check_depth): Now ptrdiff_t, not int.
11420 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11421 Adjust to new way of storing sizes. Check for size overflow bugs
11422 in rest of code.
11423 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11424 slightly wrong anyway, as it missed one instance of
11425 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11426 (refill_memory_reserve): Omit needless cast to size_t.
11427 (mark_object_loop_halt): Mark as externally visible.
11428
11429 * xselect.c: Integer signedness and overflow fixes.
11430 (Fx_register_dnd_atom, x_handle_dnd_message):
11431 Use ptrdiff_t, not size_t, since we prefer signed.
11432 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11433 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11434 x_dnd_atoms_size and x_dnd_atoms_length.
11435
11436 * doprnt.c: Prefer signed to unsigned when either works.
11437 * eval.c (verror):
11438 * doprnt.c (doprnt):
11439 * lisp.h (doprnt):
11440 * xdisp.c (vmessage):
11441 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11442 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11443 prefer signed arithmetic to avoid comparison confusion.
11444 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11445 but is a bit tricky.
11446
11447 Assume freestanding C89 headers, string.h, stdlib.h.
11448 * data.c, doprnt.c, floatfns.c, print.c:
11449 Include float.h unconditionally.
11450 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11451 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11452 * regex.c: Likewise for stddef.h, string.h.
11453 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11454 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11455 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11456 (STDC_HEADERS): Remove obsolete defines.
11457 * sysdep.c: Include limits.h unconditionally.
11458
11459 Assume support for memcmp, memcpy, memmove, memset.
11460 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11461 * regex.c (memcmp, memcpy):
11462 Remove; we assume C89 now.
11463
11464 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11465 (__malloc_safe_bcopy): Remove; no longer needed.
11466
11467 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11468 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11469 well either way, and we prefer signed to unsigned.
11470
11471 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11472
11473 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11474 closes the connection while we're reading (bug#9182).
11475
11476 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11477
11478 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11479 are specified (Bug#9168).
11480
11481 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11482
11483 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11484 Found by GCC static checking and --with-wide-int on a 32-bit host.
11485
11486 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11487
11488 * xdisp.c (compute_display_string_pos): Fix logic of caching
11489 previous display string position. Initialize cached_prev_pos to
11490 -1. Fixes slow-down at the beginning of a buffer.
11491
11492 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11493
11494 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11495 for attrs[LFACE_FONTSET_INDEX].
11496
11497 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11498
11499 * xml.c (parse_region): Remove unused local
11500 that was recently introduced.
11501
11502 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11503
11504 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11505 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11506
11507 * xdisp.c (move_it_in_display_line_to): Record the best matching
11508 position for TO_CHARPOS while scanning the line, and restore it on
11509 exit if none of the characters scanned was an exact match.
11510 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11511 when exact match is impossible due to invisible text, and the
11512 lines are truncated.
11513
11514 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11515
11516 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11517 for OSX >= 10.7.
11518
11519 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11520
11521 Fix a significant slow-down of cursor motion with C-n, C-p,
11522 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11523 auto-repeat under bidi redisplay in fontified buffers.
11524 * xdisp.c (compute_stop_pos_backwards): New function.
11525 (next_element_from_buffer): Call compute_stop_pos_backwards to
11526 find a suitable prev_stop when we find ourselves before
11527 base_level_stop.
11528 (reseat): Don't look for prev_stop, as that could mean a very long
11529 run.
11530 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11531 <cached_disp_overlay_modiff>: Cache for last found display string
11532 position.
11533 (compute_display_string_pos): Return the cached position if asked
11534 about the same buffer in the same area of character positions, and
11535 the buffer wasn't changed since the time the display string
11536 position was cached.
11537
11538 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11539
11540 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11541 is an integer, which is important for empty lines. (Bug#9149)
11542
11543 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11544
11545 * frame.c (Fmodify_frame_parameters): In tty case, update the
11546 default face if necessary (Bug#4238).
11547
11548 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11549
11550 * editfns.c (Fstring_to_char): No need to explain what a character
11551 is in the docstring (Bug#6576).
11552
11553 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11554
11555 * xml.c (parse_region): Make sure we always return a tree.
11556
11557 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11558
11559 * xml.c (parse_region): If a document contains only comments,
11560 return that, too.
11561
11562 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11563
11564 * xml.c (make_dom): Return comments, too.
11565
11566 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11567
11568 Port to OpenBSD.
11569 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11570 and the surrounding thread.
11571 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11572 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11573 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11574 timer goes off.
11575 * s/openbsd.h (BROKEN_SIGIO): Define.
11576 * unexelf.c (unexec) [__OpenBSD__]:
11577 Don't update the .mdebug section of the Alpha COFF symbol table.
11578
11579 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11580
11581 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11582 (bug#8460).
11583
11584 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11585
11586 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11587 This fixes some race conditions on the permissions of any newly
11588 created file.
11589
11590 * alloc.c (valid_pointer_p): Use pipe, not open.
11591 This fixes some permissions issues when debugging.
11592
11593 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11594 If fchown fails to set both uid and gid, try to set just gid,
11595 as that is sometimes allowed. Adjust the file's mode to eliminate
11596 setuid or setgid bits that are inappropriate if fchown fails.
11597
11598 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11599
11600 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11601 to compare Lisp_Objects.
11602 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11603 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11604 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11605
11606 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11607
11608 * lread.c (read_integer): Unread even EOF character.
11609 (read1): Likewise. Properly record start position of symbol.
11610
11611 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11612 symbol character follows.
11613
11614 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11615
11616 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11617 This works around a problem with the previous change to Fcopy_file.
11618 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11619 and without this change, GCC might complain about discarding
11620 fchown's return value.
11621
11622 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11623
11624 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11625
11626 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11627
11628 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11629
11630 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11631
11632 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11633 it's used from the C level.
11634
11635 * process.c: Use the same condition for POLL_FOR_INPUT in both
11636 keyboard.c and process.c (bug#1858).
11637
11638 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11639
11640 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11641 (Fgnutls_boot): Use it.
11642
11643 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11644
11645 * doc.c (Fsubstitute_command_keys): Revert last change.
11646
11647 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11648
11649 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11650 quotes the next character, and doesn't affect other longer
11651 sequences (bug#8935).
11652
11653 * lread.c (syms_of_lread): Clarify that is isn't only
11654 `eval-buffer' and `eval-defun' that's affected by
11655 `lexical-binding' (bug#8460).
11656
11657 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11658
11659 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11660 bidi redisplay when a line includes both an image and is truncated.
11661
11662 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11663
11664 Fix minor problems found by static checking.
11665 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11666 (elsz): Now a signed constant, not a size_t var. We prefer signed
11667 types to unsigned, to avoid integer comparison confusion. Without
11668 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11669 "cannot optimize loop, the loop counter may overflow", a symptom
11670 of the confusion.
11671 * indent.c (Fvertical_motion): Mark locals as initialized.
11672 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11673
11674 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11675
11676 * search.c (Fre_search_backward): Mention `case-fold-search' in
11677 all the re_search_* functions (bug#8138).
11678
11679 * keyboard.c (Fopen_dribble_file): Document when the file is
11680 closed (bug#8056).
11681
11682 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11683
11684 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11685 bidi_cache_idx.
11686
11687 Support bidi reordering of display and overlay strings.
11688 * xdisp.c (compute_display_string_pos)
11689 (compute_display_string_end): Accept additional argument STRING.
11690 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11691 (reseat_to_string): Initialize bidi_it->string.s and
11692 bidi_it->string.schars.
11693 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11694 NULL (avoids a crash in bidi_paragraph_init).
11695 Initialize itb.string.lstring.
11696 (init_iterator): Call bidi_init_it only of a valid
11697 buffer position was specified. Initialize paragraph_embedding to
11698 L2R.
11699 (reseat_to_string): Initialize the bidi iterator.
11700 (display_string): If we need to ignore text properties of
11701 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11702 original value of -1 will not work with bidi.)
11703 (compute_display_string_pos): First arg is now struct
11704 `text_pos *'; all callers changed. Support display properties on
11705 Lisp strings.
11706 (compute_display_string_end): Support display properties on Lisp
11707 strings.
11708 (init_iterator, reseat_1, reseat_to_string): Initialize the
11709 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11710 when iterating on a string not from display properties).
11711 (compute_display_string_pos, compute_display_string_end):
11712 Fix calculation of the object to scan. Fixes an error when using
11713 arrow keys.
11714 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11715 base_level_stop; instead, set base_level_stop to BEGV.
11716 Fixes crashes in vertical-motion.
11717 (next_element_from_buffer): Improve commentary for when
11718 the iterator is before prev_stop.
11719 (init_iterator): Initialize bidi_p from the default value of
11720 bidi-display-reordering, not from buffer-local value. Use the
11721 buffer-local value only if initializing for buffer iteration.
11722 (handle_invisible_prop): Support invisible properties on strings
11723 that are being bidi-reordered.
11724 (set_iterator_to_next): Support bidi reordering of C strings and
11725 Lisp strings.
11726 (next_element_from_string): Support bidi reordering of Lisp
11727 strings.
11728 (handle_stop_backwards): Support Lisp strings as well.
11729 (display_string): Support display of R2L glyph rows.
11730 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11731 (init_iterator): Don't initialize it->bidi_p for strings
11732 here.
11733 (reseat_to_string): Initialize it->bidi_p for strings here.
11734 (next_element_from_string, next_element_from_c_string)
11735 (next_element_from_buffer): Add xassert's for correspondence
11736 between IT's object being iterated and it->bidi_it.string
11737 structure.
11738 (face_before_or_after_it_pos): Support bidi iteration.
11739 (next_element_from_c_string): Handle the case of the first string
11740 character that is not the first one in the visual order.
11741 (get_visually_first_element): New function, refactored from common
11742 parts of next_element_from_buffer, next_element_from_string, and
11743 next_element_from_c_string.
11744 (tool_bar_lines_needed, redisplay_tool_bar)
11745 (display_menu_bar): Force left-to-right direction. Add a FIXME
11746 comment for making that be controlled by a user option.
11747 (push_it, pop_it): Save and restore the state of the
11748 bidi iterator. Save and restore the bidi_p flag.
11749 (pop_it): Iterate out of display property for string iteration as
11750 well.
11751 (iterate_out_of_display_property): Support iteration over strings.
11752 (handle_single_display_spec): Set up it->bidi_it for iteration
11753 over a display string, and call bidi_init_it.
11754 (handle_single_display_spec, next_overlay_string)
11755 (get_overlay_strings_1, push_display_prop): Set up the bidi
11756 iterator for displaying display or overlay strings.
11757 (forward_to_next_line_start): Don't use the shortcut if
11758 bidi-iterating.
11759 (back_to_previous_visible_line_start): If handle_display_prop
11760 pushed the iterator stack, restore the internal state of the bidi
11761 iterator by calling bidi_pop_it same number of times.
11762 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11763 and we are bidi-iterating, don't decrement the iterator position;
11764 instead, set the first_elt flag in the bidi iterator, to produce
11765 the same effect.
11766 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11767 (push_display_prop): xassert that we are iterating a buffer.
11768 (push_it, pop_it): Save and restore paragraph_embedding member.
11769 (handle_single_display_spec, next_overlay_string)
11770 (get_overlay_strings_1, reseat_1, reseat_to_string)
11771 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11772 correctly. Don't assume unibyte strings are not bidi-reordered.
11773 (compute_display_string_pos)
11774 (compute_display_string_end): Fix handling the case of C string.
11775 (push_it, pop_it): Save and restore from_disp_prop_p.
11776 (handle_single_display_spec, push_display_prop): Set the
11777 from_disp_prop_p flag.
11778 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11779 (pop_it): Call iterate_out_of_display_property only if we are
11780 popping after iteration over a string that came from a display
11781 property. Fix a typo in popping stretch info. Add an assertion
11782 for verifying that the iterator position is in sync with the bidi
11783 iterator.
11784 (handle_single_display_spec, get_overlay_strings_1)
11785 (push_display_prop): Fix initialization of paragraph direction for
11786 string when that of the parent object is not yet determined.
11787 (reseat_1): Call bidi_init_it to resync the bidi
11788 iterator with IT's position. (Bug#7616)
11789 (find_row_edges): If ROW->start.pos gives position
11790 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11791 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11792 Reset the from_disp_prop_p flag.
11793 (SAVE_IT, RESTORE_IT): New macros.
11794 (pos_visible_p, face_before_or_after_it_pos)
11795 (back_to_previous_visible_line_start)
11796 (move_it_in_display_line_to, move_it_in_display_line)
11797 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11798 (try_scrolling, redisplay_window, display_line): Use them when
11799 saving a temporary copy of the iterator and restoring it back.
11800 (back_to_previous_visible_line_start, reseat_1)
11801 (init_iterator): Empty the bidi cache "stack".
11802 (move_it_in_display_line_to): If iterator ended up at
11803 EOL, but we never saw any buffer positions smaller than
11804 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11805 motion in bidi-reordered lines.
11806 (move_it_in_display_line_to): Record prev_method and prev_pos
11807 immediately before the call to set_iterator_to_next. Fixes cursor
11808 motion in bidi-reordered lines with stretch glyphs and strings
11809 displayed in margins. (Bug#8133) (Bug#8867)
11810 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11811 TO_CHARPOS.
11812 (pos_visible_p): Support positions in bidi-reordered lines.
11813 Save and restore bidi cache.
11814
11815 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11816 (bidi_paragraph_info): Delete unused struct.
11817 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11818 (bidi_cache_start): New variable.
11819 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11820 to zero.
11821 (bidi_cache_fetch_state, bidi_cache_search)
11822 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11823 (bidi_cache_find, bidi_peek_at_next_level)
11824 (bidi_level_of_next_char, bidi_find_other_level_edge)
11825 (bidi_move_to_visually_next): Compare cache index with
11826 bidi_cache_start rather than with zero.
11827 (bidi_fetch_char): Accept new argument STRING; all callers
11828 changed. Support iteration over a string. Support strings with
11829 display properties. Support unibyte strings. Fix the type of
11830 `len' according to what STRING_CHAR_AND_LENGTH expects.
11831 (bidi_paragraph_init, bidi_resolve_explicit_1)
11832 (bidi_resolve_explicit, bidi_resolve_weak)
11833 (bidi_level_of_next_char, bidi_move_to_visually_next):
11834 Support iteration over a string.
11835 (bidi_set_sor_type, bidi_resolve_explicit_1)
11836 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11837 can now be zero (for strings); special values 0 and -1 were
11838 changed to -1 and -2, respectively.
11839 (bidi_char_at_pos): New function.
11840 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11841 Call it instead of FETCH_MULTIBYTE_CHAR.
11842 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11843 initialized to valid values.
11844 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11845 values.
11846 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11847 the test for valid cached positions. Fix the logic for looking up
11848 the sentinel state in the cache. GCPRO the Lisp string we are
11849 iterating.
11850 (bidi_push_it, bidi_pop_it): New functions.
11851 (bidi_initialize): Initialize the bidi cache start stack pointer.
11852 (bidi_cache_ensure_space): New function, refactored from part of
11853 bidi_cache_iterator_state. Don't assume the required size is just
11854 one BIDI_CACHE_CHUNK away.
11855 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11856 (bidi_count_bytes, bidi_char_at_pos): New functions.
11857 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11858 always valid if bidi_cache_idx is valid.
11859 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11860 is valid if it's going to be used.
11861 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11862 (bidi_cache_fetch_state, bidi_cache_search)
11863 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11864 (bidi_cache_iterator_state, bidi_cache_find)
11865 (bidi_find_other_level_edge, bidi_cache_start_stack):
11866 All variables related to cache indices are now EMACS_INT.
11867
11868 * dispextern.h (struct bidi_string_data): New structure.
11869 (struct bidi_it): New member `string'. Make flag members be 1-bit
11870 fields, and put them last in the struct.
11871 (compute_display_string_pos, compute_display_string_end):
11872 Update prototypes.
11873 (bidi_push_it, bidi_pop_it): Add prototypes.
11874 (struct iterator_stack_entry): New members bidi_p,
11875 paragraph_embedding, and from_disp_prop_p.
11876 (struct it): Member bidi_p is now a bit field 1 bit wide.
11877 (bidi_shelve_cache, bidi_unshelve_cache):
11878 Declare prototypes.
11879
11880 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11881 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11882 and vector-like objects.
11883
11884 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11885 cache around display iteration.
11886
11887 * window.c (Fwindow_end, window_scroll_pixel_based)
11888 (displayed_window_lines, Frecenter): Save and restore the bidi
11889 cache around display iteration.
11890
11891 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11892
11893 * editfns.c (Fdelete_region): Clarify the use of the named
11894 parameters (bug#6788).
11895
11896 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11897
11898 * indent.c (Fvertical_motion): Set and restore w->pointm when
11899 saving and restoring the window's buffer (Bug#9006).
11900
11901 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11902
11903 * editfns.c (Fstring_to_char): Clarify just what is returned
11904 (bug#6576). Text by Eli Zaretskii.
11905
11906 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11907
11908 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11909
11910 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11911
11912 * buffer.c (mmap_find): Fix a typo.
11913
11914 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11915
11916 Fix execution of x selection hooks.
11917 * xselect.c (Qx_lost_selection_functions)
11918 (Qx_sent_selection_functions): New vars.
11919 (syms_of_xselect): DEFSYM them.
11920 (x_handle_selection_request): Pass Qx_sent_selection_functions
11921 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11922 (x_handle_selection_clear,x_clear_frame_selections):
11923 Pass Qx_lost_selection_functions rather than
11924 Vx_lost_selection_functions to Frun_hook_with_args.
11925
11926 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11927
11928 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11929 The old code sometimes used this field without initializing it.
11930
11931 * alloc.c (gc_sweep): Don't read past end of array.
11932 In theory, the old code could also have corrupted Emacs internals,
11933 though it'd be very unlikely.
11934
11935 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11936
11937 * character.c (Fcharacterp): Don't advertise optional ignored
11938 argument. (Bug#4026)
11939
11940 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11941
11942 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11943 key" (bug#4257).
11944
11945 * window.c (Fset_window_start): Doc fix (bug#4199).
11946 (Fset_window_hscroll): Ditto.
11947
11948 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11949
11950 Fix minor new problems caught by GCC 4.6.1.
11951 * term.c (init_tty): Remove unused local.
11952 * xsettings.c (store_monospaced_changed): Define this function only
11953 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11954 not used otherwise.
11955
11956 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11957
11958 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11959
11960 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11961
11962 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11963 are the mini-buffer and the echo area (bug#3320).
11964
11965 * term.c (init_tty): Remove support for supdup, c10 and perq
11966 terminals, which are no longer supported (bug#1482).
11967
11968 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11969
11970 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11971
11972 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11973
11974 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11975 for non-popups (Bug#3642).
11976
11977 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11978
11979 * alloc.c (reset_malloc_hooks): Protoize.
11980 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11981 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11982 * cm.c (losecursor): Likewise.
11983 * data.c (fmod): Likewise.
11984 * dispnew.c (swap_glyphs_in_rows): Likewise.
11985 * emacs.c (memory_warning_signal): Likewise.
11986 * floatfns.c (float_error): Likewise.
11987 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11988 (otf_open, font_otf_capability, generate_otf_features)
11989 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11990 Likewise.
11991 * image.c (pbm_read_file): Likewise.
11992 * indent.c (string_display_width): Likewise.
11993 * intervals.c (check_for_interval, search_for_interval)
11994 (inc_interval_count, count_intervals, root_interval)
11995 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11996 * lread.c (defalias): Likewise.
11997 * ralloc.c (r_alloc_check): Likewise.
11998 * regex.c (set_image_of_range_1, set_image_of_range)
11999 (regex_grow_registers): Likewise.
12000 * sysdep.c (strerror): Likewise.
12001 * termcap.c (valid_filename_p, tprint, main): Likewise.
12002 * tparam.c (main): Likewise.
12003 * unexhp9k800.c (run_time_remap, save_data_space)
12004 (update_file_ptrs, read_header, write_header, calculate_checksum)
12005 (copy_file, copy_rest, display_header): Likewise.
12006 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12007 Likewise.
12008 * xdisp.c (check_it): Likewise.
12009 * xfaces.c (register_color, unregister_color, unregister_colors):
12010 Likewise.
12011 * xfns.c (print_fontset_result): Likewise.
12012 * xrdb.c (member, fatal, main): Likewise.
12013
12014 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12015
12016 Fix minor problems found by static checking (Bug#9031).
12017 * chartab.c (char_table_set_range, map_sub_char_table):
12018 Remove unused locals.
12019 (uniprop_table): Now static.
12020 * composite.c (_work_char): Remove unused static var.
12021
12022 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12023
12024 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12025
12026 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12027
12028 * gtkutil.c (qttip_cb): Remove code without function.
12029
12030 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12031
12032 * w32.c (pthread_sigmask): New stub.
12033
12034 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12035
12036 Use pthread_sigmask, not sigprocmask (Bug#9010).
12037 sigprocmask is portable only for single-threaded applications, and
12038 Emacs can be multi-threaded when it uses GTK.
12039 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12040 (LIBES): Use it.
12041 * callproc.c (Fcall_process):
12042 * process.c (create_process):
12043 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12044 Use pthread_sigmask, not sigprocmask.
12045
12046 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12047
12048 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12049 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12050 wrong (Bug#8591).
12051
12052 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12053
12054 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12055 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12056 (xg_hide_tooltip): Fix comment.
12057
12058 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12059 in registerServicesMenuSendTypes.
12060 (validRequestorForSendType): Don't check ns_return_types.
12061
12062 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12063 ns_return_type.
12064
12065 2011-07-08 Jason Rumney <jasonr@gnu.org>
12066
12067 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12068 SH_SHOW for hidden windows (Bug#5482).
12069
12070 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12071 frame struct members of non-existent frames (Bug#6284).
12072
12073 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12074
12075 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12076 variable firstTime not needed on OSX >= 10.6.
12077 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12078 >= 10.5. Use setKnobProportion, setDoubleValue.
12079
12080 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12081 (MAC_OS_X_VERSION_10_5): Define if not defined.
12082 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12083 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12084 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12085
12086 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12087 cString and lossyCString on OSX >= 10.4.
12088
12089 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12090 sizeToFit on OSX >= 10.2.
12091
12092 * nsimage.m (allocInitFromFile): Don't use deprecated method
12093 bestRepresentationForDevice on OSX >= 10.6.
12094
12095 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12096 to avoid warning.
12097
12098 * emacs.c: Declare unexec_init_emacs_zone.
12099
12100 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12101
12102 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12103
12104 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12105 on svcsMenu (Bug#8842).
12106
12107 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12108 ns_return_types.
12109 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12110
12111 * nsterm.m (QUTF8_STRING): Declare.
12112 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12113 (validRequestorForSendType): Return type is (id).
12114 Change indexOfObjectIdenticalTo to indexOfObject.
12115 Check if we have local selection before returning self (Bug#8842).
12116 (writeSelectionToPasteboard): Put local selection into paste board
12117 if we have a local selection (Bug#8842).
12118 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12119
12120 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12121 (ns_get_local_selection): Declare.
12122
12123 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12124
12125 * keymap.c (describe_map_tree): Don't insert a double newline at
12126 the end of the buffer (bug#1169) and return whether we inserted
12127 something.
12128
12129 * callint.c (Fcall_interactively): Change "reading args" to
12130 "providing args" to try to clarify what it does (bug#1010).
12131
12132 2011-07-07 Kenichi Handa <handa@m17n.org>
12133
12134 * composite.c (composition_compute_stop_pos): Ignore a static
12135 composition starting before CHARPOS (Bug#8915).
12136
12137 * xdisp.c (handle_composition_prop): Likewise.
12138
12139 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12140
12141 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12142 (Bug#9015)
12143
12144 2011-07-07 Kenichi Handa <handa@m17n.org>
12145
12146 * character.h (unicode_category_t): New enum type.
12147
12148 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12149 (Qchar_code_property_table): New variable.
12150 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12151 (UNIPROP_COMPRESSED_FORM_P): New macros.
12152 (char_table_ascii): Uncompress the compressed values.
12153 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12154 Uncompress the compressed values.
12155 (sub_char_table_ref_and_range): Likewise.
12156 (char_table_ref_and_range): Uncompress the compressed values.
12157 (sub_char_table_set): New arg is_uniprop. Callers changed.
12158 Uncompress the compressed values.
12159 (sub_char_table_set_range): Args changed. Callers changed.
12160 (char_table_set_range): Adjuted for the above change.
12161 (map_sub_char_table): Delete args default_val and parent. Add arg
12162 top. Give decoded values to a Lisp function.
12163 (map_char_table): Adjust for the above change. Give decoded
12164 values to a Lisp function. Gcpro more variables.
12165 (uniprop_table_uncompress)
12166 (uniprop_decode_value_run_length): New functions.
12167 (uniprop_decoder, uniprop_decoder_count): New variables.
12168 (uniprop_get_decoder, uniprop_encode_value_character)
12169 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12170 New functions.
12171 (uniprop_encoder, uniprop_encoder_count): New variables.
12172 (uniprop_get_encoder, uniprop_table)
12173 (Funicode_property_table_internal, Fget_unicode_property_internal)
12174 (Fput_unicode_property_internal): New functions.
12175 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12176 Sunicode_property_table_internal, Sget_unicode_property_internal,
12177 and Sput_unicode_property_internal. Defvar_lisp
12178 char-code-property-alist.
12179
12180 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12181 Vunicode_category_table.
12182
12183 * font.c (font_range): Adjust for the change of
12184 Vunicode_category_table.
12185
12186 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12187
12188 * m/iris4d.h: Remove file, move contents ...
12189 * s/irix6-5.h: ... here.
12190
12191 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12192
12193 Remove unportable assumption about struct layout (Bug#8884).
12194 * alloc.c (mark_buffer):
12195 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12196 (clone_per_buffer_values): Don't assume that
12197 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12198 This isn't true in general, and it's particularly not true
12199 if Emacs is configured with --with-wide-int.
12200 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12201 New macros, used in the buffer.c change.
12202
12203 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12204
12205 * xsettings.c: Use both GConf and GSettings if both are available.
12206 (store_config_changed_event): Add comment.
12207 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12208 (store_tool_bar_style_changed): New functions.
12209 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12210 (struct xsettings): Move font inside HAVE_XFT.
12211 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12212 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12213 Move inside HAVE_XFT.
12214 (something_changed_gsettingsCB): Rename from something_changedCB.
12215 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12216 also.
12217 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12218 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12219 (something_changed_gconfCB): Rename from something_changedCB.
12220 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12221 (parse_settings): Move check for font inside HAVE_XFT.
12222 (read_settings, apply_xft_settings): Add comment.
12223 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12224 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12225 call store_font_name_changed.
12226 (xft_settings_event): Add comment.
12227 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12228 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12229 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12230 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12231 (xsettings_initialize): Call init_gsettings last.
12232 (xsettings_get_system_font, xsettings_get_system_normal_font):
12233 Add comment.
12234
12235 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12236
12237 Random fixes. E.g., (random) never returned negative values.
12238 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12239 subseconds part to the entropy, as that's a bit more random.
12240 Prefer signed to unsigned, since the signedness doesn't matter and
12241 in general we prefer signed. When given a limit, use a
12242 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12243 latter isn't right if USE_2_TAGS_FOR_INTS.
12244 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12245 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12246
12247 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12248
12249 * textprop.c (text_property_stickiness):
12250 Obey Vtext_property_default_nonsticky.
12251 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12252 * w32fns.c (syms_of_w32fns):
12253 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12254
12255 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12256
12257 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12258 This is more efficient than Ffile_directory_p and avoids a minor race.
12259
12260 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12261
12262 * buffer.c (Foverlay_put): Say what the return value is
12263 (bug#7835).
12264
12265 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12266 is a directory before asking whether to use the file name
12267 (bug#7564).
12268 (barf_or_query_if_file_exists): Make the "File is a directory"
12269 error be more correct.
12270
12271 * fns.c (Frequire): Remove the mention of the .gz files, since
12272 that's installation-specific, but keep the mention of
12273 `get-load-suffixes'.
12274
12275 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12276
12277 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12278 Report string overflow if the output is too long.
12279
12280 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12281
12282 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12283 (syms_of_gnutls): Remove duplicate DEFSYM for
12284 Qgnutls_bootprop_verify_hostname_error, an error for
12285 Qgnutls_bootprop_verify_error (which is no longer used).
12286
12287 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12288 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12289 Also (re)move comments that are misplaced or no longer relevant.
12290
12291 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12292
12293 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12294
12295 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12296
12297 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12298 and background color parameters if they have been changed.
12299
12300 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12301
12302 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12303
12304 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12305
12306 * xsettings.c (SYSTEM_FONT): Define only when used.
12307 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12308
12309 * keymap.c (access_keymap_1): Now static.
12310
12311 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12312
12313 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12314 leave any prefix arg for the up event (Bug#1586).
12315
12316 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12317
12318 * lread.c (syms_of_lread): Mention single symbols defined by
12319 `defvar' or `defconst' (bug#7154).
12320
12321 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12322 (Frequire): Mention get-load-suffixes.
12323
12324 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12325
12326 * window.h (window): Remove clone_number slot.
12327 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12328 Remove.
12329 (make_parent_window, make_window, saved_window)
12330 (Fset_window_configuration, save_window_save): Don't deal with
12331 clone numbers.
12332 * buffer.c (Qclone_number): Remove declaration.
12333 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12334
12335 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12336
12337 Add multiple inheritance to keymaps.
12338 * keymap.c (Fmake_composed_keymap): New function.
12339 (Fset_keymap_parent): Simplify.
12340 (fix_submap_inheritance): Remove.
12341 (access_keymap_1): New function extracted from access_keymap to handle
12342 embedded parents and handle lists of maps.
12343 (access_keymap): Use it.
12344 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12345 (Fcopy_keymap): Handle embedded parents.
12346 (Fcommand_remapping, define_as_prefix): Simplify.
12347 (Fkey_binding): Simplify.
12348 (syms_of_keymap): Move minibuffer-local-completion-map,
12349 minibuffer-local-filename-completion-map,
12350 minibuffer-local-must-match-map, and
12351 minibuffer-local-filename-must-match-map to Elisp.
12352 (syms_of_keymap): Defsubr make-composed-keymap.
12353 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12354 (parse_menu_item): Trivial simplification.
12355
12356 2011-07-01 Glenn Morris <rgm@gnu.org>
12357
12358 * Makefile.in (SETTINGS_LIBS): Fix typo.
12359
12360 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12361
12362 * coding.c (Fencode_coding_string): Record the last coding system
12363 used, as the function doc string says (bug#8738).
12364
12365 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12366
12367 * xsettings.c (store_monospaced_changed): Take new font as arg and
12368 check for change against current_mono_font.
12369 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12370 (emacs_settings_constructor, emacs_settings_get_property)
12371 (emacs_settings_set_property, emacs_settings_class_init)
12372 (emacs_settings_init, gsettings_obj): Remove.
12373 (something_changedCB): New function for HAVE_GSETTINGS.
12374 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12375 with value as argument.
12376 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12377 g_settings_new (Bug#8967). Do not create gsettings_obj.
12378 Remove calls to g_settings_bind. Connect something_changedCB to
12379 "changed".
12380
12381 * xgselect.c: Add defined (HAVE_GSETTINGS).
12382 (xgselect_initialize): Ditto.
12383
12384 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12385 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12386 xg_select.
12387
12388 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12389
12390 * eval.c (struct backtrace): Simplify and port the data structure.
12391 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12392 signed bit field, as this assumption is not portable and it makes
12393 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12394 "char debug_on_exit : 1" as this is not portable either; instead,
12395 use the portable "unsigned int debug_on_exit : 1". Remove unused
12396 member evalargs. Remove obsolete comments about cc bombing out.
12397
12398 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12399
12400 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12401 Let HAVE_GSETTINGS override HAVE_GCONF.
12402 (store_monospaced_changed): New function.
12403 (EMACS_SETTINGS): A new type derived from GObject to handle
12404 GSettings notifications.
12405 (emacs_settings_constructor, emacs_settings_get_property)
12406 (emacs_settings_set_property, emacs_settings_class_init):
12407 New functions.
12408 (gsettings_client, gsettings_obj): New variables.
12409 (GSETTINGS_SCHEMA): New define.
12410 (something_changedCB): Call store_monospaced_changed.
12411 (init_gsettings): New function.
12412 (xsettings_initialize): Call init_gsettings.
12413 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12414 to NULL.
12415
12416 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12417 GCONF_CFLAGS/LIBS.
12418
12419 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12420
12421 * window.c (resize_root_window, grow_mini_window)
12422 (shrink_mini_window): Rename Qresize_root_window to
12423 Qwindow_resize_root_window and Qresize_root_window_vertically to
12424 Qwindow_resize_root_window_vertically.
12425
12426 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12427
12428 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12429
12430 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12431
12432 * makefile.w32-in: Redesign dependencies so they reflect more
12433 clearly which files are directly included by each source file,
12434 and not through other includes.
12435
12436 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12437
12438 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12439 (sort_overlays, overlay_strings): When an overlay's clone number
12440 matches the window's clone number process the overlay even if
12441 the overlay's window property doesn't match the current window.
12442
12443 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12444 (Fwindow_hchild): Rename to Fwindow_left_child.
12445 (Fwindow_next): Rename to Fwindow_next_sibling.
12446 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12447 (resize_window_check): Rename to window_resize_check.
12448 (resize_window_apply): Rename to window_resize_apply.
12449 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12450 (Fdelete_other_windows_internal, resize_frame_windows)
12451 (Fsplit_window_internal, Fdelete_window_internal)
12452 (grow_mini_window, shrink_mini_window)
12453 (Fresize_mini_window_internal): Fix callers accordingly.
12454
12455 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12456
12457 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12458 (emacs_fixed_set_min_size): Remove.
12459 (emacs_fixed_new): Take frame as argument.
12460
12461 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12462 (_EmacsFixedPrivate): Remove minwidth/height.
12463 Add struct frame *f.
12464 (emacs_fixed_init): Initialize priv->f.
12465 (get_parent_class, emacs_fixed_set_min_size): Remove.
12466 (emacs_fixed_new): Set priv->f to argument.
12467 (emacs_fixed_get_preferred_width)
12468 (emacs_fixed_get_preferred_height): Use min_width/height from
12469 frames size_hint to set minimum and natural (Bug#8919).
12470 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12471 and use min_width/height from frames size_hint to set
12472 min_width/height (Bug#8919).
12473
12474 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12475 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12476 Fix indentation.
12477
12478 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12479
12480 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12481 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12482 called at ZV.
12483
12484 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12485
12486 * process.c (wait_reading_process_output): Bypass select if
12487 waiting for a cell while ignoring keyboard input, and input is
12488 pending. Suggested by Jan Djärv (Bug#8869).
12489
12490 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12491
12492 Use gnulib's dup2 module instead of rolling our own.
12493 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12494
12495 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12496
12497 * dispnew.c (scrolling_window): Before scrolling, turn off a
12498 mouse-highlight in the window being scrolled.
12499
12500 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12501
12502 Move DEFSYM to lisp.h and use everywhere.
12503
12504 * character.h (DEFSYM): Move declaration...
12505 * lisp.h (DEFSYM): ...here.
12506
12507 * gnutls.c:
12508 * minibuf.c:
12509 * w32menu.c:
12510 * w32proc.c:
12511 * w32select.c: Don't include character.h.
12512
12513 * alloc.c (syms_of_alloc):
12514 * buffer.c (syms_of_buffer):
12515 * bytecode.c (syms_of_bytecode):
12516 * callint.c (syms_of_callint):
12517 * casefiddle.c (syms_of_casefiddle):
12518 * casetab.c (init_casetab_once):
12519 * category.c (init_category_once, syms_of_category):
12520 * ccl.c (syms_of_ccl):
12521 * cmds.c (syms_of_cmds):
12522 * composite.c (syms_of_composite):
12523 * dbusbind.c (syms_of_dbusbind):
12524 * dired.c (syms_of_dired):
12525 * dispnew.c (syms_of_display):
12526 * doc.c (syms_of_doc):
12527 * editfns.c (syms_of_editfns):
12528 * emacs.c (syms_of_emacs):
12529 * eval.c (syms_of_eval):
12530 * fileio.c (syms_of_fileio):
12531 * fns.c (syms_of_fns):
12532 * frame.c (syms_of_frame):
12533 * fringe.c (syms_of_fringe):
12534 * insdel.c (syms_of_insdel):
12535 * keymap.c (syms_of_keymap):
12536 * lread.c (init_obarray, syms_of_lread):
12537 * macros.c (syms_of_macros):
12538 * msdos.c (syms_of_msdos):
12539 * print.c (syms_of_print):
12540 * process.c (syms_of_process):
12541 * search.c (syms_of_search):
12542 * sound.c (syms_of_sound):
12543 * syntax.c (init_syntax_once, syms_of_syntax):
12544 * terminal.c (syms_of_terminal):
12545 * textprop.c (syms_of_textprop):
12546 * undo.c (syms_of_undo):
12547 * w32.c (globals_of_w32):
12548 * window.c (syms_of_window):
12549 * xdisp.c (syms_of_xdisp):
12550 * xfaces.c (syms_of_xfaces):
12551 * xfns.c (syms_of_xfns):
12552 * xmenu.c (syms_of_xmenu):
12553 * xsettings.c (syms_of_xsettings):
12554 * xterm.c (syms_of_xterm): Use DEFSYM.
12555
12556 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12557
12558 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12559
12560 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12561
12562 Integer and buffer overflow fixes (Bug#8873).
12563
12564 * print.c (printchar, strout): Check for string overflow.
12565 (PRINTPREPARE, printchar, strout):
12566 Don't set size unless allocation succeeds.
12567
12568 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12569 for sizes. Check for string overflow more accurately.
12570 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12571
12572 * macros.c: Integer and buffer overflow fixes.
12573 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12574 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12575 Use ptrdiff_t, not int, for sizes.
12576 Don't increment bufsize until after realloc succeeds.
12577 Check for size-calculation overflow.
12578 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12579
12580 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12581
12582 * lread.c: Integer overflow fixes.
12583 (read_integer): Radix is now EMACS_INT, not int,
12584 to improve quality of diagnostics for out-of-range radices.
12585 Calculate buffer size correctly for out-of-range radices.
12586 (read1): Check for integer overflow in radices, and in
12587 read-circle numbers.
12588 (read_escape): Avoid int overflow.
12589 (Fload, openp, read_buffer_size, read1)
12590 (substitute_object_recurse, read_vector, read_list, map_obarray):
12591 Use ptrdiff_t, not int, for sizes.
12592 (read1): Use EMACS_INT, not int, for sizes.
12593 Check for size overflow.
12594
12595 * image.c (cache_image): Check for size arithmetic overflow.
12596
12597 * lread.c: Integer overflow issues.
12598 (saved_doc_string_size, saved_doc_string_length)
12599 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12600 Now ptrdiff_t, not int.
12601 (read1): Don't assume doc string length fits in int. Check for
12602 out-of-range doc string lengths.
12603 (read_list): Don't assume file position fits in int.
12604 (read_escape): Check for hex character overflow.
12605
12606 2011-06-22 Leo Liu <sdl.web@gmail.com>
12607
12608 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12609 Move to minibuffer.el.
12610
12611 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12612
12613 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12614 The following patches are for when GLYPH_DEBUG && !XASSERT.
12615 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12616 * dispnew.c (flush_stdout):
12617 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12618 Mark as externally visible.
12619 * dispnew.c (check_window_matrix_pointers): Now static.
12620 * dispnew.c (window_to_frame_vpos):
12621 * xfns.c (unwind_create_frame):
12622 * xterm.c (x_check_font): Remove unused local.
12623 * scroll.c (CHECK_BOUNDS):
12624 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12625 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12626 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12627 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12628 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12629 Now static.
12630 (debug_method_add): Use va_list and vsprintf rather than relying
12631 on undefined behavior with wrong number of arguments.
12632 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12633 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12634 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12635 since we're not interested in debugging glyphs with old libraries.
12636 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12637 GCC 4.6.0's static checking.
12638
12639 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12640
12641 Integer overflow and signedness fixes (Bug#8873).
12642 A few related buffer overrun fixes, too.
12643
12644 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12645
12646 * dispextern.h (struct face.stipple):
12647 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12648 (x_bitmap_mask, x_allocate_bitmap_record)
12649 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12650 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12651 (x_create_bitmap_from_xpm_data):
12652 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12653 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12654 (.bitmaps_last):
12655 * xfaces.c (load_pixmap):
12656 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12657 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12658 (.bitmaps_last, struct x_output.icon_bitmap):
12659 Use ptrdiff_t, not int, for bitmap indexes.
12660 (x_allocate_bitmap_record): Check for size overflow.
12661 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12662
12663 Use ptrdiff_t, not int, for overlay counts.
12664 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12665 * editfns.c (overlays_around, get_pos_property):
12666 * textprop.c (get_char_property_and_overlay):
12667 * xdisp.c (next_overlay_change, note_mouse_highlight):
12668 * xfaces.c (face_at_buffer_position):
12669 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12670 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12671 (Fnext_overlay_change, Fprevious_overlay_change)
12672 (mouse_face_overlay_overlaps, Foverlays_in):
12673 Use ptrdiff_t, not int, for sizes.
12674 (overlays_at, overlays_in): Check for size-calculation overflow.
12675
12676 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12677
12678 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12679 (x_session_initialize): Do not assume string length fits in int.
12680
12681 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12682 This is unlikely, but can occur if DPI is outlandish.
12683
12684 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12685 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12686
12687 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12688 * xrdb.c (magic_file_p, search_magic_path):
12689 Omit last arg SUFFIX; it was always 0. All callers changed.
12690 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12691
12692 * xfont.c (xfont_match): Avoid need for strlen.
12693
12694 * xfns.c: Don't assume strlen fits in int.
12695 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12696
12697 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12698 not unsigned long, as we prefer signed integers. All callers changed.
12699 Detect integer overflow in repeat count.
12700 (message_dolog): Don't assume print length fits in 39 bytes.
12701 (display_mode_element): Don't assume strlen fits in int.
12702
12703 * termcap.c: Don't assume sizes fit in int and never overflow.
12704 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12705 (gobble_line): Check for size-calculation overflow.
12706
12707 * minibuf.c (Fread_buffer):
12708 * lread.c (intern, intern_c_string):
12709 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12710 Don't assume string length fits in int.
12711
12712 * keyboard.c (parse_tool_bar_item):
12713 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12714
12715 * font.c: Don't assume string length fits in int.
12716 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12717 Use ptrdiff_t, not int.
12718 (font_intern_prop): Don't assume string length fits in int.
12719 Don't assume integer property fits in fixnum.
12720 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12721
12722 * filelock.c: Fix some buffer overrun and integer overflow issues.
12723 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12724 Reformulate so as not to need the command string.
12725 Invoke gzip -cd rather than gunzip, as it's more portable.
12726 (lock_info_type, lock_file_1, lock_file):
12727 Don't assume pid_t and time_t fit in unsigned long.
12728 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12729 (current_lock_owner): Prefer signed type for sizes.
12730 Use memcpy, not strncpy, where memcpy is what is really wanted.
12731 Don't assume (via atoi) that time_t and pid_t fit in int.
12732 Check for time_t and/or pid_t out of range, e.g., via a network share.
12733 Don't alloca where an auto var works fine.
12734
12735 * fileio.c: Fix some integer overflow issues.
12736 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12737 Don't assume string length fits in int.
12738 (directory_file_name): Don't assume string length fits in long.
12739 (make_temp_name): Don't assume pid fits in int, or that its print
12740 length is less than 20.
12741
12742 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12743
12744 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12745
12746 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12747
12748 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12749 We prefer signed integers, even for size calculations.
12750
12751 * emacs.c: Don't assume string length fits in 'int'.
12752 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12753 (main): Don't invoke strlen when not needed.
12754
12755 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12756 (XD_DEBUG_MESSAGE): Don't waste a byte.
12757
12758 * callproc.c (getenv_internal_1, getenv_internal)
12759 (Fgetenv_internal):
12760 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12761
12762 * lread.c (invalid_syntax): Omit length argument.
12763 All uses changed. This doesn't fix a bug, but it simplifies the
12764 code away from its former Hollerith-constant appearance, and it's
12765 one less 'int' to worry about when looking at integer-overflow issues.
12766 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12767
12768 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12769 This didn't break anything, but it didn't help either.
12770 It's confusing to put a bogus integer in a place where the actual
12771 value does not matter.
12772 (LIST_END_P): Remove unused macro and its bogus comment.
12773 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12774
12775 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12776 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12777 implementation.
12778 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12779 We prefer signed types, and the value cannot exceed the EMACS_INT
12780 range anyway (because otherwise the length would not be representable).
12781 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12782 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12783 This avoids a GCC warning when WIDE_EMACS_INT.
12784
12785 * indent.c (sane_tab_width): New function.
12786 (current_column, scan_for_column, Findent_to, position_indentation)
12787 (compute_motion): Use it. This is just for clarity.
12788 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12789
12790 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12791
12792 * lisp.h (lint_assume): New macro.
12793 * composite.c (composition_gstring_put_cache):
12794 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12795
12796 * editfns.c, insdel.c:
12797 Omit unnecessary forward decls, to simplify future changes.
12798
12799 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12800
12801 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12802
12803 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12804 Use much-faster test for byte-length change.
12805 Don't assume string byte-length fits in 'int'.
12806 Check that character arg fits in 'int'.
12807 (mapcar1): Declare byte as byte, for clarity.
12808
12809 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12810
12811 * fns.c (concat): Catch string overflow earlier.
12812 Do not rely on integer wraparound.
12813
12814 * dispextern.h (struct it.overlay_strings_charpos)
12815 (struct it.selective): Now EMACS_INT, not int.
12816 * xdisp.c (forward_to_next_line_start)
12817 (back_to_previous_visible_line_start)
12818 (reseat_at_next_visible_line_start, next_element_from_buffer):
12819 Don't arbitrarily truncate the value of 'selective' to int.
12820
12821 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12822
12823 * composite.c: Don't truncate sizes to 'int'.
12824 (composition_gstring_p, composition_reseat_it)
12825 (composition_adjust_point): Use EMACS_INT, not int.
12826 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12827 not EMACS_UINT, for indexes.
12828
12829 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12830
12831 * buffer.c: Include <verify.h>.
12832 (struct sortvec.priority, struct sortstr.priority):
12833 Now EMACS_INT, not int.
12834 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12835 (struct sortstr.size, record_overlay_string)
12836 (struct sortstrlist.size, struct sortlist.used):
12837 Don't truncate size to int.
12838 (record_overlay_string): Check for size-calculation overflow.
12839 (init_buffer_once): Check at compile-time, not run-time.
12840
12841 2011-06-22 Jim Meyering <meyering@redhat.com>
12842
12843 Don't leak an XBM-image-sized buffer
12844 * image.c (xbm_load): Free the image buffer after using it.
12845
12846 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12847
12848 Port to Sun C.
12849 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12850 that Sun C diagnosed.
12851 * fns.c (secure_hash): Fix pointer signedness issue.
12852 * intervals.c (static_offset_intervals): New function.
12853 (offset_intervals): Use it.
12854
12855 2011-06-21 Leo Liu <sdl.web@gmail.com>
12856
12857 * deps.mk (fns.o):
12858 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12859 sha512.h.
12860
12861 * fns.c (secure_hash): Rename from crypto_hash_function and change
12862 the first arg to accept symbols.
12863 (Fsecure_hash): New primitive.
12864 (syms_of_fns): New symbols.
12865
12866 2011-06-20 Deniz Dogan <deniz@dogan.se>
12867
12868 * process.c (Fset_process_buffer): Clarify return value in
12869 docstring.
12870
12871 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12872
12873 * dispnew.c (add_window_display_history): Use BVAR.
12874
12875 * xdisp.c (debug_method_add): Use BVAR.
12876 (check_window_end, dump_glyph_matrix, dump_glyph)
12877 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12878
12879 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12880 Likewise.
12881
12882 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12883 check till after the cache is created in init_frame_faces.
12884
12885 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12886
12887 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12888
12889 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12890
12891 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12892 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12893 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12894
12895 Improve buffer-overflow checking (Bug#8873).
12896 * fileio.c (Finsert_file_contents):
12897 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12898 Remove the old (too-loose) buffer overflow checks.
12899 They weren't needed, since make_gap checks for buffer overflow.
12900 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12901 The old code merely checked for Emacs fixnum overflow, and relied
12902 on undefined (wraparound) behavior. The new code avoids undefined
12903 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12904
12905 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12906 Tune. Don't use wider integers than needed. Don't use alloca.
12907 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12908
12909 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12910
12911 * insdel.c, lisp.h (buffer_overflow): New function.
12912 (insert_from_buffer_1, replace_range, replace_range_2):
12913 * insdel.c (make_gap_larger):
12914 * editfns.c (Finsert_char):
12915 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12916
12917 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12918
12919 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12920
12921 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12922
12923 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12924 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12925
12926 * fileio.c: Don't assume EMACS_INT fits in off_t.
12927 (emacs_lseek): New static function.
12928 (Finsert_file_contents, Fwrite_region): Use it.
12929 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12930
12931 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12932
12933 * fns.c: Don't overflow int when computing a list length.
12934 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12935 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12936 truncation on 64-bit hosts. Check for QUIT every
12937 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12938 faster and is responsive enough.
12939 (Flength): Report an error instead of overflowing an integer.
12940 (Fsafe_length): Return a float if the value is not representable
12941 as a fixnum. This shouldn't happen except in contrived situations.
12942 (Fnthcdr, Fsort): Don't assume list length fits in int.
12943 (Fcopy_sequence): Don't assume vector length fits in int.
12944
12945 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12946 (header_size, word_size): New constants.
12947 (allocate_vectorlike): Don't check size overflow here.
12948 (allocate_vector): Check it here instead, since this is the only
12949 caller of allocate_vectorlike that could cause overflow.
12950 Check that the new vector's length is representable as a fixnum.
12951
12952 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12953 The previous code was bogus. For example, next_almost_prime (32)
12954 returned 39, which is undesirable as it is a multiple of 3; and
12955 next_almost_prime (24) returned 25, which is a multiple of 5 so
12956 why was the code bothering to check for multiples of 7?
12957
12958 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12959
12960 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12961
12962 Variadic C functions now count arguments with ptrdiff_t.
12963 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12964 Back then I didn't know that the Emacs coding style prefers signed int.
12965 Also, in the meantime I found a few more instances where arguments
12966 were being counted with int, which may truncate counts on 64-bit
12967 machines, or EMACS_INT, which may be unnecessarily wide.
12968 * lisp.h (struct Lisp_Subr.function.aMANY)
12969 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12970 Arg counts are now ptrdiff_t, not size_t.
12971 All variadic functions and their callers changed accordingly.
12972 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12973 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12974 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12975 * callint.c (Fcall_interactively): Check arg count for overflow,
12976 to avoid potential buffer overrun. Use signed char, not 'int',
12977 for 'varies' array, so that we needn't bother to check its size
12978 calculation for overflow.
12979 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12980 * eval.c (apply_lambda):
12981 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12982 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12983 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12984
12985 * callint.c (Fcall_interactively): Don't use index var as event count.
12986
12987 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12988 * mem-limits.h (SIZE): Remove; no longer used.
12989
12990 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12991
12992 Remove unnecessary casts.
12993 * xterm.c (x_term_init):
12994 * xfns.c (x_set_border_pixel):
12995 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12996 These aren't needed now that we assume ANSI C.
12997
12998 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12999 It's more likely to cause problems (due to unsigned overflow)
13000 than to cure them.
13001
13002 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13003
13004 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13005
13006 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13007
13008 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13009
13010 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13011
13012 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13013
13014 GLYPH_CODE_FACE returns EMACS_INT, not int.
13015 * dispextern.h (merge_faces):
13016 * xfaces.c (merge_faces):
13017 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13018 Don't assume EMACS_INT fits in int.
13019
13020 * character.h (CHAR_VALID_P): Remove unused parameter.
13021 * fontset.c, lisp.h, xdisp.c: All uses changed.
13022
13023 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13024
13025 * fns.c (concat): Minor tuning based on overflow analysis.
13026 This doesn't fix any bugs. Use int to hold character, instead
13027 of constantly refetching from Emacs object. Use XFASTINT, not
13028 XINT, for value known to be a character. Don't bother comparing
13029 a single byte to 0400, as it's always less.
13030
13031 * floatfns.c (Fexpt):
13032 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13033
13034 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13035 for characters.
13036
13037 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13038
13039 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13040 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13041 incorrectly succeed when S was a string, because 4294967386 was
13042 truncated before it was used.
13043
13044 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13045 Otherwise, an out-of-range integer could cause undefined behavior
13046 on a 64-bit host.
13047
13048 * composite.c: Use int, not EMACS_INT, for characters.
13049 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13050 EMACS_INT, for values that are known to be in character range.
13051 This doesn't fix any bugs but is the usual style inside Emacs and
13052 may generate better code on 32-bit machines.
13053
13054 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13055 This is for reasons similar to the recent CHAR_STRING fix.
13056 * charset.c (Fencode_char): Check that character arg is actually
13057 a character. Pass an int to ENCODE_CHAR.
13058 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13059 wider than 'int', as a compile-time check to prevent future regressions
13060 in this area.
13061
13062 * character.c (char_string): Remove unnecessary casts.
13063
13064 Make sure a 64-bit char is never passed to CHAR_STRING.
13065 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13066 by silently ignoring the top 32 bits, allowing some values
13067 that were far too large to be valid characters.
13068 * character.h: Include <verify.h>.
13069 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13070 arguments are no wider than unsigned, as a compile-time check
13071 to prevent future regressions in this area.
13072 * data.c (Faset):
13073 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13074 (Fsubst_char_in_region):
13075 * fns.c (concat):
13076 * xdisp.c (decode_mode_spec_coding):
13077 Adjust to CHAR_STRING's new requirement.
13078 * editfns.c (Finsert_char, Fsubst_char_in_region):
13079 * fns.c (concat): Check that character args are actually
13080 characters. Without this test, these functions did the wrong
13081 thing with wildly out-of-range values on 64-bit hosts.
13082
13083 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13084 These casts should not be needed on 32-bit hosts, either.
13085 * keyboard.c (read_char):
13086 * lread.c (Fload): Remove casts to unsigned.
13087
13088 * lisp.h (UNSIGNED_CMP): New macro.
13089 This fixes comparison bugs on 64-bit hosts.
13090 (ASCII_CHAR_P): Use it.
13091 * casefiddle.c (casify_object):
13092 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13093 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13094 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13095 * dispextern.h (FACE_FROM_ID):
13096 * keyboard.c (read_char): Use UNSIGNED_CMP.
13097
13098 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13099 not to EMACS_INT, to avoid GCC warning.
13100
13101 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13102
13103 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13104 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13105 isn't needed on 32-bit machines.
13106
13107 * buffer.c (Fgenerate_new_buffer_name):
13108 Use EMACS_INT for count, not int.
13109 (advance_to_char_boundary): Return EMACS_INT, not int.
13110
13111 * data.c (Qcompiled_function): Now static.
13112
13113 * window.c (window_body_lines): Now static.
13114
13115 * image.c (gif_load): Rename local to avoid shadowing.
13116
13117 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13118 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13119 * alloc.c (make_save_value): Integer argument is now of type
13120 ptrdiff_t, not int.
13121 (mark_object): Use ptrdiff_t, not int.
13122 * lisp.h (pD): New macro.
13123 * print.c (print_object): Use it.
13124
13125 * alloc.c: Use EMACS_INT, not int, to count objects.
13126 (total_conses, total_markers, total_symbols, total_vector_size)
13127 (total_free_conses, total_free_markers, total_free_symbols)
13128 (total_free_floats, total_floats, total_free_intervals)
13129 (total_intervals, total_strings, total_free_strings):
13130 Now EMACS_INT, not int. All uses changed.
13131 (Fgarbage_collect): Compute overall total using a double, so that
13132 integer overflow is less likely to be a problem. Check for overflow
13133 when converting back to an integer.
13134 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13135 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13136 These were 'int' variables that could overflow on 64-bit hosts;
13137 they were never used, so remove them instead of repairing them.
13138 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13139 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13140 Previously, this ceilinged at INT_MAX, but that doesn't work on
13141 64-bit machines.
13142 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13143
13144 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13145 (allocate_vectorlike): Check for ptrdiff_t overflow.
13146 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13147 when a (possibly-narrower) signed value would do just as well.
13148 We prefer using signed arithmetic, to avoid comparison confusion.
13149
13150 * alloc.c: Catch some string size overflows that we were missing.
13151 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13152 for convenience in STRING_BYTES_MAX.
13153 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13154 The definition here is exact; the one in lisp.h was approximate.
13155 (allocate_string_data): Check for string overflow. This catches
13156 some instances we weren't catching before. Also, it catches
13157 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13158 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13159 and ptrdiff_t and EMACS_INT are both 64 bits.
13160
13161 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13162 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13163 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13164
13165 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13166
13167 * alloc.c (Fmake_string): Check for out-of-range init.
13168
13169 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13170
13171 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13172
13173 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13174
13175 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13176 xg_get_default_scrollbar_width.
13177
13178 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13179 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13180 (style_changed_cb): Call update_theme_scrollbar_width and call
13181 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13182 all frames (Bug#8505).
13183 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13184 Call gtk_window_set_resizable if HAVE_GTK3.
13185 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13186 and height if HAVE_GTK3 (Bug#8505).
13187 (scroll_bar_width_for_theme): New variable.
13188 (update_theme_scrollbar_width): New function.
13189 (xg_get_default_scrollbar_width): Move code to
13190 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13191 (xg_initialize): Call update_theme_scrollbar_width.
13192
13193 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13194
13195 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13196
13197 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13198
13199 * frame.c (make_frame): Call other_buffer_safely instead of
13200 other_buffer.
13201
13202 * window.c (temp_output_buffer_show): Call display_buffer with
13203 second argument Vtemp_buffer_show_specifiers and reset latter
13204 immediately after the call.
13205 (Vtemp_buffer_show_specifiers): New variable.
13206 (auto_window_vscroll_p, next_screen_context_lines)
13207 (Vscroll_preserve_screen_position): Remove leading asterisks from
13208 doc-strings.
13209
13210 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13211
13212 Fix minor problems found by GCC 4.6.0 static checking.
13213 * buffer.c (Qclone_number): Remove for now, as it's unused.
13214 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13215 (record_buffer): Remove unused local.
13216 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13217 (set_frame_buffer_list): Remove; unused.
13218 * frame.h (other_visible_frames): Remove decl.
13219 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13220 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13221 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13222 if HAVE_GPM.
13223 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13224 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13225 Define only if HAVE_GPM.
13226 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13227 (update_hints_inhibit): Remove; never set. All uses removed.
13228 * widgetprv.h (emacsFrameClassRec): Remove decl.
13229 * window.c (delete_deletable_window): Now returns void, since it
13230 wasn't returning anything.
13231 (compare_window_configurations): Remove unused locals.
13232 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13233 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13234 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13235 the same widths as pointers. This follows up on the 2011-05-06 patch.
13236 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13237 * xterm.h: Likewise.
13238 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13239
13240 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13241
13242 * makefile.w32-in: Update dependencies.
13243 (LISP_H): Add lib/intprops.h.
13244
13245 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13246
13247 * image.c (gif_load): Add animation frame delay to the metadata.
13248 (syms_of_image): Use DEFSYM. New symbol `delay'.
13249
13250 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13251
13252 * window.c (delete_deletable_window): Re-add.
13253 (Fset_window_configuration): Rewrite to handle dead buffers and
13254 consequently deletable windows.
13255 (window_tree, Fwindow_tree): Remove. Supply functionality in
13256 window.el.
13257 (compare_window_configurations): Simplify code.
13258
13259 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13260
13261 * image.c (imagemagick_load_image): Fix type mismatch.
13262 (Fimagemagick_types): Likewise.
13263
13264 * window.h (replace_buffer_in_windows): Declare.
13265
13266 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13267
13268 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13269 Qclone_number. Remove external declaration of Qdelete_window.
13270 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13271 code.
13272 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13273 Run Qbuffer_list_update_hook if allowed.
13274 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13275 buffer list implementation.
13276 (other_buffer_safely): New function.
13277 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13278 calls to replace_buffer_in_windows and
13279 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13280 if allowed.
13281 (record_buffer): Inhibit quitting and rewrite using quittable
13282 functions. Run Qbuffer_list_update_hook if allowed.
13283 (Frecord_buffer, Funrecord_buffer): New functions.
13284 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13285 Move switch-to-buffer to window.el.
13286 (bury-buffer): Move to window.el.
13287 (Vbuffer_list_update_hook): New variable.
13288
13289 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13290 section.
13291
13292 * window.h (resize_frame_windows): Move up in code.
13293 (Fwindow_frame): Remove EXFUN.
13294 (replace_buffer_in_all_windows): Remove prototype.
13295 (replace_buffer_in_windows_safely): Add prototype.
13296
13297 * window.c: Declare Qdelete_window static again. Move down
13298 declaration of select_count.
13299 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13300 (Fother_window): Move to window.el.
13301 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13302 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13303 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13304 window.el.
13305 (replace_buffer_in_windows): Implement by calling
13306 Qreplace_buffer_in_windows.
13307 (replace_buffer_in_all_windows): Remove with some functionality
13308 moved into replace_buffer_in_windows_safely.
13309 (replace_buffer_in_windows_safely): New function.
13310 (select_window_norecord, select_frame_norecord): Move in front
13311 of run_window_configuration_change_hook. Remove now obsolete
13312 declarations.
13313 (Fset_window_buffer): Rewrite doc-string.
13314 Call Qrecord_window_buffer.
13315 (keys_of_window): Move binding for other-window to window.el.
13316
13317 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13318
13319 * dispextern.h (struct image): Replace data member, whose int_val
13320 and ptr_val fields were not used by anything, with a single
13321 lisp_val object.
13322
13323 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13324 (gif_clear_image, gif_load, imagemagick_load_image)
13325 (gs_clear_image, gs_load): Callers changed.
13326
13327 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13328
13329 * buffer.h: Include <time.h>, for time_t.
13330 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13331
13332 Fix minor problems found by static checking.
13333
13334 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13335
13336 Make identifiers static if they are not used in other modules.
13337 * data.c (Qcompiled_function, Qframe, Qvector):
13338 * image.c (QimageMagick, Qsvg):
13339 * minibuf.c (Qmetadata):
13340 * window.c (resize_window_check, resize_root_window): Now static.
13341 * window.h (resize_window_check, resize_root_window): Remove decls.
13342
13343 * window.c (window_deletion_count, delete_deletable_window):
13344 Remove; unused.
13345 (window_body_lines): Now static.
13346 (Fdelete_other_windows_internal): Mark vars as initialized.
13347 Make sure 'resize_failed' is initialized.
13348 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13349 (resize_window_apply): Remove unused local.
13350 * window.h (delete_deletable_window): Remove decl.
13351
13352 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13353 (imagemagick_load_image): Fix pointer signedness problem by changing
13354 last arg from unsigned char * to char *. All uses changed.
13355 Also, fix a local for similar reasons.
13356 Remove unused locals. Remove locals to avoid shadowing.
13357 (fn_rsvg_handle_free): Remove; unused.
13358 (svg_load, svg_load_image): Fix pointer signedness problem.
13359 (imagemagick_load_image): Don't use garbage pointer image_wand.
13360
13361 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13362
13363 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13364
13365 * image.c (gif_load): Fix omitted cast error introduced by
13366 2011-06-06 change.
13367
13368 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13369
13370 * window.h (resize_proportionally, orig_total_lines)
13371 (orig_top_line): Remove from window structure.
13372 (set_window_height, set_window_width, change_window_heights)
13373 (Fdelete_window): Remove prototypes.
13374 (resize_frame_windows): Remove duplicate declaration.
13375
13376 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13377
13378 * window.h (resize_frame_windows, resize_window_check)
13379 (delete_deletable_window, resize_root_window)
13380 (resize_frame_windows): Declare prototypes.
13381
13382 * window.c (resize_window_apply): Make definition be "static" to
13383 match the prototype.
13384
13385 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13386
13387 * window.c: Remove declarations of Qwindow_size_fixed,
13388 window_min_size_1, window_min_size_2, window_min_size,
13389 size_window, window_fixed_size_p, enlarge_window, delete_window.
13390 Remove static from declaration of Qdelete_window, it's
13391 temporarily needed by Fbury_buffer.
13392 (replace_window): Don't assign orig_top_line and
13393 orig_total_lines.
13394 (Fdelete_window, delete_window): Remove. Window deletion is
13395 handled by window.el.
13396 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13397 Replace Fdelete_window calls with calls to Qdelete_window.
13398 (Fdelete_other_windows): Remove. Deleting other windows is
13399 handled by window.el.
13400 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13401 handled in window.el.
13402 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13403 Window minimum sizes are handled in window.el.
13404 (shrink_windows, size_window, set_window_height)
13405 (set_window_width, change_window_heights, window_height)
13406 (window_width, CURBEG, CURSIZE, enlarge_window)
13407 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13408 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13409 handled in window.el.
13410 (make_dummy_parent): Rename to make_parent_window and give it a
13411 second argument horflag.
13412 (make_window): Don't set resize_proportionally any more.
13413 (Fsplit_window): Remove. Windows are split in window.el.
13414 (save_restore_action, save_restore_orig_size)
13415 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13416 Resize mini windows in window.el.
13417 (grow_mini_window, shrink_mini_window): Implement by calling
13418 Qresize_root_window_vertically, resize_window_check and
13419 resize_window_apply.
13420 (saved_window, Fset_window_configuration, save_window_save):
13421 Do not handle orig_top_line, orig_total_lines, and
13422 resize_proportionally.
13423 (window_min_height, window_min_width): Move to window.el.
13424 (keys_of_window): Move bindings for delete-other-windows,
13425 split-window, delete-window and enlarge-window to window.el.
13426
13427 * buffer.c: Temporarily extern Qdelete_window.
13428 (Fbury_buffer): Temporarily call Qdelete_window instead of
13429 Fdelete_window (Fbury_buffer will move to window.el soon).
13430
13431 * frame.c (set_menu_bar_lines_1): Remove code handling
13432 orig_top_line and orig_total_lines.
13433
13434 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13435 set_window_height but set heights directly.
13436 (change_frame_size_1): Use resize_frame_windows.
13437
13438 * xdisp.c (init_xdisp): Don't use set_window_height but set
13439 heights directly.
13440
13441 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13442 Use resize_frame_windows instead of change_window_heights and run
13443 run_window_configuration_change_hook.
13444
13445 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13446 instead of change_window_heights and run
13447 run_window_configuration_change_hook.
13448
13449 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13450
13451 * window.c (replace_window): Rename second argument REPLACEMENT to
13452 NEW. New third argument SETFLAG. Rewrite.
13453 (delete_window, make_dummy_parent): Call replace_window with
13454 third argument 1.
13455 (window_list_1): Move down in code.
13456 (run_window_configuration_change_hook): Move set_buffer part
13457 before select_frame_norecord part in order to unwind correctly.
13458 Rename count1 to count.
13459 (recombine_windows, delete_deletable_window, resize_root_window)
13460 (Fdelete_other_windows_internal)
13461 (Frun_window_configuration_change_hook, make_parent_window)
13462 (resize_window_check, resize_window_apply, Fresize_window_apply)
13463 (resize_frame_windows, Fsplit_window_internal)
13464 (Fdelete_window_internal, Fresize_mini_window_internal):
13465 New functions.
13466 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13467
13468 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13469
13470 * window.h (window): Add some new members to window structure -
13471 normal_lines, normal_cols, new_total, new_normal, clone_number,
13472 splits, nest, prev_buffers, next_buffers.
13473 (WINDOW_TOTAL_SIZE): Move here from window.c.
13474 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13475
13476 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13477 Remove.
13478 (make_dummy_parent): Set new members of windows structure.
13479 (make_window): Move down in code. Handle new members of window
13480 structure.
13481 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13482 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13483 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13484 (Fset_window_prev_buffers, Fwindow_next_buffers)
13485 (Fset_window_next_buffers, Fset_window_clone_number):
13486 New functions.
13487 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13488 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13489 Doc-string fixes.
13490 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13491 Argument WINDOW can be now internal window too.
13492 (Fwindow_use_time): Move up in code.
13493 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13494 Rewrite doc-string.
13495 (Fset_window_configuration, saved_window)
13496 (Fcurrent_window_configuration, save_window_save): Handle new
13497 members of window structure.
13498 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13499 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13500 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13501 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13502 Qget_mru_window, Qresize_root_window,
13503 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13504 Qauto_buffer_name; staticpro them.
13505
13506 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13507
13508 * window.c (Fwindow_total_size, Fwindow_left_column)
13509 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13510 (Fwindow_list_1): New functions.
13511 (window_box_text_cols): Replace with window_body_cols.
13512 (Fwindow_width, Fscroll_left, Fscroll_right):
13513 Use window_body_cols instead of window_box_text_cols.
13514 (delete_window, Fset_window_configuration):
13515 Call delete_all_subwindows with window as argument.
13516 (delete_all_subwindows): Take a window as argument and not a
13517 structure. Rewrite.
13518 (window_loop): Remove handling of GET_LRU_WINDOW and
13519 GET_LARGEST_WINDOW.
13520 (Fget_lru_window, Fget_largest_window): Move to window.el.
13521
13522 * window.h: Extern window_body_cols instead of
13523 window_box_text_cols. delete_all_subwindows now takes a
13524 Lisp_Object as argument.
13525
13526 * indent.c (compute_motion, Fcompute_motion):
13527 Use window_body_cols instead of window_box_text_cols.
13528
13529 * frame.c (delete_frame): Call delete_all_subwindows with root
13530 window as argument.
13531
13532 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13533
13534 * fns.c (Fputhash): Document return value.
13535
13536 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13537
13538 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13539
13540 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13541
13542 Cons<->int and similar integer overflow fixes (Bug#8794).
13543
13544 Check for overflow when converting integer to cons and back.
13545 * charset.c (Fdefine_charset_internal, Fdecode_char):
13546 Use cons_to_unsigned to catch overflow.
13547 (Fencode_char): Use INTEGER_TO_CONS.
13548 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13549 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13550 * data.c (long_to_cons, cons_to_long): Remove.
13551 (cons_to_unsigned, cons_to_signed): New functions.
13552 These signal an error for invalid or out-of-range values.
13553 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13554 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13555 * font.c (Ffont_variation_glyphs):
13556 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13557 * lisp.h: Include <intprops.h>.
13558 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13559 (cons_to_signed, cons_to_unsigned): New decls.
13560 (long_to_cons, cons_to_long): Remove decls.
13561 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13562 (Fprimitive_undo): Use CONS_TO_INTEGER.
13563 * xfns.c (Fx_window_property): Likewise.
13564 * xselect.c: Include <limits.h>.
13565 (x_own_selection, selection_data_to_lisp_data):
13566 Use INTEGER_TO_CONS.
13567 (x_handle_selection_request, x_handle_selection_clear)
13568 (x_get_foreign_selection, Fx_disown_selection_internal)
13569 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13570 (lisp_data_to_selection_data): Use cons_to_unsigned.
13571 (x_fill_property_data): Use cons_to_signed.
13572 Report values out of range.
13573
13574 Check for buffer and string overflow more precisely.
13575 * buffer.h (BUF_BYTES_MAX): New macro.
13576 * lisp.h (STRING_BYTES_MAX): New macro.
13577 * alloc.c (Fmake_string):
13578 * character.c (string_escape_byte8):
13579 * coding.c (coding_alloc_by_realloc):
13580 * doprnt.c (doprnt):
13581 * editfns.c (Fformat):
13582 * eval.c (verror):
13583 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13584 since they may not be the same number.
13585 * editfns.c (Finsert_char):
13586 * fileio.c (Finsert_file_contents):
13587 Likewise for BUF_BYTES_MAX.
13588
13589 * image.c: Use ptrdiff_t, not int, for sizes.
13590 (slurp_file): Switch from int to ptrdiff_t.
13591 All uses changed.
13592 (slurp_file): Check that file size fits in both size_t (for
13593 malloc) and ptrdiff_t (for sanity and safety).
13594
13595 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13596 if b->modtime has its maximal value.
13597
13598 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13599
13600 Don't assume time_t can fit into int.
13601 * buffer.h (struct buffer.modtime): Now time_t, not int.
13602 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13603 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13604
13605 Minor fixes for signed vs unsigned integers.
13606 * character.h (MAYBE_UNIFY_CHAR):
13607 * charset.c (maybe_unify_char):
13608 * keyboard.c (read_char, reorder_modifiers):
13609 XINT -> XFASTINT, since the integer must be nonnegative.
13610 * ftfont.c (ftfont_spec_pattern):
13611 * keymap.c (access_keymap, silly_event_symbol_error):
13612 XUINT -> XFASTINT, since the integer must be nonnegative.
13613 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13614 since it makes no difference and we prefer signed.
13615 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13616 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13617 nonnegative.
13618
13619 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13620
13621 * window.h (Fwindow_frame): Declare.
13622
13623 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13624
13625 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13626 (SPARE_MEMORY): Always define.
13627 (LARGE_REQUEST): Remove.
13628 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13629
13630 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13631
13632 * lisp.h: Move EXFUNS for Fframe_root_window,
13633 Fframe_first_window and Fset_frame_selected_window to window.h.
13634
13635 * window.h: Move EXFUNS for Fframe_root_window,
13636 Fframe_first_window and Fset_frame_selected_window here from
13637 lisp.h.
13638
13639 * frame.c (Fwindow_frame, Fframe_first_window)
13640 (Fframe_root_window, Fframe_selected_window)
13641 (Fset_frame_selected_window): Move to window.c.
13642 (Factive_minibuffer_window): Move to minibuf.c.
13643 (Fother_visible_frames_p): New function.
13644
13645 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13646
13647 * window.c (decode_window, decode_any_window): Move up in code.
13648 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13649 (inhibit_frame_unsplittable): Remove unused variable.
13650 (Fwindow_buffer): Move up and rewrite doc-string.
13651 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13652 (Fwindow_prev): New functions.
13653 (Fwindow_frame): Move here from frame.c. Accept any window as
13654 argument.
13655 (Fframe_root_window, Fframe_first_window)
13656 (Fframe_selected_window): Move here from frame.c. Accept frame
13657 or arbitrary window as argument. Update doc-strings.
13658 (Fminibuffer_window): Move up in code.
13659 (Fwindow_minibuffer_p): Move up in code and simplify.
13660 (Fset_frame_selected_window): Move here from frame.c.
13661 Marginal rewrite.
13662 (Fselected_window, select_window, Fselect_window): Move up in
13663 code. Minor doc-string fixes.
13664
13665 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13666
13667 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13668 Do not assume that spare memory exists; that assumption is valid
13669 only if SYSTEM_MALLOC.
13670 (LARGE_REQUEST): New macro, so that the issue of large requests
13671 is separated from the issue of spare memory.
13672
13673 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13674
13675 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13676 format. (Bug#8806)
13677
13678 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13679
13680 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13681 before statements.
13682
13683 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13684
13685 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13686
13687 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13688
13689 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13690 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13691
13692 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13693
13694 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13695
13696 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13697
13698 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13699 (x_clipboard_manager_save): Add return value.
13700 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13701 New error handlers.
13702 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13703 Obey Vx_select_enable_clipboard_manager. Catch errors in
13704 x_clipboard_manager_save (Bug#8779).
13705 (Vx_select_enable_clipboard_manager): New variable.
13706 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13707
13708 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13709
13710 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13711
13712 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13713
13714 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13715 in the current matrix if keep_current_p is non-zero.
13716
13717 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13718
13719 * bidi.c (bidi_level_of_next_char): Fix last change.
13720
13721 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13722
13723 Support bidi reordering of text covered by display properties.
13724
13725 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13726 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13727 (bidi_cache_search, bidi_cache_iterator_state)
13728 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13729 (bidi_level_of_next_char, bidi_move_to_visually_next):
13730 Support character positions inside a run of characters covered by a
13731 display string.
13732 (bidi_paragraph_init, bidi_resolve_explicit_1)
13733 (bidi_level_of_next_char): Call bidi_fetch_char and
13734 bidi_fetch_char_advance instead of FETCH_CHAR and
13735 FETCH_CHAR_ADVANCE.
13736 (bidi_init_it): Initialize new members.
13737 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13738 definitions.
13739 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13740 instead of using explicit *_CHAR codes.
13741 (bidi_resolve_explicit, bidi_resolve_weak):
13742 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13743 bidirectional text is supported only in multibyte buffers.
13744 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13745 it to initialize the frame_window_p member of struct bidi_it.
13746 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13747 (bidi_resolve_explicit, bidi_resolve_weak)
13748 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13749 bidi_it->nchars is non-positive.
13750 (bidi_level_of_next_char): Don't try to lookup the cache for the
13751 next/previous character if nothing is cached there yet, or if we
13752 were just reseat()'ed to a new position.
13753
13754 * xdisp.c (set_cursor_from_row): Set start and stop points
13755 according to the row's direction when priming the loop that looks
13756 for the glyph on which to display cursor.
13757 (single_display_spec_intangible_p): Function deleted.
13758 (display_prop_intangible_p): Reimplement to call
13759 handle_display_spec instead of single_display_spec_intangible_p.
13760 Accept 3 additional arguments needed by handle_display_spec.
13761 This fixes incorrect cursor motion across display property with complex
13762 values: lists, `(when COND...)' forms, etc.
13763 (single_display_spec_string_p): Support property values that are
13764 lists with the argument STRING its top-level element.
13765 (display_prop_string_p): Fix the condition for processing a
13766 property that is a list to be consistent with handle_display_spec.
13767 (handle_display_spec): New function, refactored from the
13768 last portion of handle_display_prop.
13769 (compute_display_string_pos): Accept additional argument
13770 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13771 value of a `display' property is a "replacing spec".
13772 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13773 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13774 the display property, but just return a value indicating whether
13775 the display property will replace the characters it covers.
13776 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13777 frame_window_p members of struct bidi_it.
13778 (compute_display_string_pos, compute_display_string_end):
13779 New functions.
13780 (push_it): Accept second argument POSITION, where pop_it should
13781 jump to continue iteration.
13782 (reseat_1): Initialize bidi_it.disp_pos.
13783
13784 * keyboard.c (adjust_point_for_property): Adjust the call to
13785 display_prop_intangible_p to its new signature.
13786
13787 * dispextern.h (struct bidi_it): New member frame_window_p.
13788 (bidi_init_it): Update prototypes.
13789 (display_prop_intangible_p): Update prototype.
13790 (compute_display_string_pos, compute_display_string_end):
13791 Declare prototypes.
13792 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13793 EMACS_INT.
13794
13795 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13796
13797 Malloc failure behavior now depends on size of allocation.
13798 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13799 * lisp.h: Change signatures accordingly.
13800 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13801 All callers changed. (Bug#8762)
13802
13803 * gnutls.c: Use Emacs's memory allocators.
13804 Without this change, the gnutls library would invoke malloc etc.
13805 directly, which causes problems on non-SYNC_INPUT hosts, and which
13806 runs afoul of improving memory_full behavior. (Bug#8761)
13807 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13808 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13809 xfree instead of the default malloc, realloc, free.
13810 (Fgnutls_boot): No need to check for memory allocation failure,
13811 since xmalloc does that for us.
13812
13813 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13814 * category.c (hash_get_category_set):
13815 * ccl.c (ccl_driver):
13816 * charset.c (Fdefine_charset_internal):
13817 * charset.h (struct charset.hash_index):
13818 * composite.c (get_composition_id, gstring_lookup_cache)
13819 (composition_gstring_put_cache):
13820 * composite.h (struct composition.hash_index):
13821 * dispextern.h (struct image.hash):
13822 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13823 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13824 (hashfn_equal, hashfn_user_defined, make_hash_table)
13825 (maybe_resize_hash_table, hash_lookup, hash_put)
13826 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13827 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13828 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13829 * image.c (make_image, search_image_cache, lookup_image)
13830 (xpm_put_color_table_h):
13831 * lisp.h (struct Lisp_Hash_Table):
13832 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13833 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13834 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13835 * alloc.c (allocate_vectorlike):
13836 Check for overflow in vector size calculations.
13837 * ccl.c (ccl_driver):
13838 Check for overflow when converting EMACS_INT to int.
13839 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13840 need to be updated by these changes.
13841 * fns.c (make_hash_table, maybe_resize_hash_table):
13842 Check for integer overflow with large hash tables.
13843 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13844 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13845 (SXHASH_REDUCE): New macro.
13846 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13847 Use it instead of discarding useful hash info with large hash values.
13848 (sxhash_float): New function.
13849 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13850 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13851 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13852 Rewrite to use FIXNUM_BITS, as this simplifies things.
13853 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13854 Adjust signatures to match updated version of code.
13855 (consing_since_gc): Now EMACS_INT, since a single hash table can
13856 use more than INT_MAX bytes.
13857
13858 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13859
13860 Make it possible to build with GCC-4.6+ -O2 -flto.
13861
13862 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13863
13864 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13865
13866 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13867 Call minibuffer-inactive-mode.
13868
13869 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13870
13871 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13872 Update dependencies.
13873
13874 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13875
13876 * data.c (init_data): Remove code for UTS, this system is not
13877 supported anymore.
13878
13879 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13880
13881 Don't force ./temacs to start in terminal mode.
13882
13883 * frame.c (make_initial_frame): Initialize faces in all cases, not
13884 only when CANNOT_DUMP is defined.
13885 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13886
13887 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13888
13889 * dispnew.c (add_window_display_history): Use const for the string
13890 pointer. Remove declaration, not needed.
13891
13892 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13893
13894 Use 'inline', not 'INLINE'.
13895 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13896 * alloc.c, fontset.c (INLINE): Remove.
13897 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13898 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13899 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13900 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13901 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13902
13903 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13904
13905 Make it possible to run ./temacs.
13906
13907 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13908 syms_of_callproc does the same thing. Remove test for
13909 "initialized", do it in the caller.
13910 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13911
13912 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13913
13914 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13915 (read_minibuf): Use get_minibuffer.
13916 (syms_of_minibuf): Use DEFSYM.
13917 (Qmetadata): New var.
13918 * data.c (Qbuffer): Don't make it static.
13919 (syms_of_data): Use DEFSYM.
13920
13921 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13922
13923 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13924 (CCL_CODE_MIN): New macro.
13925
13926 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13927
13928 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13929
13930 * eval.c (Qdebug): Now static.
13931 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13932 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13933 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13934
13935 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13936
13937 * image.c: Various fixes to ImageMagick code comments.
13938 (Fimagemagick_types): Doc fix.
13939
13940 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13941
13942 Minor fixes prompted by GCC 4.6.0 warnings.
13943
13944 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13945
13946 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13947 (x_clipboard_manager_save_all): Move extern decl to ...
13948 * xterm.h: ... here, so that it can be checked for consistency.
13949
13950 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13951
13952 * xselect.c (x_clipboard_manager_save_frame)
13953 (x_clipboard_manager_save_all): New functions.
13954 (Fx_clipboard_manager_save): Lisp function deleted.
13955
13956 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13957 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13958
13959 * xterm.h: Update prototype.
13960
13961 2011-05-28 William Xu <william.xwl@gmail.com>
13962
13963 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13964 exiting (Bug#8239).
13965
13966 2011-05-28 Jim Meyering <meyering@redhat.com>
13967
13968 Avoid a sign-extension bug in crypto_hash_function.
13969 * fns.c (to_uchar): Define.
13970 (crypto_hash_function): Use it to convert some newly-signed
13971 variables to unsigned, to avoid sign-extension bugs. For example,
13972 without this change, (md5 "truc") would evaluate to
13973 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13974 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13975 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13976
13977 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13978
13979 Integer overflow fixes.
13980
13981 * dbusbind.c: Serial number integer overflow fixes.
13982 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13983 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13984 to hold a serial number that is too large for a fixnum.
13985 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13986 Check for serial numbers out of range. Decode any serial number
13987 that was so large that it became a float. (Bug#8722)
13988
13989 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13990 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13991 Use XFASTINT rather than XUINT when numbers are nonnegative.
13992 (xd_append_arg, Fdbus_method_return_internal):
13993 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13994 arguments, check that Lisp number is nonnegative, rather than
13995 silently wrapping negative numbers around. (Bug#8722)
13996 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13997 (Bug#8722)
13998
13999 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14000
14001 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14002
14003 ccl: Add integer overflow checks.
14004 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14005 (IN_INT_RANGE): New macros.
14006 (ccl_driver): Use them to check for integer overflow when
14007 decoding a CCL program. Many of the new checks are whether XINT (x)
14008 fits in int; it doesn't always, on 64-bit hosts. The new version
14009 doesn't catch all possible integer overflows, but it's an
14010 improvement. (Bug#8719)
14011
14012 * alloc.c (make_event_array): Use XINT, not XUINT.
14013 There's no need for unsigned here.
14014
14015 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14016 This follows up to the 2011-05-06 change that substituted uintptr_t
14017 for EMACS_INT. This case wasn't caught back then.
14018
14019 Rework Fformat to avoid integer overflow issues.
14020 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14021 now (part of C89). Include <verify.h>.
14022 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14023 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14024 (Fformat): Avoid the prepass trying to compute sizes; it was only
14025 approximate and thus did not catch overflow reliably. Instead, walk
14026 through the format just once, formatting and computing sizes as we go,
14027 checking for integer overflow at every step, and allocating a larger
14028 buffer as needed. Keep track separately whether the format is
14029 multibyte. Keep only the most-recently calculated precision, rather
14030 than them all. Record whether each argument has been converted to
14031 string. Use EMACS_INT, not int, for byte and char and arg counts.
14032 Support field widths and precisions larger than INT_MAX. Avoid
14033 sprintf's undefined behavior with conversion specifications such as %#d
14034 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14035 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14036 formatting out-of-range floating point numbers with int
14037 formats. (Bug#8668)
14038
14039 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14040
14041 * data.c: Avoid integer truncation in expressions involving floats.
14042 * data.c: Include <intprops.h>.
14043 (arith_driver): When there's an integer overflow in an expression
14044 involving floating point, convert the integers to floating point
14045 so that the resulting value does not suffer from catastrophic
14046 integer truncation. For example, on a 64-bit host (* 4
14047 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14048 Do not rely on undefined behavior after integer overflow.
14049
14050 merge count_size_as_multibyte, parse_str_to_multibyte
14051 * character.c, character.h (count_size_as_multibyte):
14052 Rename from parse_str_to_multibyte; all uses changed.
14053 Check for integer overflow.
14054 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14055 since it's now a duplicate of the other. This is more of
14056 a character than a buffer op, so better that it's in character.c.
14057 * fns.c, print.c: Adjust to above changes.
14058
14059 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14060
14061 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14062
14063 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14064
14065 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14066 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14067 (x_clipboard_manager_save): Now static.
14068 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14069
14070 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14071 (crypto_hash_function): Now static.
14072 Fix pointer signedness problems. Avoid unnecessary initializations.
14073
14074 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14075
14076 * termhooks.h (Vselection_alist): Make it terminal-local.
14077
14078 * terminal.c (create_terminal): Initialize it.
14079
14080 * xselect.c: Support for clipboard managers.
14081 (Vselection_alist): Move to termhooks.h as terminal-local var.
14082 (LOCAL_SELECTION): New macro.
14083 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14084 (symbol_to_x_atom): Remove gratuitous arg.
14085 (x_handle_selection_request, lisp_data_to_selection_data)
14086 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14087 (x_own_selection, x_get_local_selection, x_convert_selection):
14088 New arg, specifying work frame. Use terminal-local Vselection_alist.
14089 (some_frame_on_display): Delete unused function.
14090 (Fx_own_selection_internal, Fx_get_selection_internal)
14091 (Fx_disown_selection_internal, Fx_selection_owner_p)
14092 (Fx_selection_exists_p): New optional frame arg.
14093 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14094 (x_handle_selection_clear): Don't treat other terminals with the
14095 same keyboard specially. Use the terminal-local Vselection_alist.
14096 (x_clear_frame_selections): Use Frun_hook_with_args.
14097
14098 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14099
14100 * xterm.h: Add support for those atoms.
14101
14102 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14103
14104 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14105 (converted_selections, conversion_fail_tag): New global variables.
14106 (x_selection_request_lisp_error): Free the above.
14107 (x_get_local_selection): Remove unnecessary code.
14108 (x_reply_selection_request): Args changed; handle arbitrary array
14109 of converted selections stored in converted_selections.
14110 Separate the XChangeProperty and SelectionNotify steps.
14111 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14112 (x_convert_selection): New function.
14113 (x_handle_selection_event): Simplify.
14114 (x_get_foreign_selection): Don't ignore incoming requests while
14115 waiting for an answer; this will fail when we implement
14116 SAVE_TARGETS, and seems unnecessary anyway.
14117 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14118 (Vx_sent_selection_functions): Doc fix.
14119
14120 2011-05-26 Leo Liu <sdl.web@gmail.com>
14121
14122 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14123
14124 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14125
14126 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14127
14128 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14129 for fringe update if it has periodic bitmap.
14130 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14131 and fringe_bitmap_periodic_p.
14132
14133 * fringe.c (get_fringe_bitmap_data): New function.
14134 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14135 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14136 row. Mark glyph row for fringe update if periodicity changed.
14137
14138 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14139 for fringe update unless it has periodic bitmap.
14140
14141 2011-05-25 Kenichi Handa <handa@m17n.org>
14142
14143 * xdisp.c (get_next_display_element): Set correct it->face_id for
14144 a static composition.
14145
14146 2011-05-24 Leo Liu <sdl.web@gmail.com>
14147
14148 * deps.mk (fns.o):
14149 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14150
14151 * fns.c (crypto_hash_function, Fsha1): New function.
14152 (Fmd5): Use crypto_hash_function.
14153 (syms_of_fns): Add Ssha1.
14154
14155 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14156
14157 * gnutls.c: Remove unused macros.
14158 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14159 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14160 Remove macros that are defined and never used.
14161 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14162
14163 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14164
14165 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14166 (Fx_get_selection_internal): Minor cleanup.
14167 (Fx_own_selection_internal): Rename arguments for consistency with
14168 select.el.
14169
14170 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14171
14172 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14173
14174 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14175
14176 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14177
14178 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14179
14180 * dispnew.c (scrolling_window): Don't exclude the case that the
14181 last enabled row in the desired matrix touches the bottom boundary.
14182
14183 2011-05-21 Glenn Morris <rgm@gnu.org>
14184
14185 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14186 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14187 and add some more files.
14188
14189 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14190
14191 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14192 report_file_error introduced by the change from 2011-05-07.
14193
14194 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14195
14196 * systime.h (Time): Define only if emacs is defined.
14197 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14198 where the include path doesn't have X11/X.h by default. See
14199 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14200
14201 2011-05-20 Kenichi Handa <handa@m17n.org>
14202
14203 * composite.c (find_automatic_composition): Fix previous change.
14204
14205 2011-05-20 Glenn Morris <rgm@gnu.org>
14206
14207 * lisp.mk: New file, split from Makefile.in.
14208 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14209 (shortlisp): Remove.
14210 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14211
14212 2011-05-19 Glenn Morris <rgm@gnu.org>
14213
14214 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14215 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14216 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14217 (lisp): Set the order to that of loadup.el.
14218 (shortlisp): Make it a copy of $lisp.
14219 (SOME_MACHINE_LISP): Remove.
14220 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14221 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14222
14223 2011-05-18 Kenichi Handa <handa@m17n.org>
14224
14225 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14226 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14227 (find_automatic_composition): Mostly rewrite for efficiency.
14228
14229 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14230
14231 * makefile.w32-in: Update dependencies.
14232
14233 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14234
14235 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14236 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14237
14238 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14239
14240 Fix some integer overflow issues, such as string length overflow.
14241
14242 * insdel.c (count_size_as_multibyte): Check for string overflow.
14243
14244 * character.c (lisp_string_width): Check for string overflow.
14245 Use EMACS_INT, not int, for string indexes and lengths; in
14246 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14247 the resulting string length overflows an EMACS_INT; instead,
14248 report a string overflow if no precision given. When checking for
14249 precision exhaustion, use a check that cannot possibly have
14250 integer overflow. (Bug#8675)
14251 * character.h (lisp_string_width): Adjust to new signature.
14252
14253 * alloc.c (string_overflow): New function.
14254 (Fmake_string): Use it. This doesn't change behavior, but saves
14255 a few bytes and will simplify future changes.
14256 * character.c (string_escape_byte8): Likewise.
14257 * lisp.h (string_overflow): New decl.
14258
14259 Fixups, following up to the user-interface timestamp change.
14260 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14261 for UI timestamps, instead of unsigned long.
14262 * msdos.c (mouse_get_pos): Likewise.
14263 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14264 * w32gui.h (Time): Define by including "systime.h" rather than by
14265 declaring it ourselves. (Bug#8664)
14266
14267 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14268 * image.c (clear_image_cache): Likewise.
14269
14270 * term.c (term_mouse_position): Don't assume time_t wraparound.
14271
14272 Be more systematic about user-interface timestamps.
14273 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14274 and sometimes 'EMACS_UINT', to represent these timestamps.
14275 This change causes it to use 'Time' uniformly, as that's what X uses.
14276 This makes the code easier to follow, and makes it easier to catch
14277 integer overflow bugs such as Bug#8664.
14278 * frame.c (Fmouse_position, Fmouse_pixel_position):
14279 Use Time, not unsigned long, for user-interface timestamps.
14280 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14281 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14282 * keyboard.h (last_event_timestamp): Likewise.
14283 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14284 * menu.h (xmenu_show): Likewise.
14285 * term.c (term_mouse_position): Likewise.
14286 * termhooks.h (struct input_event.timestamp): Likewise.
14287 (struct terminal.mouse_position_hook): Likewise.
14288 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14289 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14290 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14291 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14292 what it was before.
14293 * menu.h, termhooks.h: Include "systime.h", for Time.
14294
14295 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14296 Don't assume that the difference between two unsigned long values
14297 can fit into an integer. At this point, we know button_down_time
14298 <= event->timestamp, so the difference must be nonnegative, so
14299 there's no need to cast the result if double-click-time is
14300 nonnegative, as it should be; check that it's nonnegative, just in
14301 case. This bug is triggered when events are more than 2**31 ms
14302 apart (about 25 days). (Bug#8664)
14303
14304 * xselect.c (last_event_timestamp): Remove duplicate decl.
14305 (x_own_selection): Remove needless cast to unsigned long.
14306
14307 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14308 that always fit in int. Use a sentinel instead of a counter, to
14309 avoid a temp and to allay GCC's concerns about possible int overflow.
14310 * frame.h (struct frame): Use int for menu_bar_items_used
14311 instead of EMACS_INT, since it always fits in int.
14312
14313 * menu.c (grow_menu_items): Check for int overflow.
14314
14315 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14316
14317 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14318 Before, the code was not consistent. These values cannot exceed
14319 2**31 - 1 so there's no need to make them unsigned.
14320 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14321 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14322 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14323 as modifiers.
14324 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14325
14326 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14327 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14328 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14329 presumably because the widths might not match.
14330
14331 * window.c (size_window): Avoid needless test at loop start.
14332
14333 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14334
14335 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14336
14337 2011-05-12 Drew Adams <drew.adams@oracle.com>
14338
14339 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14340
14341 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14342
14343 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14344 `width' to `bar_area_x' and `bar_area_width', respectively.
14345 (x_scroll_run): Take account of fringe background extension.
14346
14347 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14348 Rename local vars `left' and `width' to `bar_area_x' and
14349 `bar_area_width', respectively.
14350 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14351 background extension.
14352
14353 2011-05-10 Jim Meyering <meyering@redhat.com>
14354
14355 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14356
14357 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14358
14359 * image.c (Finit_image_library): Return t for built-in image types,
14360 like pbm and xbm. (Bug#8640)
14361
14362 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14363
14364 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14365
14366 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14367
14368 * w32console.c (Fset_screen_color): Doc fix.
14369 (Fget_screen_color): New function.
14370 (syms_of_ntterm): Defsubr it.
14371
14372 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14373 unlink the temporary file if Fcall_process didn't create it in the
14374 first place.
14375 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14376 child process will be redirected to a file specified with `:file'.
14377 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14378 cue to call_process_cleanup not to close that handle.
14379
14380 2011-05-07 Ben Key <bkey76@gmail.com>
14381
14382 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14383 one of two shell specific rules, either bootstrap-temacs-CMD or
14384 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14385 to the previous implementation of the bootstrap-temacs rule.
14386 The bootstrap-temacs-CMD rule is similar to the previous
14387 implementation of the bootstrap-temacs rule except that it
14388 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14389 variable.
14390
14391 These changes, along with some changes to nt/configure.bat,
14392 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14393 earlier fix to add support for --cflags and --ldflags options
14394 that include quotes so that it works whether make uses cmd or
14395 sh as the shell.
14396
14397 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14398
14399 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14400 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14401 is a constant.
14402 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14403 a string. Handle both cases.
14404 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14405 (Fdbus_register_method): Use Qinvalid_function.
14406
14407 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14408
14409 * makefile.w32-in: Update dependencies.
14410 (LISP_H): Add inttypes.h and stdin.h.
14411 (PROCESS_H): Add unistd.h.
14412
14413 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14414
14415 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14416 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14417
14418 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14419
14420 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14421
14422 * term.c (vfatal): Remove stray call to va_end.
14423 It's not needed and the C Standard doesn't allow it here anyway.
14424
14425 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14426 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14427
14428 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14429 bytes.
14430
14431 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14432
14433 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14434
14435 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14436
14437 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14438
14439 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14440
14441 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14442 * charset.c (Fdefine_charset_internal): Don't initialize
14443 charset.code_space[15]. The value was garbage, on hosts with
14444 32-bit int (Bug#8600).
14445
14446 * lread.c (read_integer): Be more consistent with string-to-number.
14447 Use string_to_number to do the actual conversion; this avoids
14448 rounding errors and fixes some other screwups. Without this fix,
14449 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14450 (digit_to_number): Move earlier, for benefit of read_integer.
14451 Return -1 if the digit is out of range for the base, -2 if it is
14452 not a digit in any supported base. (Bug#8602)
14453
14454 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14455
14456 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14457 to match comment at start of function. This also removes a
14458 GCC warning about overflow in a 32+64-bit port.
14459
14460 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14461
14462 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14463 Reported by Stefan Monnier in
14464 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14465 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14466 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14467
14468 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14469 (EMACS_UINTPTR): Likewise, with uintptr_t.
14470
14471 * lisp.h: Prefer 64-bit EMACS_INT if available.
14472 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14473 on 32-bit hosts that have 64-bit int, so that they can access
14474 large files.
14475 However, temporarily disable this change unless the temporary
14476 symbol WIDE_EMACS_INT is defined.
14477
14478 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14479
14480 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14481 This removes an assumption that EMACS_INT and long are the same
14482 width as pointers. The assumption is true for Emacs porting targets
14483 now, but we want to make other targets possible.
14484 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14485 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14486 In the rest of the code, change types of integers that hold casted
14487 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14488 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14489 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14490 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14491 No need to cast type when ORing.
14492 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14493 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14494 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14495 assume EMACS_INT is the same width as char *.
14496 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14497 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14498 Remove no-longer-needed casts.
14499 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14500 (xg_tool_bar_help_callback, xg_make_tool_item):
14501 Use EMACS_INTPTR to hold an integer
14502 that will be cast to void *; this can avoid a GCC warning
14503 if EMACS_INT is not the same width as void *.
14504 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14505 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14506 (current_message_1, set_message_1):
14507 Use a local to convert to proper width without a cast.
14508 * xmenu.c (dialog_selection_callback): Likewise.
14509
14510 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14511 Also, don't assume VALBITS / RAND_BITS is less than 5,
14512 and don't rely on undefined behavior when shifting a 1 left into
14513 the sign bit.
14514 * lisp.h (get_random): Change signature to match.
14515
14516 * lread.c (hash_string): Use size_t, not int, for hash computation.
14517 Normally we prefer signed values; but hashing is special, because
14518 it's better to use unsigned division on hash table sizes so that
14519 the remainder is nonnegative. Also, size_t is the natural width
14520 for hashing into memory. The previous code used 'int', which doesn't
14521 retain enough info to hash well into very large tables.
14522 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14523
14524 * dbusbind.c: Don't possibly lose pointer info when converting.
14525 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14526 Use XPNTR rather than XHASH, so that the high-order bits of
14527 the pointer aren't lost when converting through void *.
14528
14529 * eval.c (Fautoload): Don't double-shift a pointer.
14530
14531 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14532
14533 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14534
14535 * gnutls.c (DEF_GNUTLS_FN):
14536 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14537
14538 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14539
14540 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14541 marker. (Bug#8610)
14542
14543 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14544
14545 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14546 New version that can reserve upto 2GB of heap space.
14547
14548 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14549
14550 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14551
14552 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14553
14554 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14555 `gnutls_certificate_set_x509_key_file'.
14556
14557 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14558
14559 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14560 Update dependencies.
14561
14562 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14563
14564 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14565 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14566 Remove unused parameter `fildes'.
14567 * process.c (read_process_output, send_process): Don't pass it.
14568
14569 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14570
14571 Fix previous change: the library cache is defined in w32.c.
14572 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14573 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14574
14575 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14576
14577 Implement dynamic loading of GnuTLS on Windows.
14578
14579 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14580 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14581 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14582 Declare.
14583
14584 * gnutls.c (Qgnutls_dll): Define.
14585 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14586 (gnutls_*): Declare function pointers.
14587 (init_gnutls_functions): New function to initialize function pointers.
14588 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14589 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14590 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14591 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14592 (emacs_gnutls_write, emacs_gnutls_read)
14593 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14594 (Fgnutls_available_p): New function.
14595 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14596 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14597 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14598
14599 * image.c: Include w32.h.
14600 (Vimage_type_cache): Delete.
14601 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14602 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14603 (w32_delayed_load): Move to w32.c.
14604
14605 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14606
14607 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14608 (w32_delayed_load): Move from image.c. When loading a library, record
14609 its filename in the :loaded-from property of the library id.
14610 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14611 Initialize and staticpro them.
14612 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14613
14614 * process.c: Include lisp.h before w32.h, not after.
14615 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14616 instead of gnutls_record_check_pending.
14617
14618 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14619
14620 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14621
14622 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14623 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14624 as passed in.
14625
14626 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14627
14628 * xterm.c (x_set_frame_alpha): Do not set property on anything
14629 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14630
14631 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14632
14633 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14634
14635 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14636
14637 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14638 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14639 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14640 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14641 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14642 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14643 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14644 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14645 (Qgnutls_bootprop_callbacks_verify): Make static.
14646
14647 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14648
14649 * callproc.c: Indentation fixup.
14650
14651 * sysdep.c (wait_for_termination_1): Make static.
14652 (wait_for_termination, interruptible_wait_for_termination):
14653 Move after wait_for_termination_1.
14654
14655 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14656
14657 * sysdep.c (interruptible_wait_for_termination): New function
14658 which is like wait_for_termination, but allows keyboard
14659 interruptions.
14660
14661 * callproc.c (Fcall_process): Add (:file "file") as an option for
14662 the STDOUT buffer.
14663 (Fcall_process_region): Ditto.
14664
14665 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14666
14667 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14668 rather than `XVECTOR (FOO)->size'.
14669
14670 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14671 inttypes.h, as a gnulib replacement is used if it not available in
14672 system headers.
14673
14674 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14675
14676 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14677 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14678 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14679
14680 * coding.c (coding_alloc_by_realloc): Error out if destination
14681 will grow beyond MOST_POSITIVE_FIXNUM.
14682 (decode_coding_emacs_mule): Abort if there isn't enough place in
14683 charbuf for the composition carryover bytes. Reserve an extra
14684 space for up to 2 characters produced in a loop.
14685 (decode_coding_iso_2022): Abort if there isn't enough place in
14686 charbuf for the composition carryover bytes.
14687
14688 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14689
14690 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14691 aborting when %lld or %lll format is passed.
14692 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14693 %llo or %llx format is passed. (Bug#8545)
14694
14695 * window.c (window_scroll_line_based): Use a marker instead of
14696 simple variables to record original value of point. (Bug#7952)
14697
14698 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14699 produced by %s or %c overflows available buffer space. (Bug#8545)
14700
14701 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14702
14703 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14704 (SIZE_MAX): Move defn after all includes, as they might #define it.
14705
14706 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14707
14708 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14709
14710 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14711
14712 * keyboard.c (Qdelayed_warnings_hook): Define.
14713 (command_loop_1): Run `delayed-warnings-hook'
14714 if Vdelayed_warnings_list is non-nil.
14715 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14716 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14717
14718 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14719
14720 * doprnt.c (doprnt): Don't return value smaller than the buffer
14721 size if the message was truncated. (Bug#8545).
14722
14723 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14724
14725 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14726 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14727
14728 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14729
14730 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14731
14732 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14733
14734 * makefile.w32-in: Update dependencies.
14735
14736 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14737
14738 Improve `doprnt' and its usage. (Bug#8545)
14739 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14740 `format_end'. Remove support for %l as a conversion specifier.
14741 Don't use xrealloc. Improve diagnostics when the %l size modifier
14742 is used. Update the commentary.
14743
14744 * eval.c (verror): Simplify calculation of size_t.
14745
14746 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14747 messages.
14748
14749 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14750
14751 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14752 change.
14753
14754 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14755
14756 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14757 This makes this file independent of the recent pseudovector change.
14758
14759 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14760
14761 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14762
14763 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14764 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14765 Remove unused local.
14766 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14767
14768 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14769 GCC 4.6.0 optimizes based on type-based alias analysis.
14770 For example, if b is of type struct buffer * and v of type struct
14771 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14772 != &v->size, and therefore "v->size = 1; b->size = 2; return
14773 v->size;" must therefore return 1. This assumption is incorrect
14774 for Emacs, since it type-puns struct Lisp_Vector * with many other
14775 types. To fix this problem, this patch adds a new type struct
14776 vectorlike_header that documents the constraints on layout of vectors
14777 and pseudovectors, and helps optimizing compilers not get fooled
14778 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14779 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14780 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14781 the size member.
14782 (XSETPVECTYPE): Rewrite in terms of new macro.
14783 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14784 This is a bit clearer, and further avoids the possibility of
14785 undesirable aliasing.
14786 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14787 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14788 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14789 since Lisp_Subr is a special case (no "next" field).
14790 (ASIZE): Now uses header.size rather than size.
14791 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14792 to avoid the hassle of writing XVECTOR (foo)->header.size.
14793 (struct vectorlike_header): New type.
14794 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14795 object, to help avoid aliasing.
14796 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14797 (SUBRP): Likewise, since Lisp_Subr is a special case.
14798 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14799 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14800 (struct Lisp_Hash_Table): Combine first two members into a single
14801 struct vectorlike_header member. All uses of "size" and "next" members
14802 changed to be "header.size" and "header.next".
14803 * buffer.h (struct buffer): Likewise.
14804 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14805 * frame.h (struct frame): Likewise.
14806 * process.h (struct Lisp_Process): Likewise.
14807 * termhooks.h (struct terminal): Likewise.
14808 * window.c (struct save_window_data, struct saved_window): Likewise.
14809 * window.h (struct window): Likewise.
14810 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14811 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14812 * buffer.c (init_buffer_once): Likewise.
14813 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14814 special case.
14815 * process.c (Fformat_network_address): Use local var for size,
14816 for brevity.
14817
14818 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14819
14820 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14821 * data.c (atof): Remove decl; no longer used or needed.
14822 (digit_to_number): Move to lread.c.
14823 (Fstring_to_number): Use new string_to_number function, to be
14824 consistent with how the Lisp reader treats infinities and NaNs.
14825 Do not assume that floating-point numbers represent EMACS_INT
14826 without losing information; this is not true on most 64-bit hosts.
14827 Avoid double-rounding errors, by insisting on integers when
14828 parsing non-base-10 numbers, as the documentation specifies.
14829 * lisp.h (string_to_number): New decl, replacing ...
14830 (isfloat_string): Remove.
14831 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14832 (read1): Do not accept +. and -. as integers; this
14833 appears to have been a coding error. Similarly, do not accept
14834 strings like +-1e0 as floating point numbers. Do not report
14835 overflow for integer overflows unless the base is not 10 which
14836 means we have no simple and reliable way to continue.
14837 Break out the floating-point parsing into a new
14838 function string_to_number, so that Fstring_to_number parses
14839 floating point numbers consistently with the Lisp reader.
14840 (digit_to_number): Move here from data.c. Make it static inline.
14841 (E_CHAR, EXP_INT): Remove, replacing with ...
14842 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14843 (string_to_number): New function, replacing isfloat_string.
14844 This function checks for valid syntax and produces the resulting
14845 Lisp float number too. Rework it so that string-to-number
14846 no longer mishandles examples like "1.0e+". Use strtoumax,
14847 so that overflow for non-base-10 numbers is reported only when
14848 there's no portable and simple way to convert to floating point.
14849
14850 * textprop.c (set_text_properties_1): Rewrite for clarity,
14851 and to avoid GCC warning about integer overflow.
14852
14853 * intervals.h (struct interval): Use EMACS_INT for members
14854 where EMACS_UINT might cause problems. See
14855 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14856 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14857 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14858 All uses changed.
14859 (offset_intervals): Tell GCC not to worry about length overflow
14860 when negating a negative length.
14861
14862 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14863 (overrun_check_free): Likewise.
14864
14865 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14866 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14867 word size.
14868
14869 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14870 (gnutls_make_error): Rename local to avoid shadowing.
14871 (gnutls_emacs_global_deinit): ifdef out; not used.
14872 (Fgnutls_boot): Use const for pointer to readonly storage.
14873 Comment out unused local. Fix pointer signedness problems.
14874
14875 * lread.c (openp): Don't stuff size_t into an 'int'.
14876 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14877 about possible signed overflow.
14878
14879 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14880 (GDK_KEY_g): Don't define if already defined.
14881 (xg_prepare_tooltip): Avoid pointer signedness problem.
14882 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14883
14884 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14885 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14886
14887 * xfns.c (Fx_window_property): Simplify a bit,
14888 to make a bit faster and to avoid GCC 4.6.0 warning.
14889 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14890
14891 * fns.c (internal_equal): Don't assume size_t fits in int.
14892
14893 * alloc.c (compact_small_strings): Tighten assertion a little.
14894
14895 Replace pEd with more-general pI, and fix some printf arg casts.
14896 * lisp.h (pI): New macro, generalizing old pEd macro to other
14897 conversion specifiers. For example, use "...%"pI"d..." rather
14898 than "...%"pEd"...".
14899 (pEd): Remove. All uses replaced with similar uses of pI.
14900 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14901 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14902 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14903 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14904 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14905 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14906 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14907 64-bit hosts.
14908 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14909 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14910 * print.c (safe_debug_print, print_object): Likewise.
14911 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14912 to int.
14913 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14914 avoiding the 0 flag, which is not portable.
14915 * process.c (Fmake_network_process): Use pI to avoid cast.
14916 * region-cache.c (pp_cache): Likewise.
14917 * xdisp.c (decode_mode_spec): Likewise.
14918 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14919 behavior on 64-bit hosts with printf arg.
14920 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14921 (x_stop_queuing_selection_requests): Likewise.
14922 (x_get_window_property): Don't truncate byte count to an 'int'
14923 when tracing.
14924
14925 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14926 here, since it parses constructs like leading '-' and spaces,
14927 which are not wanted; and it overflows with large numbers.
14928 Instead, simply match F[0-9]+, which is what is wanted anyway.
14929
14930 * alloc.c: Remove unportable assumptions about struct layout.
14931 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14932 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14933 (allocate_vectorlike, make_pure_vector): Use the new macros,
14934 plus offsetof, to remove unportable assumptions about struct layout.
14935 These assumptions hold on all porting targets that I know of, but
14936 they are not guaranteed, they're easy to remove, and removing them
14937 makes further changes easier.
14938
14939 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14940 This doesn't fix a bug but makes the code clearer.
14941 (string_overrun_cookie): Now const. Use initializers that
14942 don't formally overflow signed char, to avoid warnings.
14943 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14944 can cause Emacs to crash when string overrun checking is enabled.
14945 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14946 multiple of sizeof (EMACS_INT); it need not be, if
14947 alignof(EMACS_INT) < sizeof (EMACS_INT).
14948 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14949
14950 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14951
14952 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14953
14954 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14955
14956 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14957 supposed to be handshaking. (Bug#8556)
14958 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14959
14960 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14961
14962 * lisp.h (Qdebug): List symbol.
14963 * eval.c (Qdebug): Restore global linkage.
14964 * keyboard.c (debug-on-event): New variable.
14965 (handle_user_signal): Break into debugger when debug-on-event
14966 matches the current signal symbol.
14967
14968 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14969
14970 * alloc.c (check_sblock, check_string_bytes)
14971 (check_string_free_list): Convert to standard C.
14972
14973 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14974
14975 * w32.c (emacs_gnutls_push): Fix typo.
14976
14977 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14978
14979 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14980 "cast to pointer from integer of different size".
14981
14982 Improve doprnt and its use in verror. (Bug#8545)
14983 * doprnt.c (doprnt): Document the set of format control sequences
14984 supported by the function. Use SAFE_ALLOCA instead of always
14985 using `alloca'.
14986
14987 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14988 is one byte too soon. Don't use xrealloc; instead xfree and
14989 xmalloc anew.
14990
14991 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14992
14993 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14994 callbacks stage.
14995
14996 * gnutls.c: Renamed global_initialized to
14997 gnutls_global_initialized. Added internals for the
14998 :verify-hostname-error, :verify-error, and :verify-flags
14999 parameters of `gnutls-boot' and documented those parameters in the
15000 docstring. Start callback support.
15001 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15002 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15003 on error. Return error code.
15004 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15005 (emacs_gnutls_read): Likewise.
15006 (Fgnutls_boot): Return handshake error code.
15007 (emacs_gnutls_handle_error): New function.
15008 (wsaerror_to_errno): Likewise.
15009
15010 * w32.h (emacs_gnutls_pull): Add prototype.
15011 (emacs_gnutls_push): Likewise.
15012
15013 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15014 (emacs_gnutls_push): Likewise.
15015
15016 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15017
15018 * process.c (wait_reading_process_output): Check if GnuTLS
15019 buffered some data internally if no FDs are set for TLS
15020 connections.
15021
15022 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15023 (LIBS): Link to USER_LIBS.
15024 ($(BLD)/gnutls.$(0)): New target.
15025
15026 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15027
15028 * xdisp.c (handle_single_display_spec): Rename the
15029 display_replaced_before_p argument into display_replaced_p, to
15030 make it consistent with the commentary. Fix typos in the
15031 commentary.
15032
15033 * textprop.c (syms_of_textprop): Remove dead code.
15034 (copy_text_properties): Delete obsolete commentary about an
15035 interface that was deleted long ago. Fix typos in the description
15036 of arguments.
15037
15038 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15039 to changes in oldXMenu/XMenu.h from 2011-04-16.
15040 <menu_help_message, prev_menu_help_message>: Constify.
15041 (IT_menu_make_room): menu->help_text is now `const char **';
15042 adjust.
15043
15044 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15045 to changes in oldXMenu/XMenu.h from 2011-04-16.
15046 (struct XMenu): Declare `help_text' `const char **'.
15047
15048 * xfaces.c <Qunspecified>: Make extern again.
15049
15050 * syntax.c: Include sys/types.h before including regex.h, as
15051 required by POSIX.
15052
15053 * doc.c (get_doc_string): Improve the format passed to `error'.
15054
15055 * doprnt.c (doprnt): Improve commentary.
15056
15057 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15058
15059 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15060 them with etags.
15061
15062 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15063 changes in globals.h immediately force recompilation.
15064 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15065 $(CURDIR)/s/ms-w32.h.
15066 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15067
15068 * character.c (Fchar_direction): Function deleted.
15069 (syms_of_character): Don't defsubr it.
15070 <char-direction-table>: Deleted.
15071
15072 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15073
15074 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15075 * doprnt.c: Include limits.h.
15076 (SIZE_MAX): New macro.
15077 (doprnt): Return a size_t value. 2nd arg is now size_t.
15078 Many local variables are now size_t instead of int or unsigned.
15079 Improve overflow protection. Support `l' modifier for integer
15080 conversions. Support %l conversion. Don't assume an EMACS_INT
15081 argument for integer conversions and for %c.
15082
15083 * lisp.h (doprnt): Restore prototype.
15084
15085 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15086 $(SRC)/character.h.
15087
15088 * Makefile.in (base_obj): Add back doprnt.o.
15089
15090 * deps.mk (doprnt.o): Add back prerequisites.
15091 (callint.o): Depend on character.h.
15092
15093 * eval.c (internal_lisp_condition_case): Include the handler
15094 representation in the error message.
15095 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15096 when breaking from the loop.
15097
15098 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15099
15100 * callint.c (Fcall_interactively): When displaying error message
15101 about invalid control letter, pass the character's codepoint, not
15102 a pointer to its multibyte form. Improve display of the character
15103 in octal and display also its hex code.
15104
15105 * character.c (char_string): Use %x to display the (unsigned)
15106 codepoint of an invalid character, to avoid displaying a bogus
15107 negative value.
15108
15109 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15110 `error', not SYMBOL_NAME itself.
15111
15112 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15113 character arguments to `error'.
15114
15115 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15116 to `error' in error message about FINAL_CHAR argument. Make sure
15117 FINAL_CHAR is a character, and use %c when it is passed as
15118 argument to `error'.
15119
15120 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15121
15122 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15123
15124 * w32.c: Include <time.h>.
15125 (sys_localtime): New function.
15126
15127 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15128
15129 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15130
15131 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15132
15133 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15134
15135 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15136 zombies (Bug#8467).
15137
15138 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15139
15140 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15141 gl_state.e_property when gl_state.object is Qt.
15142
15143 * insdel.c (make_gap_larger): Remove limitation of buffer size
15144 to <= INT_MAX.
15145
15146 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15147
15148 * xdisp.c (lookup_glyphless_char_display)
15149 (produce_glyphless_glyph): Handle cons cell entry in
15150 glyphless-char-display.
15151 (Vglyphless_char_display): Document it.
15152
15153 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15154 glyphless-char-display.
15155
15156 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15157
15158 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15159
15160 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15161
15162 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15163 definition for no-X builds.
15164
15165 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15166
15167 Static checks with GCC 4.6.0 and non-default toolkits.
15168
15169 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15170
15171 * process.c (keyboard_bit_set): Define only if SIGIO.
15172 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15173 (send_process): Repair possible setjmp clobbering.
15174
15175 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15176
15177 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15178
15179 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15180
15181 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15182 Define only if needed.
15183
15184 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15185 by pacifying GCC about it. Maybe it's time to retire it?
15186 * xfaces.c (USG, __TIMEVAL__): Likewise.
15187
15188 * dispextern.h (struct redisplay_interface): Rename param
15189 to avoid shadowing.
15190 * termhooks.h (struct terminal): Likewise.
15191 * xterm.c (xembed_send_message): Likewise.
15192
15193 * insdel.c (make_gap_smaller): Define only if
15194 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15195
15196 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15197 it.
15198
15199 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15200 so that we aren't warned about unused symbols.
15201
15202 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15203
15204 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15205
15206 * xfns.c (x_real_positions): Mark locals as initialized.
15207
15208 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15209
15210 * xterm.c: Fix problems found by static analysis with other toolkits.
15211 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15212 (x_dispatch_event): Declare static if USE_GTK, and
15213 define if USE_GTK || USE_X_TOOLKIT.
15214 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15215 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15216 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15217 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15218
15219 * xmenu.c (menu_help_callback): Pointer type fixes.
15220 Use const pointers when pointing at readonly data. Avoid pointer
15221 signedness clashes.
15222 (FALSE): Remove unused macro.
15223 (update_frame_menubar): Remove unused decl.
15224
15225 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15226
15227 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15228 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15229 (single_menu_item): Rename local to avoid shadowing.
15230
15231 * keyboard.c (make_lispy_event): Remove unused local var.
15232
15233 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15234 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15235
15236 * bitmaps: Change bitmaps from unsigned char back to the X11
15237 compatible char. Avoid the old compiler warnings about
15238 out-of-range initializers by using, for example, '\xab' rather
15239 than 0xab.
15240
15241 * xgselect.c (xgselect_initialize): Check vs interface
15242 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15243
15244 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15245
15246 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15247 to read-only memory.
15248
15249 * fns.c (vector): Remove; this old hack is no longer needed.
15250
15251 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15252 Remove unused var.
15253 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15254
15255 * xrdb.c (x_load_resources): Omit unused local.
15256
15257 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15258 (x_window): Rename locals to avoid shadowing.
15259 (USG): Use the kludged USG macro, to pacify gcc.
15260
15261 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15262 (x_term_init): Remove local to avoid shadowing.
15263
15264 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15265
15266 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15267 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15268
15269 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15270
15271 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15272
15273 Fix regex.c, syntax.c and friends for buffers > 2GB.
15274 * syntax.h (struct gl_state_s): Declare character position members
15275 EMACS_INT.
15276
15277 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15278
15279 * textprop.c (verify_interval_modification, interval_of):
15280 Declare arguments EMACS_INT.
15281
15282 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15283 EMACS_INT.
15284
15285 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15286
15287 * indent.c (Fvertical_motion): Local variable it_start is now
15288 EMACS_INT.
15289
15290 * regex.c (re_match, re_match_2, re_match_2_internal)
15291 (bcmp_translate, regcomp, regexec, print_double_string)
15292 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15293 (re_compile_pattern, re_exec): Declare arguments and local
15294 variables `size_t' and `ssize_t' and return values `regoff_t', as
15295 appropriate.
15296 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15297 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15298 <compile_stack_type>: `size' and `avail' are now `size_t'.
15299
15300 * regex.h <regoff_t>: Use ssize_t, not int.
15301 (re_search, re_search_2, re_match, re_match_2): Arguments that
15302 specify buffer/string position and length are now ssize_t and
15303 size_t. Return type is regoff_t.
15304
15305 2011-04-16 Ben Key <bkey76@gmail.com>
15306
15307 * nsfont.m: Fixed bugs in ns_get_family and
15308 ns_descriptor_to_entity that were caused by using free to
15309 deallocate memory blocks that were allocated by xmalloc (via
15310 xstrdup). This caused Emacs to crash when compiled with
15311 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15312 --enable-checking=xmallocoverrun). xfree is now used to
15313 deallocate these memory blocks.
15314
15315 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15316
15317 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15318
15319 emacs_write: Accept and return EMACS_INT for sizes.
15320 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15321 et seq.
15322 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15323 Accept and return EMACS_INT.
15324 (emacs_gnutls_write): Return the number of bytes written on
15325 partial writes.
15326 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15327 (emacs_read, emacs_write): Remove check for negative size, as the
15328 Emacs source code has been audited now.
15329 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15330 (emacs_read, emacs_write): Use it.
15331 * process.c (send_process): Adjust to the new signatures of
15332 emacs_write and emacs_gnutls_write. Do not attempt to store
15333 a byte offset into an 'int'; it might overflow.
15334 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15335
15336 * sound.c: Don't assume sizes fit in 'int'.
15337 (struct sound_device.period_size, alsa_period_size):
15338 Return EMACS_INT, not int.
15339 (struct sound_device.write, vox_write, alsa_write):
15340 Accept EMACS_INT, not int.
15341 (wav_play, au_play): Use EMACS_INT to store sizes and to
15342 record read return values.
15343
15344 2011-04-15 Ben Key <bkey76@gmail.com>
15345
15346 * keyboard.c (Qundefined): Don't declare static since it is used
15347 in nsfns.m.
15348 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15349 static since they are used in nsfont.m.
15350
15351 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15352
15353 * process.c (Qprocessp): Don't declare static.
15354 * lisp.h (Qprocessp): Declare again.
15355
15356 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15357
15358 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15359
15360 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15361
15362 Improve C-level modularity by making more things 'static'.
15363
15364 Don't publish debugger-only interfaces to other modules.
15365 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15366 (verify_bytepos, count_markers): Move decls to the only modules
15367 that need them.
15368 * region-cache.h (pp_cache): Likewise.
15369 * window.h (check_all_windows): Likewise.
15370 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15371
15372 * sysdep.c (croak): Now static, if
15373 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15374 * syssignal.h (croak): Declare only if not static.
15375
15376 * alloc.c (refill_memory_reserve): Now static if
15377 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15378 * lisp.h (refill_memory_reserve): Declare only if not static.
15379
15380 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15381 Define only if USE_LUCID.
15382
15383 * xrdb.c (x_customization_string, x_rm_string): Now static.
15384
15385 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15386 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15387
15388 * xdisp.c (draw_row_with_mouse_face): Now static.
15389 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15390
15391 * window.h (check_all_windows): Mark externally visible.
15392
15393 * window.c (window_deletion_count): Now static.
15394
15395 * undo.c: Make symbols static if they're not exported.
15396 (last_undo_buffer, last_boundary_position, pending_boundary):
15397 Now static.
15398
15399 * textprop.c (interval_insert_behind_hooks): Now static.
15400 (interval_insert_in_front_hooks): Likewise.
15401
15402 * term.c: Make symbols static if they're not exported.
15403 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15404 (max_frame_lines, tty_set_terminal_modes):
15405 (tty_reset_terminal_modes, tty_turn_off_highlight):
15406 (get_tty_terminal): Now static.
15407 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15408 * termhooks.h (term_mouse_moveto): Do not declare if
15409 HAVE_WINDOW_SYSTEM.
15410 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15411 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15412
15413 * sysdep.c: Make symbols static if they're not exported.
15414 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15415 Now static.
15416 (sigprocmask_set, full_mask): Remove; unused.
15417 (wait_debugging): Mark as visible.
15418 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15419 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15420
15421 * syntax.c (syntax_temp): Define only if !__GNUC__.
15422
15423 * sound.c (current_sound_device, current_sound): Now static.
15424
15425 * search.c (searchbufs, searchbuf_head): Now static.
15426
15427 * scroll.c (scroll_cost): Remove; unused.
15428 * dispextern.h (scroll_cost): Remove decl.
15429
15430 * region-cache.h (pp_cache): Mark as externally visible.
15431
15432 * process.c: Make symbols static if they're not exported.
15433 (process_tick, update_tick, create_process, chan_process):
15434 (Vprocess_alist, proc_buffered_char, datagram_access):
15435 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15436 (deactivate_process): Mark defn as static, as well as decl.
15437 * lisp.h (create_process): Remove decl.
15438 * process.h (chan_process, Vprocess_alist): Remove decls.
15439
15440 * print.c: Make symbols static if they're not exported.
15441 (print_depth, new_backquote_output, being_printed, print_buffer):
15442 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15443 (print_interval, print_number_index, initial_stderr_stream):
15444 Now static.
15445 * lisp.h (Fprinc): Remove decl.
15446 (debug_output_compilation_hack): Mark as externally visible.
15447
15448 * sysdep.c (croak): Move decl from here to syssignal.h.
15449 * syssignal.h (croak): Put it here, so the API can be checked when
15450 'croak' is called from dissociate_if_controlling_tty.
15451
15452 * minibuf.c: Make symbols static if they're not exported.
15453 (minibuf_save_list, choose_minibuf_frame): Now static.
15454 * lisp.h (choose_minibuf_frame): Remove decl.
15455
15456 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15457
15458 * lread.c: Make symbols static if they're not exported.
15459 (read_objects, initial_obarray, oblookup_last_bucket_number):
15460 Now static.
15461 (make_symbol): Remove; unused.
15462 * lisp.h (initial_obarray, make_symbol): Remove decls.
15463
15464 * keyboard.c: Make symbols static if they're not exported.
15465 (single_kboard, recent_keys_index, total_keys, recent_keys):
15466 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15467 (this_single_command_key_start, echoing, last_auto_save):
15468 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15469 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15470 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15471 (Vlispy_mouse_stem, double_click_count):
15472 Now static.
15473 (force_auto_save_soon): Define only if SIGDANGER.
15474 (ignore_mouse_drag_p): Now static if
15475 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15476 (print_help): Remove; unused.
15477 (stop_character, last_timer_event): Mark as externally visible.
15478 * keyboard.h (ignore_mouse_drag_p): Declare only if
15479 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15480 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15481 * lisp.h (echoing): Remove decl.
15482 (force_auto_save_soon): Declare only if SIGDANGER.
15483 * xdisp.c (redisplay_window): Simplify code, to make it more
15484 obvious that ignore_mouse_drag_p is not accessed if !defined
15485 USE_GTK && !defined HAVE_NS.
15486
15487 * intervals.c: Make symbols static if they're not exported.
15488 (merge_properties_sticky, merge_interval_right, delete_interval):
15489 Now static.
15490 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15491
15492 * insdel.c: Make symbols static if they're not exported.
15493 However, leave prepare_to_modify_buffer alone. It's never
15494 called from outside this function, but that appears to be a bug.
15495 (combine_after_change_list, combine_after_change_buffer):
15496 (adjust_after_replace, signal_before_change): Now static.
15497 (adjust_after_replace_noundo): Remove; unused.
15498 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15499 (signal_before_change): Remove decls.
15500
15501 * indent.c (val_compute_motion, val_vmotion): Now static.
15502
15503 * image.c: Make symbols static if they're not exported.
15504 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15505 if USE_GTK.
15506 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15507 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15508
15509 * fringe.c (standard_bitmaps): Now static.
15510 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15511
15512 * frame.c: Make symbols static if they're not exported.
15513 (x_report_frame_params, make_terminal_frame): Now static.
15514 (get_frame_param): Now static, unless HAVE_NS.
15515 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15516 (x_get_resource_string): Remove; not used.
15517 * frame.h (make_terminal_frame, x_report_frame_params):
15518 (x_get_resource_string); Remove decls.
15519 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15520 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15521
15522 * font.c, fontset.c: Make symbols static if they're not exported.
15523 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15524 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15525 * font.c (font_close_object): Now static.
15526 * font.h (font_close_object): Remove.
15527 * fontset.c (FONTSET_OBJLIST): Remove.
15528 (free_realized_fontset) #if-0 the body, which does nothing.
15529 (face_suitable_for_char_p): #if-0, as it's never called.
15530 * fontset.h (face_suitable_for_char_p): Remove decl.
15531 * xfaces.c (face_at_string_position):
15532 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15533 since 0 is always ASCII.
15534
15535 * fns.c (weak_hash_tables): Now static.
15536
15537 * fileio.c: Make symbols static if they're not exported.
15538 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15539 (Vwrite_region_annotation_buffers): Now static.
15540
15541 * eval.c: Make symbols static if they're not exported.
15542 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15543 * lisp.h (backtrace_list): Remove decl.
15544
15545 * emacs.c: Make symbols static if they're not exported.
15546 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15547 (fatal_error_code, fatal_error_signal_hook, standard_args):
15548 Now static.
15549 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15550 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15551 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15552 * lisp.h (fatal_error_signal_hook): Remove decl.
15553 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15554
15555 * editfns.c: Move a (normally-unused) function to its only use.
15556 * editfns.c, lisp.h (get_operating_system_release): Remove.
15557 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15558 worth the hassle of breaking this out.
15559
15560 * xterm.c: Make symbols static if they're not exported.
15561 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15562 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15563 (x_destroy_window, x_delete_display):
15564 Now static.
15565 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15566 (x_mouse_leave): Remove; unused.
15567 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15568 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15569 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15570 Remove decls.
15571 (x_mouse_leave): Declare only if WINDOWSNT.
15572 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15573 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15574 USE_X_TOOLKIT.
15575
15576 * ftxfont.c: Make symbols static if they're not exported.
15577 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15578 HAVE_FREETYPE.
15579 * font.h (ftxfont_driver): Likewise.
15580
15581 * xfns.c: Make symbols static if they're not exported.
15582 (x_last_font_name, x_display_info_for_name):
15583 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15584 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15585 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15586 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15587 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15588 (last_show_tip_args): Now static.
15589 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15590 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15591 (x_screen_planes): Remove; unused.
15592 * dispextern.h (x_screen_planes): Remove decl.
15593
15594 * dispnew.c: Make symbols static if they're not exported.
15595 * dispextern.h (redraw_garbaged_frames, scrolling):
15596 (increment_row_positions): Remove.
15597 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15598 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15599 Now static.
15600 (redraw_garbaged_frames): Remove; unused.
15601
15602 * xfaces.c: Make symbols static if they're not exported.
15603 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15604 Remove decls.
15605 * xterm.h (defined_color): Remove decls.
15606 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15607 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15608 (menu_face_changed_default, defined_color, free_realized_face):
15609 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15610 (ascii_face_of_lisp_face): Remove; unused.
15611
15612 * xdisp.c: Make symbols static if they're not exported.
15613 * dispextern.h (scratch_glyph_row, window_box_edges):
15614 (glyph_to_pixel_coords, set_cursor_from_row):
15615 (get_next_display_element, set_iterator_to_next):
15616 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15617 (show_mouse_face): Remove decls
15618 * frame.h (message_buf_print): Likewise.
15619 * lisp.h (pop_message, set_message, check_point_in_composition):
15620 Likewise.
15621 * xterm.h (set_vertical_scroll_bar): Likewise.
15622 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15623 (message_buf_print, scratch_glyph_row, displayed_buffer):
15624 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15625 (get_next_display_element, show_mouse_face, window_box_edges):
15626 (frame_to_window_pixel_xy, check_point_in_composition):
15627 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15628 (glyph_to_pixel_coords): Remove; unused.
15629
15630 * dired.c (file_name_completion): Now static.
15631
15632 * dbusbind.c (xd_in_read_queued_messages): Now static.
15633
15634 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15635 * data.c (circular_list_error): Remove.
15636
15637 * commands.h (last_point_position, last_point_position_buffer):
15638 (last_point_position_window): Remove decls.
15639 * keyboard.c: Make these variables static.
15640
15641 * coding.h (coding, code_convert_region, encode_coding_gap):
15642 Remove decls.
15643 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15644 (iso_code_class, detect_coding, code_convert_region): Now static.
15645 (encode_coding_gap): Remove; unused.
15646
15647 * chartab.c (chartab_chars, chartab_bits): Now static.
15648
15649 * charset.h (charset_iso_8859_1): Remove decl.
15650 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15651 Now static.
15652
15653 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15654 * ccl.c (Vccl_program_table): Now static.
15655 (check_ccl_update): Remove; unused.
15656
15657 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15658 * category.h: ... from here.
15659 * category.c (check_category_table, set_category_set): Now static.
15660
15661 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15662 * lisp.h: Remove these decls.
15663
15664 * buffer.c (buffer_count): Remove unused var.
15665
15666 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15667 so that it's not optimized away.
15668 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15669 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15670 exported only to the debugger.
15671
15672 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15673 * atimer.h (run_all_atimers): Remove; not exported.
15674
15675 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15676 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15677 was inaccessible from Lisp.
15678 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15679 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15680
15681 alloc.c: Import and export fewer symbols, and remove unused items.
15682 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15683 is defined.
15684 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15685 it's not optimized away by whole-program optimization.
15686 (message_enable_multibyte, free_misc): Remove.
15687 (catchlist, handlerlist, mark_backtrace):
15688 Declare only if BYTE_MARK_STACK.
15689 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15690 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15691 (message_enable_multibyte): Remove decl.
15692 (free_misc, interval_free_list, float_block, float_block_index):
15693 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15694 (cons_free_list, last_marked_index):
15695 Now static.
15696 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15697 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15698 (mark_backtrace): Define only if BYTE_MARK_STACK.
15699 * xdisp.c (message_enable_multibyte): Now static.
15700
15701 Declare Lisp_Object Q* variables to be 'static' if not exported.
15702 This makes it easier for human readers (and static analyzers)
15703 to see whether these variables are used from other modules.
15704 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15705 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15706 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15707 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15708 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15709 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15710 * xmenu.c, xselect.c:
15711 Declare Q* vars static if they are not used in other modules.
15712 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15713 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15714 Remove decls of unexported vars.
15715 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15716
15717 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15718
15719 Make Emacs functions such as Fatom 'static' by default.
15720 This makes it easier for human readers (and static analyzers)
15721 to see whether these functions can be called from other modules.
15722 DEFUN now defines a static function. To make the function external
15723 so that it can be used in other C modules, use the new macro DEFUE.
15724 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15725 (Finit_image_library):
15726 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15727 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15728 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15729 Remove decls, since these functions are now static.
15730 (Funintern, Fget_internal_run_time): New decls, since these functions
15731 were already external.
15732
15733 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15734 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15735 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15736 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15737 * keyboard.c, keymap.c, lread.c:
15738 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15739 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15740 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15741 Mark functions with DEFUE instead of DEFUN,
15742 if they are used in other modules.
15743 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15744 decls for now-static functions.
15745 * buffer.h (Fdelete_overlay): Remove decl.
15746 * callproc.c (Fgetenv_internal): Mark as internal.
15747 * composite.c (Fremove_list_of_text_properties): Remove decl.
15748 (Fcomposition_get_gstring): New forward static decl.
15749 * composite.h (Fcomposite_get_gstring): Remove decl.
15750 * dired.c (Ffile_attributes): New forward static decl.
15751 * doc.c (Fdocumntation_property): New forward static decl.
15752 * eval.c (Ffetch_bytecode): New forward static decl.
15753 (Funintern): Remove extern decl; now in .h file where it belongs.
15754 * fileio.c (Fmake_symbolic_link): New forward static decl.
15755 * image.c (Finit_image_library): New forward static decl.
15756 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15757 * intervals.h (Fprevious_property_change):
15758 (Fremove_list_of_text_properties): Remove decls.
15759 * keyboard.c (Fthis_command_keys): Remove decl.
15760 (Fcommand_execute): New forward static decl.
15761 * keymap.c (Flookup_key): New forward static decl.
15762 (Fcopy_keymap): Now static.
15763 * keymap.h (Flookup_key): Remove decl.
15764 * process.c (Fget_process): New forward static decl.
15765 (Fprocess_datagram_address): Mark as internal.
15766 * syntax.c (Fsyntax_table_p): New forward static decl.
15767 (skip_chars): Remove duplicate decl.
15768 * textprop.c (Fprevious_property_change): New forward static decl.
15769 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15770 Now internal.
15771 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15772 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15773
15774 * editfns.c (Fformat): Remove unreachable code.
15775
15776 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15777
15778 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15779 change. (Bug#8496)
15780
15781 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15782
15783 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15784 when at ZV. (Bug#8487)
15785
15786 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15787
15788 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15789 (Bug#8437)
15790 * keyboard.c (parse_tool_bar_item): Likewise.
15791 * sound.c (sound_cleanup, alsa_close): Likewise.
15792 * termcap.c (tgetent): Likewise.
15793 * xfns.c (x_default_font_parameter): Likewise.
15794 * xsettings.c (read_and_apply_settings): Likewise.
15795
15796 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15797 (overrun_check_free): Protoize.
15798
15799 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15800
15801 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15802 since callers should never pass a negative size.
15803 Change the signature to match that of plain 'read' and 'write'; see
15804 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15805 * lisp.h: Update prototypes of emacs_write and emacs_read.
15806
15807 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15808
15809 * xdisp.c (redisplay_window): Don't try to determine the character
15810 position of the scroll margin if the window start point w->startp
15811 is outside the buffer's accessible region. (Bug#8468)
15812
15813 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15814
15815 Fix write-region and its subroutines for buffers > 2GB.
15816 * fileio.c (a_write, e_write): Modify declaration of arguments and
15817 local variables to support buffers larger than 2GB.
15818 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15819
15820 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15821 argument, local variables, and return value.
15822
15823 * lisp.h: Update prototypes of emacs_write and emacs_read.
15824
15825 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15826
15827 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15828
15829 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15830
15831 Fix more problems found by GCC 4.6.0's static checks.
15832
15833 * xdisp.c (vmessage): Use a better test for character truncation.
15834
15835 * charset.c (load_charset_map): <, not <=, for optimization,
15836 and to avoid potential problems with integer overflow.
15837 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15838 * casetab.c (set_identity, shuffle): Likewise.
15839 * editfns.c (Fformat): Likewise.
15840 * syntax.c (skip_chars): Likewise.
15841
15842 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15843 This also lets GCC 4.6.0 generate slightly better loop code.
15844
15845 * callint.c (Fcall_interactively): <, not <=, for optimization.
15846 (Fcall_interactively): Count the number of arguments produced,
15847 not the number of arguments given. This is simpler and lets GCC
15848 4.6.0 generate slightly better code.
15849
15850 * ftfont.c: Distingish more carefully between FcChar8 and char.
15851 The previous code passed unsigned char * to a functions like
15852 strlen and xstrcasecmp that expect char *, which does not
15853 conform to the C standard.
15854 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15855 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15856 char * when the C standard requires it.
15857
15858 * keyboard.c (read_char): Remove unused var.
15859
15860 * eval.c: Port to Windows vsnprintf (Bug#8435).
15861 Include <limits.h>.
15862 (SIZE_MAX): Define if the headers do not.
15863 (verror): Do not give up if vsnprintf returns a negative count.
15864 Instead, grow the buffer. This ports to Windows vsnprintf, which
15865 does not conform to C99. Problem reported by Eli Zaretskii.
15866 Also, simplify the allocation scheme, by avoiding the need for
15867 calling realloc, and removing the ALLOCATED variable.
15868
15869 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15870
15871 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15872 But keep the doprint source code for now, as we might revamp it
15873 and use it again (Bug#8435).
15874 * lisp.h (doprnt): Remove.
15875 * Makefile.in (base_obj): Remove doprnt.o.
15876 * deps.mk (doprnt.o): Remove.
15877
15878 error: Print 32- and 64-bit integers portably (Bug#8435).
15879 Without this change, on typical 64-bit hosts error ("...%d...", N)
15880 was used to print both 32- and 64-bit integers N, which relied on
15881 undefined behavior.
15882 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15883 * lisp.h (error, verror): Mark as printf-like functions.
15884 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15885 Report overflow in size calculations when allocating printf buffer.
15886 Do not truncate output string at its first null byte.
15887 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15888 Truncate the output at a character boundary, since vsnprintf does not
15889 do that.
15890 * charset.c (check_iso_charset_parameter): Convert internal
15891 character to string before calling 'error', since %c now has the
15892 printf meaning.
15893 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15894 overflow when computing char to be passed to 'error'. Do not
15895 pass Lisp_Object to 'error'; pass the integer instead.
15896 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15897 formatted with plain %d.
15898
15899 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15900
15901 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15902
15903 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15904
15905 * xterm.c (x_catch_errors): Remove duplicate declaration.
15906
15907 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15908
15909 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15910
15911 2011-04-10 Jim Meyering <meyering@redhat.com>
15912
15913 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15914 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15915 return ssize_t not "int", and use size_t as the buffer length.
15916 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15917 * gnutls.h: Update declarations.
15918 * process.c (read_process_output): Use ssize_t, to match.
15919 (send_process): Likewise.
15920
15921 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15922
15923 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15924
15925 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15926
15927 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15928 Use unsigned char, to match FcChar8 type definition.
15929
15930 * xterm.c (handle_one_xevent):
15931 * xmenu.c (create_and_show_popup_menu):
15932 * xselect.c (x_decline_selection_request)
15933 (x_reply_selection_request): Avoid type-punned deref of X events.
15934
15935 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15936
15937 Fix some uses of `int' instead of EMACS_INT.
15938 * search.c (string_match_1, fast_string_match)
15939 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15940 (scan_buffer, find_next_newline_no_quit)
15941 (find_before_next_newline, search_command, Freplace_match)
15942 (Fmatch_data): Make some `int' variables be EMACS_INT.
15943
15944 * xdisp.c (display_count_lines): 3rd argument and return value now
15945 EMACS_INT. All callers changed.
15946 (pint2hrstr): Last argument is now EMACS_INT.
15947
15948 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15949 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15950 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15951 (decode_coding_utf_16, decode_coding_emacs_mule)
15952 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15953 (decode_coding_ccl, decode_coding_charset)
15954 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15955 (decode_coding_iso_2022, decode_coding_emacs_mule)
15956 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15957 <char_offset, last_offset>: Declare EMACS_INT.
15958 (encode_coding_utf_8, encode_coding_utf_16)
15959 (encode_coding_emacs_mule, encode_invocation_designation)
15960 (encode_designation_at_bol, encode_coding_iso_2022)
15961 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15962 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15963 Declare EMACS_INT.
15964 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15965 (encode_invocation_designation): Last argument P_NCHARS is now
15966 EMACS_INT.
15967 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15968 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15969
15970 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15971 All users changed.
15972
15973 * ccl.c (Fccl_execute_on_string): Declare some variables
15974 EMACS_INT.
15975
15976 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15977
15978 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15979
15980 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15981
15982 * process.c (Fformat_network_address): Doc fix.
15983
15984 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15985
15986 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15987
15988 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15989
15990 * keyboard.c (read_char): Call Lisp function help-form-show,
15991 instead of using internal_with_output_to_temp_buffer.
15992 (Qhelp_form_show): New var.
15993 (syms_of_keyboard): Use DEFSYM macro.
15994
15995 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15996
15997 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15998
15999 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16000
16001 * process.c (Flist_processes): Remove to Lisp.
16002 (list_processes_1): Delete.
16003
16004 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16005
16006 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16007
16008 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16009
16010 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16011
16012 Fix more problems found by GCC 4.6.0's static checks.
16013
16014 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16015
16016 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16017
16018 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16019
16020 * xdisp.c (vmessage): Mark as a printf-like function.
16021
16022 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16023
16024 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16025
16026 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16027 printf-like functions.
16028 (tiff_load): Add casts to remove these marks before passing them
16029 to system-supplied API.
16030
16031 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16032
16033 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16034 This avoids several warnings with gcc -Wstrict-overflow.
16035 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16036 directly, rather than having caller test rule sign. This avoids
16037 some unnecessary tests.
16038 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16039 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16040 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16041
16042 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16043 (xfont_open): Avoid unnecessary tests.
16044
16045 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16046
16047 * composite.h, composite.c (composition_gstring_put_cache):
16048 Use EMACS_INT, not int, for length.
16049
16050 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16051 breaking out part of COMPOSITION_DECODE_RULE.
16052 (COMPOSITION_DECODE_RULE): Use it.
16053 * composite.c (get_composition_id): Remove unused local vars,
16054 by using the new macro.
16055
16056 * textprop.c (set_text_properties_1): Change while to do-while,
16057 since the condition is always true at first.
16058
16059 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16060 (interval_deletion_adjustment): Return unsigned value.
16061 All uses changed.
16062
16063 * process.c (list_processes_1, create_pty, read_process_output):
16064 (exec_sentinel): Remove vars that were set but not used.
16065 (create_pty): Remove unnecessary "volatile"s.
16066 (Fnetwork_interface_info): Avoid possibility of int overflow.
16067 (read_process_output): Do adaptive read buffering even if carryover.
16068 (read_process_output): Simplify nbytes computation if buffered.
16069
16070 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16071
16072 * syntax.c (scan_words): Remove var that was set but not used.
16073 (update_syntax_table): Use unsigned instead of int.
16074
16075 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16076 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16077 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16078
16079 * print.c (print_error_message): Avoid int overflow.
16080
16081 * font.c (font_list_entities): Redo for clarity,
16082 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16083
16084 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16085 (font_score): Avoid potential overflow in diff calculation.
16086
16087 * fns.c (substring_both): Remove var that is set but not used.
16088 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16089
16090 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16091
16092 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16093 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16094 can always succeed if overflow has undefined behavior.
16095
16096 * search.c (boyer_moore, wordify): Remove vars set but not used.
16097 (wordify): Omit three unnecessary tests.
16098
16099 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16100 All callers changed. This avoids the need for an unused var.
16101
16102 * casefiddle.c (casify_region): Remove var that is set but not used.
16103
16104 * dired.c (file_name_completion): Remove var that is set but not used.
16105
16106 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16107
16108 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16109 (Finsert_file_contents): Remove unnecessary code checking fd.
16110
16111 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16112 Check for integer overflow on size calculations.
16113
16114 * buffer.c (Fprevious_overlay_change): Remove var that is set
16115 but not used.
16116
16117 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16118 Remove vars that are set but not used.
16119 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16120 (timer_check_2): Mark vars as initialized.
16121
16122 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16123
16124 * image.c (lookup_image): Remove var that is set but not used.
16125 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16126
16127 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16128 that are set but not used.
16129
16130 * xfns.c (make_invisible_cursor): Don't return garbage
16131 if XCreateBitmapFromData fails (Bug#8410).
16132
16133 * xselect.c (x_get_local_selection, x_handle_property_notify):
16134 Remove vars that are set but not used.
16135
16136 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16137 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16138
16139 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16140 Remove var that is set but not used.
16141 (scroll_bar_windows_size): Now size_t, not int.
16142 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16143 Check for overflow.
16144
16145 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16146 (map_tty_color) [!defined MSDOS]: Likewise.
16147
16148 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16149
16150 * coding.c: Remove vars that are set but not used.
16151 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16152 All callers changed.
16153 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16154 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16155 (decode_coding_charset): Remove vars that are set but not used.
16156
16157 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16158 that is set but not used.
16159
16160 * print.c (print_object): Remove var that is set but not used.
16161
16162 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16163 The gnulib version avoids calling malloc in the usual case,
16164 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16165 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16166 * filelock.c (current_lock_owner): Likewise.
16167 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16168 * sysdep.c: Include allocator.h, careadlinkat.h.
16169 (emacs_no_realloc_allocator): New static constant.
16170 (emacs_readlink): New function.
16171 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16172 ../lib/careadlinkat.h.
16173
16174 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16175
16176 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16177 first non-nil return value).
16178
16179 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16180
16181 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16182 if not defined (Bug#8403).
16183
16184 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16185
16186 * xdisp.c (display_count_lines): Remove parameter `start',
16187 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16188 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16189 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16190 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16191 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16192 and thereabouts. All callers changed.
16193 (get_per_char_metric): Remove parameter `f', unused since
16194 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16195
16196 2011-04-02 Jim Meyering <meyering@redhat.com>
16197
16198 do not dereference NULL upon failed strdup
16199 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16200 (ns_get_family): Likewise.
16201
16202 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16203
16204 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16205
16206 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16207
16208 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16209 later (Bug#8403).
16210
16211 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16212
16213 Add lexical binding.
16214
16215 * window.c (Ftemp_output_buffer_show): New fun.
16216 (Fsave_window_excursion):
16217 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16218
16219 * lread.c (lisp_file_lexically_bound_p): New function.
16220 (Fload): Bind Qlexical_binding.
16221 (readevalloop): Remove `evalfun' arg.
16222 Bind Qinternal_interpreter_environment.
16223 (Feval_buffer): Bind Qlexical_binding.
16224 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16225 Mark as dynamic.
16226 (syms_of_lread): Declare `lexical-binding'.
16227
16228 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16229
16230 * keyboard.c (eval_dyn): New fun.
16231 (menu_item_eval_property): Use it.
16232
16233 * image.c (parse_image_spec): Use Ffunctionp.
16234
16235 * fns.c (concat, mapcar1): Accept byte-code-functions.
16236
16237 * eval.c (Fsetq): Handle lexical vars.
16238 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16239 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16240 (FletX, Flet): Obey lexical binding.
16241 (Fcommandp): Handle closures.
16242 (Feval): New `lexical' arg.
16243 (eval_sub): New function extracted from Feval. Use it almost
16244 everywhere where Feval was used. Look up vars in lexical env.
16245 Handle closures.
16246 (Ffunctionp): Move from subr.el.
16247 (Ffuncall): Handle closures.
16248 (apply_lambda): Remove `eval_flags'.
16249 (funcall_lambda): Handle closures and new byte-code-functions.
16250 (Fspecial_variable_p): New function.
16251 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16252 but without exporting it to Lisp.
16253
16254 * doc.c (Fdocumentation, store_function_docstring):
16255 * data.c (Finteractive_form): Handle closures.
16256
16257 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16258 interactive spec.
16259
16260 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16261 New byte-codes.
16262 (exec_byte_code): New function extracted from Fbyte_code to handle new
16263 calling convention for byte-code-functions. Add new byte-codes.
16264
16265 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16266
16267 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16268
16269 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16270
16271 * xdisp.c (redisplay_internal): Fix prototype.
16272
16273 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16274
16275 * xdisp.c (SCROLL_LIMIT): New macro.
16276 (try_scrolling): Use it when setting scroll_limit.
16277 Limit scrolling to 100 screen lines.
16278 (redisplay_window): Even when falling back on "recentering",
16279 position point in the window according to scroll-conservatively,
16280 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16281
16282 (try_scrolling): When point is above the window, allow searching
16283 as far as scroll_max, or one screenful, to compute vertical
16284 distance from PT to the scroll margin position. This prevents
16285 try_scrolling from unnecessarily failing when
16286 scroll-conservatively is set to a value slightly larger than the
16287 window height. Clean up the case of PT below the margin at bottom
16288 of window: scroll_max can no longer be INT_MAX. When aggressive
16289 scrolling is in use, don't let point enter the opposite scroll
16290 margin as result of the scroll.
16291 (syms_of_xdisp) <scroll-conservatively>: Document the
16292 threshold of 100 lines for never-recentering scrolling.
16293
16294 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16295
16296 * dispextern.h (move_it_by_lines):
16297 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16298 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16299 (message_log_check_duplicate): Remove parameters `prev_bol' and
16300 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16301 (redisplay_internal): Remove parameter `preserve_echo_area',
16302 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16303
16304 * indent.c (Fvertical_motion):
16305 * window.c (window_scroll_pixel_based, Frecenter):
16306 Don't pass `need_y_p' to `move_it_by_lines'.
16307
16308 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16309
16310 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16311 steal a few bits to be more compact.
16312 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16313 Remove unneeded casts.
16314
16315 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16316
16317 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16318
16319 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16320 binding" message (bug#7967).
16321
16322 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16323
16324 Fix more problems found by GCC 4.6.0's static checks.
16325
16326 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16327 Remove unused local var.
16328
16329 * editfns.c (Fmessage_box): Remove unused local var.
16330
16331 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16332 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16333 Omit unused local vars.
16334 * window.c (shrink_windows): Omit unused local var.
16335 * menu.c (digest_single_submenu): Omit unused local var.
16336 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16337 Omit unused local var.
16338
16339 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16340 Don't assume string length fits in int.
16341 (keyremap_step, read_key_sequence): Use size_t for sizes.
16342 (read_key_sequence): Don't check last_real_key_start redundantly.
16343
16344 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16345 instead of alloca (Bug#8344).
16346
16347 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16348 (Fbacktrace_frame): Don't assume nframes fits in int.
16349
16350 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16351
16352 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16353 concerns.
16354
16355 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16356
16357 * cm.c (calccost): Turn while-do into do-while, for clarity.
16358
16359 * keyboard.c (syms_of_keyboard): Use the same style as later
16360 in this function when indexing through an array. This also
16361 works around GCC bug 48267.
16362
16363 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16364
16365 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16366
16367 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16368 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16369
16370 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16371 This avoids undefined behavior on integer overflow, and is a bit
16372 more convenient anyway since it is compared to a size_t variable.
16373
16374 Variadic C functions now count arguments with size_t, not int.
16375 This avoids an unnecessary limitation on 64-bit machines, which
16376 caused (substring ...) to crash on large vectors (Bug#8344).
16377 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16378 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16379 All variadic functions and their callers changed accordingly.
16380 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16381 * data.c (arith_driver, float_arith_driver): Likewise.
16382 * editfns.c (general_insert_function): Likewise.
16383 * eval.c (struct backtrace.nargs, interactive_p)
16384 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16385 (funcall_lambda, mark_backtrace): Likewise.
16386 * fns.c (concat): Likewise.
16387 * frame.c (x_set_frame_parameters): Likewise.
16388 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16389 0 if not found, not -1. All callers changed.
16390
16391 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16392 (stack_copy_size): Now size_t, not int.
16393 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16394
16395 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16396
16397 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16398 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16399 All callers changed.
16400
16401 * lisp.h (multibyte_char_to_unibyte):
16402 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16403 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16404 * character.h (CHAR_TO_BYTE8):
16405 * cmds.c (internal_self_insert):
16406 * editfns.c (general_insert_function):
16407 * keymap.c (push_key_description):
16408 * search.c (Freplace_match):
16409 * xdisp.c (message_dolog, set_message_1): All callers changed.
16410
16411 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16412
16413 * keyboard.c (safe_run_hook_funcall): New function.
16414 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16415 don't set the hook to nil, but remove the offending function instead.
16416 (Qcommand_hook_internal): Remove, unused.
16417 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16418 Vcommand_hook_internal.
16419
16420 * eval.c (enum run_hooks_condition): Remove.
16421 (funcall_nil, funcall_not): New functions.
16422 (run_hook_with_args): Call each function through a `funcall' argument.
16423 Remove `cond' argument, now redundant.
16424 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16425 (Frun_hook_with_args_until_failure): Adjust accordingly.
16426 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16427
16428 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16429
16430 * dispextern.h (string_buffer_position): Remove declaration.
16431
16432 * print.c (strout): Remove parameter `multibyte', unused since
16433 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16434
16435 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16436 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16437 All callers changed.
16438
16439 * w32.c (_wsa_errlist): Use braces for struct initializers.
16440
16441 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16442 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16443 All callers changed.
16444 (string_buffer_position): Likewise. Also, make static (it's never
16445 used outside xdisp.c).
16446 (cursor_row_p): Remove parameter `w', unused since
16447 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16448 (decode_mode_spec): Remove parameter `precision', introduced during
16449 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16450 All callers changed.
16451
16452 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16453
16454 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16455
16456 2011-03-27 Anders Lindgren <andlind@gmail.com>
16457
16458 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16459 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16460 (ns_update_auto_hide_menu_bar): New functions.
16461 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16462 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16463 ns_constrain_all_frames.
16464 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16465 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16466
16467 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16468
16469 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16470
16471 2011-03-27 Glenn Morris <rgm@gnu.org>
16472
16473 * syssignal.h: Replace RETSIGTYPE with void.
16474 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16475 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16476 Replace SIGTYPE with void everywhere.
16477 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16478 * s/template.h (SIGTYPE): Remove commented out definition.
16479
16480 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16481
16482 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16483 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16484
16485 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16486
16487 * w32.c (read_unc_volume): Use parameter `henum', instead of
16488 global variable `wget_enum_handle'.
16489
16490 * keymap.c (describe_vector): Remove parameters `indices' and
16491 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16492 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16493
16494 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16495
16496 * keyboard.c (timer_check): Remove parameter `do_it_now',
16497 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16498 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16499 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16500
16501 * keyboard.c (read_char):
16502 * w32menu.c (w32_menu_display_help):
16503 * xmenu.c (show_help_event, menu_help_callback):
16504 Adjust calls to `show_help_echo'.
16505
16506 * gtkutil.c (xg_maybe_add_timer):
16507 * keyboard.c (readable_events):
16508 * process.c (wait_reading_process_output):
16509 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16510
16511 * insdel.c (adjust_markers_gap_motion):
16512 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16513 (gap_left, gap_right): Don't call it.
16514
16515 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16516
16517 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16518 incurred during fontification.
16519
16520 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16521
16522 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16523 (DEFVAR_PER_BUFFER): Don't pass it.
16524
16525 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16526 (scrolling_window): Don't pass it.
16527
16528 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16529
16530 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16531
16532 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16533 and `suffix'.
16534 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16535 of variables specific to SELinux and computation of `encoded_absname'.
16536
16537 * image.c (XPutPixel): Remove unused variable `height'.
16538
16539 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16540
16541 * unexw32.c (get_section_info): Remove unused variable `section'.
16542
16543 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16544 (system_process_attributes): Remove unused variable `sess'.
16545 (sys_read): Remove unused variable `err'.
16546
16547 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16548 (w32_wnd_proc): Remove unused variable `isdead'.
16549 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16550 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16551 (x_create_tip_frame): Remove unused variable `tem'.
16552
16553 * w32inevt.c (w32_console_read_socket):
16554 Remove unused variable `no_events'.
16555
16556 * w32term.c (x_draw_composite_glyph_string_foreground):
16557 Remove unused variable `width'.
16558
16559 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16560
16561 * w32term.c (x_set_glyph_string_clipping):
16562 Don't pass uninitialized region to CombineRgn.
16563
16564 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16565
16566 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16567 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16568 (Fx_close_connection): Remove unused variable `i'.
16569
16570 * w32font.c (w32font_draw): Return number of glyphs.
16571 (w32font_open_internal): Remove unused variable `i'.
16572 (w32font_driver): Add missing initializer.
16573
16574 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16575 (fill_in_menu): Remove unused variable `items_added'.
16576
16577 * w32term.c (last_mouse_press_frame): Remove static global variable.
16578 (w32_clip_to_row): Remove unused variable `f'.
16579 (x_delete_terminal): Remove unused variable `i'.
16580
16581 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16582 (NOTHING): Remove unused static global variable.
16583 (uniscribe_check_otf): Remove unused variable `table'.
16584 (uniscribe_font_driver): Add missing initializers.
16585
16586 2011-03-23 Julien Danjou <julien@danjou.info>
16587
16588 * term.c (Fsuspend_tty, Fresume_tty):
16589 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16590 * window.c (temp_output_buffer_show):
16591 * insdel.c (signal_before_change):
16592 * frame.c (Fhandle_switch_frame):
16593 * fileio.c (Fdo_auto_save):
16594 * emacs.c (Fkill_emacs):
16595 * editfns.c (save_excursion_restore):
16596 * cmds.c (internal_self_insert):
16597 * callint.c (Fcall_interactively):
16598 * buffer.c (Fkill_all_local_variables):
16599 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16600 Use Frun_hooks.
16601 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16602 unconditionally since it does the check itself.
16603
16604 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16605
16606 Fix more problems found by GCC 4.5.2's static checks.
16607
16608 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16609 the first time through the loop, since we know p0 < p1 then.
16610 This also avoids a gcc -Wstrict-overflow warning.
16611
16612 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16613 leading to a memory leak, possible in functions like
16614 load_charset_map_from_file that can allocate an unbounded number
16615 of objects (Bug#8318).
16616
16617 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16618 that could (at least in theory) be that large.
16619
16620 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16621 This is less likely to overflow, and avoids undefined behavior if
16622 overflow does occur. All callers changed. Use strtoul to scan
16623 for the unsigned long integer.
16624 (pint2hrstr): Simplify and tune code slightly.
16625 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16626
16627 * scroll.c (do_scrolling): Work around GCC bug 48228.
16628 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16629
16630 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16631 This also avoids a warning with gcc -Wstrict-overflow.
16632 (validate_x_resource_name): Simplify count usage.
16633 This also avoids a warning with gcc -Wstrict-overflow.
16634
16635 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16636 fail (Bug#8306).
16637
16638 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16639
16640 * process.c (Fmake_network_process): Use socklen_t, not int,
16641 where POSIX says socklen_t is required in portable programs.
16642 This fixes a porting bug on hosts like 64-bit HP-UX, where
16643 socklen_t is wider than int (Bug#8277).
16644 (Fmake_network_process, server_accept_connection):
16645 (wait_reading_process_output, read_process_output):
16646 Likewise.
16647
16648 * process.c: Rename or move locals to avoid shadowing.
16649 (list_processes_1, Fmake_network_process):
16650 (read_process_output_error_handler, exec_sentinel_error_handler):
16651 Rename or move locals.
16652 (Fmake_network_process): Define label "retry_connect" only if needed.
16653 (Fnetwork_interface_info): Fix pointer signedness.
16654 (process_send_signal): Add cast to avoid pointer signedness problem.
16655 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16656 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16657
16658 Make tparam.h and terminfo.c consistent.
16659 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16660 Include tparam.h instead, since it declares them.
16661 * cm.h (PC): Remove extern decl; tparam.h now does this.
16662 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16663 * terminfo.c: Include tparam.h, to check interfaces.
16664 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16665 (tparam): Adjust signature to match interface in tparam.h;
16666 this removes some undefined behavior. Check that outstring and len
16667 are zero, which they always are with Emacs.
16668 * tparam.h (PC, BC, UP): New extern decls.
16669
16670 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16671 (xftfont_open): Rename locals to avoid shadowing.
16672
16673 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16674 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16675 (OTF_TAG_SYM): Omit macro if not needed.
16676 (ftfont_list): Remove unused local.
16677 (get_adstyle_property, ftfont_pattern_entity):
16678 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16679 Rename locals to avoid shadowing.
16680
16681 * xfont.c (xfont_list_family): Mark var as initialized.
16682
16683 * xml.c (make_dom): Now static.
16684
16685 * composite.c (composition_compute_stop_pos): Rename local to
16686 avoid shadowing.
16687 (composition_reseat_it): Remove unused locals.
16688 (find_automatic_composition, composition_adjust_point): Likewise.
16689 (composition_update_it): Mark var as initialized.
16690 (find_automatic_composition): Mark vars as initialized,
16691 with a FIXME (Bug#8290).
16692
16693 character.h: Rename locals to avoid shadowing.
16694 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16695 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16696 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16697 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16698 to avoid shadowing.
16699
16700 * textprop.c (property_change_between_p): Remove; unused.
16701
16702 * intervals.c (interval_start_pos): Now static.
16703
16704 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16705
16706 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16707 Rename locals to avoid shadowing.
16708
16709 * sound.c (wav_play, au_play, Fplay_sound_internal):
16710 Fix pointer signedness.
16711 (alsa_choose_format): Remove unused local var.
16712 (wav_play): Initialize a variable to 0, to prevent undefined
16713 behavior (Bug#8278).
16714
16715 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16716
16717 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16718
16719 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16720 clobbering (Bug#8298).
16721 * sysdep.c (sys_subshell): Likewise.
16722 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16723
16724 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16725 This should get cleaned up, so that child_setup has the
16726 same signature on all platforms.
16727
16728 * callproc.c (call_process_cleanup): Now static.
16729 (relocate_fd): Rename locals to avoid shadowing.
16730
16731 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16732
16733 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16734 not to be necessary, and produces flickering.
16735
16736 2011-03-20 Glenn Morris <rgm@gnu.org>
16737
16738 * config.in: Remove file.
16739
16740 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16741
16742 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16743 are now in src/globals.h.
16744 (syms_of_minibuf): Remove spurious & from previous change.
16745
16746 2011-03-20 Leo Liu <sdl.web@gmail.com>
16747
16748 * minibuf.c (completing-read-function): New variable.
16749 (completing-read-default): Rename from completing-read.
16750 (completing-read): Call completing-read-function.
16751
16752 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16753
16754 * xfaces.c (Fx_load_color_file):
16755 Read color file from absolute filename (bug#8250).
16756
16757 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16758
16759 * makefile.w32-in: Update dependencies.
16760
16761 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16762
16763 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16764
16765 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16766
16767 Fix more problems found by GCC 4.5.2's static checks.
16768
16769 * process.c (make_serial_process_unwind, send_process_trap):
16770 (sigchld_handler): Now static.
16771
16772 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16773 That way, the code declares only the vars that it needs.
16774 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16775 * s/cygwin.h (PTY_ITERATION): Likewise.
16776 * s/darwin.h (PTY_ITERATION): Likewise.
16777 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16778
16779 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16780 * process.c (allocate_pty): Don't declare stb unless it's needed.
16781
16782 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16783 (CONSTANTLIM): Remove; unused.
16784 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16785 Define only if needed.
16786
16787 * unexelf.c (unexec): Name an expression,
16788 to avoid gcc -Wbad-function-cast warning.
16789 Use a different way to cause a compilation error if anyone uses
16790 n rather than nn, a way that does not involve shadowing.
16791 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16792
16793 * deps.mk (unexalpha.o): Remove; unused.
16794
16795 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16796 * unexec.h: New file.
16797 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16798 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16799 Depend on unexec.h.
16800 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16801 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16802 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16803 Change as necessary to match prototype in unexec.h.
16804
16805 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16806 shadowing.
16807 (back_comment, skip_chars): Mark vars as initialized.
16808
16809 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16810 Rename locals to avoid shadowing.
16811
16812 * lread.c (read1): Rewrite so as not to use empty "else".
16813 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16814
16815 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16816
16817 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16818 warning when compiling print.c.
16819
16820 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16821 instead of using an uninitialized var.
16822 (font_sort_entities): Mark var as initialized.
16823
16824 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16825
16826 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16827 pointers to constants.
16828 (font_parse_fcname): Remove unused vars.
16829 (font_delete_unmatched): Now static.
16830 (font_get_spec): Remove; unused.
16831 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16832 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16833 Rename or move locals to avoid shadowing.
16834
16835 * fns.c (require_nesting_list, require_unwind): Now static.
16836 (Ffillarray): Rename locals to avoid shadowing.
16837
16838 * floatfns.c (domain_error2): Define only if needed.
16839 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16840
16841 * alloc.c (mark_backtrace): Move decl from here ...
16842 * lisp.h: ... to here, so that it can be checked.
16843
16844 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16845 (Fdefvar): Rewrite so as not to use empty "else".
16846 (lisp_indirect_variable): Name an expression,
16847 to avoid gcc -Wbad-function-cast warning.
16848 (Fdefvar): Rename locals to avoid shadowing.
16849
16850 * callint.c (quotify_arg, quotify_args): Now static.
16851 (Fcall_interactively): Rename locals to avoid shadowing.
16852 Use const pointer when appropriate.
16853
16854 * lisp.h (get_system_name, get_operating_system_release):
16855 Move decls here, to check interfaces.
16856 * process.c (get_operating_system_release): Move decl to lisp.h.
16857 * xrdb.c (get_system_name): Likewise.
16858 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16859 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16860 some of which prompt warnings from gcc -Wbad-function-cast.
16861 (Fformat_time_string, Fencode_time, Finsert_char):
16862 (Ftranslate_region_internal, Fformat):
16863 Rename or remove local vars to avoid shadowing.
16864 (Ftranslate_region_internal): Mark var as initialized.
16865
16866 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16867 avoid shadowing.
16868
16869 * lisp.h (eassert): Check that the argument compiles, even if
16870 ENABLE_CHECKING is not defined.
16871
16872 * data.c (Findirect_variable): Name an expression, to avoid
16873 gcc -Wbad-function-cast warning.
16874 (default_value, arithcompare, arith_driver, arith_error): Now static.
16875 (store_symval_forwarding): Rename local to avoid shadowing.
16876 (Fmake_variable_buffer_local, Fmake_local_variable):
16877 Mark variables as initialized.
16878 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16879
16880 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16881 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16882 Rename locals to avoid shadowing.
16883 (mark_stack): Move local variables into the #ifdef region where
16884 they're used.
16885 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16886 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16887 needed otherwise.
16888 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16889 (GC_STRING_CHARS): Remove; not used.
16890 (Fmemory_limit): Cast sbrk's returned value to char *.
16891
16892 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16893 avoids undefined behavior in theory.
16894
16895 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16896
16897 Use functions, not macros, for up- and down-casing (Bug#8254).
16898 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16899 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16900 to use the following functions instead of these macros.
16901 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16902 EMACS_INT, since callers assume the returned value fits in int.
16903 (upcase1): Likewise, for UPCASE_TABLE.
16904 (uppercasep, lowercasep, upcase): New static inline functions.
16905 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16906 the race-condition problem in the old DOWNCASE.
16907
16908 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16909 Rename locals to avoid shadowing.
16910 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16911 (regex_compile, re_search_2, re_match_2_internal):
16912 Remove unused local vars.
16913 (FREE_VAR): Rewrite so as not to use empty "else",
16914 which gcc can warn about.
16915 (regex_compile, re_match_2_internal): Mark locals as initialized.
16916 (RETALLOC_IF): Define only if needed.
16917 (WORDCHAR_P): Likewise. This one is never needed, but is used
16918 only in a comment talking about a compiler bug, so put inside
16919 the #if 0 of that comment.
16920 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16921 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16922 Remove; unused.
16923
16924 * search.c (boyer_moore): Rename locals to avoid shadowing.
16925 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16926 (PREV_CHAR_BOUNDARY): Likewise.
16927
16928 * search.c (simple_search): Remove unused var.
16929
16930 * dired.c (compile_pattern): Move decl from here ...
16931 * lisp.h: ... to here, so that it can be checked.
16932 (struct re_registers): New forward decl.
16933
16934 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16935
16936 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16937 All uses changed.
16938 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16939 Rename locals to avoid shadowing.
16940 (Fvertical_motion): Mark locals as initialized.
16941
16942 * casefiddle.c (casify_object, casify_region): Now static.
16943 (casify_region): Mark local as initialized.
16944
16945 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16946
16947 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16948 New macros, so that the caller can use some names other than
16949 gcpro1, gcpro2, etc.
16950 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16951 of the new macros.
16952 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16953 argument, for consistency with GCPRO2_VAR, etc: it is now the
16954 prefix of the variable, not the variable itself. All uses
16955 changed.
16956 * dired.c (directory_files_internal, file_name_completion):
16957 Rename locals to avoid shadowing.
16958
16959 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16960 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16961 dired.c's scmp function, had undefined behavior.
16962 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16963 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16964 * buffer.h: ... to here, because these macros use current_buffer,
16965 and the new implementation with inline functions needs to have
16966 current_buffer in scope now, rather than later when the macros
16967 are used.
16968 (downcase, upcase1): New static inline functions.
16969 (DOWNCASE, UPCASE1): Reimplement using these functions.
16970 This avoids undefined behavior in expressions like
16971 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16972 from race conditions in accessing the global variables
16973 case_temp1 and case_temp2.
16974 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16975 * lisp.h (case_temp1, case_temp2): Remove their decls.
16976 * character.h (ASCII_CHAR_P): Move from here ...
16977 * lisp.h: ... to here, so that the inline functions mentioned
16978 above can use them.
16979
16980 * dired.c (directory_files_internal_unwind): Now static.
16981
16982 * fileio.c (file_name_as_directory, directory_file_name):
16983 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16984 Now static.
16985 (file_name_as_directory): Use const pointers when appropriate.
16986 (Fexpand_file_name): Likewise. In particular, newdir might
16987 point at constant storage, so make it a const pointer.
16988 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16989 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16990 signedness issues.
16991 (Fset_file_times, Finsert_file_contents, auto_save_error):
16992 Rename locals to avoid shadowing.
16993
16994 * minibuf.c (choose_minibuf_frame_1): Now static.
16995 (Ftry_completion, Fall_completions): Rename or remove locals
16996 to avoid shadowing.
16997
16998 * marker.c (bytepos_to_charpos): Remove; unused.
16999
17000 * lisp.h (verify_bytepos, count_markers): New decls,
17001 so that gcc does not warn that these functions aren't declared.
17002
17003 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17004 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17005 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17006 (copy_text): Remove unused local var.
17007
17008 * filelock.c (within_one_second): Now static.
17009 (lock_file_1): Rename local to avoid shadowing.
17010
17011 * buffer.c (fix_overlays_before): Mark locals as initialized.
17012 (fix_start_end_in_overlays): Likewise. This function should be
17013 simplified by using pointers-to-pointers, but that's a different
17014 matter.
17015 (switch_to_buffer_1): Now static.
17016 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17017 (report_overlay_modification): Rename locals to avoid shadowing.
17018
17019 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17020 Fix pointer signedness issue.
17021 (sys_subshell): Mark local as volatile if checking for lint,
17022 to suppress a gcc -Wclobbered warning that does not seem to be right.
17023 (MAXPATHLEN): Define only if needed.
17024
17025 * process.c (serial_open, serial_configure): Move decls from here ...
17026 * systty.h: ... to here, so that they can be checked.
17027
17028 * fns.c (get_random, seed_random): Move extern decls from here ...
17029 * lisp.h: ... to here, so that they can be checked.
17030
17031 * sysdep.c (reset_io): Now static.
17032 (wait_for_termination_signal): Remove; unused.
17033
17034 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17035 (copy_keymap_item, append_key, push_text_char_description):
17036 Now static.
17037 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17038 (DENSE_TABLE_SIZE): Remove; unused.
17039 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17040 (describe_map_tree):
17041 Rename locals to avoid shadowing.
17042
17043 * keyboard.c: Declare functions static if they are not used elsewhere.
17044 (echo_char, echo_dash, cmd_error, top_level_2):
17045 (poll_for_input, handle_async_input): Now static.
17046 (read_char, kbd_buffer_get_event, make_lispy_position):
17047 (make_lispy_event, make_lispy_movement, apply_modifiers):
17048 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17049 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17050 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17051 (read_key_sequence, read_char): Mark locals as initialized.
17052 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17053
17054 * keyboard.h (make_ctrl_char): New decl.
17055 (mark_kboards): Move decl here ...
17056 * alloc.c (mark_kboards): ... from here.
17057
17058 * lisp.h (force_auto_save_soon): New decl.
17059
17060 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17061 (DEFINE_DUMMY_FUNCTION): New macro.
17062 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17063 Use it.
17064 (main): Add casts to avoid warnings
17065 if GCC considers string literals to be constants.
17066
17067 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17068
17069 * dbusbind.c: Pointer signedness fixes.
17070 (xd_signature, xd_append_arg, xd_initialize):
17071 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17072 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17073 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17074 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17075
17076 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17077 if GCC considers string literals to be constants.
17078 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17079
17080 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17081
17082 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17083 (print_preprocess, print_object): New macro to fix last change.
17084
17085 * print.c (print_preprocess): Don't forget font objects.
17086
17087 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17088
17089 * emacs.c (USAGE3): Doc fixes.
17090
17091 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17092
17093 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17094 structure.
17095
17096 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17097
17098 * lisp.h (VWindow_system, Qfile_name_history):
17099 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17100 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17101 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17102
17103 * w32select.c: Don't #include "keyboard.h".
17104 (run_protected): Add extern declaration for waiting_for_input.
17105
17106 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17107 * w32console.c (detect_input_pending, read_input_pending)
17108 (encode_terminal_code):
17109 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17110 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17111 (w32_system_caret_y, Qfile_name_history):
17112 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17113 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17114 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17115 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17116 * w32proc.c (Qlocal, report_file_error):
17117 * w32term.c (Vwindow_system, updating_frame):
17118 * w32uniscribe.c (initialized, uniscribe_font_driver):
17119 Remove unneeded extern declarations.
17120
17121 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17122
17123 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17124
17125 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17126
17127 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17128 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17129 These macros can no longer be used for assignment.
17130
17131 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17132 Assign struct members directly, instead of using BUF_BEGV etc.
17133 (record_buffer_markers, fetch_buffer_markers): New functions for
17134 recording and fetching special buffer markers.
17135 (set_buffer_internal_1, set_buffer_temp): Use them.
17136
17137 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17138
17139 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17140
17141 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17142 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17143
17144 * xdisp.c (hscroll_window_tree):
17145 (reconsider_clip_changes): Use PT instead of BUF_PT.
17146
17147 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17148
17149 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17150 $(EMACS_ROOT)/lib/intprops.h.
17151
17152 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17153
17154 Fix more problems found by GCC 4.5.2's static checks.
17155
17156 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17157 to unsigned char * to avoid compiler diagnostic.
17158 (xg_free_frame_widgets): Make it clear that a local variable is
17159 needed only if USE_GTK_TOOLTIP.
17160 (gdk_window_get_screen): Make it clear that this macro is needed
17161 only if USE_GTK_TOOLTIP.
17162 (int_gtk_range_get_value): New function, which avoids a diagnostic
17163 from gcc -Wbad-function-cast.
17164 (xg_set_toolkit_scroll_bar_thumb): Use it.
17165 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17166 diagnostic from gcc -Wbad-function-cast.
17167 (get_utf8_string, xg_get_file_with_chooser):
17168 Rename locals to avoid shadowing.
17169 (create_dialog): Move locals to avoid shadowing.
17170
17171 * xgselect.c (xg_select): Remove unused var.
17172
17173 * image.c (four_corners_best): Mark locals as initialized.
17174 (gif_load): Initialize transparent_p to zero (Bug#8238).
17175 Mark another local as initialized.
17176 (my_png_error, my_error_exit): Mark with NO_RETURN.
17177
17178 * image.c (clear_image_cache): Now static.
17179 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17180 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17181 (x_edge_detection): Remove unnecessary cast that
17182 gcc -Wbad-function-cast diagnoses.
17183 (gif_load): Fix pointer signedness.
17184 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17185 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17186
17187 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17188
17189 Improve quality of tests for time stamp overflow.
17190 For example, without this patch (encode-time 0 0 0 1 1
17191 1152921504606846976) returns the obviously-bogus value (-948597
17192 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17193 reports time overflow. See
17194 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17195 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17196 * editfns.c: Include limits.h and intprops.h.
17197 (TIME_T_MIN, TIME_T_MAX): New macros.
17198 (time_overflow): Move earlier, to before first use.
17199 (hi_time, lo_time): New functions, for an accurate test for
17200 out-of-range times.
17201 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17202 (Fget_internal_run_time): Don't assume time_t fits in int.
17203 (make_time): Use list2 instead of Fcons twice.
17204 (Fdecode_time): More accurate test for out-of-range times.
17205 (check_tm_member): New function.
17206 (Fencode_time): Use it, to test for out-of-range times.
17207 (lisp_time_argument): Don't rely on undefined left-shift and
17208 right-shift behavior when checking for time stamp overflow.
17209
17210 * editfns.c (time_overflow): New function, refactoring common code.
17211 (Fformat_time_string, Fdecode_time, Fencode_time):
17212 (Fcurrent_time_string): Use it.
17213
17214 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17215 * dired.c (make_time): Move to ...
17216 * editfns.c (make_time): ... here.
17217 * systime.h: Note the move.
17218
17219 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17220
17221 * fringe.c (update_window_fringes): Remove unused variables.
17222
17223 * unexmacosx.c (copy_data_segment): Also copy __got section.
17224 (Bug#8223)
17225
17226 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17227
17228 * termcap.c [MSDOS]: Include "msdos.h".
17229 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17230 Constify `char *' arguments and their references according to
17231 prototypes in tparam.h.
17232
17233 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17234
17235 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17236 Adapt all references accordingly.
17237
17238 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17239
17240 2011-03-11 Tom Tromey <tromey@redhat.com>
17241
17242 * buffer.c (syms_of_buffer): Remove obsolete comment.
17243
17244 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17245
17246 * termhooks.h (encode_terminal_code): Declare prototype.
17247
17248 * msdos.c (encode_terminal_code): Don't declare prototype.
17249
17250 * term.c (encode_terminal_code): Now external again, used by
17251 w32console.c and msdos.c.
17252
17253 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17254 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17255
17256 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17257
17258 Fix some minor problems found by GCC 4.5.2's static checks.
17259
17260 * fringe.c (update_window_fringes): Mark locals as initialized
17261 (Bug#8227).
17262 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17263
17264 * alloc.c (mark_fringe_data): Move decl from here ...
17265 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17266 to check its interface.
17267 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17268
17269 * fontset.c (free_realized_fontset): Now static.
17270 (Fset_fontset_font): Rename local to avoid shadowing.
17271 (fontset_font): Mark local as initialized.
17272 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17273
17274 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17275
17276 * xselect.c (x_disown_buffer_selections): Remove; not used.
17277 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17278 (x_own_selection, Fx_disown_selection_internal): Rename locals
17279 to avoid shadowing.
17280 (x_handle_dnd_message): Remove local to avoid shadowing.
17281
17282 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17283 so that the caller can use some name other than gcpro1.
17284 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17285 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17286 (Fx_backspace_delete_keys_p):
17287 Use them to avoid shadowing, and rename vars to avoid shadowing.
17288 (x_decode_color, x_set_name, x_window): Now static.
17289 (Fx_create_frame): Add braces to silence GCC warning.
17290 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17291 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17292 Remove unused locals.
17293 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17294 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17295 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17296 macros.
17297
17298 * xterm.h (x_mouse_leave): New decl.
17299
17300 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17301 Remove unused functions.
17302 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17303 (x_calc_absolute_position): Now static.
17304 (XTread_socket): Don't define label "out" unless it's used.
17305 Don't declare local "event" unless it's used.
17306 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17307 unless they are used.
17308 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17309 (x_fatal_error_signal): Remove; not used.
17310 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17311 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17312 (x_error_catcher, x_connection_closed, x_error_handler):
17313 (x_error_quitter, xembed_send_message, x_iconify_frame):
17314 (my_log_handler): Rename locals to avoid shadowing.
17315 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17316 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17317
17318 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17319 Rename or move locals to avoid shadowing.
17320 (tty_defined_color, merge_face_heights): Now static.
17321 (free_realized_faces_for_fontset): Remove; not used.
17322 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17323 does not deduce is never used uninitialized.
17324 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17325 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17326
17327 * terminal.c (store_terminal_param): Now static.
17328
17329 * xmenu.c (menu_highlight_callback): Now static.
17330 (set_frame_menubar): Remove unused local.
17331 (xmenu_show): Rename parameter to avoid shadowing.
17332 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17333 since they might point to immutable storage.
17334 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17335 since it's unused otherwise.
17336
17337 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17338 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17339 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17340 avoids a gcc -Wuninitialized diagnostic.
17341 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17342 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17343 does not deduce are never used uninitialized.
17344
17345 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17346
17347 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17348 * window.c (window_loop, size_window):
17349 (run_window_configuration_change_hook, enlarge_window): Likewise.
17350
17351 * window.c (display_buffer): Now static.
17352 (size_window): Mark variables that gcc -Wuninitialized
17353 does not deduce are never used uninitialized.
17354 * window.h (check_all_windows): New decl, to forestall
17355 gcc -Wmissing-prototypes diagnostic.
17356 * dispextern.h (bidi_dump_cached_states): Likewise.
17357
17358 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17359 shadowing.
17360 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17361 Include <limits.h>.
17362 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17363 and to avoid gcc -Wuninitialized warning.
17364 (load_charset_map): Mark variables that gcc -Wuninitialized
17365 does not deduce are never used uninitialized.
17366 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17367
17368 * coding.c (coding_set_source, coding_set_destination):
17369 Use "else { /* comment */ }" rather than "else /* comment */;"
17370 for clarity, and to avoid gcc -Wempty-body warning.
17371 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17372 a block, when the outer 'i' will do.
17373 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17374 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17375 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17376 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17377 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17378 Rename locals to avoid shadowing.
17379 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17380 * coding.c (emacs_mule_char, encode_invocation_designation):
17381 Now static, since they're not used elsewhere.
17382 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17383 (decode_coding_object, encode_coding_object, detect_coding_system):
17384 (decode_coding_emacs_mule): Mark variables that gcc
17385 -Wuninitialized does not deduce are never used uninitialized.
17386 (detect_coding_iso_2022): Initialize a local variable that might
17387 be used uninitialized. Leave a FIXME because it's not clear that
17388 this initialization is needed. (Bug#8211)
17389 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17390 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17391 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17392 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17393 Remove unused macros.
17394
17395 * category.c (hash_get_category_set): Remove unused local var.
17396 (copy_category_table): Now static, since it's not used elsewhere.
17397 * character.c (string_count_byte8): Likewise.
17398
17399 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17400 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17401
17402 * chartab.c (copy_sub_char_table): Now static, since it's not used
17403 elsewhere.
17404 (sub_char_table_ref_and_range, char_table_ref_and_range):
17405 Rename locals to avoid shadowing.
17406 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17407
17408 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17409 (BIDI_BOB): Remove unused macro.
17410
17411 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17412 deduce are never used uninitialized.
17413 * term.c (encode_terminal_code): Likewise.
17414
17415 * term.c (encode_terminal_code): Now static. Remove unused local.
17416
17417 * tparam.h: New file.
17418 * term.c, tparam.h: Include it.
17419 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17420 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17421 Move these decls to tparam.h, and make them agree with what
17422 is actually in tparam.c. The previous trick of using incompatible
17423 decls in different modules does not conform to the C standard.
17424 All callers of tparam changed to use tparam's actual API.
17425 * tparam.c (tparam1, tparam, tgoto):
17426 Use const pointers where appropriate.
17427
17428 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17429 * cm.h (struct cm): Likewise.
17430 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17431 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17432 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17433 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17434 (turn_on_face, init_tty): Likewise.
17435 * termchar.h (struct tty_display_info): Likewise.
17436
17437 * term.c (term_mouse_position): Rename local to avoid shadowing.
17438
17439 * alloc.c (mark_ttys): Move decl from here ...
17440 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17441
17442 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17443
17444 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17445
17446 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17447
17448 * search.c (compile_pattern_1): Remove argument regp, unused since
17449 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17450 (compile_pattern): Don't pass it.
17451
17452 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17453
17454 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17455 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17456 for ! HAVE_GTK3.
17457 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17458
17459 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17460
17461 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17462 gdk_window_get_screen, gdk_window_get_geometry,
17463 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17464 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17465 (xg_get_pixbuf_from_pixmap): New function.
17466 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17467 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17468 Call xg_get_pixbuf_from_pixmap instead of
17469 gdk_pixbuf_get_from_drawable.
17470 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17471 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17472 (xg_check_special_colors): Use GtkStyleContext and its functions
17473 for HAVE_GTK3.
17474 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17475 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17476 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17477 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17478 Call gtk_widget_get_preferred_size.
17479 (xg_frame_resized): gdk_window_get_geometry only takes 5
17480 parameters.
17481 (xg_win_to_widget, xg_event_is_for_menubar):
17482 Call gdk_x11_window_lookup_for_display.
17483 (xg_set_widget_bg): New function.
17484 (delete_cb): New function.
17485 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17486 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17487 (xg_set_background_color): Call xg_set_widget_bg.
17488 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17489 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17490 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17491 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17492 if ! HAVE_GTK3.
17493 (update_frame_tool_bar): Call gtk_widget_hide.
17494 (xg_initialize): Use GDK_KEY_g.
17495
17496 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17497 if ! HAVE_GTK3
17498 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17499
17500 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17501 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17502 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17503
17504 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17505
17506 * w32xfns.c (select_palette): Check success of RealizePalette against
17507 GDI_ERROR, not zero.
17508
17509 See ChangeLog.11 for earlier changes.
17510
17511 ;; Local Variables:
17512 ;; coding: utf-8
17513 ;; End:
17514
17515 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17516
17517 This file is part of GNU Emacs.
17518
17519 GNU Emacs is free software: you can redistribute it and/or modify
17520 it under the terms of the GNU General Public License as published by
17521 the Free Software Foundation, either version 3 of the License, or
17522 (at your option) any later version.
17523
17524 GNU Emacs is distributed in the hope that it will be useful,
17525 but WITHOUT ANY WARRANTY; without even the implied warranty of
17526 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17527 GNU General Public License for more details.
17528
17529 You should have received a copy of the GNU General Public License
17530 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.