Do not use SA_NODEFER.
[bpt/emacs.git] / src / ChangeLog
1 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2
3 Do not use SA_NODEFER.
4 Problem reported by Dani Moncayo in
5 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6 * alloc.c (die):
7 * sysdep.c (emacs_abort): Do not reset signal handler.
8 * emacs.c (terminate_due_to_signal): Reset signal handler here.
9 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
10 wanted even on POSIXish hosts, and it doesn't work on Windows.
11
12 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
13
14 * xterm.c (x_term_init): Call fixup_locale before and after calling
15 gtk_init (Bug#12392).
16
17 2012-09-23 Chong Yidong <cyd@gnu.org>
18
19 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
20 Vdynamic_library_alist.
21
22 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
23 (Fgnutls_available_p): Caller changed.
24
25 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
26 (Flibxml_parse_xml_region): Likewise.
27
28 * dispextern.h (struct image_type): Remove arg from init function.
29
30 * image.c (Finit_image_library, lookup_image_type)
31 (define_image_type): Remove now-unneeded second arg.
32 (init_xpm_functions, init_png_functions, init_jpeg_functions)
33 (init_tiff_functions, init_gif_functions, init_svg_functions):
34 Arglist and w32_delayed_load calling convention changed.
35 (gs_type): Remove init_gs_functions; there is no such function.
36 (valid_image_p, make_image): Fix caller to lookup_image_type.
37
38 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
39
40 Simplify and avoid signal-handling races (Bug#12471).
41 * alloc.c (die):
42 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
43 Avoid recursive loop if there's a fatal error in the function itself.
44 * atimer.c (pending_atimers):
45 * blockinput.h: Don't include "atimer.h"; no longer needed.
46 (interrupt_input_pending): Remove. All uses removed.
47 pending_signals now counts both atimers and ordinary interrupts.
48 This is less racy than having three separate pending-signal flags.
49 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
50 (input_blocked_p):
51 Rename from their upper-case counterparts BLOCK_INPUT,
52 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
53 INPUT_BLOCKED_P, and turn into functions. All uses changed.
54 This makes it easier to access volatile variables more accurately.
55 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
56 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
57 that's more reliable if the code is buggy and sets
58 interrupt_input_blocked to a negative value. All uses changed.
59 * atimer.c (deliver_alarm_signal):
60 Remove. No need to deliver this to the parent; any thread can
61 handle this signal now. All uses replaced by underlying handler.
62 * atimer.c (turn_on_atimers):
63 * dispnew.c (handle_window_change_signal):
64 * emacs.c (handle_danger_signal):
65 * keyboard.c (kbd_buffer_get_event):
66 Don't reestablish signal handler; not needed with sigaction.
67 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
68 (UNBLOCK_INPUT_TO):
69 Rework to avoid unnecessary accesses to volatile variables.
70 (UNBLOCK_INPUT_TO): Now a function.
71 (totally_unblock_input, unblock_input): New decls.
72 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
73 (init_data): Remove. Necessary stuff now done in init_signal.
74 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
75 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
76 (fatal_error_code): Remove; no longer needed.
77 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
78 it doesn't always backtrace. All uses changed. No need to reset
79 signal to default, since sigaction and/or die does that for us now.
80 Use emacs_raise (FOO), not kill (getpid (), FOO).
81 (main): Check more-accurately whether we're dumping.
82 Move fatal-error setup to sysdep.c
83 * floatfns.c: Do not include "syssignal.h"; no longer needed.
84 * gtkutil.c (xg_get_file_name, xg_get_font):
85 Remove no-longer-needed signal-mask manipulation.
86 * keyboard.c, process.c (POLL_FOR_INPUT):
87 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
88 * keyboard.c (read_avail_input): Remove.
89 All uses replaced by gobble_input.
90 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
91 (kbd_buffer_store_event_hold, gobble_input):
92 (record_asynch_buffer_change) [USABLE_SIGIO]:
93 (store_user_signal_events):
94 No need to mess with signal mask.
95 (gobble_input): If blocking input and there are terminals, simply
96 set pending_signals to 1 and return. All hooks changed to not
97 worry about whether input is blocked.
98 (process_pending_signals): Clear pending_signals before processing
99 them, in case a signal comes in while we're processing.
100 By convention callers now test pending_signals before calling us.
101 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
102 New functions, to support changes to blockinput.h.
103 (handle_input_available_signal): Now extern.
104 (reinvoke_input_signal): Remove. All uses replaced by
105 handle_async_input.
106 (quit_count): Now volatile, since a signal handler uses it.
107 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All
108 callers changed. Block SIGINT only if not already blocked.
109 Clear sigmask reliably, even if Fsignal returns, which it can.
110 Omit unnecessary accesses to volatile var.
111 (quit_throw_to_read_char): No need to restore sigmask.
112 * keyboard.c (gobble_input, handle_user_signal):
113 * process.c (wait_reading_process_output):
114 Call signal-handling code rather than killing ourselves.
115 * lisp.h: Include <float.h>, for...
116 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
117 (pending_signals): Now volatile.
118 (syms_of_data): Now const if IEEE floating point.
119 (handle_input_available_signal) [USABLE_SIGIO]:
120 (terminate_due_to_signal, record_child_status_change): New decls.
121 * process.c (create_process): Avoid disaster if memory is exhausted
122 while we're processing a vfork, by tightening the critical section
123 around the vfork.
124 (send_process_frame, process_sent_to, handle_pipe_signal)
125 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
126 ignores SIGPIPE.
127 (send_process): No need for setjmp/longjmp any more, since the
128 SIGPIPE stuff is now gone. Instead, report an error if errno
129 is EPIPE.
130 (record_child_status_change): Now extern. PID and W are now args.
131 Return void, not bool. All callers changed.
132 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
133 Remove. All uses removed. This bug should be fixed now in a
134 different way.
135 (wait_for_termination_1): Use waitpid rather than sigsuspend,
136 and record the child status change directly. This avoids the
137 need to futz with the signal mask.
138 (process_fatal_action): Move here from emacs.c.
139 (emacs_sigaction_flags): New function, containing
140 much of what used to be in emacs_sigaction_init.
141 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
142 caught by emacs, to make races less likely.
143 (deliver_process_signal): Rename from handle_on_main_thread.
144 All uses changed.
145 (BACKTRACE_LIMIT_MAX): Now at top level.
146 (thread_backtrace_buffer, threadback_backtrace_pointers):
147 New static vars.
148 (deliver_thread_signal, deliver_fatal_thread_signal):
149 New functions, for more-accurate delivery of thread-specific signals.
150 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
151 (deliver_arith_signal): Handle in this thread, not
152 in the main thread, since it's triggered by this thread.
153 (maybe_fatal_sig): New function.
154 (init_signals): New arg DUMPING so that we can be more accurate
155 about whether we're dumping. Caller changed.
156 Treat thread-specific signals differently from process-general signals.
157 Block all signals while handling fatal error; that's safer.
158 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
159 on IEEE hosts.
160 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
161 Ignore SIGPIPE unless batch.
162 (emacs_backtrace): Output backtrace for the appropriate thread,
163 which is not necessarily the main thread.
164 * syssignal.h: Include <stdbool.h>.
165 (emacs_raise): New macro.
166 * xterm.c (x_connection_signal): Remove; no longer needed
167 now that we use sigaction.
168 (x_connection_closed): No need to mess with sigmask now.
169 (x_initialize): No need to reset SIGPIPE handler here, since
170 init_signals does this for us now.
171
172 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
173
174 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
175 background rect may be larger (Bug#12445).
176
177 2012-09-23 Chong Yidong <cyd@gnu.org>
178
179 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
180
181 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
182
183 * .gdbinit: Just stop at fatal_error_backtrace.
184 See Stefan Monnier's request in
185 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
186 Remove no-longer-used query of system type.
187
188 2012-09-22 Chong Yidong <cyd@gnu.org>
189
190 * search.c (Freplace_match): Doc fix (Bug#12325).
191
192 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
193
194 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
195 (Fline_end_position): Doc fix.
196
197 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
198
199 2012-09-22 Chong Yidong <cyd@gnu.org>
200
201 * dispextern.h (struct image_type): Add new slot, storing a type
202 initialization function.
203
204 * image.c (define_image_type): Call the image initializer function
205 if it is defined. Arguments and return value changed.
206 (valid_image_p, make_image): Callers changed.
207 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
208 (gif_type, imagemagick_type, svg_type, gs_type): Add
209 initialization functions.
210 (Finit_image_library): Call lookup_image_type.
211 (CHECK_LIB_AVAILABLE): Macro deleted.
212 (lookup_image_type): Call define_image_type here, rather than via
213 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
214 (syms_of_image): Move define_image_type calls for xbm_type and
215 pbm_type to lookup_image_type.
216
217 2012-09-22 Eli Zaretskii <eliz@gnu.org>
218
219 * keyboard.c (timer_check_2): Move calculation of 'timers' and
220 'idle_timers' from here ...
221 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
222 lists, to avoid infloops when the timer does something stupid,
223 like reinvoke itself with the same or smaller time-out.
224 (Bug#12447)
225
226 2012-09-22 Martin Rudalics <rudalics@gmx.at>
227
228 * window.c (Fsplit_window_internal): Handle only Qt value of
229 Vwindow_combination_limit separately.
230 (Qtemp_buffer_resize): New symbol.
231 (Vwindow_combination_limit): New default value. Rewrite
232 doc-string.
233
234 2012-09-22 Eli Zaretskii <eliz@gnu.org>
235
236 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
237 the new overlay string. (Bug#10159)
238
239 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
240
241 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
242 or that fprintf is async-signal-safe. POSIX doesn't require
243 either assumption.
244
245 2012-09-22 Chong Yidong <cyd@gnu.org>
246
247 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
248 (Bug#8207).
249
250 2012-09-22 Kenichi Handa <handa@gnu.org>
251
252 * composite.c (composition_reseat_it): Handle the case that a
253 grapheme cluster is not covered by a single font (Bug#12352).
254
255 2012-09-21 Chong Yidong <cyd@gnu.org>
256
257 * image.c (define_image_type): Avoid adding duplicate types to
258 image_types (Bug#12463). Suggested by Jörg Walter.
259
260 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
261
262 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
263 (print_load_command_name): Add case LC_DATA_IN_CODE.
264 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
265
266 2012-09-21 Glenn Morris <rgm@gnu.org>
267
268 * eval.c (Frun_hook_with_args_until_success)
269 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
270
271 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
272
273 * fileio.c (Ffile_selinux_context): Only call freecon when
274 lgetfilecon succeeded.
275 (Fset_file_selinux_context): Likewise. (Bug#12444)
276
277 2012-09-21 Eli Zaretskii <eliz@gnu.org>
278
279 * xdisp.c (try_window_reusing_current_matrix): Under bidi
280 reordering, locate the cursor by calling set_cursor_from_row; if
281 that fails, clear the desired glyph matrix before returning a
282 failure indication to the caller. Fixes leaving garbled display
283 when fast scrolling with a down-key. (Bug#12403)
284 (compute_stop_pos_backwards): Fix a typo that caused crashes while
285 scrolling through multibyte text.
286
287 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
288
289 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
290 calling mark_vectorlike since that's the one that marks the window.
291 (mark_discard_killed_buffers): Mark the final cdr.
292 * window.h (struct window): Move prev/next_buffers to the
293 non-standard fields.
294 * window.c (make_window): Initialize prev/next_buffers manually.
295
296 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
297
298 Omit unused arg EXPECTED from socket hooks.
299 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
300 * nsterm.m (ns_term_init):
301 * termhooks.h (struct terminal.read_socket_hook):
302 * w32inevt.c (w32_console_read_socket):
303 * w32term.c (w32_read_socket):
304 * xterm.c (XTread_socket):
305 Omit unused arg EXPECTED. All callers changed.
306 (store_user_signal_events): Return void, not int, since callers no
307 longer care about the return value. All uses changed.
308
309 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
310
311 * w32gui.h (XParseGeometry): Do not declare.
312
313 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
314
315 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
316 Ignore 'expected'. See Eli Zaretskii in
317 <http://bugs.gnu.org/12471#8> (last line).
318
319 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
320 (XParseGeometry): Now static. Substitute extremal values for
321 values that are out of range.
322
323 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
324
325 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
326
327 * nsfns.m (XParseGeometry): Remove.
328 (Fx_create_frame): Call x_set_offset to correctly interpret
329 top_pos in geometry.
330
331 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
332 (Fx_parse_geometry): If there is a space in string, call
333 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
334
335 2012-09-17 Eli Zaretskii <eliz@gnu.org>
336
337 * search.c (scan_buffer): Use character positions in calls to
338 region_cache_forward and region_cache_backward, not byte
339 positions. (Bug#12196)
340
341 * w32term.c (w32_read_socket): Set pending_signals to 1, like
342 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
343
344 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
345 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
346 emacs_blocked_malloc, now deleted.
347
348 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
349
350 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
351 The workaround was for improving performance on Solaris 2.4, but
352 is getting in the way now. Emacs will still work if someone is
353 still running Solaris 2.4 in a museum somewhere; Sun dropped
354 support for Solaris 2.4 in 2003.
355 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
356 * process.c (create_process) [HAVE_WORKING_VFORK]:
357 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
358 since Emacs no longer uses vfork on that platform.
359
360 2012-09-17 Glenn Morris <rgm@gnu.org>
361
362 * emacs.c: Use COPYRIGHT.
363
364 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
365
366 Remove configure's --without-sync-input option (Bug#12450).
367 When auditing signal-handling in preparation for cleaning it up,
368 I found that SYNC_INPUT has race conditions and would be a real
369 pain to fix. Since it's an undocumented and deprecated
370 configure-time option, now seems like a good time to remove it.
371 Also see <http://bugs.gnu.org/11080#16>.
372 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
373 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
374 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
375 (malloc_hysteresis):
376 (check_depth) [XMALLOC_OVERRUN_CHECK]:
377 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
378 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
379 (dont_register_blocks, bytes_used_when_reconsidered)
380 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
381 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
382 [!SYSTEM_MALLOC && !SYNC_INPUT]:
383 Remove. All uses removed.
384 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
385 implementation, one that depends on whether the new macro
386 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
387 is defined.
388 * atimer.c (run_timers, handle_alarm_signal):
389 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
390 (handle_async_input, process_pending_signals)
391 (handle_input_available_signal, init_keyboard):
392 * nsterm.m (ns_read_socket):
393 * process.c (wait_reading_process_output):
394 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
395 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
396 (emacs_write):
397 * xterm.c (XTread_socket):
398 Assume SYNC_INPUT.
399 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
400 * eval.c (handling_signal): Remove. All uses removed.
401 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
402 All uses replaced with the SYNC_INPUT version.
403 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
404 Remove decls.
405 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
406 Now static.
407
408 * font.c (Ffont_shape_gstring): Remove unused local.
409
410 2012-09-16 Glenn Morris <rgm@gnu.org>
411
412 * Makefile.in (clean): No longer run nextstep's clean.
413
414 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
415 (ns_frag): Remove.
416 (ns-app): Move here from ns.mk, and simplify.
417 (clean): Simplify nextstep entry.
418 * ns.mk: Remove file.
419
420 2012-09-17 Kenichi Handa <handa@gnu.org>
421
422 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
423 not covert the last few charactes.
424
425 2012-09-16 Kenichi Handa <handa@gnu.org>
426
427 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
428 here, but just check the validity of glyphs in the glyph-string.
429
430 2012-09-16 Martin Rudalics <rudalics@gmx.at>
431
432 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
433 any window as argument (Bug#12452).
434
435 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
436
437 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
438 to ns_term_init to avoid memory leak.
439
440 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
441 explicit retain/release.
442 (ns_term_init): Only allow one display. Initialize outerpool and
443 ns_*_types.
444
445 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
446
447 Port _setjmp fix to POSIXish hosts as well as Microsoft.
448 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
449 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
450 the Microsoft problem in a different way, by altering ../nt/config.nt.
451
452 2012-09-15 Eli Zaretskii <eliz@gnu.org>
453
454 * w32xfns.c:
455 * w32uniscribe.c:
456 * w32term.c:
457 * w32select.c:
458 * w32reg.c:
459 * w32proc.c:
460 * w32menu.c:
461 * w32inevt.c:
462 * w32heap.c:
463 * w32font.c:
464 * w32fns.c:
465 * w32console.c:
466 * w32.c:
467 * w16select.c: Remove inclusion of setjmp.h, as it is now included
468 by lisp.h. This completes removal of setjmp.h inclusion
469 erroneously announced in the previous commit. (Bug#12446)
470
471 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
472 more accurate.
473
474 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
475 not defined as a macro. The latter happens on MS-Windows.
476 (Bug#12446)
477
478 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
479
480 Port better to POSIX hosts lacking _setjmp (Bug#12446).
481 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
482 Some instances of '#include <setjmp.h>' removed, if the
483 only reason for the instance was because "lisp.h" was included.
484 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
485 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
486 and _longjmp with the new symbols. Emacs already uses _setjmp if
487 available, so this change affects only POSIXish hosts that have
488 sigsetjmp but not _setjmp, such as some versions of Solaris and
489 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
490 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
491 (png_load_body) [HAVE_PNG]:
492 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
493 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
494 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
495 since PNG requires jmp_buf. This is the only exception to the
496 general rule that we now use sys_setjmp and sys_longjmp.
497 This exception is OK since this code does not change the signal
498 mask or longjmp out of a signal handler.
499
500 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
501
502 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
503 Include "syssignal.h", for 'main_thread'.
504
505 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
506
507 Avoid out-of-range marker position (Bug#12426).
508 * insdel.c (replace_range, replace_range_2): Adjust
509 markers before overlays, as suggested by comments.
510 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
511 Remove redundant check before calling offset_intervals.
512
513 2012-09-14 Martin Rudalics <rudalics@gmx.at>
514
515 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
516 current buffer (Bug#12387).
517
518 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
519
520 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
521
522 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
523
524 Use a more backwards-compatible timer format (Bug#12430).
525 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
526 vector element, not from the 4th, since PSECS is now at the end.
527 (Fcurrent_idle_time): Doc fix.
528
529 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
530
531 Function to mark objects and remove killed buffers at once.
532 * alloc.c (discard_killed_buffers): Rename to ...
533 (mark_discard_killed buffers) ... new name. Add marking
534 of remaining objects. Fix comment. Adjust users.
535 (mark_object): Do not touch frame buffer lists here.
536 * frame.c (delete_frame): Reset frame buffer lists here.
537
538 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
539
540 Better workaround for GNOME bug when --enable-gcc-warnings.
541 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
542 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
543 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
544
545 Simplify SIGIO usage (Bug#12408).
546 The code that dealt with SIGIO was crufty and confusing, e.g., it
547 played tricks like "#undef SIGIO" but these tricks were not used
548 consistently. Simplify mostly by not #undeffing standard symbols,
549 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
550 or not as we please) rather than "defined SIGIO" (standard symbol
551 that we probably shouldn't #undef).
552 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
553 Modules that need it can include it.
554 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
555 * dispextern.h (ignore_sigio): New decl.
556 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
557 unconditionally, since it's now a no-op if !USABLE_SIGIO.
558 * emacs.c (shut_down_emacs):
559 * keyboard.c (kbd_buffer_store_event_hold):
560 Use ignore_sigio rather than invoking 'signal' directly.
561 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
562 for FIONREAD.
563 (FIONREAD, SIGIO): Do not #undef.
564 (tty_read_avail_input): Use #error rather than a syntax error.
565 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
566 for I_PIPE, used by SETUP_SLAVE_PTY.
567 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
568 * sysdep.c (croak): Remove; no longer needed. This bit of
569 temporary code, with Fred N. Fish's comment that it's temporary,
570 has been in Emacs since at least 1992!
571 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
572 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
573 * syssignal.h (croak): Remove decl.
574 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
575 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
576 now that we're termios-only.
577 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
578 * term.c (dissociate_if_controlling_tty): Use #error rather than
579 a run-time error.
580
581 Work around GCC and GNOME bugs when --enable-gcc-warnings.
582 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
583 to work around GNOME bug 683906.
584 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
585 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
586 This works around GCC bug 54561.
587
588 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
589
590 More fixes for 'volatile' and setjmp/longjmp.
591 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
592 * image.c (struct png_load_context) [HAVE_PNG]: New type.
593 (png_load_body) [HAVE_PNG]:
594 (jpeg_load_body) [HAVE_JPEG]:
595 New function, with most of the old parent function's body.
596 (png_load) [HAVE_PNG]:
597 (jpeg_load) [HAVE_JPEG]:
598 Invoke the new function, to avoid longjmp munging our locals.
599 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
600 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
601 longjmp is passed 2, as the C standard doesn't guarantee this.
602 Instead, store the failure code into mgr->failure_code.
603
604 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
605
606 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
607 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
608 (syms_of_keyboard): Remove support for unread-command-char.
609
610 2012-09-12 Eli Zaretskii <eliz@gnu.org>
611
612 * w32proc.c (sys_kill): If PID is our process ID and the signal is
613 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
614 violation. (Bug#12426)
615
616 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
617
618 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
619
620 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
621
622 * eval.c: Add `inhibit-debugger'.
623 (Qinhibit_debugger): New symbol.
624 (call_debugger): Bind it instead of Qdebug_on_error.
625 (maybe_call_debugger): Test Vinhibit_debugger.
626 (syms_of_eval): Define inhibit-debugger.
627 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
628 (syms_of_xdisp): Remove inhibit-debug-on-message.
629
630 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
631
632 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
633 If a nonvolatile local variable is written before a _longjmp to
634 the frame containing the variable, and is read after the _longjmp,
635 the value read is indeterminate. Some local variables of type
636 'struct handler' and 'struct catchtag' are used in this way, so
637 mark each of their slots as volatile if the slot can be set before
638 _longjmp and read afterwards.
639 * lisp.h (struct handler): var and chosen_clause are now volatile.
640 (struct catchtag): val, next, and pdlcount are now volatile.
641
642 * bidi.c (bidi_push_it, bidi_pop_it):
643 * fns.c (copy_hash_table):
644 * image.c (define_image_type):
645 * keyboard.c (kbd_buffer_store_event_hold):
646 * process.c (Fprocess_send_eof):
647 * xfaces.c (x_create_gc) [HAVE_NS]:
648 * xgselect.c (xg_select):
649 Prefer assignment to memcpy when either will do.
650
651 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
652 Use pointer-to-a-pointer to simplify and avoid a NILP check each
653 time an item is removed. No need to mark this function 'inline';
654 the compiler knows better than we do.
655
656 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
657
658 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
659 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
660 to change_frame_size (Bug#12388).
661 (windowDidResize:): Pass YES to updateFrameSize.
662
663 * nsterm.h: Add delay parameter to updateFrameSize.
664
665 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
666
667 Discard killed buffers from deleted window and frame objects.
668 This reduces an amount of references to killed buffers and
669 helps GC to reclaim them faster.
670 * alloc.c (discard_killed_buffers): New function.
671 (mark_object): Use it for deleted windows and frames.
672 (mark_object): If symbol's value is set up for a killed buffer
673 or deleted frame, restore it's global binding.
674 * data.c (swap_in_global_binding): Add GC notice.
675 (swap_in_symval_forwarding): Use convenient set_blv_where.
676 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
677 * window.h: ... to here.
678
679 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
680
681 Convenient macro to check whether the buffer is live.
682 * buffer.h (BUFFER_LIVE_P): New macro.
683 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
684 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
685
686 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
687
688 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
689 composition cases (Bug#12364).
690
691 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
692 overhang of succeeding glyphs overlapping box cursor.
693
694 * w32term.c (x_draw_glyph_string): Likewise.
695
696 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
697
698 Simplify, document, and port floating-point (Bug#12381).
699 The porting part of this patch fixes bugs on non-IEEE platforms
700 with frexp, ldexp, logb.
701 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
702 Now static.
703 * floatfns.c: Simplify discussion of functions that Emacs doesn't
704 support, by removing commented-out code and briefly listing the
705 C89 functions excluded. The commented-out stuff was confusing
706 maintenance, e.g., we thought we needed cbrt but it was commented out.
707 (logb): Remove decl; no longer needed.
708 (isfinite): New macro, if not already supplied.
709 (isnan): Don't replace any existing macro.
710 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
711 are present on all C89 platforms.
712 (Ffrexp): Do not special-case zero, as frexp does the right thing
713 for that case.
714 (Flogb): Do not use logb, as it doesn't have the desired meaning
715 on hosts that use non-base-2 floating point. Instead, stick with
716 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
717 frexp, to avoid getting an unspecified result.
718
719 * xdisp.c (Qinhibit_debug_on_message): Now static.
720
721 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
722
723 * nsterm.m (ns_update_begin): Set clip path to whole view by using
724 NSBezierPath (Bug#12131).
725
726 2012-09-10 Chong Yidong <cyd@gnu.org>
727
728 * fns.c (Fdelq, Fdelete): Doc fix.
729
730 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
731
732 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
733 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
734
735 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
736
737 * lisp.h (make_lisp_ptr): New macro to replace XSET.
738 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
739 Use it.
740
741 2012-09-09 Eli Zaretskii <eliz@gnu.org>
742
743 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
744 left fringe if the window has a left margin. This avoids leaving
745 traces of the cursor because its leftmost pixel is not drawn over.
746
747 * dispnew.c (update_window_line): When the left margin area of a
748 screen line is updated, set the redraw_fringe_bitmaps_p flag of
749 that screen line. (Bug#12277)
750
751 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
752
753 Assume C89 or later for math functions (Bug#12381).
754 This simplifies the code, and makes it a bit smaller and faster,
755 and (most important) makes it easier to clean up signal handling
756 since we can stop worring about floating-point exceptions in
757 library code. That was a problem before C89, but the problem
758 went away many years ago on all practical Emacs targets.
759 * data.c, image.c, lread.c, print.c:
760 Don't include <math.h>; no longer needed.
761 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
762 might be autoconfigured, as that never happens.
763 * data.c (fmod):
764 * doprnt.c (DBL_MAX_10_EXP):
765 * print.c (DBL_DIG):
766 Remove. C89 or later always defines these.
767 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
768 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
769 (arith_error, domain_error, domain_error2):
770 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
771 no longer needed -- we simply return what C returns. All uses removed.
772 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
773 the wrapped code.
774 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
775 Remove. All uses expanded, as these macros are no longer used
776 more than once and are now more trouble than they're worth.
777 (Ftan): Use tan, not sin / cos.
778 (Flogb): Assume C89 frexp.
779 (fmod_float): Assume C89 fmod.
780 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
781 (init_floatfns): Remove. All uses removed.
782
783 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
784
785 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
786 compositeToPoint for OSX < 10.6 (Bug#12390).
787
788 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
789
790 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
791 This produces more-accurate results.
792
793 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
794
795 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
796 changes (Bug#12088).
797
798 2012-09-08 Chong Yidong <cyd@gnu.org>
799
800 * syntax.c (Fstring_to_syntax): Doc fix.
801
802 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
803
804 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
805 in the internal border.
806 (x_set_window_size): Remove static variables and their usage.
807 (ns_redraw_scroll_bars): Fix NSTRACE arg.
808 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
809 fringe/internal border adjustment (Bug#11052).
810 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
811 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
812 (ns_fix_rect_ibw): Remove.
813 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
814 (ns_dumpglyphs_box_or_relief): Ditto.
815 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
816 adjustment.
817 (ns_dumpglyphs_image): Ditto.
818 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
819 border adjustment.
820 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
821 their usage. Add fringe_extended_p and its use as in other terms.
822 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
823 scroll bar was removed.
824 (updateFrameSize): New function.
825 (windowDidResize): Move code to updateFrameSize and call it.
826
827 * nsterm.h (EmacsView): Add updateFrameSize.
828
829 2012-09-07 Chong Yidong <cyd@gnu.org>
830
831 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
832
833 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
834
835 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
836
837 More signal-handler cleanup (Bug#12327).
838 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
839 Problem introduced when merging patches. Noted by Eli Zaretskii in
840 <http://bugs.gnu.org/12327#67>.
841 * floatfns.c: Comment fix.
842 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
843 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
844 and anyway the declaration is harmless even if SIGDANGER is not defined.
845 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
846 defined BROKEN_FIONREAD). systty.h formerly did this, but other
847 source files not surprisingly expected syssignal.h to define, or
848 not define, SIGIO, and it's cleaner to do it that way, for consistency.
849 Include <sys/ioctl.h>, for FIONREAD.
850 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
851 This eliminates a problem whereby other files mysteriously had
852 to include "syssignal.h" before including "systty.h" if they
853 wanted to use "#ifdef SIGIO".
854
855 2012-09-07 Eli Zaretskii <eliz@gnu.org>
856
857 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
858
859 * w32.c (sigemptyset): Empty the set.
860 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
861
862 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
863
864 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
865
866 * alloc.c (mark_buffer): Revert unsafe marking optimization.
867 (mark_object): Likewise for frame objects.
868
869 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
870
871 * syssignal.h (handle_on_main_thread): Always declare,
872 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
873 This ports to platforms without HAVE_PTHREAD.
874
875 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
876
877 Signal-handler cleanup (Bug#12327).
878 Emacs's signal handlers were written in the old 4.2BSD style with
879 sigblock and sigmask and so forth, and this led to some
880 inefficiencies and confusion. Rewrite these to use
881 pthread_sigmask etc. without copying signal sets around. Also,
882 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
883 'signal', and instead use functions that do not attempt to take
884 over the system name space. This patch causes Emacs's text
885 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
886 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
887 Do not include <signal.h> or "syssignal.h", as these
888 modules do not use signals.
889 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
890 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
891 Do not include <signal.h>, as "syssignal.h" does that for us now.
892 * atimer.c (sigmask_atimers): New function.
893 (block_atimers, unblock_atimers): New functions,
894 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
895 All uses replaced.
896 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
897 no longer needed here.
898 * emacs.c (main): Inspect existing signal handler with sigaction,
899 so that there's no need to block and unblock SIGHUP.
900 * sysdep.c (struct save_signal): New member 'action', replacing
901 old member 'handler'.
902 (save_signal_handlers, restore_signal_handlers):
903 Use sigaction instead of 'signal' to save and restore.
904 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
905 New function. All users of 'signal' modified to use set_sighandler
906 if they're writeonly, and to use sys_signal if they're read+write.
907 (emacs_sigaction_init, forwarded_signal): New functions.
908 (sys_signal): Remove. All uses replaced by calls to sigaction
909 and emacs_sigaction_init, or by direct calls to 'signal'.
910 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
911 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
912 all uses replaced by pthread_sigmask etc. calls.
913 * syssignal.h: Include <signal.h>.
914 (emacs_sigaction_init, forwarded_signal): New decls.
915 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
916 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
917 (sigmask, sys_sigmask): Remove; no longer needed.
918 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
919 (sigblock, sigunblock, sigfree):
920 (sigsetmask) [!defined sigsetmask]:
921 Remove. All uses replaced by pthread_sigmask.
922 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
923 no longer need to be replaced, and its typical old uses
924 are now done via emacs_sigaction_init and sigaction.
925 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
926 (sys_sigdel): Remove; unused.
927 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
928
929 2012-09-06 Eli Zaretskii <eliz@gnu.org>
930
931 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
932 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
933
934 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
935
936 Explicitly mark buffer_defaults and buffer_local_symbols.
937 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
938 mark_local_symbols here.
939 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
940 since special buffers aren't marked here any more.
941 (allocate_buffer): Chain new buffer with all_buffers here...
942 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
943 not here.
944 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
945 (syms_of_buffer): Remove staticpro of the above.
946 (init_buffer_once): Set names for buffer_defaults and
947 buffer_local_symbols.
948
949 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
950
951 Use bool for booleans in font-related modules.
952 * font.c (font_intern_prop, font_style_to_value)
953 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
954 (generate_otf_features, font_check_otf_features, font_check_otf)
955 (font_match_p, font_list_entities, font_at):
956 * fontset.c (fontset_id_valid_p, reorder_font_vector
957 (fontset_find_font, Fset_fontset_font)
958 (face_suitable_for_char_p) [0]:
959 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
960 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
961 (m17n_flt_initialized, ftfont_shape_by_flt):
962 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
963 * nsfont.m (nsfont_draw):
964 * w32font.c (w32font_draw):
965 * w32term.c (x_draw_glyphless_glyph_string_foreground):
966 Use bool for booleans.
967 * font.h: Adjust to above API changes.
968 (struct font, struct font_driver, struct font_driver_list):
969 Use bool for booleans.
970 (struct font): Remove useless member encoding_type.
971 All users removed.
972 * fontset.c, xftfont.c: Omit unnecessary static decls.
973
974 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
975
976 * alloc.c (mark_object): Revert window marking code
977 since it's unsafe for the Fset_window_configuration.
978
979 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
980
981 Fix race conditions with signal handlers and errno (Bug#12327).
982 Be more systematic about preserving errno whenever a signal
983 handler returns, even if it's not in the main thread. Do this by
984 renaming signal handlers to distinguish between signal delivery
985 and signal handling. All uses changed.
986 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
987 * data.c (deliver_arith_signal): Rename from arith_error.
988 * dispnew.c (deliver_window_change_signal): Rename from
989 window_change_signal.
990 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
991 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
992 * keyboard.c (deliver_input_available_signal): Rename from
993 input_available_signal.
994 (deliver_user_signal): Rename from handle_user_signal.
995 (deliver_interrupt_signal): Rename from interrupt_signal.
996 * process.c (deliver_pipe_signal): Rename from send_process_trap.
997 (deliver_child_signal): Rename from sigchld_handler.
998 * atimer.c (handle_alarm_signal):
999 * data.c (handle_arith_signal):
1000 * dispnew.c (handle_window_change_signal):
1001 * emacs.c (handle_fatal_signal, handle_danger_signal):
1002 * keyboard.c (handle_input_available_signal):
1003 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1004 * process.c (handle_pipe_signal, handle_child_signal):
1005 New functions, with the actual signal-handling code taken from the
1006 original respective signal handlers, sans the sporadic attempts to
1007 preserve errno, since that's now done by handle_on_main_thread.
1008 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1009 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1010 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1011 Move to sysdep.c.
1012 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1013 Move initialization of main_thread to sysdep.c's init_signals.
1014 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1015 our usage, and simplifies the mainline code.
1016 (record_child_status_change): New static function, as a helper
1017 for handle_child_signal, and with most of the old child handler's
1018 contents.
1019 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1020 (handle_child_signal): Use the above.
1021 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1022 Moved here from emacs.c.
1023 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1024 code moved here from emacs.c's main function.
1025 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1026 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
1027 lets callers save and restore errno properly.
1028
1029 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1030
1031 Remove redundant or unused things here and there.
1032 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1033 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1034 * editfns.c (Fcompare_buffer_substrings): Likewise.
1035 * frame.h (struct terminal, struct font_driver_list):
1036 Remove redundant declarations.
1037 * window.h (Qleft, Qright): Likewise.
1038
1039 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1040
1041 Do not mark objects from deleted buffers, windows and frames.
1042 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1043 (mark_object): Likewise for windows and frames.
1044
1045 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1046
1047 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1048 buffer_defaults and buffer_local_symbols as valid objects.
1049 Return special value to denote them.
1050
1051 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1052
1053 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1054 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1055 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1056 (file_name_absolute_p, Fsubstitute_in_file_name):
1057 (check_executable, check_writable, Ffile_accessible_directory_p)
1058 (Fset_file_selinux_context, Fdefault_file_modes)
1059 (Finsert_file_contents, choose_write_coding_system)
1060 (Fwrite_region, build_annotations, a_write, e_write)
1061 (Fdo_auto_save):
1062 * filelock.c (boot_time_initialized, get_boot_time)
1063 (get_boot_time_1, lock_file_1, within_one_second):
1064 * floatfns.c (in_float):
1065 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1066 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1067 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1068 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1069 * window.c (compare_window_configurations):
1070 Use bool for booleans.
1071 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1072 (Fdefault_file_modes): Now mode_t, not int, for modes.
1073 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1074 (internal_delete_file): Now returns void, not a (boolean) int,
1075 since nobody was looking at the return value.
1076 * lisp.h, window.h: Adjust to above API changes.
1077
1078 * xdisp.c (set_message): Simplify and reindent last change.
1079
1080 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1081
1082 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1083
1084 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1085
1086 * eval.c (call_debugger): Make the function non-static so that we
1087 can call it from set_message.
1088
1089 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1090 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1091
1092 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1093
1094 Give more-useful info on a fatal error (Bug#12328).
1095 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1096 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1097 of doing the work ourselves.
1098 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1099 do most of the work.
1100 (fatal_error_backtrace): New function, taken from the guts
1101 of the old fatal_error_signal, but with a new option to output
1102 a backtrace.
1103 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1104 info about the signal than just its number.
1105 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1106 * sysdep.c: Include <execinfo.h>
1107 (emacs_backtrace): New function, taken partly from the previous
1108 code of the 'die' function.
1109 (emacs_abort): Call fatal_error_backtrace rather than abort.
1110
1111 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1112
1113 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1114 eager (load-time) macro-expansion.
1115 * lisp.mk (lisp): Add macroexp.
1116
1117 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1118
1119 Simplify redefinition of 'abort' (Bug#12316).
1120 Do not try to redefine the 'abort' function. Instead, redo
1121 the code so that it calls 'emacs_abort' rather than 'abort'.
1122 This removes the need for the NO_ABORT configure-time macro
1123 and makes it easier to change the abort code to do a backtrace.
1124 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1125 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1126 Remove; sysdep.c's emacs_abort now takes its place.
1127 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1128 'abort' changed to use 'emacs_abort'.
1129 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1130 (abort) [!defined abort]: Rename to ...
1131 (emacs_abort): ... new name.
1132 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1133 the place of the old 'abort' in emacs.c.
1134 * w32.c, w32fns.c (abort): Do not #undef.
1135 * w32.c (emacs_abort): Rename from w32_abort.
1136
1137 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1138
1139 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1140 offsets[j].dv, since the y axis of the screen coordinates points
1141 down, while the y axis of the font definition coordinates points
1142 up. This fixes display of Arabic diacritics such as KASRA and
1143 KASRATAN. (Bug#11860)
1144
1145 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1146
1147 Be more systematic about _setjmp vs setjmp.
1148 * alloc.c (test_setjmp, mark_stack):
1149 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1150 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1151 (png_load, my_error_exit, jpeg_load):
1152 * process.c (send_process_trap, send_process):
1153 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1154 The underscored versions are up to 30x faster on some hosts.
1155 Formerly, the code used setjmp+longjmp sometimes and
1156 _setjmp+_longjmp at other times, with no particular reason to
1157 prefer setjmp+longjmp.
1158
1159 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1160
1161 Fix minor problem found by static checking.
1162 * buffer.c (Fdelete_all_overlays): Return nil.
1163
1164 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1165
1166 * buffer.c (Fdelete_all_overlays): New function.
1167
1168 2012-09-03 Chong Yidong <cyd@gnu.org>
1169
1170 * gtkutil.c: Add extern decl for Qxft.
1171
1172 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1173
1174 * emacs.c, eval.c: Use bool for boolean.
1175 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1176 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1177 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1178 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1179 (main, decode_env_path, Fdaemon_initialized):
1180 * eval.c (call_debugger, Finteractive_p, interactive_p):
1181 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1182 (maybe_call_debugger, Fbacktrace):
1183 * process.c (read_process_output, exec_sentinel):
1184 Use bool for booleans.
1185 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1186 All callers changed.
1187 * eval.c (interactive_p): Omit always-true boolean argument
1188 EXCLUDE_SUBRS_P. All callers changed.
1189 * dispextern.h, lisp.h: Reflect above API changes.
1190 * firstfile.c (dummy): Use the address of 'main', whose signature
1191 won't change, instead of the address of 'initialize', whose
1192 signature just changed from int to bool.
1193 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1194 * msdos.c (fatal_error_in_progress): ... from here.
1195 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1196 of incrementing it.
1197 (redisplay_internal, unwind_redisplay): Simply clear
1198 REDISPLAYING_P when unwinding, instead of saving its previous,
1199 always-false value and then restoring it.
1200
1201 Clean up some extern decls.
1202 Mostly, this hoists extern decls out of .c files and into .h files.
1203 That way, we're more likely to catch errors if the interfaces change.
1204 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1205 declare xg_mark_data.
1206 * dispextern.h (x_frame_parm_handlers):
1207 * font.h (Qxft):
1208 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1209 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1210 (Qultra_bold, Qoblique, Qitalic):
1211 Move extern decl here from .c file.
1212 * alloc.c (xg_mark_data) [USE_GTK]:
1213 * doc.c (Qclosure):
1214 * eval.c (Qlexical_binding):
1215 * fns.c (time) [!HAVE_UNISTD_H]:
1216 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1217 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1218 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1219 * lread.c (Qinternal_interpreter_environment):
1220 * minibuf.c (Qbuffer):
1221 * process.c (QCfamily, QCfilter):
1222 * widget.c (free_frame_faces):
1223 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1224 * xfont.c (x_clear_errors):
1225 * xterm.c (x_frame_parm_handlers):
1226 Remove now-redundant extern decls.
1227 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1228 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1229 Now static.
1230 * xfaces.c: Remove unnecessary static decls.
1231 * xterm.c (updating_frame): Remove decl of nonexistent object.
1232
1233 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1234 when building globals.h, as the objects that are not built on
1235 this host are not needed to compile C files on this host.
1236
1237 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1238
1239 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1240
1241 * frame.h: Add missing prototype for x_wm_set_size_hint.
1242
1243 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1244
1245 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1246 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1247 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1248 (Fsubstitute_command_keys):
1249 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1250 (save_excursion_save, save_excursion_restore)
1251 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1252 (format_time_string, general_insert_function)
1253 (make_buffer_string, make_buffer_string_both)
1254 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1255 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1256 (copy_text, insert_1, insert_1_both, insert_from_string)
1257 (insert_from_string_before_markers, insert_from_string_1)
1258 (insert_from_buffer, insert_from_buffer_1, replace_range)
1259 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1260 (del_range_2, modify_region):
1261 * intervals.c (intervals_equal, balance_possible_root_interval)
1262 (adjust_intervals_for_insertion, merge_properties_sticky)
1263 (graft_intervals_into_buffer, lookup_char_property)
1264 (adjust_for_invis_intang, set_point_both)
1265 (get_property_and_range, compare_string_intervals)
1266 (set_intervals_multibyte_1, set_intervals_multibyte):
1267 * keyboard.c (decode_timer):
1268 Use bool for boolean.
1269 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1270 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1271
1272 2012-09-02 Chong Yidong <cyd@gnu.org>
1273
1274 * keymap.c (push_key_description): Print M-TAB as C-M-i
1275 (Bug#11758).
1276
1277 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1278
1279 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1280 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1281 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1282 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1283 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1284 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1285 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1286
1287 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1288
1289 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1290 more than one grapheme cluster passed to the shaper: compute the
1291 offset adjustment values separately for each cluster. (Bug#11860)
1292
1293 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1294 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1295 about implicit conversions from integer to pointer.
1296
1297 2012-09-01 Daniel Colascione <dancol@dancol.org>
1298
1299 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1300 system used too early.
1301
1302 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1303
1304 Better seed support for (random).
1305 * emacs.c (main): Call init_random.
1306 * fns.c (Frandom): Set the seed from a string argument, if given.
1307 Remove long-obsolete Gentzel cruft.
1308 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1309 (init_random): New function.
1310
1311 2012-09-01 Daniel Colascione <dancol@dancol.org>
1312
1313 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1314 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1315 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1316 x_wm_set_size_hint, x_query_colors, x_real_positions,
1317 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1318 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1319 all of which have been moved to common code.
1320
1321 * xfaces.c: Include TERM_HEADER instead of listing all possible
1322 window-system headers.
1323
1324 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1325 to match header.
1326
1327 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1328 directly accessing frame internals.
1329
1330 * w32font.h: Include font.h. Define syms_of_w32font and
1331 globals_of_w32font.
1332
1333 * process.c: Include TERM_HEADER instead of listing all possible
1334 window-system headers.
1335
1336 * nsterm.h: Remove declarations now in frame.h. Define
1337 FRAME_X_SCREEN, FRAME_X_VISUAL.
1338
1339 * menu.c: Include TERM_HEADER instead of listing all possible
1340 window-system headers.
1341
1342 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1343 window system.
1344
1345 * keyboard.c: Include TERM_HEADER instead of listing all possible
1346 window-system headers.
1347
1348 * image.c: Include TERM_HEADER instead of listing all possible
1349 window-system headers. Declare Vlibrary_cache when compiling for
1350 Windows.
1351
1352 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1353 window system declarations.
1354
1355 * frame.h: Move common functions here: set_frame_menubar,
1356 x_set_window_size, x_sync, x_get_focus_frame,
1357 x_set_mouse_position, x_set_mouse_pixel_position,
1358 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1359 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1360 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1361 x_activate_menubar, x_real_positions, x_bitmap_icon,
1362 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1363 and x_query_colors.
1364
1365 * frame.c: Include TERM_HEADER instead of listing all possible
1366 window-system headers.
1367
1368 * font.c: Include TERM_HEADER instead of listing all possible
1369 window-system headers.
1370
1371 * emacs.c: Include TERM_HEADER.
1372
1373 * dispnew.c: Include TERM_HEADER instead of listing all possible
1374 window-system headers.
1375
1376 * ccl.h: Include character.h.
1377
1378 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1379 the current window system; include in list of objects to link into
1380 Emacs.
1381
1382 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1383
1384 Remove mark_ttys function and fix tty_display_info initialization.
1385 * lisp.h (mark_ttys): Remove prototype.
1386 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1387 to mark_ttys because all possible values of 'top_frame' slot are
1388 the frames which are reachable from Vframe_list.
1389 * term.c (mark_ttys): Remove.
1390 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1391
1392 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1393
1394 Change struct frame bitfields from unsigned char to unsigned.
1395 * frame.h (struct frame): Change type of 'display_preempted',
1396 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1397 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1398 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1399 bitfields from unsigned char to unsigned.
1400
1401 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1402
1403 Remove unused member of struct x_output and struct w32_output.
1404 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1405 * w32term.h (struct w32_output): Likewise.
1406
1407 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1408
1409 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1410 does not become zero (Bug#12234).
1411
1412 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1413
1414 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1415 for GCC 4.7.1 x86-64.
1416
1417 2012-08-30 Glenn Morris <rgm@gnu.org>
1418
1419 * lread.c (init_lread): For out-of-tree builds, only add the
1420 source directory's site-lisp dir to the load-path if it exists,
1421 consistent with in-tree builds. (Bug#12302)
1422
1423 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1424
1425 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1426 button_values to NULL. Call setStykeMask so dialogs get a close button.
1427 (windowShouldClose:): Set window_closed.
1428 (dealloc): New member, free button_values.
1429 (process_dialog:): Make member function. Remove window argument,
1430 replace window with self. Count buttons and allocate and store values
1431 in button_values.
1432 (addButton:value:row:): value is int with the name tag. Call setTag
1433 with tag. Remove return self, declare return value as void.
1434 (addString:row:): Remove return self, declare return value as void.
1435 (addSplit): Remove return self, declare return value as void.
1436 (clicked:): Remove return self, declare return value as void.
1437 Set dialog_return to button_values[seltag]. Code formatting change.
1438 (initFromContents:isQuestion:): Adjust call to process_dialog.
1439 Code formatting change.
1440 (timeout_handler:): Set timer_fired to YES.
1441 (runDialogAt:): Set timer_fired to NO.
1442 Handle click on close button as quit.
1443
1444 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1445 Add window_closed and button_values. Add void as return value for
1446 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1447 Add process_dialog as new member.
1448
1449 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1450
1451 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1452 is not one of the heaps we manage. (Bug#12242)
1453
1454 2012-08-28 Glenn Morris <rgm@gnu.org>
1455
1456 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1457
1458 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1459
1460 * window.c (Fset_window_configuration): Remove handling of
1461 auto-buffer-name window parameter. Install revision of reverted
1462 fix.
1463
1464 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1465
1466 Do not allow to set major mode for a dead buffer.
1467 * buffer.c (Fset_buffer_major_mode): Signal an error
1468 if the buffer is dead.
1469 (Fother_buffer, other_buffer_safely): Remove redundant
1470 nested declaration.
1471
1472 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1473
1474 Always use set_buffer_if_live to restore original buffer at unwind.
1475 * buffer.h (record_unwind_current_buffer): New function.
1476 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1477 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1478 * undo.c, window.c: Adjust users.
1479 * buffer.c (set_buffer_if_live): Fix comment.
1480
1481 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1482
1483 Fix usage of set_buffer_internal.
1484 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1485 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1486 * coding.c (decode_coding): Omit redundant test.
1487 * fileio.c (decide_coding_unwind): Likewise.
1488 * fns.c (secure_hash): Likewise.
1489 * insdel.c (modify_region): Likewise.
1490 * keyboard.c (command_loop_1): Likewise.
1491 * print.c (PRINTFINISH): Likewise.
1492 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1493
1494 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1495
1496 * dispnew.c: Use bool for boolean.
1497 (frame_garbaged, display_completed, delayed_size_change)
1498 (fonts_changed_p, add_window_display_history)
1499 (add_frame_display_history, verify_row_hash)
1500 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1501 (row_equal_p, realloc_glyph_pool)
1502 (allocate_matrices_for_frame_redisplay)
1503 (showing_window_margins_p)
1504 (adjust_frame_glyphs_for_frame_redisplay)
1505 (build_frame_matrix_from_leaf_window, make_current)
1506 (mirrored_line_dance, mirror_line_dance, update_frame)
1507 (update_window_tree, update_single_window)
1508 (check_current_matrix_flags, update_window, update_text_area)
1509 (update_window_line, set_window_update_flags, scrolling_window)
1510 (update_frame_1, scrolling, buffer_posn_from_coords)
1511 (do_pending_window_change, change_frame_size)
1512 (change_frame_size_1, sit_for):
1513 Use bool for boolean.
1514 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1515 and remove last int (actually boolean) argument, which was always 0.
1516 All callers changed.
1517 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1518 * dispextern.h (struct composition_it): Use bool for boolean.
1519 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1520 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1521 * dired.c (file_name_completion):
1522 Use bool for boolean. (This was missed in an earlier change.)
1523
1524 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1525
1526 * window.c (Fset_window_configuration): Revert first part of
1527 last change.
1528
1529 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1530
1531 * nsterm.h (NSPanel): New class variable dialog_return.
1532
1533 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1534 dialog_return.
1535 (windowShouldClose:): Use stop instead of stopModalWithCode.
1536 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1537 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1538 event.
1539 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1540 modal loop returns.
1541
1542 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1543
1544 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1545 * composite.c (find_composition, composition_gstring_p)
1546 (composition_reseat_it, find_automatic_composition):
1547 * data.c (let_shadows_buffer_binding_p)
1548 (let_shadows_global_binding_p, set_internal, make_blv)
1549 (Fmake_variable_buffer_local, Fmake_local_variable)
1550 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1551 (cons_to_signed, arith_driver):
1552 * dbusbind.c (xd_in_read_queued_messages):
1553 * dired.c (directory_files_internal, file_name_completion):
1554 Use bool for booleans.
1555 * dired.c (file_name_completion):
1556 * process.h (fd_callback):
1557 Omit int (actually boolean) argument. It wasn't being used.
1558 All uses changed.
1559 * composite.h, lisp.h: Reflect above API changes.
1560
1561 * cmds.c, coding.c: Use bool for booleans.
1562 * cmds.c (move_point, Fself_insert_command):
1563 * coding.h (struct composition status, struct coding_system):
1564 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1565 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1566 (emacs_mule_char, decode_coding_emacs_mule)
1567 (encode_coding_emacs_mule, detect_coding_iso_2022)
1568 (decode_coding_iso_2022, encode_invocation_designation)
1569 (encode_designation_at_bol, encode_coding_iso_2022)
1570 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1571 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1572 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1573 (encode_coding_raw_text, detect_coding_charset)
1574 (decode_coding_charset, encode_coding_charset, detect_eol)
1575 (detect_coding, get_translation_table, produce_chars)
1576 (consume_chars, reused_workbuf_in_use)
1577 (make_conversion_work_buffer, code_conversion_save)
1578 (decode_coding_object, encode_coding_object)
1579 (detect_coding_system, char_encodable_p)
1580 (Funencodable_char_position, code_convert_region)
1581 (code_convert_string, code_convert_string_norecord)
1582 (Fset_coding_system_priority):
1583 * fileio.c (Finsert_file_contents):
1584 Use bool for booleans.
1585 * coding.h, lisp.h: Reflect above API changes.
1586 * coding.c: Remove unnecessary static function decls.
1587 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1588 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1589 not a boolean 'int', since callers never look at the return value.
1590 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1591 * coding.h (decoding_buffer_size, encoding_buffer_size)
1592 (emacs_mule_string_char): Remove unused extern decls.
1593 (struct iso_2022_spec, struct coding_system):
1594 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1595 (struct emacs_mule_spec): Remove unused field 'full_support'.
1596 All initializations removed.
1597 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1598
1599 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1600
1601 Fix spare memory change (Bug#12286).
1602 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1603 (valid_lisp_object_p): Likewise.
1604
1605 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1606
1607 * window.c (Fset_window_configuration): Record any window's old
1608 buffer if it's replaced (see Bug#8789). If the new current
1609 buffer doesn't appear in the selected window, go to its old
1610 point (Bug#12208).
1611
1612 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1613
1614 Special MEM_TYPE_SPARE to denote reserved memory.
1615 * alloc.c (enum mem_type): New memory type.
1616 (refill_memory_reserve): Use new type for spare memory.
1617 This prevents live_cons_p and live_string_p from incorrect
1618 detection of uninitialized objects from spare memory as live.
1619
1620 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1621
1622 Spelling fixes.
1623 * Makefile.in (.PHONY): versioclean -> versionclean.
1624
1625 Remove unused external symbols.
1626 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1627 * window.c (Qwindow_valid_p, decode_valid_window):
1628 Now static, not extern.
1629 * data.c (Qinterval): Remove; unused.
1630 (syms_of_data): Do not define 'interval'.
1631 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1632 * window.h (decode_valid_window):
1633 Remove decls.
1634
1635 * character.c, charset.c, chartab.c: Use bool for booleans.
1636 * character.c (lisp_string_width, string_count_byte8)
1637 (string_escape_byte8):
1638 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1639 (load_charset_map_from_file, map_charset_chars)
1640 (Fdefine_charset_internal, define_charset_internal)
1641 (Fdeclare_equiv_charset, find_charsets_in_text)
1642 (Ffind_charset_region, char_charset, Fiso_charset):
1643 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1644 (sub_char_table_set, sub_char_table_set_range)
1645 (char_table_set_range, optimize_sub_char_table)
1646 (map_sub_char_table):
1647 Use bool for boolean.
1648 * character.c (str_to_unibyte): Omit last boolean argument; it was
1649 always 0. All callers changed.
1650 * character.h, charset.h: Adjust to match previous changes.
1651 * character.h (char_printable_p): Remove decl of nonexistent function.
1652 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1653 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1654 are all boolean, so make them single-bit bitfields.
1655
1656 * lisp.h (ASET): Remove attempt to detect side effects.
1657 It was meant to be temporary and it often doesn't work,
1658 because when IDX has side effects the behavior of IDX==IDX
1659 is undefined. See Stefan Monnier in
1660 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1661
1662 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1663
1664 * lisp.h (functionp): New function (extracted from Ffunctionp).
1665 (FUNCTIONP): Use it.
1666 * eval.c (Ffunctionp): Use it.
1667
1668 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1669
1670 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1671 as that's faster and simpler than static storage. Don't bother
1672 with the g_main_context_query overhead if g_main_context_pending
1673 says no events are pending.
1674 (gfds, gfds_size): Remove these static vars.
1675 (xgselect_initialize): Remove; no longer needed.
1676 All uses and decls removed.
1677
1678 * emacs.c (fatal_error_signal_hook): Remove.
1679 All uses removed. This leftover from old code was always 0.
1680
1681 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1682 * casefiddle.c (casify_object, casify_region):
1683 * casetab.c (set_case_table):
1684 * category.c, category.h (word_boundary_p):
1685 * category.h (CHAR_HAS_CATEGORY):
1686 Use bool for booleans, instead of int.
1687
1688 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1689
1690 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1691
1692 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1693
1694 On assertion failure, print backtrace if available.
1695 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1696 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1697 * Makefile.in (LIB_EXECINFO): New macro.
1698 (LIBES): Use it.
1699
1700 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1701 * bytecode.c (exec_byte_code):
1702 * callint.c (check_mark, Fcall_interactively):
1703 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1704 (getenv_internal, sync_process_alive, call_process_exited):
1705 * lisp.h (USE_SAFE_ALLOCA):
1706 Use bool for booleans, instead of int.
1707 * lisp.h, process.h: Adjust prototypes to match above changes.
1708 * callint.c (Fcall_interactively): Don't assume the mark's
1709 offset fits in 'int'.
1710
1711 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1712
1713 * buffer.c, buffer.h: Use bool for boolean.
1714 * buffer.c (reset_buffer_local_variables)
1715 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1716 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1717 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1718 (overlay_touches_p, overlay_strings, Foverlay_put)
1719 (report_overlay_modification, call_overlay_mod_hooks):
1720 (mmap_enlarge, mmap_set_vars):
1721 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1722 Use bool for booleans, instead of int.
1723 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1724 since the 1-or-0 return value is always ignored anyway.
1725 (mmap_initialized_p):
1726 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1727 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1728
1729 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1730
1731 * bidi.c: Use bool for boolean.
1732 This is a bit more readable, and makes the text segment of bidi.o
1733 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1734 Presumably it's faster too.
1735 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1736 Now bool.
1737 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1738 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1739 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1740 (bidi_explicit_dir_char, bidi_level_of_next_char)
1741 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1742 Use bool for booleans, instead of int.
1743 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1744 (bidi_unshelve_cache): Adjust decls to match code.
1745
1746 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1747
1748 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1749 argument.
1750
1751 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1752
1753 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1754 * atimer.h: Include <stdbool.h>.
1755
1756 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1757
1758 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1759 compile time tests instead of run time tests on systems that do
1760 not use them.
1761 (FRAME_MAC_P): Remove leftover from deleted code.
1762 * frame.c (syms_of_frame): Remove leftover from deleted code.
1763
1764 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1765
1766 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1767
1768 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1769
1770 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1771 Otherwise, the compiler complains about (A?B:C) where B is void
1772 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1773 (fontset_add): Return void, for FONTSET_ADD.
1774
1775 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1776
1777 * alloc.c: Use bool for booleans.
1778 (gc_in_progress, abort_on_gc)
1779 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1780 (dont_register_blocks) [GC_MALLOC_CHECK]:
1781 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1782 (check_string_bytes, make_specified_string, memory_full)
1783 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1784 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1785 (mark_stack, valid_pointer_p, make_pure_string)
1786 (Fgarbage_collect, survives_gc_p, gc_sweep):
1787 Use bool for booleans, instead of int.
1788 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1789 Remove unused local.
1790 * alloc.c (PURE_POINTER_P):
1791 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1792 * editfns.c (Fformat):
1793 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1794 (Fdo_auto_save):
1795 * fns.c (sweep_weak_table):
1796 * lisp.h (suppress_checking, push_message, survives_gc_p)
1797 (make_pure_string, gc_in_progress, abort_on_gc):
1798 * lread.c (readchar, read1):
1799 * print.c (Fprin1_to_string):
1800 * xdisp.c (push_message):
1801 Use bool for booleans affected directly or indirectly by
1802 alloc.c's changes.
1803
1804 Make recently-introduced setters macros.
1805 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1806 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1807 (set_fontset_default, set_fontset_fallback): Rename from their
1808 upper-case counterparts, and make them functions rather than macros.
1809 This is more consistent with the other recently-introduced setters.
1810 These don't need to be inline, since they're local.
1811
1812 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1813
1814 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1815 the loop (Bug#12247).
1816
1817 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1818
1819 * lisp.h (vcopy): Use memcpy rather than our own loop.
1820 This fixes a performance regression introduced by the recent
1821 addition of vcopy. This means 'vcopy' will need to be modified
1822 for a copying collector, but that's OK. Also, tighten the
1823 checking in the assertion.
1824
1825 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1826
1827 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1828 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1829 non-base glyph for the width of the base character, according to
1830 what x_draw_composite_glyph_string_foreground expects.
1831 Generate WADJUST value according to composition_gstring_width's
1832 expectations, to produce correct width of the composed character.
1833 Reverse the sign of the DU offset produced by ScriptPlace.
1834
1835 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1836
1837 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1838
1839 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1840
1841 Avoid direct writes to contents member of struct Lisp_Vector.
1842 * lisp.h (vcopy): New function to copy data into vector.
1843 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1844 * fns.c (Ffillarray): Use ASET.
1845 * keyboard.c (timer_check_2): Use AREF and ASET.
1846 (append_tool_bar_item, Frecent_keys): Use vcopy.
1847 * lread.c (read_vector): Use ASET.
1848 * msdos.c (Frecent_doskeys): Use vcopy.
1849 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1850 (Finternal_merge_in_global_face): Use ASET and vcopy.
1851 * xfont.c (xfont_list_pattern): Likewise.
1852
1853 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1854
1855 * window.c (Fwindow_point): For the selected window always return
1856 the position of its buffer's point.
1857 (Fset_window_point): For the selected window always go in its
1858 buffer to the specified position.
1859
1860 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1861
1862 Setter macros for fontsets.
1863 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1864 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1865 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1866 Adjust users.
1867
1868 2012-08-20 Glenn Morris <rgm@gnu.org>
1869
1870 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1871 Don't assume that `ln -f' works.
1872
1873 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1874
1875 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1876 and later about non-assignments with no effect. See discussion at
1877 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1878 details.
1879
1880 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1881
1882 Inline setter functions for Lisp_Objects slots of struct specbinding.
1883 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1884 Adjust users.
1885
1886 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1887
1888 * window.c (select_window): Always make selected window's buffer
1889 current.
1890
1891 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1892
1893 Use AREF and ASET for docstrings of category tables.
1894 * category.h (CATEGORY_DOCSTRING): Use AREF.
1895 (SET_CATEGORY_DOCSTRING): Use ASET.
1896 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1897
1898 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1899
1900 Inline setter functions for hash table members.
1901 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1902 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1903 (set_hash_key_and_value, set_hash_index, set_hash_next)
1904 (set_hash_hash): New functions.
1905 * charset.c, fns.c: Adjust users.
1906
1907 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1908
1909 Inline getter and setter functions for per-buffer values.
1910 * buffer.h (per_buffer_default, set_per_buffer_default)
1911 (per_buffer_value, set_per_buffer_value): New functions.
1912 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1913 * buffer.c, data.c: Adjust users.
1914
1915 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1916
1917 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1918
1919 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1920
1921 Rely on <config.h> + <unistd.h> to declare 'environ',
1922 as gnulib does this if the system doesn't.
1923 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1924 Remove declaration. MS-Windows declares it on stdlib.h which is
1925 included by conf_post.h.
1926 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1927 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1928 * vm-limit.c: Include <unistd.h>, for 'environ'.
1929
1930 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1931 (start_of_data): Remove decl; mem-limits.h provides it.
1932
1933 * xdisp.c (handle_invisible_prop): Make it a bit faster
1934 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1935
1936 2012-08-19 Chong Yidong <cyd@gnu.org>
1937
1938 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1939 ends (Bug#3874).
1940
1941 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1942
1943 * .gdbinit: Use call instead of set when calling a function in the
1944 inferior.
1945
1946 * data.c (set_internal): Don't use set_blv_found.
1947 (Fkill_local_variable): Likewise.
1948
1949 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1950
1951 * nsfont.m (ns_ascii_average_width): Ensure the string
1952 ascii_printable is initialized with a null-terminated character
1953 array. Otherwise, it can contain undesired extra characters.
1954
1955 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1956
1957 port new setting code to Sun C 5.8 2005/10/13
1958 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1959 Return void, not Lisp_Object. Otherwise, the compiler
1960 complains about (A?B:C) where B is void and C is Lisp_Object
1961 when compiling CHAR_TABLE_SET, due to the recent change to
1962 the API of sub_char_table_set_contents.
1963
1964 2012-08-18 Chong Yidong <cyd@gnu.org>
1965
1966 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1967 for the string case (Bug#3874).
1968
1969 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1970
1971 * buffer.h (BSET): Remove (Bug#12215).
1972 Replace all uses with calls to new setter functions.
1973 (bset_bidi_paragraph_direction, bset_case_canon_table)
1974 (bset_case_eqv_table, bset_directory, bset_display_count)
1975 (bset_display_time, bset_downcase_table)
1976 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1977 (bset_last_selected_window, bset_local_var_alist)
1978 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1979 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1980 (bset_width_table):
1981 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1982 (bset_auto_fill_function, bset_auto_save_file_format)
1983 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1984 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1985 (bset_cache_long_line_scans, bset_case_fold_search)
1986 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1987 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1988 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1989 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1990 (bset_header_line_format, bset_indicate_buffer_boundaries)
1991 (bset_indicate_empty_lines, bset_invisibility_spec)
1992 (bset_left_fringe_width, bset_major_mode, bset_mark)
1993 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1994 (bset_name, bset_overwrite_mode, bset_pt_marker)
1995 (bset_right_fringe_width, bset_save_length)
1996 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1997 (bset_scroll_up_aggressively, bset_selective_display)
1998 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1999 (bset_word_wrap, bset_zv_marker):
2000 * category.c (bset_category_table):
2001 * syntax.c (bset_syntax_table):
2002 New setter functions.
2003
2004 * process.h (PSET): Remove (Bug#12215).
2005 Replace all uses with calls to new setter functions.
2006 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2007 (PROCESS_INLINE): New macro.
2008 (pset_childp): New setter function.
2009 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2010 * process.c (PROCESS_INLINE):
2011 Define to EXTERN_INLINE, so that the corresponding functions
2012 are compiled into code.
2013 (pset_buffer, pset_command, pset_decode_coding_system)
2014 (pset_decoding_buf, pset_encode_coding_system)
2015 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2016 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2017 (pset_type, pset_write_queue): New setter functions.
2018
2019 * window.h (WSET): Remove (Bug#12215).
2020 Replace all uses with calls to new setter functions.
2021 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2022 (WINDOW_INLINE): New macro.
2023 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2024 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2025 (wset_total_lines, wset_vertical_scroll_bar)
2026 (wset_window_end_pos, wset_window_end_valid)
2027 (wset_window_end_vpos): New setter functions.
2028 * window.c (WINDOW_INLINE):
2029 Define to EXTERN_INLINE, so that the corresponding functions
2030 are compiled into code.
2031 (wset_combination_limit, wset_dedicated, wset_display_table)
2032 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2033 (wset_new_normal, wset_new_total, wset_next_buffers)
2034 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2035 (wset_prev_buffers, wset_right_fringe_width)
2036 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2037 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2038 (wset_window_parameters):
2039 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2040 (wset_column_number_displayed, wset_region_showing):
2041 New setter functions.
2042
2043 * termhooks.h (TSET): Remove (Bug#12215).
2044 Replace all uses with calls to new setter functions.
2045 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2046 (TERMHOOKS_INLINE): New macro.
2047 (tset_charset_list, tset_selection_alist): New setter functions.
2048 * terminal.c (TERMHOOKS_INLINE):
2049 Define to EXTERN_INLINE, so that the corresponding functions
2050 are compiled into code.
2051 (tset_param_alist): New setter function.
2052
2053 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2054
2055 * keyboard.h (KSET): Remove (Bug#12215).
2056 Replace all uses with calls to new setter functions.
2057 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2058 (KEYBOARD_INLINE): New macro.
2059 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2060 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2061 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2062 New setter functions.
2063 * keyboard.c (KEYBOARD_INLINE):
2064 Define to EXTERN_INLINE, so that the corresponding functions
2065 are compiled into code.
2066 (kset_echo_string, kset_kbd_queue)
2067 (kset_keyboard_translate_table, kset_last_prefix_arg)
2068 (kset_last_repeatable_command, kset_local_function_key_map)
2069 (kset_overriding_terminal_local_map, kset_real_last_command)
2070 (kset_system_key_syms): New setter functions.
2071
2072 * frame.h (FSET): Remove (Bug#12215).
2073 Replace all uses with calls to new setter functions.
2074 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2075 (FRAME_INLINE): New macro.
2076 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2077 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2078 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2079 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2080 (fset_param_alist, fset_root_window, fset_scroll_bars)
2081 (fset_selected_window, fset_title, fset_tool_bar_items)
2082 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2083 * frame.c (FRAME_INLINE):
2084 Define to EXTERN_INLINE, so that the corresponding functions
2085 are compiled into code.
2086 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2087
2088 A few more naming-convention fixes for getters and setters.
2089 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2090 and rename from buffer_overlays_set_before.
2091 (set_buffer_overlays_after): Move here from buffer.h, and rename
2092 from buffer_overlays_set_after.
2093 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2094 All uses changed.
2095 (set_buffer_intervals): Rename from buffer_set_intervals.
2096 * intervals.c (set_interval_object): Move here from intervals.h,
2097 and rename from interval_set_object.
2098 (set_interval_left): Move here from intervals.h, and rename from
2099 interval_set_left.
2100 (set_interval_right): Move here from intervals.h, and rename from
2101 interval_set_right.
2102 (copy_interval_parent): Move here from intervals.h, and rename from
2103 interval_copy_parent.
2104 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2105 (set_interval_plist): Rename from interval_set_plist.
2106 Return void, not Lisp_Object, since no caller uses the result.
2107 * lisp.h (string_intervals): Rename from string_get_intervals.
2108 (set_string_intervals): Rename from string_set_intervals.
2109
2110 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2111 (set_char_table_contents): Rename from char_table_set_contents.
2112 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2113 All uses changed. See the end of
2114 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2115
2116 * lisp.h (CSET): Remove (Bug#12215).
2117 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2118 (set_char_table_purpose): New functions,
2119 replacing CSET. All uses changed. For example, replace
2120 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2121 "set_char_table_parent (char_table, parent);".
2122 The old version was confusing because it used the same name
2123 'parent' for two different things.
2124
2125 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2126
2127 Functions to get and set Lisp_Object fields of buffer-local variables.
2128 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2129 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2130 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2131 * data.c, eval.c, frame.c: Adjust users.
2132
2133 2012-08-17 Chong Yidong <cyd@gnu.org>
2134
2135 * xfaces.c (merge_face_vectors): If the target font specfies a
2136 font spec, make the font's attributes take precedence over
2137 directly-specified attributes.
2138 (merge_face_ref): Recognize :font.
2139
2140 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2141
2142 Do not use memcpy for copying intervals.
2143 * intervals.c (reproduce_interval): New function.
2144 (reproduce_tree, reproduce_tree_obj): Use it.
2145 (reproduce_tree_obj): Remove prototype.
2146
2147 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2148
2149 * lisp.h (duration_to_sec_usec): Remove unused decl.
2150
2151 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2152
2153 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2154 to an allocated instance of NSString, not to the class itself.
2155
2156 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2157
2158 * makefile.w32-in (C_CTYPE_H): New macro.
2159 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2160 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2161 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2162
2163 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2164
2165 Use ASCII tests for character types.
2166 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2167 * xfns.c, xterm.c:
2168 Don't include <ctype.h>; was not needed.
2169 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2170 * sysdep.c, xfaces.c:
2171 Include <c-ctype.h> instead of <ctype.h>.
2172 * nsterm.m: Include <c-ctype.h>.
2173 * charset.c (read_hex):
2174 * doc.c (Fsnarf_documentation):
2175 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2176 (DRIVE_LETTER) [DOS_NT]:
2177 (Ffile_name_directory, Fexpand_file_name)
2178 (Fsubstitute_in_file_name):
2179 * font.c (font_parse_xlfd, font_parse_fcname):
2180 * frame.c (x_set_font_backend):
2181 * gtkutil.c (xg_get_font):
2182 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2183 * nsimage.m (hexchar):
2184 * nsterm.m (ns_xlfd_to_fontname):
2185 * sysdep.c (system_process_attributes):
2186 * xfaces.c (hash_string_case_insensitive):
2187 Use C-locale tests instead of locale-specific tests for character
2188 types, since we want the ASCII interpretation here, not the
2189 interpretation suitable for whatever happens to be the current locale.
2190
2191 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2192
2193 Consistently check windows for validity/liveness
2194 (Bug#11984, Bug#12025, Bug#12026).
2195 * lisp.h (CHECK_VALID_WINDOW): New macro.
2196 * window.c (decode_window): Rename to decode_live_window.
2197 (decode_valid_window, Fwindow_valid_p): New functions.
2198 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2199 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2200 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2201 (Fwindow_prev_sibling, Fwindow_combination_limit)
2202 (Fset_window_combination_limit, Fwindow_use_time)
2203 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2204 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2205 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2206 (Fwindow_hscroll, Fset_window_hscroll)
2207 (Fwindow_redisplay_end_trigger)
2208 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2209 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2210 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2211 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2212 (Fwindow_end, Fset_window_point, Fset_window_start)
2213 (Fpos_visible_in_window_p, Fwindow_line_height)
2214 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2215 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2216 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2217 (Fset_window_parameter, Fwindow_display_table)
2218 (Fset_window_display_table, Fdelete_other_windows_internal)
2219 (Fset_window_buffer, Fset_window_new_total)
2220 (Fset_window_new_normal, Fdelete_window_internal)
2221 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2222 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2223 (Fwindow_scroll_bars): Check whether argument window is a valid or
2224 live window. Update doc-strings.
2225 (syms_of_window): New symbol Qwindow_valid_p.
2226 * keyboard.c (Fposn_at_x_y): Check whether argument
2227 frame_or_window denotes a valid window.
2228
2229 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2230
2231 Fix previous char table change.
2232 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2233 * chartab.c (optimize_sub_char_table): Likewise.
2234
2235 2012-08-16 Chong Yidong <cyd@gnu.org>
2236
2237 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2238
2239 * xfont.c (xfont_open):
2240 * xftfont.c (xftfont_open): Set the font's max_width field.
2241
2242 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2243 min_width to space_width and average_width to the average over
2244 printable ASCII characters.
2245 (ns_char_width): Code cleanup.
2246 (ns_ascii_average_width): New utility function.
2247
2248 * font.h (struct font): Update comments.
2249
2250 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2251
2252 Simple interface to set Lisp_Object fields of character tables.
2253 * lisp.h (CSET): New macro.
2254 (char_table_set_extras, char_table_set_contents)
2255 (sub_char_table_set_contents): New function.
2256 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2257 * syntax.c: Adjust users.
2258
2259 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2260
2261 * eval.c (eval_sub): Bind lexical-binding.
2262 * lread.c (Qlexical_binding): Make non-static.
2263
2264 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2265
2266 * nsmenu.m (popupSession): Remove.
2267 (pop_down_menu): Remove endModalSession.
2268 (timeout_handler:): New method.
2269 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2270 Call runModalForWindow. Check timer_fired when it returns.
2271 If not set, cancel timer and break out of loop.
2272 Otherwise loop again, with a new timeout.
2273
2274 * nsterm.m: Include fcntl.h if present.
2275 (fd_entry, t_readfds, inNsSelect): Remove.
2276 (select_writefds, select_valid, select_timeout, selfds)
2277 (select_mutex, apploopnr): Add.
2278 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2279 Otherwise call kbd_buffer_store_event.
2280 (ns_send_appdefined): Remove release of fd_entry.
2281 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2282 Increment and decrement apploopnr.
2283 (ns_select): If no file descriptors, just do a NSTimer.
2284 Otherwise copy read/write masks and start select thread (fd_handler).
2285 Start main loop and wait for application defined event.
2286 Inform select thread to stop selecting after main loop is exited.
2287 (ns_term_init): Create selfds pipe and set non-blocking.
2288 Initialize select_mutex. Start the select thread (fd_handler).
2289 (fd_handler:): Loop forever, wait for info from the main thread
2290 to either start or stop selecting. When select returns, send
2291 and appdefined event.
2292 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2293 If not call kbd_buffer_store_event.
2294
2295 * nsterm.h (EmacsApp): fd_handler takes id argument.
2296 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2297
2298 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2299
2300 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2301
2302 * region-cache.c (move_cache_gap): Update gap_len using the actual
2303 growth of the boundaries array. Do not change cache_len.
2304 (Bug#12196)
2305
2306 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2307
2308 Generalize and cleanup font subsystem checks.
2309 * font.h (FONT_DEBUG, font_assert): Remove.
2310 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2311 Change font_assert to eassert. Use eassert where appropriate.
2312
2313 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2314
2315 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2316
2317 2012-08-15 Chong Yidong <cyd@gnu.org>
2318
2319 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2320 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2321 extract the font descriptor instead of just the font name.
2322 In that case, return a font spec instead of a string.
2323 (x_last_font_name): Move to this file from xfns.c.
2324
2325 * xfns.c (Fx_select_font): The return value can also be a font
2326 spec. Move x_last_font_name management to gtkutil.c.
2327
2328 * xfaces.c: Make font weight and style symbols non-static.
2329
2330 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2331
2332 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2333 (bug#12117).
2334
2335 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2336
2337 * alloc.c (Fgarbage_collect): Use plural form consistently.
2338
2339 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2340
2341 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2342 iteration through the command loop. Fixes a problem whereby mouse
2343 movements are ignored until the first mouse click.
2344
2345 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2346
2347 Use bool, not int, for Lisp booleans.
2348 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2349 makes Emacs a bit smaller and presumably a bit faster.
2350 * lisp.h: Include <stdbool.h>.
2351 (struct Lisp_Boolfwd, defvar_bool):
2352 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2353 * regex.c [!emacs]: Include <stdbool.h>.
2354 (false, true): Remove; <stdbool.h> does this for us now.
2355
2356 2012-08-14 Chong Yidong <cyd@gnu.org>
2357
2358 * character.c (Fcharacterp): Doc fix (Bug#12076).
2359
2360 * data.c (Findirect_variable): Doc fix (Bug#11040).
2361
2362 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2363
2364 * editfns.c (Fformat): Doc fix (Bug#12059).
2365 (Fsave_current_buffer): Doc fix (Bug#11542).
2366
2367 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2368
2369 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2370 (bug#12022).
2371
2372 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2373
2374 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2375 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2376 * minibuf.c (choose_minibuf_frame, read_minibuf):
2377 * w32fns.c (x_create_tip_frame):
2378 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2379 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2380
2381 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2382
2383 * intervals.c (offset_intervals): Remove obsolete comment.
2384
2385 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2386
2387 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2388
2389 2012-08-14 Gergely Risko <gergely@risko.hu>
2390
2391 * coding.c (decode_coding): Record buffer modification before
2392 disabling undo_list (Bug#11773).
2393
2394 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2395
2396 Revert and cleanup some recent overlay changes.
2397 * buffer.h (enum overlay_type): Remove.
2398 (buffer_get_overlays, buffer_set_overlays): Likewise.
2399 (buffer_set_overlays_before, buffer_set_overlays_after):
2400 New function. Adjust users.
2401 (unchain_both): Add eassert.
2402
2403 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2404
2405 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2406
2407 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2408
2409 * gtkutil.c (xg_mark_data): Don't assume C99.
2410
2411 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2412
2413 * gtkutil.c (xg_frame_tb_info): New struct.
2414 (TB_INFO_KEY): New define.
2415 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2416 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2417 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2418 if not present.
2419 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2420 is up to date. Otherwise store new data.
2421 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2422
2423 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2424
2425 Use KSET for write access to Lisp_Object members of struct kboard.
2426 * keyboard.h (KSET): New macro.
2427 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2428 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2429 * xterm.c: Adjust users.
2430
2431 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2432
2433 Use BSET for write access to Lisp_Object members of struct buffer.
2434 * buffer.h (BSET): New macro.
2435 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2436 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2437 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2438 * window.c, xdisp.c, xfns.c: Adjust users.
2439
2440 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2441
2442 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2443
2444 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2445
2446 * nsterm.m (not_in_argv): New function.
2447 (application:openFile, application:openTempFile:):
2448 (application:openFileWithoutUI:, application:openFiles:): Open file
2449 if not_in_argv returns non-zero (bug#12171).
2450
2451 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2452 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2453 Define for Gtk+ versions less than 3.2.
2454 (xg_get_font_name): Use those functions/macros here.
2455 Reported by Frans Oilinki <moilinki@gmail.com>.
2456
2457 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2458
2459 * unexmacosx.c (copy_data_segment): Copy initialized data in
2460 statically linked libraries from input file rather than memory.
2461
2462 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2463 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2464 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2465
2466 2012-08-10 Glenn Morris <rgm@gnu.org>
2467
2468 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2469 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2470
2471 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2472
2473 Fix last change to allow compilation with low optimization levels.
2474 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2475 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2476
2477 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2478
2479 Use common inline syntax in intervals.h.
2480 * intervals.h (INTERVALS_INLINE): New macro.
2481 Change all users from LISP_INLINE.
2482
2483 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2484
2485 Define Qnone once for all platforms.
2486 * frame.c (Qnone): Define here.
2487 (syms_of_frame): DEFSYM it.
2488 * lisp.h (Qnone): New declaration.
2489 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2490 * xfns.c: Remove duplication. Adjust users.
2491
2492 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2493
2494 Remove unused macros from intervals.h.
2495 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2496 * intervals.c: Adjust comment.
2497
2498 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2499
2500 * w32fns.c <w32_unicode_gui>: New static variable.
2501 (globals_of_w32fns): Initialize it according to os_subtype.
2502 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2503 testing os_subtype.
2504
2505 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2506 Eli Zaretskii <eliz@gnu.org>
2507
2508 Fix bug #10299 with Unicode characters sent by customized
2509 keyboards created by MSKLC.
2510 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2511 (w32_init_class): Use it to initialize the Emacs class with either
2512 ANSI or Unicode API calls.
2513 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2514 later.
2515 (w32_wnd_proc): If the character code sent by WM_CHAR or
2516 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2517 original message. Call DefWindowProcW on NT and later.
2518
2519 2012-08-10 Glenn Morris <rgm@gnu.org>
2520
2521 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2522
2523 * lisp.h (DIRECTORY_SEP): Let configure set it.
2524
2525 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2526
2527 Use TSET for write access to Lisp_Object slots of struct terminal.
2528 * termhooks.h (TSET): New macro.
2529 * coding.c, terminal.c, xselect.c: Adjust users.
2530
2531 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2532
2533 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2534 the failing expression, include them in the error message.
2535 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2536 * lisp.h (internal_condition_case_n): Update declaration.
2537
2538 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2539
2540 Inline functions to examine and change buffer overlays.
2541 * buffer.c (unchain_both): New function.
2542 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2543 (buffer_has_overlays): New function.
2544 (enum overlay_type): New enum.
2545 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2546 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2547
2548 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2549
2550 Inline functions to examine and change buffer intervals.
2551 * alloc.c (mark_interval_tree): Remove.
2552 (MARK_INTERVAL_TREE): Simplify.
2553 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2554 * intervals.c (buffer_balance_intervals): New function.
2555 (graft_intervals_into_buffer): Adjust indentation.
2556 (set_intervals_multibyte): Simplify.
2557 * buffer.h (BUF_INTERVALS): Remove.
2558 (buffer_get_intervals, buffer_set_intervals): New function.
2559 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2560 * intervals.c, textprop.c: Adjust users.
2561
2562 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2563
2564 Inline functions to examine and change string intervals.
2565 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2566 (string_get_intervals, string_set_intervals): New function.
2567 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2568 * lread.c, print.c, textprop.c: Adjust users.
2569
2570 2012-08-08 Glenn Morris <rgm@gnu.org>
2571
2572 * lisp.mk (lisp): Remove language/persian.elc.
2573
2574 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2575
2576 Cleanup intervals.
2577 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2578 (NULL_INTERVAL_P): Likewise. Adjust users.
2579 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2580 Adjust comment. Move under #if 0.
2581 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2582 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2583
2584 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2585
2586 Check total length of intervals with eassert.
2587 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2588 * intervals.c: Change all users to eassert.
2589
2590 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2591
2592 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2593 Rename fields to match removal of FGET and WGET and disuse of
2594 INTERNAL_FIELD in Lisp_Cons.
2595
2596 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2597
2598 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2599 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2600 name since all xname users are fixed long time ago. Do not
2601 use INTERNAL_FIELD.
2602 (set_symbol_name, set_symbol_function, set_symbol_plist):
2603 (set_symbol_next, set_overlay_plist): New function.
2604 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2605 (struct Lisp_Overlay): Likewise.
2606 (CVAR, MVAR, SVAR): Remove.
2607 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2608 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2609 * xterm.c: Adjust users.
2610 * .gdbinit: Change to use name field of struct Lisp_Symbol
2611 where appropriate.
2612
2613 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2614
2615 Basic functions to set Lisp_Object and pointer slots of intervals.
2616 * intervals.h (interval_set_parent, interval_set_object):
2617 (interval_set_left, interval_set_right, interval_set_plist):
2618 (interval_copy_parent): New function.
2619 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2620 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2621 Adjust indentation.
2622 (INTERVAL_SIZE): Remove. Adjust users.
2623 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2624
2625 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2626
2627 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2628 * process.h (PGET): Remove.
2629 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2630 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2631
2632 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2633
2634 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2635 * window.h (WGET): Remove.
2636 (struct window): Do not use INTERNAL_FIELD.
2637 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2638 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2639 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2640 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2641 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2642 Adjust users.
2643
2644 2012-08-07 Chong Yidong <cyd@gnu.org>
2645
2646 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2647 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2648 (Fdelete_window_internal): Signal an error if the window is not on
2649 a live frame (Bug#12025).
2650
2651 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2652
2653 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2654 * frame.h (FGET): Remove.
2655 (struct frame): Do not use INTERNAL_FIELD.
2656 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2657 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2658 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2659 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2660
2661 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2662
2663 * w32.c: Silence compiler warnings.
2664 (map_w32_filename): Remove unused variable `is_fat'.
2665 (chase_symlinks): Add parentheses around expression.
2666
2667 2012-08-06 Glenn Morris <rgm@gnu.org>
2668
2669 * sysdep.c: Respect BROKEN_GETWD.
2670
2671 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2672 Let configure handle it.
2673 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2674
2675 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2676
2677 Use GCALIGNMENT where appropriate.
2678 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2679 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2680 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2681
2682 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2683
2684 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2685 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2686
2687 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2688
2689 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2690 that should be sufficient for everyone.
2691
2692 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2693
2694 * keyboard.c (timer_check_2): Add break so timer_check returns next
2695 timeout.
2696
2697 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2698
2699 Fix Windows build errors introduced after converting to WGET and WSET.
2700 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2701 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2702
2703 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2704
2705 * nsterm.m (ns_frame_rehighlight): Use FSET.
2706
2707 * nsmenu.m (ns_update_menubar): Use FSET.
2708
2709 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2710
2711 Separate read and write access to Lisp_Object slots of Lisp_Process.
2712 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2713 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2714
2715 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2716
2717 Separate read and write access to Lisp_Object slots of struct window.
2718 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2719 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2720 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2721 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2722 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2723 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2724 Adjust users.
2725
2726 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2727
2728 Fix Windows build errors introduced after converting to FGET and FSET.
2729 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2730 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2731 (w32_judge_scroll_bars): Change to use FSET.
2732 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2733
2734 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2735
2736 Fix replacement typo.
2737 * window.c (replace_window): Set root_window instead of
2738 selected_window. This fixes a total window subsystem
2739 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2740
2741 2012-08-06 Glenn Morris <rgm@gnu.org>
2742
2743 * lisp.mk (lisp): Add language/persian.elc.
2744
2745 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2746
2747 Separate read and write access to Lisp_Object slots of struct frame.
2748 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2749 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2750 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2751 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2752 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2753
2754 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2755
2756 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2757
2758 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2759
2760 Generalize common compile-time constants.
2761 * lisp.h (header_size, bool_header_size, word_size): Now here.
2762 (struct Lisp_Vector): Add comment.
2763 (struct Lisp_Bool_Vector): Move up to define handy constants.
2764 (VECSIZE, PSEUDOVECSIZE): Simplify.
2765 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2766 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2767 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2768 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2769 * xfont.c, xmenu.c: Use word_size where appropriate.
2770
2771 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2772
2773 * search.c (Freplace_match): Treat \? in the replacement text
2774 literally (Bug#8161).
2775
2776 2012-08-05 Chong Yidong <cyd@gnu.org>
2777
2778 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2779 * frame.c (Vdelete_frame_functions):
2780 * emacs.c (Vkill_emacs_hook): Doc fix.
2781
2782 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2783
2784 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2785 --with-x-toolkit=no builds.
2786 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2787
2788 2012-08-04 Chong Yidong <cyd@gnu.org>
2789
2790 * syntax.c (Fmodify_syntax_entry): Doc fix.
2791
2792 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2793
2794 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2795 * w32.c (init_environment): Change the default values of many
2796 environment variables in dflt_envvars[] to NULL, to avoid pushing
2797 them into environment when they were not already defined.
2798 Remove the code that deletes site-lisp subdirectories from the default
2799 value of EMACSLOADPATH, as it is no longer needed.
2800 (check_windows_init_file): Now external, not static.
2801 Use Vload_path as is, without adding anything, as this function is now
2802 called when Vload_path is already set up.
2803
2804 * w32.h (check_windows_init_file): Add prototype.
2805
2806 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2807 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2808 compatibility with Posix platforms.
2809 (main): Move the call to check_windows_init_file to here from
2810 w32.c.
2811 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2812 any, in the DEFALT argument into the root of the Emacs build or
2813 installation tree, as appropriate.
2814
2815 * callproc.c (init_callproc_1): Call decode_env_path instead of
2816 doing its equivalent by hand.
2817 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2818 the code that sets Vexec_path run on MS-Windows.
2819
2820 * lread.c (init_lread): Add comments to #ifdef's.
2821
2822 * msdos.c (dos_set_window_size, IT_update_begin)
2823 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2824 instead of direct references.
2825
2826 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2827
2828 Export DEFAULT_REHASH_* to GDB.
2829 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2830 Now constants, not macros.
2831
2832 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2833
2834 Remove unnecessary casts involving pointers.
2835 These casts are no longer needed now that we assume C89 or later,
2836 since they involve casting to or from void *.
2837 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2838 (make_pure_float, make_pure_vector):
2839 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2840 * macros.c (Fstart_kbd_macro):
2841 * menu.c (find_and_return_menu_selection):
2842 * minibuf.c (read_minibuf_noninteractive):
2843 * sysdep.c (closedir):
2844 * xdisp.c (x_produce_glyphs):
2845 * xfaces.c (compare_fonts_by_sort_order):
2846 * xfns.c (x_real_positions, select_visual):
2847 * xselect.c (x_stop_queuing_selection_requests)
2848 (x_get_window_property, x_get_window_property_as_lisp_data):
2849 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2850 Remove unnecessary pointer casts.
2851 * alloc.c (record_xmalloc): New function.
2852 * lisp.h (record_xmalloc): New decl.
2853 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2854 more like a function. This is because the pointer cast is not
2855 needed. All uses changed.
2856 * print.c (print_string, print_error_message): Avoid length recalc.
2857
2858 Improve fix for macroexp crash with debugging (Bug#12118).
2859 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2860 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2861 not supposed to be invoked from the garbage collector.
2862 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2863 (gc_aset): New function, which is like ASET but can be
2864 used in the garbage collector.
2865 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2866 (set_hash_index): Use it instead of ASET.
2867
2868 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2869
2870 Support symlinks on latest versions of MS-Windows.
2871 * w32.c: Include winioctl.h and aclapi.h.
2872 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2873 (revert_to_self): Forward declarations of static functions.
2874 <static BOOL g_b_init_get_security_info>:
2875 <g_b_init_create_symbolic_link>: New static flags.
2876 (globals_of_w32): Initialize them to zero.
2877 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2878 (map_w32_filename): Improve commentary. Simplify switch.
2879 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2880 headers (most versions of MinGW w32api don't).
2881 (get_security_info, create_symbolic_link)
2882 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2883 New functions.
2884 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2885 in the argument file name.
2886 (sys_access): Call unc_volume_file_attributes only if
2887 GetFileAttributes fails with network-related error codes.
2888 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2889 have the required privileges.
2890 (get_file_security_desc_by_name): Rename from
2891 get_file_security_desc.
2892 (stat_worker): New function, with most of the guts of 'stat', and
2893 with addition of handling of symlinks and support for 'lstat'.
2894 If possible, get file's attributes and security information by
2895 handle, not by name. Produce S_IFLNK bit for symlinks, when
2896 called from 'lstat'.
2897 (stat, lstat): New functions, call 'stat_worker'.
2898 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2899 symlinks when the underlying filesystem supports them.
2900
2901 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2902
2903 Fix macroexp crash on Windows with debugging (Bug#12118).
2904 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2905 checking subscripts; problem introduced with the recent
2906 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2907 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2908 since it's used in non-static inline functions now.
2909
2910 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2911 Don't assume buffer size fits in 'int'. Remove unused local.
2912
2913 Use C99-style 'extern inline' if available.
2914 * buffer.h (BUFFER_INLINE):
2915 * category.h (CATEGORY_INLINE):
2916 * character.h (CHARACTER_INLINE):
2917 * charset.h (CHARSET_INLINE):
2918 * composite.h (COMPOSITE_INLINE):
2919 * dispextern.h (DISPEXTERN_INLINE):
2920 * lisp.h (LISP_INLINE):
2921 * systime.h (SYSTIME_INLINE):
2922 New macro, replacing 'static inline' in this header.
2923 * buffer.h, category.h, character.h, charset.h, composite.h:
2924 * dispextern.h, lisp.h, systime.h:
2925 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2926 * alloc.c (LISP_INLINE):
2927 * buffer.c (BUFFER_INLINE):
2928 * category.c (CATEGORY_INLINE):
2929 * character.c (CHARACTER_INLINE):
2930 * charset.c (CHARSET_INLINE):
2931 * composite.c (COMPOSITE_INLINE):
2932 * dispnew.c (DISPEXTERN_INLINE):
2933 * sysdep.c (SYSTIME_INLINE):
2934 Define to EXTERN_INLINE, so that the corresponding functions
2935 are compiled into code.
2936 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2937 (INLINE_HEADER_END): New macros.
2938 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2939 since it's used in non-static inline functions now.
2940 (VALMASK) [!USE_LSB_TAG]: Likewise.
2941
2942 2012-08-02 Glenn Morris <rgm@gnu.org>
2943
2944 * s/: Remove empty directory.
2945
2946 * s/ms-w32.h: Move to ../nt/inc.
2947 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2948 Update for new ms-w32.h location.
2949
2950 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2951
2952 Port to Solaris 8.
2953 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2954
2955 2012-08-02 Glenn Morris <rgm@gnu.org>
2956
2957 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2958 hard-coding the path separator.
2959
2960 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2961
2962 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2963 This how ASET and AREF are supposed to work, and makes
2964 it easier to think about future improvements. See
2965 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2966 * charset.h (set_charset_attr): New function.
2967 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2968 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2969 (aref_addr): New function. All uses of &AREF(...) changed.
2970 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2971 (set_hash_index): New functions. All lvalue-style uses of
2972 HASH_KEY etc. changed.
2973 * keyboard.c (set_prop): New function. All lvalue-style uses
2974 of PROP changed.
2975
2976 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2977
2978 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2979 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2980 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2981 * nsfns.m (ns_set_name_as_filename): Likewise.
2982 * nsmenu.m (ns_update_menubar): Likewise.
2983 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2984
2985 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2986
2987 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2988 Adapt to latest changes in field names of the corresponding Lisp
2989 objects.
2990
2991 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2992
2993 2012-08-01 Glenn Morris <rgm@gnu.org>
2994
2995 * s/msdos.h: Remove file.
2996 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2997 * Makefile.in (S_FILE): Remove.
2998 (config_h): Remove S_FILE.
2999
3000 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3001
3002 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3003 Remove; moved to nt/config.nt.
3004
3005 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3006
3007 Use INTERNAL_FIELD for conses and overlays.
3008 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3009 Remove obsolete comment.
3010 (MVAR): New macro.
3011 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3012 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3013
3014 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3015
3016 Use INTERNAL_FIELD for symbols.
3017 * lisp.h (SVAR): New macro. Adjust users.
3018 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3019 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3020
3021 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3022
3023 Use INTERNAL_FIELD for processes.
3024 * process.h (PVAR): New macro. Adjust style.
3025 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3026 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3027
3028 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3029
3030 Use INTERNAL_FIELD for windows.
3031 * window.h (WVAR): New macro.
3032 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3033 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3034 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3035 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3036 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3037 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3038
3039 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3040
3041 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3042
3043 2012-08-01 Glenn Morris <rgm@gnu.org>
3044
3045 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3046 Move to configure.ac.
3047
3048 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3049
3050 * makefile.w32-in (CONFIG_H): Update dependencies.
3051 (CONF_POST_H): New macro.
3052
3053 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3054
3055 2012-07-31 Glenn Morris <rgm@gnu.org>
3056
3057 * Makefile.in (S_FILE): No longer set by configure.
3058
3059 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3060 is available.
3061 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3062
3063 * process.h (NULL_DEVICE):
3064 * emacs.c (SEPCHAR):
3065 * editfns.c (USER_FULL_NAME): Let configure set them.
3066
3067 * s/README, s/template.h: Remove files.
3068
3069 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3070
3071 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3072 Move to configure.ac.
3073
3074 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3075
3076 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3077 resulting renaming of 'struct frame' members.
3078
3079 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3080
3081 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3082 after introduction of FVAR.
3083
3084 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3085
3086 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3087
3088 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3089 instead of compositeToPoint.
3090 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3091
3092 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3093
3094 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3095
3096 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3097 * lisp.h (INTERNAL_FIELD): New macro.
3098 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3099 (BVAR): Change to use INTERNAL_FIELD.
3100 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3101 (KVAR): Change to use INTERNAL_FIELD.
3102 * frame.h (FVAR): New macro.
3103 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3104 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3105 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3106 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3107 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3108
3109 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3110
3111 Miscellaneous fixes for non-default X toolkits.
3112 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3113 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3114 Move under #ifdef USE_LUCID.
3115 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3116 definition and usage to avoid warnings.
3117
3118 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3119
3120 * nsterm.m (openFiles): Fix previous checkin.
3121
3122 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3123
3124 * indent.c (compute_motion): Remove unused local.
3125
3126 2012-07-31 Glenn Morris <rgm@gnu.org>
3127
3128 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3129
3130 * conf_post.h [USG5_4]:
3131 Move remaining contents of s/usg5-4-common.h here.
3132 * s/usg5-4-common.h: Remove file.
3133
3134 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3135 * s/irix6-5.h: Remove file.
3136
3137 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3138 * s/darwin.h: Remove file.
3139
3140 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3141 * s/hpux10-20.h: Remove file, which is now empty.
3142
3143 2012-07-30 Glenn Morris <rgm@gnu.org>
3144
3145 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3146 * Makefile.in (config_h): Add conf_post.h.
3147 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3148
3149 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3150
3151 * nsterm.m (ns_do_open_file): New variable.
3152 (ns_term_init): Set ns_do_open_file to YES after run returns.
3153 (openFile, openTempFile, openFileWithoutUI, openFiles):
3154 Open files only if ns_do_open_file.
3155
3156 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3157
3158 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3159 This no-op macro hasn't been needed for many years.
3160 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3161
3162 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3163 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3164 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3165 gdb_make_enums_visible.
3166 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3167 (DIRECTORY_SEP): Now a constant, not a macro.
3168
3169 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3170
3171 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3172 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3173
3174 * w32term.c <w32_keyboard_codepage>: Renamed from
3175 keyboard_codepage and now external. All users changed.
3176
3177 * w32term.h: Add declaration of w32_keyboard_codepage.
3178
3179 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3180 the codepage to translate keys to Unicode. If this argument is
3181 -1, use the value returned by GetConsoleCP. All callers changed.
3182
3183 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3184
3185 Update .PHONY listings in makefiles.
3186 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3187 bootstrap-clean, distclean, maintainer-clean, versioclean,
3188 extraclean, frc.
3189
3190 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3191 This is a bit clearer. Fix some commentary typos.
3192
3193 2012-07-30 Glenn Morris <rgm@gnu.org>
3194
3195 * s/netbsd.h: Let configure include signal.h if needed.
3196 Remove file, which is now empty.
3197
3198 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3199 Let configure set them.
3200 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3201 No more need to undefine.
3202
3203 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3204
3205 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3206 non-single-byte char when adding meta modifier. (Bug#12090)
3207
3208 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3209
3210 Convert safe_call to use variable number of arguments.
3211 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3212 (safe_call2): Fix comment.
3213 * lisp.h (safe_call): Adjust prototype.
3214 * coding.c (encode_coding_object): Change to use safe_call2.
3215 * xfaces.c (merge_face_heights): Change to use safe_call1.
3216
3217 2012-07-30 Glenn Morris <rgm@gnu.org>
3218
3219 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3220 does that unconditionally. Remove file, which is now empty.
3221
3222 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3223 Remove empty files.
3224
3225 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3226
3227 Export to GDB most of lisp.h's remaining object-like macros.
3228 * lisp.h (min, max): Move earlier, because they're used earlier now.
3229 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3230 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3231 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3232 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3233 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3234 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3235 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3236 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3237 Now constants, for GDB. They need not be macros.
3238 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3239 Now constants, for GDB, as well as macros, for static initializers.
3240 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3241 Move to after the definition of struct Lisp_Char_Table,
3242 since the former now needs that type defined.
3243 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3244 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3245 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3246 New enums, for gdb_make_enums_visible.
3247 (GLYPH_MODE_LINE_FACE): Remove; unused.
3248 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3249 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3250 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3251 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3252 enum maxargs, enum MAX_ALLOCA.
3253 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3254 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3255 no longer needed, now that they are done in lisp.h.
3256
3257 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3258
3259 Cleanup string bytes checking.
3260 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3261 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3262 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3263 (check_sblock, compact_small_strings): Simplify.
3264
3265 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3266
3267 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3268 These macros are confusing and no longer need to be defined, as
3269 the enum values now suffice. All uses replaced with definiens.
3270 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3271
3272 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3273
3274 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3275 ($(BLD)/w32console.$(O)): Update dependencies.
3276
3277 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3278
3279 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3280 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3281 time. Adjust users.
3282 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3283
3284 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3285
3286 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3287 setting sitelisp (Bug#12010).
3288
3289 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3290
3291 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3292
3293 * w32heap.c (cache_system_info):
3294 * w32.c (sys_rename):
3295 * w32proc.c (find_child_console, sys_kill): All users changed.
3296
3297 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3298
3299 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3300
3301 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3302
3303 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3304
3305 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3306
3307 Cleanup statistics calculation in Fgarbage_collect.
3308 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3309 Fix zombies percentage calculation. Simplify elapsed time calculation.
3310
3311 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3312
3313 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3314 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3315 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3316 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3317 (replace_range, replace_range_2, del_range_2): Change to eassert.
3318 * marker.c (byte_char_debug_check): Adjust style.
3319
3320 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3321
3322 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3323 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3324 long-ago-commented-out code that talks about "WIN32".
3325 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3326 All uses changed.
3327
3328 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3329
3330 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3331 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3332 Simplify by using alignof.
3333 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3334 * lisp.h: Include <stdalign.h>.
3335 (GCALIGNMENT): New macro and constant.
3336 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3337 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3338 (stdalign): New macro, if not already defined.
3339
3340 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3341
3342 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3343 * w32inevt.c: Include w32inevt.h.
3344 (w32_read_console_input): New inline function, calls either
3345 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3346 w32_console_unicode_input.
3347 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3348 (w32_kbd_patch_key, key_event): Use the codepage returned by
3349 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3350 (key_event): use uChar.UnicodeChar only if
3351 w32_console_unicode_input is non-zero.
3352
3353 * w32console.c: Include w32heap.h.
3354 <w32_console_unicode_input>: New global variable.
3355 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3356 family of Windows, zero otherwise.
3357
3358 * w32inevt.h: Declare w32_console_unicode_input.
3359
3360 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3361 --without-x. (Bug#11742)
3362
3363 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3364
3365 Adjust GDB to reflect pvec_type changes (Bug#12036).
3366 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3367 2012-07-04 changes to pseudovector representation.
3368 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3369
3370 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3371
3372 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3373 bus address.
3374 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3375
3376 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3377
3378 * alloc.c (listn): Fix the order the arguments are consed onto the
3379 list.
3380
3381 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3382 enumeration constants, as PURE and HEAP are too general, and clash
3383 with other headers and sources, such as gmalloc.c and the
3384 MS-Windows system headers. All users changed.
3385
3386 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3387
3388 Revert last save_excursion_save and save_excursion_restore changes.
3389 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3390 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3391
3392 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3393
3394 Fix recently-introduced typos in Windows port.
3395 Reported by Martin Rudalics <rudalics@gmx.at>.
3396 * w32.c (init_environment): Replace comma with semicolon.
3397 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3398
3399 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3400
3401 Improve GDB symbol export (Bug#12036).
3402 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3403 arms of an 'if', not using conditional expressions; otherwise GDB
3404 complains about the types in the unevaluated arm when the argument
3405 is an integer literal.
3406 (xgetint): Simplify expression.
3407 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3408 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3409 Zaretskii in <http://bugs.gnu.org/12036#13>.
3410 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3411 needed now that we have gdb_make_enums_visible.
3412 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3413 (enum enum_USE_LSB_TAG):
3414 New enum types, packaging up enums that need to be exported to GDB.
3415
3416 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3417
3418 Utility function to make a list from specified amount of objects.
3419 * lisp.h (enum constype): New datatype.
3420 (listn): New prototype.
3421 * alloc.c (listn): New function.
3422 (Fmemory_use_count, syms_of_alloc): Use it.
3423 * buffer.c (syms_of_buffer): Likewise.
3424 * callint.c (syms_of_callint): Likewise.
3425 * charset.c (define_charset_internal): Likewise.
3426 * coding.c (syms_of_coding): Likewise.
3427 * keymap.c (syms_of_keymap): Likewise.
3428 * search.c (syms_of_search): Likewise.
3429 * syntax.c (syms_of_syntax): Likewise.
3430 * w32.c (init_environment): Likewise.
3431 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3432 * xdisp.c (syms_of_xdisp): Likewise.
3433 * xfns.c (syms_of_xfns): Likewise.
3434
3435 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3436
3437 Fast save_excursion_save and save_excursion_restore.
3438 * lisp.h (struct Lisp_Excursion): New data type.
3439 (PVEC_EXCURSION): New pseudovector type.
3440 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3441 to deal with it. Adjust comments.
3442 (init_marker, attach_marker): New prototype.
3443 (unchain_marker): Adjust prototype.
3444 * marker.c (attach_marker): Change to global.
3445 (init_marker): New function.
3446 * alloc.c (Fmake_marker, build_marker): Use it.
3447 (build_marker): More easserts.
3448 (mark_object): Handle struct Lisp_Excursion.
3449 * editfns.c (save_excursion_save, save_excursion_restore):
3450 Reimplement to use struct Lisp_Excursion. Add comments.
3451
3452 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3453
3454 Fix export of symbols to GDB (Bug#12036).
3455 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3456 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3457 emacs.c, as this is a more-suitable home. Had this been done earlier
3458 the fix for 12036 would have avoided some of the problems noted in
3459 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3460 would have been more obvious.
3461 * emacs.c: Do not include <verify.h>; no longer needed.
3462 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3463 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3464 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3465 Remove; now done in lisp.h.
3466 * lisp.h (PUBLISH_TO_GDB): New macro.
3467 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3468 (DATA_SEG_BITS): Use it.
3469 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3470 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3471 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3472 not be usable in #if. This simplifies things.
3473
3474 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3475
3476 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3477
3478 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3479
3480 Simplify export of symbols to GDB (Bug#12036).
3481 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3482 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3483 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3484 Adjust to changes in lisp.h and emacs.c, by using
3485 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3486 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3487 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3488 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3489 instead of gdb_valbits.
3490 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3491 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3492 instead of gdb_array_mark_flag.
3493 (xboolvector): Get size from $->size, not $->header.size.
3494 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3495 (xreload, hook-run, hookpost-run): Remove.
3496 * emacs.c: Include <verify.h>.
3497 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3498 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3499 Remove.
3500 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3501 (gdb_USE_LSB_TAG): New enum constants.
3502 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3503 Also define these as enum constants, so they're visible to GDB.
3504 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3505 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3506 as constants, so they're visible to GDB.
3507 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3508 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3509 Now enum constants, not macros, so they're visible to GDB.
3510 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3511 more convenient now. All uses changed.
3512 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3513 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3514
3515 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3516
3517 Explicitly free restriction data that are not needed anymore.
3518 * editfns.c (save_restriction_restore): Free restriction data.
3519
3520 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3521
3522 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3523 add argument, tune behavior, and adjust all callers.
3524
3525 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3526
3527 Use typedef for EMACS_INT, EMACS_UINT.
3528 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3529 than macros. This simplifies debugging in the usual case, since
3530 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3531 and it allows expressions involving EMACS_INT casts.
3532 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3533
3534 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3535
3536 * nsterm.m (ns_read_socket): Return early if there is a modal
3537 window (Bug#12043).
3538
3539 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3540
3541 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3542 that FOCUS-FRAME can be omitted.
3543
3544 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3545
3546 Adjust buffer text indirection counters at the end of Fkill_buffer.
3547 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3548 buffer is definitely dead. This should really fix an issue reported
3549 by Christoph Scholtes again. (Bug#12007).
3550 (init_buffer_once): Initialize indirection counters of
3551 buffer_defaults and buffer_local_symbols (for sanity and safety).
3552
3553 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3554
3555 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3556 and continuation glyphs on tooltip frames, leave them at zero.
3557 Avoids continued lines in tooltips. (Bug#11832)
3558
3559 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3560
3561 Simplify copy_overlay.
3562 * buffer.c (copy_overlay): Simplify. Use build_marker.
3563 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3564
3565 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3566
3567 * print.c (print_object): Don't crash when a frame's name is nil
3568 or invalid. (Bug#12025)
3569
3570 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3571 it signals an error when a tooltip frame is being created.
3572
3573 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3574
3575 Cleanup miscellaneous objects allocation and initialization.
3576 * alloc.c (allocate_misc): Change to static. Add argument to
3577 specify the subtype. Adjust comment and users.
3578 (build_overlay): New function.
3579 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3580 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3581 (allocate_misc): Remove prototype.
3582 (build_overlay): Add prototype.
3583
3584 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3585
3586 Swap buffer text indirection counters in Fbuffer_swap_text.
3587 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3588 This avoids crash reported by Christoph Scholtes at
3589 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3590
3591 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3592
3593 * nsmenu.m (Popdown_data): New struct.
3594 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3595 free Popdown_data.
3596 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3597 (initWithContentRect): Make imgView and contentView non-static
3598 and autorelease them. Also autorelease img and matrix (Bug#12005).
3599 (dealloc): Remove (Bug#12005).
3600
3601 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3602
3603 Adjust consing_since_gc when objects are explicitly freed.
3604 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3605 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3606 (free_cons, free_misc): Subtract object size from consing_since_gc.
3607
3608 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3609
3610 Simplify and cleanup markers positioning code.
3611 * marker.c (attach_marker): More useful eassert.
3612 (live_buffer, set_marker_internal): New function.
3613 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3614 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3615
3616 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3617
3618 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3619 as it's limited by the amount of memory, not by INT_MAX.
3620
3621 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3622
3623 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3624 in special-event-map. See the discussion at
3625 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3626 for the reasons.
3627
3628 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3629 info.dwItemData. Fixes crashes on 64-bit Windows.
3630 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3631
3632 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3633
3634 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3635 (conversationIdentifier): Return value is NSInteger.
3636 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3637
3638 2012-07-21 Chong Yidong <cyd@gnu.org>
3639
3640 * window.c (decode_any_window): Signal an error if the window is
3641 on a dead frame (Bug#11984).
3642
3643 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3644
3645 Add indirection counting to speed up Fkill_buffer.
3646 * buffer.h (struct buffer): New member.
3647 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3648 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3649 base buffer indirection counter.
3650 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3651 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3652 through buffer list if indirection counter is 0.
3653
3654 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3655
3656 Extend the value returned by Fgarbage_collect with heap statistics.
3657 * alloc.c (Qheap): New symbol.
3658 (syms_of_alloc): DEFSYM it.
3659 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3660 (Fmemory_free): Remove.
3661 (syms_of_alloc): Don't defsubr it.
3662 * buffer.c (Fcompact_buffer): Remove.
3663 (syms_of_buffer): Don't defsubr it.
3664
3665 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3666
3667 Make maybe_gc inline.
3668 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3669 * lisp.h (consing_since_gc, gc_relative_threshold)
3670 (memory_full_cons_threshold): Revert declaration.
3671 (maybe_gc): Remove prototype, define as inline.
3672 * alloc.c: Remove old commented-out code.
3673 (consing_since_gc, gc_relative_threshold)
3674 (memory_full_cons_threshold): Revert to global.
3675 (maybe_gc): Remove.
3676
3677 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3678
3679 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3680 * lisp.h (build_unibyte_string): New function.
3681 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3682 * sysdep.c, w32fns.c, xfns.c: Use it.
3683 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3684 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3685 Adjust users accordingly.
3686 * font.h (font_open_by_name): Adjust prototype.
3687
3688 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3689
3690 Cleanup calls to Fgarbage_collect.
3691 * lisp.h (maybe_gc): New prototype.
3692 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3693 Remove declarations.
3694 * alloc.c (maybe_gc): New function.
3695 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3696 Make them static.
3697 * bytecode.c (MAYBE_GC): Use maybe_gc.
3698 * eval.c (eval_sub, Ffuncall): Likewise.
3699 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3700 to avoid dependency from auto-save feature.
3701
3702 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3703
3704 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3705 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3706 'for_each_per_buffer_object_at'.
3707 All uses changed. It's better to use upper-case for macros that
3708 cannot be implemented as functions, to give the reader a clue
3709 that they're special.
3710
3711 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3712
3713 * alloc.c (Fgarbage_collect): Tweak docstring.
3714
3715 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3716
3717 Tweak the value returned from Fgarbage_collect again.
3718 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3719 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3720 Adjust documentation.
3721 (total_vector_bytes): Rename to total_vector_slots, adjust
3722 accounting.
3723 (total_free_vector_bytes): Rename to total_free_vector_slots,
3724 adjust accounting.
3725 (Qstring_bytes, Qvector_slots): New symbols.
3726 (syms_of_alloc): DEFSYM them.
3727
3728 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3729
3730 Buffer compaction primitive which may be used from Lisp.
3731 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3732 (syms_of_buffer): Register Fcompact_buffer.
3733 * alloc.c (Fgarbage_collect): Use compact_buffer.
3734 * buffer.h (compact_buffer): New prototype.
3735 (struct buffer_text): New member.
3736
3737 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3738
3739 New macro to iterate over all buffers, miscellaneous cleanups.
3740 * lisp.h (all_buffers): Remove declaration.
3741 * buffer.h (all_buffers): Add declaration, with comment.
3742 (for_each_buffer): New macro.
3743 * alloc.c (Fgarbage_collect, mark_object): Use it.
3744 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3745 (init_buffer): Likewise.
3746 * data.c (Fset_default): Likewise.
3747 * coding.c (code_conversion_restore): Remove redundant check
3748 for dead buffer.
3749 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3750
3751 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3752
3753 Fix bug that created negative-length intervals.
3754 * intervals.c (merge_interval_right, merge_interval_left):
3755 Do not zero out this interval if it is absorbed by its children,
3756 as this interval's total length doesn't change in that case. See
3757 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3758
3759 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3760
3761 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3762 when invoking (make-bool-vector N t) and N is a positive
3763 multiple of 8 -- the last 8 bits were mistakenly cleared.
3764
3765 Remove some struct layout assumptions in bool vectors.
3766 * alloc.c (bool_header_size): New constant.
3767 (header_size, word_size): Move earlier, as they're now used earlier.
3768 Use 'word_size' in a few more places, where it's appropriate.
3769 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3770 padding before the data member of a bool vector.
3771 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3772 than doing the check by hand with an abort ().
3773
3774 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3775
3776 * eval.c (Fdefvar): Don't check constants since we only set the var if
3777 it's not yet defined anyway (bug#11904).
3778
3779 * lisp.h (last_undo_boundary): Declare new var.
3780 * keyboard.c (command_loop_1): Set it.
3781 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3782 were auto-added by the command loop (bug#11774).
3783
3784 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3785
3786 * w32font.c (Qsymbol): Remove local definition.
3787 (syms_of_w32font): Don't DEFSYM it.
3788
3789 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3790
3791 Fix sweep_vectors to handle large bool vectors correctly.
3792 * alloc.c (sweep_vectors): Account total_vector_bytes for
3793 bool vectors larger than VBLOCK_BYTES_MAX.
3794
3795 2012-07-18 Chong Yidong <cyd@gnu.org>
3796
3797 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3798 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3799
3800 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3801
3802 Return more descriptive data from Fgarbage_collect.
3803 Suggested by Stefan Monnier in
3804 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3805 * alloc.c (bounded_number): New function.
3806 (total_buffers, total_vectors): New variable.
3807 (total_string_size): Rename to total_string_bytes, adjust users.
3808 (total_vector_size): Rename to total_vector_bytes, adjust users.
3809 (sweep_vectors): Account total_vectors and total_vector_bytes.
3810 (Fgarbage_collect): New return value. Adjust documentation.
3811 (gc_sweep): Account total_buffers.
3812 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3813 (VECTOR_SIZE): Remove.
3814 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3815 (Qinterval, Qmisc): New symbols.
3816 (syms_of_data): Initialize them.
3817 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3818 (Qcons, Qbuffer): New declarations.
3819
3820 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3821
3822 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3823 Round up, not down. Improve doc.
3824
3825 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3826
3827 Restore old code in allocate_string_data to avoid Faset breakage.
3828 Reported by Julien Danjou <julien@danjou.info> in
3829 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3830 * alloc.c (allocate_string_data): Restore old code with minor
3831 adjustments, fix comment to explain this subtle issue.
3832
3833 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3834
3835 Remove FILE_SYSTEM_CASE.
3836 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3837
3838 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3839 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3840 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3841 call-process-region passes it through expand-file-name.
3842
3843 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3844
3845 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3846
3847 Fix crash when creating indirect buffer (Bug#11917)
3848 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3849 Don't handle unbound variables specially if non-zero.
3850 (Fbuffer_local_variables): Pass zero.
3851 (clone_per_buffer_values): Pass non-zero.
3852
3853 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3854
3855 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3856 to make the loop interruptible.
3857
3858 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3859
3860 * gnutls.c (emacs_gnutls_handshake): Only retry if
3861 GNUTLS_E_INTERRUPTED.
3862
3863 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3864
3865 Cleanup and convert miscellaneous checks to eassert.
3866 * alloc.c (mark_interval): Fix comment, partially rephrase
3867 old comment from intervals.h (see below).
3868 * intervals.c (find_interval, adjust_intervals_for_insertion)
3869 (delete_interval, adjust_intervals_for_deletion)
3870 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3871 Convert to eassert.
3872 (adjust_intervals_for_insertion, make_new_interval):
3873 Remove obsolete and unused code.
3874 * intervals.h (struct interval): Remove obsolete comment.
3875 * textprotp.c (erase_properties): Remove unused code.
3876 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3877 (Fremove_list_of_text_properties): Convert to eassert.
3878
3879 2012-07-17 Chong Yidong <cyd@gnu.org>
3880
3881 * editfns.c (Finsert_char): Doc fix.
3882
3883 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3884
3885 Fix previous change to make Fmemory_free always accurate.
3886 * alloc.c (make_interval): Update total_free_intervals.
3887 (make_float): Likewise for total_free_floats.
3888 (free_cons, Fcons): Likewise for total_free_conses.
3889 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3890 Likewise for total_free_vector_bytes.
3891 (Fmake_symbol): Likewise for total_free_symbols.
3892 (bytes_free): Remove.
3893
3894 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3895
3896 Simple free memory accounting feature.
3897 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3898 (sweep_vectors): Accumulate size of free vectors.
3899 (Fgarbage_collect): Setup bytes_free.
3900 (Fmemory_free): New function.
3901 (syms_of_alloc): Register it.
3902
3903 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3904
3905 Cleanup overlays checking.
3906 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3907 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3908 eassert and OVERLAYP.
3909 (sort_overlays): Change to use OVERLAYP.
3910
3911 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3912
3913 * editfns.c (Finsert_char): Make it interactive, and make the
3914 second arg optional. Copy interactive spec and docstring from
3915 ucs-insert.
3916
3917 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3918
3919 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3920 Unlike the other wrapped functions, fabs has an unspecified
3921 effect on errno.
3922
3923 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3924
3925 * nsterm.m (keyDown): Interpret flags without left/right bits
3926 as the left key (Bug#11670).
3927
3928 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3929
3930 Remove empty and useless init functions.
3931 * lisp.h (init_character_once, init_fns, init_image)
3932 (init_filelock, init_sound): Remove prototype.
3933 * character.c (init_character_once): Remove.
3934 * filelock.c (init_filelock): Likewise.
3935 * fns.c (init_fns): Likewise.
3936 * image.c (init_image): Likewise.
3937 * sound.c (init_sound): Likewise.
3938 * emacs.c (main): Adjust accordingly.
3939
3940 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3941
3942 * gtkutil.h: Tiny cleanups.
3943 (use_old_gtk_file_dialog): Remove useless declaration.
3944 (xg_uses_old_file_dialog): Add suggested const attribute.
3945
3946 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3947
3948 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3949 (bidi_paragraph_init): Use it to limit search forward for a strong
3950 directional character in abnormally large paragraphs full of
3951 neutral or weak characters. (Bug#11943)
3952
3953 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3954
3955 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3956 the toolbar (Bug#9451).
3957 (xg_make_tool_item): Give the widget event box a transparent
3958 background.
3959
3960 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3961
3962 Cleanup basic allocation variables and functions.
3963 * alloc.c (ignore_warnings, init_intervals, init_float)
3964 (init_cons, init_symbol, init_marker): Remove.
3965 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3966 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3967 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3968 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3969 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3970 (staticidx, init_alloc_once, init_strings, free_ablock):
3971 Remove redundant initialization.
3972 * fns.c (init_weak_hash_tables): Remove.
3973 * lisp.h (init_weak_hash_tables): Remove prototype.
3974
3975 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3976
3977 Use zero_vector where appropriate.
3978 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3979 accordingly.
3980 * lisp.h (zero_vector): New declaration.
3981 * font.c (null_vector): Remove.
3982 (syms_of_font): Remove initialization and staticpro.
3983 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3984 * keymap.c (Faccessible_keymaps): Likewise.
3985
3986 2012-07-15 Leo Liu <sdl.web@gmail.com>
3987
3988 * fringe.c: Fix typo in comments.
3989
3990 2012-07-14 Leo Liu <sdl.web@gmail.com>
3991
3992 * fringe.c: Add a new bitmap exclamation-mark.
3993
3994 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3995
3996 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3997
3998 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3999 (HAVE_MENUS): Don't define, defined by editing config.in with
4000 msdos/sed2v2.inp.
4001 (GMALLOC_INHIBIT_VALLOC): Don't define.
4002 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4003
4004 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4005
4006 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4007
4008 2012-07-14 Glenn Morris <rgm@gnu.org>
4009
4010 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4011 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4012 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4013
4014 2012-07-13 Glenn Morris <rgm@gnu.org>
4015
4016 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4017
4018 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4019 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4020
4021 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4022
4023 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4024 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4025 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4026 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4027 where appropriate.
4028 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4029 as boolean expression.
4030 (x_set_window_size): Remove unused variable toolbar.
4031 (ns_get_color_default, ns_mod_to_lisp): Remove.
4032 (ns_mouse_position): Remove unused variables xchar and ychar.
4033 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4034 (ns_set_vertical_scroll_bar): Remove unused variable count.
4035 (ns_delete_terminal): Remove unused variable i.
4036 (ns_term_init): Remove unused variables r, g and b.
4037 (mouseDown): Remove unused variable window.
4038 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4039 (initFrameFromEmacs): Remove unused variable vbextra.
4040 (mouseEntered): Remove unused variables p and dpyinfo.
4041 (mouseExited): Remove unused variables p and r.
4042 (ns_define_frame_cursor, ns_clear_frame_area)
4043 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4044 (menuDown): Assign [sender tag] to variable and cast the variable.
4045
4046 * nsterm.h (menuDown): Add id as type to argument sender.
4047 (ns_display_info_for_name): Add Lisp_Object argument.
4048 (ns_term_init): Add Lisp_Object argument.
4049 (ns_map_event_to_object): Add void argument.
4050 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4051 prototype with arguments and only declare if __OBJC__.
4052 (nxatoms_of_nsselect): Add void argument.
4053 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4054 (ns_alloc_autorelease_pool): Add void argument.
4055 (ns_release_autorelease_pool): Add void* argument.
4056 (ns_get_defaults_value): Add const char* argument.
4057
4058 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4059 (initFromContents): Use SSDATA where appropriate.
4060 (ns_update_menubar): Add braces to ambigous if-else.
4061 (initWithTitle): Put () around assignment in if statement.
4062 (ns_menu_show): Remove unused variables window and keymap.
4063 (update_frame_tool_bar): Remove unused variable selected_p.
4064 (initWithContentRect): Remove unused variable this_cmd_name.
4065
4066 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4067 appropriate.
4068 (setXBMColor): Remove unused variable len.
4069 (setPixmapData): Put () around assignment in loop statement.
4070
4071 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4072 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4073 where appropriate.
4074 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4075 around assignment in loop statement.
4076 (nsfont_open): Remove unused variable i.
4077 (nsfont_open): Remove unused variable len.
4078 (nsfont_draw): Remove unused variable cs.
4079
4080 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4081 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4082 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4083 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4084 (Fns_font_name, Fns_perform_service)
4085 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4086 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4087 (ns_set_name): Remove unused variable view.
4088 (x_set_menu_bar_lines): Remove unused variable olines.
4089 (x_set_tool_bar_lines): Remove unused variable root_window.
4090 (Fns_list_colors): Put () around assignment in while statement.
4091 (Fns_perform_service): Remove unused variable len.
4092 (Fns_display_usable_bounds): Remove unused variable top.
4093 (syms_of_nsfns): Remove unused variable i.
4094
4095 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4096 memcpy (Bug#11907).
4097
4098 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4099
4100 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4101 and free it with DestroyExceptionInfo (Bug#11558).
4102
4103 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4104
4105 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4106 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4107 Set here, not in nt/config.nt.
4108
4109 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4110
4111 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4112 cursor overflow into the last glyph on display line when the right
4113 fringe is off. (Bug#11832)
4114
4115 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4116
4117 * xdisp.c (produce_special_glyphs): Now static.
4118 * dispextern.h (produce_special_glyphs): Remove decl.
4119
4120 2012-07-13 Glenn Morris <rgm@gnu.org>
4121
4122 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4123 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4124
4125 * s/usg5-4-common.h (USG, USG5):
4126 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4127 * s/sol2-6.h (SOLARIS2):
4128 * s/irix6-5.h (IRIX6_5):
4129 * s/hpux10-20.h (USG, USG5, HPUX):
4130 * s/gnu-linux.h (USG, GNU_LINUX):
4131 * s/freebsd.h (BSD_SYSTEM):
4132 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4133 * s/cygwin.h (CYGWIN):
4134 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4135 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4136
4137 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4138
4139 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4140
4141 2012-07-13 Glenn Morris <rgm@gnu.org>
4142
4143 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4144
4145 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4146
4147 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4148 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4149
4150 2012-07-12 Glenn Morris <rgm@gnu.org>
4151
4152 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4153
4154 * process.c (init_process_emacs): Rename from init_process.
4155 The old name is also the name of a Mach system call.
4156 * lisp.h, emacs.c: Update for this name change.
4157 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4158 longer needed.
4159
4160 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4161
4162 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4163 memmove call that removes glyphs covered by the left truncation
4164 glyph. Improve commentary.
4165 (display_line): Fix display of continuation glyphs on GUI frames
4166 when the right fringe is turned off and variable-size fonts are
4167 used in the window. Move the code that appends a stretch glyph to
4168 produce_special_glyphs, so that it could be used for truncation
4169 and continuation glyphs alike.
4170 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4171 glyph of a suitably computed width, to align the special glyphs at
4172 the window margin. Code moved from display_line. (Bug#11832)
4173
4174 2012-07-12 Glenn Morris <rgm@gnu.org>
4175
4176 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4177
4178 * s/gnu-linux.h, s/hpux10-20.h:
4179 Do not unconditionally define HAVE_XRMSETDATABASE.
4180
4181 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4182
4183 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4184
4185 Fix typos that broke OS X build.
4186 Reported by Randal L. Schwartz in
4187 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4188 * nsterm.m (ns_timeout): Add missing local decl.
4189 (ns_get_color): snprintf -> sprintf, to fix typo.
4190
4191 2012-07-12 Glenn Morris <rgm@gnu.org>
4192
4193 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4194 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4195 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4196 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4197
4198 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4199 Move PTY_OPEN to configure.
4200
4201 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4202 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4203 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4204
4205 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4206
4207 Use empty_unibyte_string where applicable.
4208 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4209 * lread.c (read1): Likewise.
4210 * xsettings.c (syms_of_xsettings): Likewise.
4211
4212 2012-07-12 Glenn Morris <rgm@gnu.org>
4213
4214 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4215 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4216 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4217 * s/hpux10-20.h (RUN_TIME_REMAP):
4218 * s/bsd-common.h (TABDLY): Move to configure.
4219
4220 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4221
4222 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4223
4224 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4225 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4226
4227 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4228
4229 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4230 * s/template.h: Move NARROWPROTO to configure.
4231
4232 2012-07-11 Glenn Morris <rgm@gnu.org>
4233
4234 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4235 unused since 2011-01-17 change to systty.h.
4236
4237 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4238 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4239 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4240
4241 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4242
4243 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4244
4245 2012-07-11 Glenn Morris <rgm@gnu.org>
4246
4247 * s/darwin.h, s/gnu-linux.h, s/template.h:
4248 Move INTERRUPT_INPUT to configure.
4249
4250 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4251
4252 Minor adjustments to interning code.
4253 * lisp.h (intern, intern_c_string): Redefine as static inline
4254 wrappers for intern_1 and intern_c_string_1, respectively.
4255 (intern_1, intern_c_string_1): Rename prototypes.
4256 * lread.c (intern_1, intern_c_string_1, oblookup):
4257 Simplify Vobarray checking.
4258 * font.c (font_intern_prop): Likewise. Adjust comment.
4259 * w32font.c (intern_font_name): Likewise.
4260
4261 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4262
4263 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4264
4265 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4266 of Fcar/Fcdr if possible.
4267 * font.c (check_otf_features): Likewise.
4268 * fontset.c (Fnew_fontset): Likewise.
4269 * gnutls.c (Fgnutls_boot): Likewise.
4270 * minibuf.c (read_minibuf): Likewise.
4271 * msdos.c (IT_set_frame_parameters): Likewise.
4272 * xmenu.c (Fx_popup_dialog): Likewise.
4273 * w32menu.c (Fx_popup_dialog): Likewise.
4274
4275 2012-07-11 Glenn Morris <rgm@gnu.org>
4276
4277 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4278 since nothing has defined it on these platforms.
4279
4280 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4281 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4282
4283 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4284 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4285 Move CLASH_DETECTION to configure.
4286
4287 * s/gnu.h: Remove file, which is now empty.
4288
4289 * s/gnu.h, s/gnu-linux.h:
4290 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4291
4292 2012-07-11 John Wiegley <johnw@newartisans.com>
4293
4294 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4295 function attribute, so we only use it if it exists in the
4296 compiler.
4297
4298 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4299
4300 Avoid call to strlen in fast_c_string_match_ignore_case.
4301 * search.c (fast_c_string_match_ignore_case): Change to use
4302 length argument. Adjust users accordingly.
4303 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4304
4305 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4306
4307 Assume mkdir, rmdir.
4308 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4309 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4310
4311 Assume rename.
4312 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4313
4314 Assume perror.
4315 * s/hpux10-20.h (HAVE_PERROR): Remove.
4316 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4317 Remove dummy definition, as this problem was obsolete long ago.
4318
4319 Assume strerror.
4320 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4321
4322 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4323
4324 Avoid calls to strlen in font processing functions.
4325 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4326 (font_open_by_name): Change to use length argument.
4327 Adjust users accordingly.
4328 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4329 Adjust prototypes.
4330 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4331 Change to return ptrdiff_t.
4332 (xfont_list_pattern, xfont_match): Use length returned by
4333 xfont_decode_coding_xlfd.
4334 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4335
4336 2012-07-11 Glenn Morris <rgm@gnu.org>
4337
4338 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4339 Move DONT_REOPEN_PTY to configure.
4340
4341 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4342 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4343
4344 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4345
4346 Remove "#define unix" that is no longer needed (Bug#11905).
4347 * s/aix4-2.h (unix): Remove; no longer needed.
4348
4349 EMACS_TIME simplification (Bug#11875).
4350 This replaces macros (which typically do not work in GDB)
4351 with functions, typedefs and enums, making the code easier to debug.
4352 The functional style also makes code easier to read and maintain.
4353 * systime.h: Include <sys/time.h> on all hosts, not just if
4354 WINDOWSNT, since 'struct timeval' is needed in general.
4355 (EMACS_TIME): Now a typedef, not a macro.
4356 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4357 not macros.
4358 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4359 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4360 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4361 (EMACS_TIME_LE): Now functions, not macros.
4362 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4363 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4364 which are not functions. All uses rewritten to use:
4365 (make_emacs_time): New function.
4366 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4367 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4368 not functions. All uses rewritten to use the following, respectively:
4369 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4370 (add_emacs_time, sub_emacs_time): New functions.
4371 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4372 * fileio.c (Fcopy_file):
4373 * xterm.c (XTflash): Get the current time closer to when it's used.
4374 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4375
4376 * bytecode.c (targets): Suppress -Woverride-init warnings.
4377
4378 Simplify by avoiding confusing use of strncpy etc.
4379 * doc.c (Fsnarf_documentation):
4380 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4381 * frame.c (Fmake_terminal_frame):
4382 * gtkutil.c (get_utf8_string):
4383 * lread.c (openp):
4384 * nsmenu.m (ns_update_menubar):
4385 * regex.c (regerror):
4386 Prefer memcpy to strncpy and strncat when either will do.
4387 * fileio.c (Fsubstitute_in_file_name):
4388 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4389 (menu_separator_name_p):
4390 * nsmenu.m (ns_update_menubar):
4391 Prefer memcmp to strncmp when either will do.
4392 * nsterm.m: Include <ftoastr.h>.
4393 (ns_get_color):
4394 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4395 Prefer snprintf to strncpy.
4396 * nsterm.m (ns_term_init):
4397 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4398 * nsterm.m (ns_term_init):
4399 Avoid the need for strncpy, by using build_string or
4400 make_unibyte_string directly. Use dtoastr, not snprintf.
4401 * process.c (Fmake_network_process): Diagnose service names that
4402 are too long, rather than silently truncating them or creating
4403 non-null-terminated names.
4404 (Fnetwork_interface_info): Likewise, for interface names.
4405 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4406 Prefer sprintf to strncat.
4407 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4408 Prefer vsnprintf to vsprintf + strncpy.
4409
4410 2012-07-10 Glenn Morris <rgm@gnu.org>
4411
4412 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4413 Clarify fallback case.
4414
4415 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4416
4417 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4418 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4419 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4420 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4421 where argument type is known to be a Lisp_Cons.
4422
4423 2012-07-10 Tom Tromey <tromey@redhat.com>
4424
4425 * bytecode.c (BYTE_CODE_THREADED): New macro.
4426 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4427 (enum byte_code_op): New type.
4428 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4429 (exec_byte_code): Use them. Use token threading when applicable.
4430
4431 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4432
4433 Optimize pure C strings initialization.
4434 * lisp.h (make_pure_string): Fix prototype.
4435 (build_pure_c_string): New function, defined as static inline. This
4436 provides a better opportunity to optimize away calls to strlen when
4437 the function is called with compile-time constant argument.
4438 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4439 argument, adjust users accordingly. Use build_pure_c_string where
4440 appropriate.
4441 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4442 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4443 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4444
4445 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4446
4447 Avoid calls to strlen in miscellaneous functions.
4448 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4449 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4450 * lread.c (openp): Likewise.
4451
4452 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4453
4454 Avoid calls to strlen in path processing functions.
4455 * fileio.c (file_name_as_directory): Add comment. Change to add
4456 srclen argument and return the length of result. Adjust users
4457 accordingly.
4458 (directory_file_name): Fix comment. Change to add srclen argument,
4459 swap 1st and 2nd arguments to obey the common convention.
4460 Adjust users accordingly.
4461 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4462
4463 2012-07-10 Glenn Morris <rgm@gnu.org>
4464
4465 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4466 Move PENDING_OUTPUT_COUNT definition to configure.
4467
4468 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4469 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4470 * s/gnu.h (DATA_START): Move definitions to configure.
4471
4472 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4473 We include usg5-4-common.h, which defines them both.
4474
4475 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4476 O_RDONLY already includes it).
4477
4478 Stop ns builds setting the EMACSLOADPATH environment variable.
4479 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4480 Now it does not set EMACSLOADPATH, just returns the load-path string.
4481 * nsterm.h: Update accordingly.
4482 * lread.c [HAVE_NS]: Include nsterm.h.
4483 (init_lread) [HAVE_NS]: Use ns_load_path.
4484 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4485
4486 2012-07-09 Glenn Morris <rgm@gnu.org>
4487
4488 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4489 since the included bsd-common.h does so.
4490
4491 Stop ns builds setting the EMACSPATH environment variable.
4492 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4493 (ns_init_paths): Do not set EMACSPATH.
4494 * nsterm.h (ns_exec_path): Add it.
4495 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4496 Use ns_exec_path.
4497
4498 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4499
4500 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4501
4502 * process.c (wait_reading_process_output): 'waitchannels' was unset
4503 when read_kbd || !NILP (wait_for_cell); fix this.
4504
4505 Add GCC-style 'const' attribute to functions that can use it.
4506 * character.h (char_resolve_modifier_mask):
4507 * keyboard.h (make_ctrl_char):
4508 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4509 (init_character_once, next_almost_prime, init_fns, init_image)
4510 (flush_pending_output, init_sound):
4511 * mem-limits.h (start_of_data):
4512 * menu.h (finish_menu_items):
4513 Add ATTRIBUTE_CONST.
4514 * emacs.c (DEFINE_DUMMY_FUNCTION):
4515 Declare the dummy function with ATTRIBUTE_CONST.
4516 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4517 Add decls with ATTRIBUTE_CONST.
4518
4519 Minor improvements to make_formatted_string.
4520 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4521 where int is good enough, as vsprintf returns an int.
4522 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4523
4524 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4525
4526 Use make_formatted_string to avoid double length calculation.
4527 * lisp.h (make_formatted_string): New prototype.
4528 * alloc.c (make_formatted_string): New function.
4529 * buffer.c (Fgenerate_new_buffer_name): Use it.
4530 * dbus.c (syms_of_dbusbind): Likewise.
4531 * editfns.c (Fcurrent_time_zone): Likewise.
4532 * filelock.c (get_boot_time): Likewise.
4533 * frame.c (make_terminal_frame, set_term_frame_name)
4534 (x_report_frame_params): Likewise.
4535 * image.c (gs_load): Likewise.
4536 * minibuf.c (get_minibuffer): Likewise.
4537 * msdos.c (dos_set_window_size): Likewise.
4538 * process.c (make_process): Likewise.
4539 * xdisp.c (ensure_echo_area_buffers): Likewise.
4540 * xsettings.c (apply_xft_settings): Likewise.
4541
4542 2012-07-09 Glenn Morris <rgm@gnu.org>
4543
4544 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4545 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4546 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4547 * nsterm.h (ns_etc_directory): Add it.
4548 * callproc.c [HAVE_NS]: Include nsterm.h.
4549 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4550
4551 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4552
4553 Move marker debugging code under MARKER_DEBUG.
4554 * marker.c (MARKER_DEBUG): Move marker debugging code under
4555 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4556 for bootstrap with --enable-checking (~3x slowdown reported
4557 by Juanma Barranquero <lekktu@gmail.com>).
4558 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4559
4560 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4561
4562 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4563 See <http://bugs.gnu.org/11825#29>.
4564
4565 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4566
4567 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4568 has no font, use the frame's font. (Bug#11813)
4569 (display_line): Add commentary about displaying truncation glyphs
4570 on GUI frames.
4571 (produce_special_glyphs): Move here from term.c.
4572
4573 * term.c (produce_special_glyphs): Move to xdisp.c.
4574
4575 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4576 section.
4577
4578 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4579
4580 * xdisp.c (display_line): Avoid warning about implicit declaration
4581 of FRAME_FONT.
4582
4583 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4584
4585 * lisp.h: Remove empty conditional.
4586
4587 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4588
4589 * lread.c (load_path_check): Now static.
4590
4591 Fix some minor --with-ns problems found by static checking.
4592 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4593 (x_set_font) [!HAVE_X_WINDOWS]:
4594 * image.c (xpm_load_image) [HAVE_NS]:
4595 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4596 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4597 Remove unused local.
4598 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4599 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4600 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4601 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4602 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4603 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4604 Fix pointer signedness problem.
4605 * xfaces.c (FRAME_X_FONT_TABLE):
4606 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4607
4608 2012-07-07 Glenn Morris <rgm@gnu.org>
4609
4610 * lread.c (load_path_check): New function, split from init_lread.
4611 (init_lread): Reorganize. Motivation:
4612 If EMACSLOADPATH is set, check/warn about that rather than the
4613 defaults, which we are not going to use. Hence we can remove
4614 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4615 Don't warn if site-lisp directories are missing.
4616 If not installed, start from a blank load-path, since
4617 PATH_LOADSEARCH refers to the eventual installation directories.
4618
4619 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4620
4621 Support truncation and continuation glyphs on GUI frames, when
4622 fringes are disabled. (Bug#11832)
4623 * xdisp.c (init_iterator): Get dimensions of truncation and
4624 continuation glyphs even if on GUI frames.
4625 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4626 or both, are absent.
4627 (start_display, move_it_in_display_line_to): Handle the case of a
4628 GUI frame without a fringe to display continuation or truncation
4629 glyphs.
4630 (insert_left_trunc_glyphs): Support GUI frames: make sure
4631 truncation glyphs overwrite enough glyphs from the current line to
4632 have sufficient space in pixels.
4633 (display_line): Support truncation and continuation glyphs on GUI
4634 frames. If some spare pixels are left on the line after inserting
4635 the truncation glyphs, fill that space with a stretch glyph of a
4636 suitably computed width.
4637
4638 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4639 produce_glyphs, to support GUI sessions.
4640
4641 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4642
4643 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4644
4645 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4646
4647 Do not require float-time's arg to fit in time_t (Bug#11825).
4648 This works better on hosts where time_t is unsigned, and where
4649 float-time is applied to the (negative) difference between two times.
4650 * editfns.c (decode_time_components): Last arg is now double *,
4651 not int *, and means to store all the result as a double, without
4652 worrying about whether the seconds part fits in time_t.
4653 All callers changed.
4654 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4655 All callers changed.
4656 (Ffloat_time): Do not fail merely because the specified time falls
4657 outside of time_t range.
4658
4659 2012-07-07 Glenn Morris <rgm@gnu.org>
4660
4661 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4662 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4663 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4664
4665 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4666
4667 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4668 Update dependencies.
4669
4670 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4671
4672 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4673
4674 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4675 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4676 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4677 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4678 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4679 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4680
4681 * xfont.c (compare_font_names): Redo to omit the need for casts.
4682
4683 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4684
4685 * xfns.c (Fx_change_window_property): Doc fix.
4686 * w32fns.c (Fx_change_window_property): Doc fix.
4687
4688 * w32fns.c (Fx_window_property): Accept the same arguments as the
4689 X Windows version. Doc fix.
4690 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4691
4692 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4693 Eli Zaretskii <eliz@gnu.org>
4694
4695 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4696 Windows-specific code from nt/config.nt moved here.
4697 Obsolete settings removed.
4698
4699 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4700
4701 * process.c: Avoid unnecessary calls to gettime.
4702 (wait_reading_process_output): Don't get the time of day
4703 when gobbling data immediately and not waiting, as there's no need
4704 for it in that case. This removes a FIXME.
4705
4706 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4707
4708 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4709 is defined (Bug#11768).
4710
4711 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4712
4713 Fix marker debugging code.
4714 * marker.c (byte_char_debug_check): Do not perform the check
4715 if buffer is not multibyte.
4716 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4717 Call byte_char_debug_check with correct arguments.
4718
4719 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4720
4721 Compile marker debugging code only if ENABLE_CHECKING is defined.
4722 * marker.c (byte_char_debug_check, count_markers):
4723 Use only if ENABLE_CHECKING is defined.
4724 (byte_debug_flag): Remove.
4725 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4726 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4727
4728 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4729
4730 Avoid code repetition in marker-related functions.
4731 * marker.c (attach_marker): New function.
4732 (Fset_marker, set_marker_restricted, set_marker_both)
4733 (set_marker_restricted_both): Use it.
4734 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4735 Consistently rename charno to charpos.
4736 (marker_position): Add eassert.
4737 (marker_byte_position): Convert to eassert.
4738
4739 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4740
4741 Simplify list operations in unchain_overlay and unchain_marker.
4742 * buffer.c (unchain_overlay): Simplify. Add comment.
4743 * marker.c (unchain_marker): Simplify. Fix comments.
4744
4745 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4746
4747 Introduce fast path for the widely used marker operation.
4748 * alloc.c (build_marker): New function.
4749 * lisp.h (build_marker): New prototype.
4750 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4751 * composite.c (autocmp_chars): Likewise.
4752 * editfns.c (buildmark): Remove.
4753 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4754 (save_restriction_save): Use build_marker.
4755 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4756 * window.c (save_window_save): Likewise.
4757
4758 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4759
4760 Do not use Fdelete_overlay in delete_all_overlays
4761 to avoid redundant calls to unchain_overlay.
4762 * buffer.c (drop_overlay): New function.
4763 (delete_all_overlays, Fdelete_overlay): Use it.
4764 * minibuf.c (get_minibuffer): Fix comment.
4765
4766 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4767
4768 Port to OpenBSD 5.1 amd64.
4769 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4770 This is needed for OpenBSD, and should be harmless on all BSD systems.
4771 Also, include <sys/sysctl.h>, as it should be available on all
4772 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4773 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4774 use p_pid member, not kp_proc.pid.
4775
4776 2012-07-06 Glenn Morris <rgm@gnu.org>
4777
4778 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4779
4780 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4781
4782 More xmalloc and related cleanup.
4783 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4784 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4785 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4786 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4787 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4788 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4789 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4790 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4791 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4792 * xterm.c:
4793 Omit needless casts involving void * pointers and allocation.
4794 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4795 as the former is more robust if P's type is changed.
4796 Prefer xzalloc to xmalloc + memset 0.
4797 Simplify malloc-or-realloc to realloc.
4798 Don't worry about xmalloc returning a null pointer.
4799 Prefer xstrdup to xmalloc + strcpy.
4800 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4801 growing it.
4802 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4803 alloca of a constant.
4804
4805 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4806
4807 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4808 hscroll is larger than the line width. Fixes long and futile
4809 looping inside extend_face_to_end_of_line (on a TTY) producing
4810 glyphs that are not needed and thrown away.
4811
4812 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4813
4814 * marker.c (set_marker_restricted_both): Simplify by using
4815 clip_to_bounds.
4816
4817 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4818
4819 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4820
4821 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4822
4823 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4824 not defined (Bug#11768).
4825 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4826 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4827 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4828 followed by gtk_box_set_homogeneous (Bug#11768).
4829 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4830 (update_theme_scrollbar_width, xg_create_scroll_bar):
4831 Use gtk_scrollbar_new (Bug#11768).
4832 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4833 (is_box_type): New function (Bug#11768).
4834 (xg_tool_item_stale_p): Call is_box_type.
4835 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4836 with default display (Bug#11768).
4837
4838 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4839
4840 * xdisp.c (window_hscroll_limited): New function.
4841 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4842 coordinates when window's hscroll is set to insanely large
4843 values. (Bug#11857)
4844
4845 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4846
4847 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4848 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4849
4850 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4851
4852 Cleanup xmalloc.
4853 * lisp.h (xzalloc): New prototype. Omit needless casts.
4854 * alloc.c (xzalloc): New function. Omit needless casts.
4855 * charset.c: Omit needless casts. Convert all calls to
4856 xmalloc with following memset to xzalloc.
4857 * dispnew.c: Likewise.
4858 * fringe.c: Likewise.
4859 * image.c: Likewise.
4860 * sound.c: Likewise.
4861 * term.c: Likewise.
4862 * w32fns.c: Likewise.
4863 * w32font.c: Likewise.
4864 * w32term.c: Likewise.
4865 * xfaces.c: Likewise.
4866 * xfns.c: Likewise.
4867 * xterm.c: Likewise.
4868 * atimer.c: Omit needless casts.
4869 * buffer.c: Likewise.
4870 * callproc.c: Likewise.
4871 * ccl.c: Likewise.
4872 * coding.c: Likewise.
4873 * composite.c: Likewise.
4874 * doc.c: Likewise.
4875 * doprnt.c: Likewise.
4876 * editfns.c: Likewise.
4877 * emacs.c: Likewise.
4878 * eval.c: Likewise.
4879 * filelock.c: Likewise.
4880 * fns.c: Likewise.
4881 * gtkutil.c: Likewise.
4882 * keyboard.c: Likewise.
4883 * lisp.h: Likewise.
4884 * lread.c: Likewise.
4885 * minibuf.c: Likewise.
4886 * msdos.c: Likewise.
4887 * print.c: Likewise.
4888 * process.c: Likewise.
4889 * region-cache.c: Likewise.
4890 * search.c: Likewise.
4891 * sysdep.c: Likewise.
4892 * termcap.c: Likewise.
4893 * terminal.c: Likewise.
4894 * tparam.c: Likewise.
4895 * w16select.c: Likewise.
4896 * w32.c: Likewise.
4897 * w32reg.c: Likewise.
4898 * w32select.c: Likewise.
4899 * w32uniscribe.c: Likewise.
4900 * widget.c: Likewise.
4901 * xdisp.c: Likewise.
4902 * xmenu.c: Likewise.
4903 * xrdb.c: Likewise.
4904 * xselect.c: Likewise.
4905
4906 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4907
4908 * fileio.c (time_error_value): Check the right error number.
4909 Problem reported by Troels Nielsen in
4910 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4911
4912 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4915 This should be fixed in a better way; see Eli Zaretskii in
4916 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4917 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4918
4919 * fileio.c (time_error_value): Rename from special_mtime.
4920 The old name's problems were noted by Eli Zaretskii in
4921 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4922
4923 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4924 This variable's comment says Emacs needs at least one GDB-visible
4925 symbol of type enum pvec_type, to work around GDB problems.
4926 The symbol's value doesn't matter.
4927
4928 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4929 that causes compilation to fail on pre-C99 compilers.
4930
4931 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4932
4933 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4934 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4935
4936 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4937
4938 * buffer.c (init_buffer_once): Fix initialization of
4939 headers for buffer_defaults and buffer_local_symbols.
4940 Reported by Juanma Barranquero <lekktu@gmail.com>.
4941
4942 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4943
4944 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4945 * lisp.h (enum pvec_type): Use fewer bits.
4946 (PSEUDOVECTOR_SIZE_BITS): New constant.
4947 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4948 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4949 change in pvec_type.
4950 (PSEUDOVECTOR_TYPEP): New macro.
4951 (TYPED_PSEUDOVECTORP): Use it.
4952 * fns.c (internal_equal): Adapt code to extract pvectype.
4953 * emacs.c (gdb_pvec_type): Update type.
4954 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4955 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4956 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4957 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4958 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4959 abusing vector->header.next.nbytes.
4960 (live_vector_p): Use PVEC_TYPE.
4961 (mark_object): Adapt code to extract pvectype. Use switch.
4962
4963 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4964
4965 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4966 Tighten new eassert a bit.
4967
4968 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4969
4970 Fix compilation with --enable-gcc-warnings and -O1
4971 optimization level.
4972 * doprnt.c (doprnt): Change type of tem to int, initialize
4973 to avoid compiler warning. Add eassert.
4974 * search.c (simple_search): Initialize match_byte to avoid
4975 compiler warning. Add eassert.
4976
4977 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4978
4979 Avoid weird behavior with large horizontal scrolls.
4980 Without this change, for example, large hscroll values would
4981 mess up Emacs's display on Fedora 15 x86, presumably due to
4982 overflows in int calculations in the display code.
4983 Also, if buffers had long lines, Emacs would freeze.
4984 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4985 (set_window_hscroll): New function, containing the old guts of
4986 Fset_window_hscroll. Return the clipped value.
4987 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4988 This avoids the need to check against PTRDIFF_MAX.
4989
4990 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4991
4992 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4993
4994 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4995
4996 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4997
4998 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4999 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5000 since GCC 4.4.6 issues a bogus warning for them.
5001
5002 Fix bugs in file timestamp newness comparisons.
5003 * fileio.c (Ffile_newer_than_file_p):
5004 * lread.c (Fload): Use full timestamp resolution of files,
5005 not just the 1-second resolution, so that files that are only
5006 slightly newer still count as newer.
5007 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5008 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5009
5010 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5011
5012 * fileio.c: Improve handling of file time marker. (Bug#11852)
5013 (special_mtime): New function.
5014 (Finsert_file_contents, Fverify_visited_file_modtime):
5015 Use it to set special mtime values consistently.
5016
5017 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5018
5019 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5020 marker for non-existing file. (Bug#11852)
5021
5022 2012-07-03 Glenn Morris <rgm@gnu.org>
5023
5024 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5025 and did not make it into globals.h).
5026
5027 2012-07-03 Tom Tromey <tromey@redhat.com>
5028
5029 * window.c (Fset_window_margins, Fset_window_fringes)
5030 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5031 * textprop.c (Fprevious_property_change): No longer static.
5032 * syntax.c (Fsyntax_table_p): No longer static.
5033 * process.c (Fget_process, Fprocess_datagram_address): No longer
5034 static.
5035 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5036 * keyboard.c (Fcommand_execute): No longer static.
5037 Remove EXFUN.
5038 * insdel.c (Fcombine_after_change_execute): No longer static.
5039 * image.c (Finit_image_library): No longer static.
5040 * fileio.c (Fmake_symbolic_link): No longer static.
5041 * eval.c (Ffetch_bytecode): No longer static.
5042 * editfns.c (Fuser_full_name): No longer static.
5043 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5044 No longer static.
5045 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5046 static.
5047 * dired.c (Ffile_attributes): No longer static.
5048 * composite.c (Fcomposition_get_gstring): No longer static.
5049 * callproc.c (Fgetenv_internal): No longer static.
5050
5051 * ccl.h: Remove EXFUNs.
5052 * buffer.h: Remove EXFUNs.
5053 * dispextern.h: Remove EXFUNs.
5054 * intervals.h: Remove EXFUNs.
5055 * fontset.h: Remove EXFUN.
5056 * font.h: Remove EXFUNs.
5057 * dosfns.c (system_process_attributes): Remove EXFUN.
5058 * keymap.h: Remove EXFUNs.
5059 * lisp.h: Remove EXFUNs.
5060 * w32term.h: Remove EXFUNs.
5061 * window.h: Remove EXFUNs.
5062 * xsettings.h: Remove EXFUN.
5063 * xterm.h: Remove EXFUN.
5064
5065 2012-07-03 Glenn Morris <rgm@gnu.org>
5066
5067 * lisp.h (Frandom): Make it visible to C.
5068 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5069 buffer for invisible buffers. (Bug#1229)
5070
5071 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5072
5073 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5074 values which aren't power of 2.
5075 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5076 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5077 accordingly.
5078
5079 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5080
5081 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5082
5083 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5084
5085 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5086
5087 * alloc.c (allocate_vector_block): Remove redundant
5088 calls to mallopt if DOUG_LEA_MALLOC is defined.
5089 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5090 avoid calls to mallopt if zero_vector is returned.
5091
5092 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5093
5094 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5095 is enabled, avoid dereferencing NULL current_sblock if
5096 running undumped.
5097
5098 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5099
5100 Cleanup basic buffer management.
5101 * buffer.h (struct buffer): Change layout to use generic vector
5102 marking code. Fix some comments. Change type of 'clip_changed'
5103 to bitfield. Remove unused #ifndef old.
5104 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5105 (GET_OVERLAYS_AT): Fix indentation.
5106 (for_each_per_buffer_object_at): New macro.
5107 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5108 (Fbuffer_local_variables): Use it.
5109 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5110 * alloc.c (allocate_buffer): Adjust to match new layout of
5111 struct buffer. Fix comment.
5112 (mark_overlay): New function.
5113 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5114 Lisp area of struct buffer.
5115 (mark_object): Use it. Adjust marking of misc objects
5116 and related comments.
5117
5118 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5119
5120 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5121 wrapper that is not needed because the wrapped code is a no-op (zero
5122 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5123 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5124
5125 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5126
5127 * alloc.c (mark_buffer): Simplify. Remove prototype.
5128 (mark_object): Add comment. Reorganize marking of vector-like
5129 objects. Use CHECK_LIVE for all vector-like objects except buffers
5130 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5131 Avoid redundant calls to mark_vectorlike for bool vectors.
5132
5133 2012-06-30 Glenn Morris <rgm@gnu.org>
5134
5135 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5136
5137 * epaths.in (PATH_SITELOADSEARCH): New.
5138 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5139 This is rather than relying on --enable-locallisppath elements
5140 having "site-lisp" in their names. (Bug#10208#25, 11658)
5141
5142 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5143
5144 * w32proc.c (sys_select): Accept and ignore one more argument.
5145
5146 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5147
5148 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5149 (pselect) [!MS_DOS]: Redirect to sys_select.
5150
5151 * sysdep.c: Don't include dos.h and dosfns.h.
5152
5153 * process.c (sys_select):
5154 * msdos.c (sys_select): Accept one more argument and ignore it.
5155
5156 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5157 adapt data types and code to that.
5158
5159 * dosfns.c:
5160 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5161 which clashes with the gnulib function of the same name.
5162
5163 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5164
5165 * font.c (font_style_to_value, font_style_symbolic)
5166 (font_prop_validate_style): Add type checks for values in
5167 font_style_table.
5168
5169 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5170 argument.
5171 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5172 uses.
5173
5174 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5175
5176 * xdisp.c (try_window_id): Undo last change.
5177
5178 * w32.c (getwd): Adjust commentary about startup_dir.
5179 (init_environment): Always call sys_access, even in non-MSVC
5180 builds. Don't chdir to the directory of the Emacs executable.
5181 This undoes code from 1997 which was justified by the need to
5182 "avoid conflicts when removing and renaming directories". But its
5183 downside was that every relative file name was being interpreted
5184 relative to the directory of the Emacs executable, which can never
5185 be TRT. In particular, it broke sys_access when called with
5186 relative file names.
5187 (sys_access): Map GetLastError to errno.
5188
5189 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5190
5191 * window.h (struct window): Change type of 'fringes_outside_margins'
5192 to bitfield. Fix comment. Adjust users accordingly.
5193 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5194 Adjust comment.
5195 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5196 to ptrdiff_t.
5197
5198 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5199
5200 * gnutls.c (emacs_gnutls_handshake):
5201 Add QUIT to make the loop interruptible.
5202
5203 2012-06-29 Glenn Morris <rgm@gnu.org>
5204
5205 * charset.c (init_charset): Make lack of etc/charsets fatal.
5206
5207 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5208
5209 * editfns.c (region_limit): Fix type mismatch.
5210
5211 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5212
5213 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5214 undefined. Convert from xassert to eassert.
5215 * nsmenu.m: Convert from xassert to eassert.
5216 * nsterm.m: Likewise.
5217
5218 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5219
5220 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5221
5222 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5223
5224 Avoid integer overflow on scroll-left and scroll-right.
5225 * window.c (HSCROLL_MAX): New macro.
5226 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5227 overflow when requested scroll falls outside ptrdiff_t range.
5228
5229 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5230
5231 * window.h (struct window): Change type of 'hscroll',
5232 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5233 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5234 Adjust users accordingly.
5235 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5236 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5237 from EMACS_INT to ptrdiff_t.
5238 (make_window): Omit redundant initialization.
5239
5240 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5241
5242 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5243
5244 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5245
5246 * window.h (struct window): Change type of 'use_time' and
5247 'sequence_number' from Lisp_Object to int.
5248 * frame.c (make_frame): Adjust users accordingly.
5249 * print.c (print_object): Likewise.
5250 * window.c (select_window, Fwindow_use_time, make_parent_window)
5251 (make_window): Likewise.
5252
5253 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5254
5255 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5256 enabled with --enable-checking=[all,glyphs] configure option.
5257 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5258 adjust comments accordingly.
5259 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5260 undefined, adjust comments accordingly.
5261 * image.c: Likewise.
5262 * scroll.c: Likewise.
5263 * w32fns.c: Likewise.
5264 * w32term.c: Likewise.
5265 * xdisp.c: Likewise.
5266 * xfaces.c: Likewise.
5267 * xfns.c: Likewise.
5268 * xterm.c: Likewise.
5269
5270 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5271
5272 Generalize run-time debugging checks.
5273 * dispextern.h (XASSERTS): Remove.
5274 * fontset.c (xassert): Remove.
5275 Convert from xassert to eassert.
5276 * alloc.c: Convert from xassert to eassert.
5277 * bidi.c: Likewise.
5278 * dispnew.c: Likewise.
5279 * fns.c: Likewise.
5280 * fringe.c: Likewise.
5281 * ftfont.c: Likewise.
5282 * gtkutil.c: Likewise.
5283 * image.c: Likewise.
5284 * keyboard.c: Likewise.
5285 * menu.c: Likewise.
5286 * process.c: Likewise.
5287 * scroll.c: Likewise.
5288 * sound.c: Likewise.
5289 * term.c: Likewise.
5290 * w32console.c: Likewise.
5291 * w32fns.c: Likewise.
5292 * w32term.c: Likewise.
5293 * window.c: Likewise.
5294 * xdisp.c: Likewise.
5295 * xfaces.c: Likewise.
5296 * xfns.c: Likewise.
5297 * xselect.c: Likewise.
5298 * xterm.c: Likewise.
5299
5300 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5301
5302 * fns.c (maybe_resize_hash_table): Output message when growing the
5303 purify-hashtable.
5304
5305 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5306
5307 * alloc.c (allocate_string_data): Remove dead code.
5308 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5309 avoid GCC warning about unused macro.
5310
5311 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5312
5313 * alloc.c (allocate_string): Omit intervals initialization.
5314 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5315 as in make_pure_string and make_pure_c_string.
5316
5317 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5318
5319 * alloc.c (allocate_string): Fix last change.
5320
5321 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5322
5323 * alloc.c (allocate_string): Remove two redundant calls
5324 to memset, add explicit initialization where appropriate.
5325
5326 2012-06-27 Glenn Morris <rgm@gnu.org>
5327
5328 * lisp.mk (lisp): Remove paths.elc.
5329
5330 2012-06-27 Chong Yidong <cyd@gnu.org>
5331
5332 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5333
5334 2012-06-26 John Wiegley <johnw@newartisans.com>
5335
5336 * unexmacosx.c (copy_data_segment): Add two section names used
5337 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5338
5339 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5340 when building with Clang.
5341
5342 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5343
5344 * eval.c (Fapply): Allow calling it with a single argument.
5345
5346 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5347
5348 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5349 _stricmp and _strnicmp.
5350 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5351
5352 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5353
5354 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5355 allocated window.
5356 (allocate_process): Likewise for new process.
5357 (allocate_terminal): Change to use offsetof.
5358 (allocate_frame): Likewise.
5359 * frame.c (make_frame): Omit redundant initialization.
5360 * window.c (make_parent_window): Use memset.
5361 (make_window): Omit redundant initialization.
5362 * process.c (make_process): Omit redundant initialization.
5363 * terminal.c (create_terminal): Likewise.
5364
5365 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5366
5367 * term.c (delete_tty): Remove redundant call to memset.
5368
5369 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5370
5371 * alloc.c: Remove build_string.
5372 * lisp.h: Define build_string as static inline. This provides
5373 a better opportunity to optimize away calls to strlen when the
5374 function is called with compile-time constant argument.
5375 * image.c (imagemagick_error): Convert to build_string.
5376 * w32proc.c (sys_spawnve): Likewise.
5377 * xterm.c (x_term_init): Likewise.
5378
5379 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5380
5381 Use sprintf return value instead of invoking strlen on result.
5382 In the old days this wasn't portable, since some sprintf
5383 implementations returned char *. But they died out years ago and
5384 Emacs already assumes sprintf returns int.
5385 Similarly for float_to_string.
5386 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5387 * ccl.c (ccl_driver):
5388 * character.c (string_escape_byte8):
5389 * data.c (Fnumber_to_string):
5390 * doprnt.c (doprnt):
5391 * print.c (print_object):
5392 * xdisp.c (message_dolog):
5393 * xfns.c (syms_of_xfns):
5394 Use sprintf or float_to_string result to avoid need to call strlen.
5395 * data.c (Fnumber_to_string):
5396 Use make_unibyte_string, since the string must be ASCII.
5397 * lisp.h, print.c (float_to_string): Now returns int length.
5398 * term.c (produce_glyphless_glyph):
5399 Use sprintf result rather than recomputing it.
5400
5401 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5402 * Makefile.in (ALL_CFLAGS):
5403 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5404 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5405
5406 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5407
5408 * dispextern.h (xstrcasecmp): Define to library function
5409 strcasecmp if available.
5410 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5411
5412 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5413
5414 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5415 Avoid comma operator.
5416 * menu.c (push_submenu_start, push_submenu_end)
5417 (push_left_right_boundary, push_menu_pane): Likewise.
5418 * msdos.c (dos_rawgetc): Likewise.
5419
5420 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5421
5422 * xfns.c (xic_create_fontsetname): Remove redundant calls
5423 to memset.
5424
5425 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5426
5427 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5428 sprintf already null-terminates its output.
5429
5430 * xfns.c (x_window): Remove redundant cast.
5431
5432 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5433
5434 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5435 `const char *' to `char *' to avoid compiler warning.
5436
5437 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5438
5439 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5440 instead of truncating it to 63 (admittedly a generous limit).
5441
5442 * process.c: Fix spelling and caps in comments.
5443
5444 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5445
5446 * emacs.c (setpgrp): Remove definition, unused.
5447 * sysdep.c (setpgrp): Remove definition, not used in this file.
5448
5449 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5450
5451 * makefile.w32-in: Update dependencies.
5452
5453 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5454
5455 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5456 (SYSTIME_H): Add nt/inc/sys/time.h.
5457
5458 * systime.h [WINDOWSNT]: Include sys/time.h.
5459
5460 * s/ms-w32.h (struct timespec): Definition moved from
5461 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5462
5463 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5464
5465 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5466 * buffer.h (buffer_slot_type_mismatch):
5467 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5468 * eval.c (unwind_to_catch):
5469 * image.c (my_png_error, my_error_exit):
5470 * keyboard.c (quit_throw_to_read_char, user_error)
5471 (Fexit_recursive_edit, Fabort_recursive_edit):
5472 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5473 (wrong_type_argument, buffer_overflow, __executable_start)
5474 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5475 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5476 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5477 (fatal):
5478 (child_setup) [!DOS_NT]:
5479 * lread.c (end_of_file_error, invalid_syntax):
5480 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5481 * puresize.h (pure_write_error):
5482 * search.c (matcher_overflow):
5483 * sound.c (sound_perror, alsa_sound_perror):
5484 * sysdep.c, syssignal.h (croak):
5485 * term.c (maybe_fatal, vfatal):
5486 * textprop.c (text_read_only):
5487 * undo.c (user_error):
5488 * unexmacosx.c (unexec_error):
5489 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5490 Use _Noreturn rather than NO_RETURN.
5491 No need for separate decl merely because of _Noreturn.
5492 * sound.c (sound_warning, parse_sound):
5493 Remove unnecessary forward decls.
5494
5495 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5496
5497 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5498 * lisp.h (WAIT_READING_MAX): New macro.
5499 * dispnew.c (Fsleep_for, sit_for):
5500 * keyboard.c (kbd_buffer_get_event):
5501 * process.c (Faccept_process_output):
5502 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5503 This improves on the previous patch, which introduced a bug
5504 when time_t is unsigned and as wide as intmax_t.
5505 See <http://bugs.gnu.org/9000#51>.
5506
5507 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5508
5509 * dispnew.c (sit_for, Fsleep_for):
5510 * keyboard.c (kbd_buffer_get_event):
5511 * process.c (Faccept_process_output): Avoid compiler warnings when
5512 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5513
5514 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5515
5516 * makefile.w32-in: Update dependencies.
5517
5518 * w32.c (ltime): Add return type and declare static.
5519 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5520
5521 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5522
5523 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5524 Privately reported by Herbert J. Skuhra.
5525 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5526 All uses changed.
5527 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5528 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5529
5530 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5531
5532 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5533 last argument of make_unibyte_string.
5534
5535 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5536 language ID in the event parameters.
5537
5538 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5539 event.code, not the obscure "character set ID".
5540
5541 2012-06-23 Chong Yidong <cyd@gnu.org>
5542
5543 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5544
5545 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5546
5547 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5548 * w32.c (fdutimens): New function.
5549
5550 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5551
5552 * s/ms-w32.h (pselect): Redirect to sys_select.
5553
5554 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5555
5556 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5557 in the logic of incrementing and decrementing the value of
5558 use_relocatable_buffers.
5559
5560 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5561
5562 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5563 Privately reported by Herbert J. Skuhra.
5564 [__FreeBSD__]: Remove "*/" typo after "#include".
5565 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5566 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5567 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5568 Don't assume EMACS_TIME and struct timeval are the same type.
5569
5570 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5571
5572 Support higher-resolution time stamps (Bug#9000).
5573 The time stamps are only nanosecond-resolution at the C level,
5574 since that's the best that any real-world system supports now.
5575 But they are picosecond-resolution at the Lisp level, as that's
5576 easy, and leaves room for future OS improvements.
5577
5578 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5579 (LIBES): Use it.
5580
5581 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5582 Don't get current time unless it's needed.
5583
5584 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5585 now provides it if it's absent.
5586 (start_atimer): Port to higher-res time stamps.
5587 Check for time stamp overflow. Don't get current time more
5588 often than is needed.
5589
5590 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5591 Include systime.h, not time.h.
5592 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5593
5594 * dired.c: Include stat-time.h.
5595 (Ffile-attributes): File times now have higher resolution.
5596
5597 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5598 (struct image): Timestamp now has higher resolution.
5599
5600 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5601 has at least microseconds now. All uses removed.
5602 (update_frame, update_single_window, update_window, update_frame_1)
5603 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5604 (duration_to_sec_usec): Remove; no longer needed.
5605
5606 * editfns.c (time_overflow): Now extern.
5607 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5608 (float-time, Fformat_time_string, Fcurrent_time_string)
5609 (Fcurrent_time_zone): Accept and generate higher-resolution
5610 time stamps.
5611 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5612 (decode_time_components, lisp_seconds_argument): New functions.
5613 (make_time): Now static.
5614 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5615 Report an error if the time is invalid, rather than having the caller
5616 do that.
5617
5618 * fileio.c: Include <stat-time.h>
5619 (Fcopy_file): Copy higher-resolution time stamps.
5620 Prefer to set the time stamp via a file descriptor if that works.
5621 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5622 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5623 (Fvisited_file_modtime, Fset_visited_file_modtime):
5624 Support higher-resolution time stamps.
5625
5626 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5627
5628 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5629
5630 * image.c (prepare_image_for_display, clear_image_cache)
5631 (lookup_image): Port to higer-resolution time stamps.
5632
5633 * keyboard.c (start_polling, bind_polling_period):
5634 Check for time stamp overflow.
5635 (read_char, kbd_buffer_get_event, timer_start_idle)
5636 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5637 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5638 Port to higher-resolution time stamps. Do not assume time_t is signed.
5639 (decode_timer): New function. Timers are now vectors of length 9,
5640 not 8, to accommodate the picosecond component.
5641 (timer_check_2): Use it.
5642
5643 * nsterm.m (select_timeout, timeval_subtract): Remove.
5644 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5645 as they're a bit more accurate and handle overflow better.
5646 (ns_select): Change prototype to be compatible with pselect.
5647 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5648 * nsterm.h (ns_select): Adjust prototype.
5649
5650 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5651 us-resolution time stamps.
5652 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5653
5654 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5655
5656 * lisp.h (time_overflow): New decl.
5657 (wait_reading_process_output): First arg is now intmax_t, not int,
5658 to accommodate larger waits.
5659
5660 * process.h (struct Lisp_Process.read_output_delay):
5661 Now counts nanoseconds, not microseconds.
5662 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5663 EMACS_HAS_USECS.
5664 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5665 (wait_reading_process_output):
5666 Port to ns-resolution time stamps.
5667 (Faccept_process_output, wait_reading_process_output):
5668 Check for time stamp overflow. Do not assume time_t is signed.
5669 (select_wrapper): Remove; we now use pselect.
5670 (Fprocess_attributes): Now generates ns-resolution time stamps.
5671
5672 * sysdep.c: Include utimens.h. Don't include utime.h
5673 or worry about struct utimbuf; gnulib does that for us now.
5674 (gettimeofday): Remove; gnulib provides a substitute.
5675 (make_timeval): New function.
5676 (set_file_times): Now sets ns-resolution time stamps.
5677 New arg FD; all uses changed.
5678 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5679 (system_process_attributes):
5680 Now returns ns-resolution time stamp. All uses changed.
5681 Check for time stamp overflow.
5682
5683 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5684 provides a substitute now.
5685
5686 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5687 since it guarantees struct timespec.
5688 (EMACS_TIME): Now struct timespec, so that we can support
5689 ns-resolution time stamps.
5690 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5691 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5692 (EMACS_USECS): Remove.
5693 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5694 so multiply the arg by 1000 before storing it.
5695 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5696 New macros.
5697 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5698 Port to ns-resolution time stamps.
5699 (EMACS_TIME_NEG_P): Remove; replaced by....
5700 (EMACS_TIME_SIGN): New macro.
5701 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5702 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5703 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5704 (make_timeval, make_lisp_time, decode_time_components): New decls.
5705 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5706 that it mishandled time_t overflow. You can't compare by subtracting!
5707 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5708 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5709
5710 * term.c: Include <sys/time.h>.
5711 (timeval_to_Time): New function, for proper overflow wraparound.
5712 (term_mouse_position, term_mouse_click): Use it.
5713
5714 * undo.c (record_first_change): Support higher-resolution time stamps
5715 in the undo buffer.
5716 (Fprimitive_undo): Use them when restoring time stamps.
5717
5718 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5719 (w32_get_internal_run_time):
5720 Port to higher-resolution Emacs time stamps.
5721 (ltime): Now accepts single 64-bit integer, as that's more convenient
5722 for callers.
5723
5724 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5725
5726 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5727 for compatibility with pselect. Support ns-resolution time stamps.
5728
5729 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5730
5731 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5732 Check for time stamp overflow, and support ns-resolution time stamps.
5733
5734 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5735 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5736 (timeval_subtract): Remove; no longer needed.
5737 (XTflash, XTring_bell, x_wait_for_event):
5738 Port to ns-resolution time stamps. Don't assume time_t is signed.
5739
5740 2012-06-22 Chong Yidong <cyd@gnu.org>
5741
5742 * xdisp.c (x_consider_frame_title): Revert last change.
5743
5744 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5745
5746 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5747 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5748 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5749 staticidx goes up to 1597 out of 1600 = 0x640.)
5750
5751 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5752
5753 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5754 Otherwise, the umask might be mistakenly 0 while handling input signals.
5755
5756 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5757
5758 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5759
5760 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5761
5762 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5763 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5764 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5765 access to `contents' member of Lisp_Vector objects with AREF and ASET
5766 where appropriate.
5767
5768 2012-06-19 Chong Yidong <cyd@gnu.org>
5769
5770 * frame.c (delete_frame): When selecting a frame on a different
5771 text terminal, do not alter the terminal's top-frame.
5772
5773 * xdisp.c (format_mode_line_unwind_data): Record the target
5774 frame's selected window and its terminal's top-frame.
5775 (unwind_format_mode_line): Restore them.
5776 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5777 Callers changed.
5778 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5779 since tty frames can be explicitly named.
5780 (prepare_menu_bars): Likewise.
5781
5782 * term.c (Ftty_top_frame): New function.
5783
5784 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5785
5786 Port byte-code-meter to modern targets.
5787 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5788 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5789 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5790 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5791 (METER_1, METER_2): Simplify.
5792
5793 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5794
5795 * data.c (Fdefalias): Return `symbol' (bug#11686).
5796
5797 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5798
5799 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5800 gets killed during executing of this function (Bug#11665).
5801 Try to always return Qt when the buffer has been actually killed.
5802 (Vkill_buffer_query_functions): In doc-string say that functions
5803 run by this hook should not change the current buffer.
5804
5805 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5806
5807 Fix recently-introduced process.c problems found by static checking.
5808 * process.c (write_queue_push, write_queue_pop, send_process):
5809 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5810 (write_queue_pop): Fix pointer signedness problem.
5811 (send_process): Remove unused local.
5812
5813 2012-06-17 Chong Yidong <cyd@gnu.org>
5814
5815 * xdisp.c (redisplay_internal): No need to redisplay terminal
5816 frames that are not on top.
5817
5818 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5819
5820 * process.c (make_process): Initialize write_queue.
5821 (write_queue_push, write_queue_pop): New functions.
5822 (send_process): Use them to maintain correct ordering of process
5823 writes (Bug#10815).
5824
5825 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5826
5827 * lisp.h (eassert): Assume C89 or later.
5828 This removes the need for CHECK.
5829 (CHECK): Remove. Its comments about always evaluating its
5830 argument were confusing, as 'eassert' typically does not evaluate
5831 its argument.
5832
5833 * coding.c (produce_chars): Use ptrdiff_t, not int.
5834
5835 * xterm.c (x_draw_underwave): Check for integer overflow.
5836 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5837
5838 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5839
5840 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5841 referenced (Bug#11583).
5842
5843 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5844
5845 Implement wave-style variant of underlining.
5846 * dispextern.h (face_underline_type): New enum.
5847 (face): Add field for underline type.
5848 * nsterm.m (ns_draw_underwave): New function.
5849 (ns_draw_text_decoration): Use it.
5850 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5851 New functions.
5852 (x_draw_glyph_string): Use them.
5853 * xfaces.c (Qline, Qwave): New Lisp objects.
5854 (check_lface_attrs, merge_face_ref)
5855 (Finternal_set_lisp_face_attribute, realize_x_face):
5856 Handle wave-style underline face attributes.
5857 * xterm.c (x_draw_underwave): New function.
5858 (x_draw_glyph_string): Use it.
5859
5860 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5861
5862 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5863 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5864 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5865 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5866 ($(BLD)/w32select.$(O)): Update dependencies.
5867
5868 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5869
5870 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5871 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5872 * character.c (_fetch_multibyte_char_p): Remove.
5873 * alloc.c: Include "character.h" before "buffer.h".
5874 * bidi.c: Likewise.
5875 * buffer.c: Likewise.
5876 * bytecode.c: Likewise.
5877 * callint.c: Likewise.
5878 * callproc.c: Likewise.
5879 * casefiddle.c: Likewise.
5880 * casetab.c: Likewise.
5881 * category.c: Likewise.
5882 * cmds.c: Likewise.
5883 * coding.c: Likewise.
5884 * composite.c: Likewise.
5885 * dired.c: Likewise.
5886 * dispnew.c: Likewise.
5887 * doc.c: Likewise.
5888 * dosfns.c: Likewise.
5889 * editfns.c: Likewise.
5890 * emacs.c: Likewise.
5891 * fileio.c: Likewise.
5892 * filelock.c: Likewise.
5893 * font.c: Likewise.
5894 * fontset.c: Likewise.
5895 * fringe.c: Likewise.
5896 * indent.c: Likewise.
5897 * insdel.c: Likewise.
5898 * intervals.c: Likewise.
5899 * keyboard.c: Likewise.
5900 * keymap.c: Likewise.
5901 * lread.c: Likewise.
5902 * macros.c: Likewise.
5903 * marker.c: Likewise.
5904 * minibuf.c: Likewise.
5905 * nsfns.m: Likewise.
5906 * nsmenu.m: Likewise.
5907 * print.c: Likewise.
5908 * process.c: Likewise.
5909 * regex.c: Likewise.
5910 * region-cache.c: Likewise.
5911 * search.c: Likewise.
5912 * syntax.c: Likewise.
5913 * term.c: Likewise.
5914 * textprop.c: Likewise.
5915 * undo.c: Likewise.
5916 * unexsol.c: Likewise.
5917 * w16select.c: Likewise.
5918 * w32fns.c: Likewise.
5919 * w32menu.c: Likewise.
5920 * window.c: Likewise.
5921 * xdisp.c: Likewise.
5922 * xfns.c: Likewise.
5923 * xmenu.c: Likewise.
5924 * xml.c: Likewise.
5925 * xselect.c: Likewise.
5926
5927 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5928
5929 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5930 If all the glyphs of the glyph row came from strings, and we have no
5931 cursor positioning clues, put the cursor on the first glyph of the
5932 row.
5933 (handle_face_prop): Use chunk-relative overlay string index when
5934 indexing into it->string_overlays array. (Bug#11653)
5935 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5936 the rightmost. (Bug#11720)
5937
5938 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5939
5940 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5941 (CATEGORY_MEMBER): Enforce 1/0 value.
5942 * category.c (_temp_category_set): Remove.
5943
5944 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5945
5946 * window.c (Fdelete_other_windows_internal)
5947 (Fdelete_window_internal): Don't access frame's mouse highlight
5948 info of the initial frame. (Bug#11677)
5949
5950 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5951
5952 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5953 Assume USE_2_TAGS_FOR_INTS.
5954 (xreload): Adjust $tagmask width to match recent lisp.h change.
5955
5956 Simplify lisp.h in minor ways that should not affect code.
5957 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5958 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5959 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5960 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5961 (INTTYPEBITS): New macro, for clarity.
5962 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5963 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5964 Simplify now that USE_LSB_TAG is always defined.
5965 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5966 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5967
5968 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5969
5970 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5971
5972 2012-06-13 Glenn Morris <rgm@gnu.org>
5973
5974 * s/bsd-common.h (BSD4_3):
5975 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5976
5977 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5978
5979 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5980 instead of union.
5981 (XLI, XIL): Define.
5982 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5983 Use them.
5984 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5985 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5986 * alloc.c (widen_to_Lisp_Object): Remove.
5987 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5988 * frame.c (delete_frame): Remove outdated comment.
5989 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5990 USE_LISP_UNION_TYPE.
5991 (Fw32_unregister_hot_key): Likewise.
5992 (Fw32_toggle_lock_key): Likewise.
5993 * w32menu.c (add_menu_item): Likewise.
5994 (w32_menu_display_help): Use XIL instead of checking
5995 USE_LISP_UNION_TYPE.
5996 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5997 (init_heap): Likewise.
5998 * w32term.c (w32_read_socket): Update comment.
5999
6000 2012-06-13 Glenn Morris <rgm@gnu.org>
6001
6002 * s/usg5-4-common.h, src/s/unixware.h:
6003 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6004
6005 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6006
6007 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6008
6009 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6010 * alloc.c (make_number) [!defined make_number]:
6011 Remove, as lisp.h always defines this now.
6012 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6013 (roundup_size): Verify that it is a power of 2.
6014 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6015 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6016 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6017 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6018 USE_LSB_TAG now is always defined to be either 0 or 1.
6019 All uses changed.
6020 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6021 code works fine either way, and efficiency is not a concern here,
6022 as the union type is for debugging, not for production.
6023 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6024 Use an inline function on all platforms when using the union type,
6025 since this is simpler and 'static inline' can be used portably
6026 within Emacs now.
6027 (LISP_INITIALLY_ZERO): New macro.
6028 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6029 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6030
6031 2012-06-12 Glenn Morris <rgm@gnu.org>
6032
6033 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6034
6035 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6036
6037 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6038 Move BROKEN_SIGIO to configure.
6039
6040 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6041 Move NO_TERMIO to configure.
6042
6043 2012-06-12 Chong Yidong <cyd@gnu.org>
6044
6045 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6046 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6047 MagickExportImagePixels is undefined.
6048
6049 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6050
6051 * image.c (imagemagick_load_image): Remove unused label.
6052
6053 2012-06-11 Glenn Morris <rgm@gnu.org>
6054
6055 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6056 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6057 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6058 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6059
6060 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6061
6062 * alloc.c (make_byte_code): New function.
6063 (Fmake_byte_code): Use it. Don't purify here.
6064 * lread.c (read1): Use it as well to avoid extra allocation.
6065
6066 2012-06-11 Chong Yidong <cyd@gnu.org>
6067
6068 * image.c (imagemagick_load_image): Implement transparency.
6069
6070 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6071
6072 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6073 account for preceding backslashes. (Bug#11663)
6074
6075 2012-06-09 Chong Yidong <cyd@gnu.org>
6076
6077 * term.c: Support italics in capable terminals (Bug#9652).
6078 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6079 (turn_on_face): Output using TS_enter_italic_mode if available.
6080 Don't handle unused blinking and alt-charset cases.
6081 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6082 and tty_alt_charset_p cases.
6083 (tty_capable_p, init_tty): Support italics.
6084
6085 * termchar.h (struct tty_display_info): Add field for italics.
6086 Remove unused blink field.
6087
6088 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6089 Handle slant.
6090
6091 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6092 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6093 tty_alt_charset_p. Add tty_italic_p.
6094
6095 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6096
6097 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6098 dbus_type_is_basic if available.
6099 (xd_extract_signed, xd_extract_unsigned): Rename from
6100 extract_signed and extract_unsigned, respectively. Adapt callers.
6101
6102 2012-06-09 Chong Yidong <cyd@gnu.org>
6103
6104 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6105
6106 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6107 case (Bug#9752).
6108
6109 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6110
6111 * xdisp.c (vmessage): Treat frame message as multibyte.
6112 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6113 would generate the diagnostic "Making \302\247 buffer-local while
6114 let-bound!".
6115
6116 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6117
6118 * dispnew.c (showing_window_margins_p): Undo last change, which
6119 was done due to an inadvertent commit.
6120 (adjust_frame_glyphs_for_frame_redisplay): Do call
6121 showing_window_margins_p.
6122
6123 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6124
6125 * eval.c (Fmake_var_non_special): New primitive.
6126 (syms_of_eval): Defsubr it.
6127 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6128
6129 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6130
6131 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6132 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6133
6134 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6135
6136 * alloc.c (allocate_vectorlike): Fix last change.
6137
6138 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6139
6140 Block-based vector allocation of small vectors.
6141 * lisp.h (struct vectorlike_header): New field `nbytes',
6142 adjust comment accordingly.
6143 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6144 to denote vector blocks. Adjust users (live_vector_p,
6145 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6146 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6147 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6148 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6149 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6150 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6151 (roundup_size): New constant.
6152 (struct vector_block): New data type.
6153 (vector_blocks, vector_free_lists, zero_vector): New variables.
6154 (all_vectors): Rename to `large_vectors'.
6155 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6156 (sweep_vectors): New functions.
6157 (allocate_vectorlike): Return `zero_vector' as the only vector of
6158 0 items. Allocate new vector from block if vector size is less than
6159 or equal to VBLOCK_BYTES_MAX.
6160 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6161 (init_alloc_once): Add call to init_vectors.
6162
6163 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6164
6165 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6166
6167 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6168
6169 * doprnt.c (doprnt): Truncate multibyte char correctly.
6170 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6171 would mishandle a string argument "Xc" if X was a multibyte
6172 character of length 2: it would truncate after X's first byte
6173 rather than including all of X.
6174
6175 2012-06-06 Chong Yidong <cyd@gnu.org>
6176
6177 * buffer.c (word_wrap): Doc fix.
6178
6179 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6180
6181 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6182
6183 2012-06-03 Glenn Morris <rgm@gnu.org>
6184
6185 * xdisp.c (tool-bar-style): Doc fix.
6186
6187 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6188
6189 * Makefile.in (PAXCTL): Define.
6190 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6191 binary via PaX flags if the paxctl utility is available.
6192 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6193 Restore PaX flags to their default. (Bug#11398)
6194
6195 2012-06-03 Chong Yidong <cyd@gnu.org>
6196
6197 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6198 buffer (Bug#11226).
6199
6200 2012-06-03 Chong Yidong <cyd@gnu.org>
6201
6202 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6203 (note_mode_line_or_margin_highlight): If there is no help echo,
6204 use mode-line-default-help-echo. Handle the case where the mouse
6205 position is past the end of the mode line string.
6206
6207 * buffer.c (buffer_local_value_1): New function, split from
6208 Fbuffer_local_value; can return Qunbound.
6209 (Fbuffer_local_value): Use it.
6210 (Vmode_line_format): Docstring tweaks.
6211
6212 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6213
6214 * sysdep.c (system_process_attributes): Improve comment.
6215
6216 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6217
6218 * keyboard.c: Export real-this-command to Elisp.
6219 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6220 and DEFVAR it. Update all users.
6221
6222 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6223
6224 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6225
6226 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6227 Convert pctcpu and pctmem to Lisp float properly.
6228 Let the compiler fold better, as 100.0/0x8000 is exact.
6229
6230 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6231
6232 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6233 cons_block.
6234
6235 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6236
6237 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6238
6239 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6240
6241 For a 'struct window', replace some Lisp_Object fields to
6242 bitfields where appropriate, remove unused fields.
6243 * window.h (struct window): Remove unused 'last_mark_x' and
6244 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6245 change it's type from Lisp_Object to bitfield.
6246 Change type of 'force_start', 'optional_new_start',
6247 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6248 fields from Lisp_Object to bitfield. Adjust users accordingly.
6249
6250 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6251
6252 Pacify gcc -Wdouble-precision when using Xaw.
6253 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6254 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6255 Use 'float' consistently, rather than 'float' in most places
6256 and 'double' in a couple of places.
6257
6258 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6259
6260 * xdisp.c (handle_stop): Detect whether we have overlay strings
6261 loaded by testing it->current.overlay_string_index to be
6262 non-negative, instead of checking whether n_overlay_strings is
6263 positive. (Bug#11587)
6264
6265 2012-05-31 Chong Yidong <cyd@gnu.org>
6266
6267 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6268
6269 * doc.c (Fsubstitute_command_keys): Doc fix.
6270
6271 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6272
6273 * search.c (search_buffer): Remove calls to
6274 r_alloc_inhibit_buffer_relocation, as it is now called by
6275 maybe_unify_char, which was the cause of relocation of buffer text
6276 in bug#11519.
6277
6278 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6279
6280 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6281 for the duration of call to load_charset, to avoid problems with
6282 callers of maybe_unify_char that access buffer text through C
6283 pointers.
6284
6285 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6286 decrement the inhibition flag, instead of just setting or
6287 resetting it.
6288
6289 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6290
6291 Remove obsolete '#define static' cruft.
6292 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6293 This #undef was "temporary" in 2000; it is no longer needed
6294 now that '#define static' has gone away.
6295 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6296 (gray_bitmap_bits): Remove; no longer needed.
6297 All uses replaced with definiens.
6298 * xterm.c: Include "bitmaps/gray.xbm".
6299
6300 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6301
6302 Clean up __executable_start, monstartup when --enable-profiling.
6303 The following changes affect the code only when profiling.
6304 * dispnew.c (__executable_start): Rename from safe_bcopy.
6305 Define only on platforms that need it.
6306 * emacs.c: Include <sys/gmon.h> when profiling.
6307 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6308 (__executable_start): Remove decl, since lisp.h does it now.
6309 (safe_bcopy): Remove decl; no longer has that name.
6310 (main): Coalesce #if into single bit of code, for simplicity.
6311 Cast pointers to uintptr_t, since standard libraries want integers
6312 and not pointers.
6313 * lisp.h (__executable_start): New decl.
6314
6315 2012-05-31 Glenn Morris <rgm@gnu.org>
6316
6317 * image.c (Fimagemagick_types): Doc fix.
6318
6319 2012-05-30 Jim Meyering <meyering@redhat.com>
6320
6321 * callproc.c (Fcall_process_region): Include directory component
6322 in mkstemp error message (Bug#11586).
6323
6324 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6325
6326 * alloc.c, lisp.h (make_pure_vector): Now static.
6327
6328 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6329
6330 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6331 Move to byte-run.el.
6332 (Fautoload): Do the hash-doc more carefully.
6333 * data.c (Fdefalias): Purify definition, except for keymaps.
6334 (Qdefun): Move from eval.c.
6335 * lisp.h (Qdefun): Remove.
6336 * lread.c (read1): Tiny simplification.
6337
6338 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6339
6340 Do not create empty overlays with the evaporate property (Bug#9642).
6341 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6342 Bug#9642, but explicitly check that the buffer the overlay would
6343 be moved to is live and rearrange lines to make sure that errors
6344 will not put the overlay in an inconsistent state.
6345 (Fdelete_overlay): Cosmetics.
6346
6347 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6348
6349 * w32term.c (my_bring_window_to_top): New function.
6350 (x_raise_frame): Use handle returned by DeferWindowPos, which
6351 could be different from the original one.
6352 Call my_bring_window_to_top instead of my_set_foreground_window.
6353 (Bug#11513)
6354
6355 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6356 by calling BringWindowToTop.
6357
6358 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6359 (WM_EMACS_END): Increase by one.
6360
6361 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6362
6363 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6364 This avoids undefined behavior that might cause the eassert
6365 to not catch an out-of-range value.
6366
6367 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6368
6369 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6370 Update dependencies.
6371
6372 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6373
6374 * bidi.c (bidi_mirror_char): Fix last change.
6375
6376 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6377
6378 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6379 when referring to sectname field in printf format.
6380
6381 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6382
6383 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6384 Only r_alloc_inhibit_buffer_relocation needed to be added;
6385 the others were already declared.
6386
6387 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6388 before checking whether it's out of range. Put the check inside
6389 eassert. See
6390 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6391
6392 2012-05-27 Ken Brown <kbrown@cornell.edu>
6393
6394 * callproc.c (Fcall_process): Restore a line that was accidentally
6395 commented out in the 2011-02-13 change (bug#11547).
6396
6397 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6398
6399 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6400 defined on ralloc.c.
6401
6402 * buffer.c [REL_ALLOC]: Remove prototypes of
6403 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6404 they are now on lisp.h.
6405
6406 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6407
6408 * search.c (search_buffer): Use it to inhibit relocation of buffer
6409 text while re_search_2 is doing its job, because re_search_2 is
6410 passed C pointers to buffer text. (Bug#11519)
6411
6412 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6413 Update value to 24.
6414
6415 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6416 state after an additional call to move_it_in_display_line_to, keep
6417 the values of it->max_ascent and it->max_descent found for the
6418 entire line.
6419 (pos_visible_p): Revert the comparison against bottom_y to what it
6420 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6421 (Bug#11464)
6422
6423 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6424
6425 Fix coding-related core dumps with gcc -ftrapv.
6426 The code was computing A - B, where A and B are pointers, and B is
6427 random garbage. This can lead to core dumps on platforms that
6428 have special pointer registers, and it also leads to core dumps on
6429 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6430 A - B only when B is initialized properly.
6431 * coding.c (coding_set_source, coding_set_destination): Return void.
6432 (coding_change_source, coding_change_destinations): New functions,
6433 with the old behaviors of coding_set_source and coding_set_destination.
6434 All callers that need an offset changed to use these new functions.
6435
6436 2012-05-26 Glenn Morris <rgm@gnu.org>
6437
6438 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6439
6440 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6441
6442 Extend mouse support on W32 text-mode console.
6443 * xdisp.c (draw_row_with_mouse_face):
6444 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6445
6446 * w32console.c: Include window.h.
6447 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6448 New functions.
6449 (initialize_w32_display): Initialize mouse-highlight data.
6450
6451 * w32inevt.c: Include termchar.h and window.h.
6452 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6453 moves, call note_mouse_highlight. If help_echo changed, call
6454 gen_help_event to produce help-echo message in the echo area.
6455 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6456 highlight info.
6457
6458 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6459
6460 * lread.c (read1): Simplify slightly to avoid an overflow warning
6461 with GCC 4.7.0 on x86-64.
6462
6463 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6464
6465 * bidi.c (bidi_mirror_char): Revert last change: an int is
6466 definitely wide enough here.
6467
6468 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6469
6470 Fix integer width and related bugs (Bug#9874).
6471 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6472 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6473 (string_bytes, check_sblock, allocate_string_data):
6474 (compact_small_strings, Fmake_bool_vector, make_string)
6475 (make_unibyte_string, make_multibyte_string)
6476 (make_string_from_bytes, make_specified_string)
6477 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6478 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6479 (mark_vectorlike):
6480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6481 (allocate_pseudovector):
6482 Use int, not EMACS_INT, where int is wide enough.
6483 (inhibit_garbage_collection, Fgarbage_collect):
6484 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6485 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6486 int might not be wide enough.
6487 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6488 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6489 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6490 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6491 (bidi_level_of_next_char, bidi_move_to_visually_next):
6492 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6493 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6494 (Fkill_buffer, Fset_buffer_major_mode)
6495 (advance_to_char_boundary, Fbuffer_swap_text)
6496 (Fset_buffer_multibyte, overlays_at, overlays_in)
6497 (overlay_touches_p, struct sortvec, record_overlay_string)
6498 (overlay_strings, recenter_overlay_lists)
6499 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6500 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6501 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6502 (Foverlay_recenter, last_overlay_modification_hooks_used)
6503 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6504 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6505 (validate_region): Omit unnecessary test for b <= e,
6506 since that's guaranteed by the previous test.
6507 (adjust_overlays_for_delete): Avoid pos + length overflow.
6508 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6509 (report_overlay_modification):
6510 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6511 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6512 Omit pointer cast, which isn't needed anyway, and doesn't work
6513 after the EMACS_INT -> ptrdiff_t change.
6514 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6515 * buffer.h: Adjust decls to match defn changes elsewhere.
6516 (struct buffer_text, struct buffer):
6517 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6518 Use EMACS_INT, not int, where int might not be wide enough.
6519 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6520 not int, to avoid needless 32-bit limit on 64-bit hosts.
6521 (exec_byte_code): Use tighter memory-full test, one that checks
6522 for alloca overflow. Don't compute the address of the object just
6523 before an array, as that's not portable. Use EMACS_INT, not
6524 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6525 * callint.c (Fcall_interactively):
6526 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6527 * callproc.c (call_process_kill, Fcall_process):
6528 Don't assume pid_t fits into an Emacs fixnum.
6529 (call_process_cleanup, Fcall_process, child_setup):
6530 Don't assume pid_t fits into int.
6531 (call_process_cleanup, Fcall_process, delete_temp_file)
6532 (Fcall_process_region):
6533 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6534 (Fcall_process): Simplify handling of volatile integers.
6535 Use int, not EMACS_INT, where int will do.
6536 * casefiddle.c (casify_object, casify_region, operate_on_word)
6537 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6538 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6539 (casify_object): Avoid integer overflow when overallocating buffer.
6540 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6541 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6542 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6543 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6544 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6545 integers are now checked earlier. All uses replaced with XINT.
6546 (ccl_driver):
6547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6548 For CCL_MapSingle, check that content and value are in int range.
6549 (ccl_driver, Fregister_code_conversion_map):
6550 Check that Vcode_version_map_vector is a vector.
6551 (resolve_symbol_ccl_program): Check that vector header is in range.
6552 Always copy the vector, so that we can check its contents reliably
6553 now rather than having to recheck each instruction as it's being
6554 executed. Check that vector words fit in 'int'.
6555 (ccl_get_compiled_code, Fregister_ccl_program)
6556 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6557 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6558 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6559 contents are in range.
6560 (Fccl_execute_on_string): Check that status is in range.
6561 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6562 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6563 Accept and return EMACS_INT, not int, because callers can pass values
6564 out of 'int' range.
6565 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6566 (multibyte_chars_in_text, parse_str_as_multibyte)
6567 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6568 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6569 (string_escape_byte8, Fget_byte):
6570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6571 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6572 avoid mishandling large integers.
6573 * character.h: Adjust decls to match defn changes elsewhere.
6574 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6575 (Ffind_charset_region):
6576 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6577 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6578 (load_charset_map_from_vector, Fdefine_charset_internal):
6579 Don't assume fixnum fits in int.
6580 (load_charset_map_from_vector, Fmap_charset_chars):
6581 Remove now-unnecessary CHECK_NATNUMs.
6582 (Fdefine_charset_internal): Check ranges here, more carefully.
6583 Don't rely on undefined behavior with signed left shift overflow.
6584 Don't assume unsigned int fits into fixnum, or that fixnum fits
6585 into unsigned int. Don't require max_code to be a valid fixnum;
6586 that's not true for gb10830 4-byte on a 32-bit host. Allow
6587 invalid_code to be a cons, for the same reason. Require code_offset
6588 to be a character. Avoid int overflow if max_char is close
6589 to INT_MAX.
6590 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6591 this is intended anyway and avoids some undefined behavior.
6592 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6593 INDEX_TO_CODE_POINT, as that's what it expects.
6594 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6595 * charset.h (DECODE_CHAR): Return int, not unsigned;
6596 this is what was intended anyway, and it avoids undefined behavior.
6597 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6598 integer-overflow issues.
6599 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6600 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6601 where the argument is EMACS_INT, and this behavior is not intended.
6602 * chartab.c (Fmake_char_table, Fset_char_table_range)
6603 (uniprop_get_decoder, uniprop_get_encoder):
6604 Don't assume fixnum fits in int.
6605 * cmds.c (move_point): New function, that does the gist of
6606 Fforward_char and Fbackward_char, but does so while checking
6607 for integer overflow more accurately.
6608 (Fforward_char, Fbackward_char): Use it.
6609 (Fforward_line, Fend_of_line, internal_self_insert)
6610 (internal_self_insert):
6611 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6612 Fix a FIXME, by checking for integer overflow when calculating
6613 target_clm and actual_clm.
6614 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6615 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6616 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6617 (coding_alloc_by_making_gap, alloc_destination)
6618 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6619 (encode_coding_utf_16, detect_coding_emacs_mule)
6620 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6621 (detect_coding_iso_2022, decode_coding_iso_2022)
6622 (encode_invocation_designation, encode_designation_at_bol)
6623 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6624 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6625 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6626 (encode_coding_ccl, encode_coding_raw_text)
6627 (detect_coding_charset, decode_coding_charset)
6628 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6629 (produce_composition, produce_charset, produce_annotation)
6630 (decode_coding, handle_composition_annotation)
6631 (handle_charset_annotation, consume_chars, decode_coding_gap)
6632 (decode_coding_object, encode_coding_object, detect_coding_system)
6633 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6634 (code_convert_region, code_convert_string)
6635 (Fdefine_coding_system_internal)
6636 (coding_set_source, coding_set_destination):
6637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6638 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6639 (Fdefine_coding_system_internal):
6640 Don't assume fixnums fit in int.
6641 (decode_coding_gap, decode_coding_object, encode_coding_object)
6642 (Fread_coding_system, Fdetect_coding_region)
6643 (Funencodable_char_position, Fcheck_coding_systems_region)
6644 (get_translation, handle_composition_annotation, consume_chars):
6645 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6646 (consume_chars): Rewrite to not calculate an address outside buffer.
6647 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6648 Don't access memory outside of the args array.
6649 (Fdefine_coding_system_internal): Check for charset-id overflow.
6650 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6651 result of ENCODE_CHAR.
6652 * coding.h: Adjust decls to match defn changes elsewhere.
6653 (struct coding_system):
6654 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6655 * composite.c (get_composition_id, find_composition)
6656 (run_composition_function, update_compositions)
6657 (compose_text, composition_gstring_put_cache)
6658 (composition_gstring_p, composition_gstring_width)
6659 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6660 (composition_compute_stop_pos, composition_reseat_it)
6661 (composition_update_it, struct position_record)
6662 (find_automatic_composition, composition_adjust_point)
6663 (Fcomposition_get_gstring, Ffind_composition_internal):
6664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6665 (update_compositions):
6666 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6667 * composite.h: Adjust decls to match defn changes elsewhere.
6668 (struct composition):
6669 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6670 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6671 Do not attempt to compute the address of the object just before a
6672 buffer; this is not portable.
6673 (Faref, Faset):
6674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6675 (Faset): Use int, not EMACS_INT, where int is wide enough.
6676 (Fstring_to_number): Don't assume fixnums fit in int.
6677 (Frem): Don't assume arg is nonnegative.
6678 * dbusbind.c (xd_append_arg): Check for integers out of range.
6679 (Fdbus_call_method): Don't overflow the timeout int.
6680 (extract_signed, extract_unsigned): New functions.
6681 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6682 (xd_get_connection_references): Return ptrdiff_t, not int.
6683 All uses changed.
6684 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6685 (xd_read_message_1):
6686 Use int, not unsigned, where the dbus API uses int.
6687 (Fdbus_message_internal): Don't overflow mtype.
6688 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6689 * dired.c (directory_files_internal, file_name_completion, scmp)
6690 (file_name_completion_stat):
6691 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6692 (file_name_completion): Don't overflow matchcount.
6693 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6694 * dispextern.h: Adjust decls to match defn changes elsewhere.
6695 (struct text_pos, struct glyph, struct bidi_saved_info)
6696 (struct bidi_string_data, struct bidi_it, struct composition_it)
6697 (struct it):
6698 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6699 (struct display_pos, struct composition_it, struct it):
6700 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6701 * dispnew.c (increment_matrix_positions)
6702 (increment_row_positions, mode_line_string)
6703 (marginal_area_string):
6704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6705 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6706 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6707 (duration_to_sec_usec): New function, to check for overflow better.
6708 (Fsleep_for, sit_for): Use it.
6709 * doc.c (get_doc_string, store_function_docstring):
6710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6711 (get_doc_string, Fsnarf_documentation):
6712 Use int, not EMACS_INT, where int is wide enough.
6713 (get_doc_string):
6714 Use SAFE_ALLOCA, not alloca.
6715 Check for overflow when converting EMACS_INT to off_t.
6716 * doprnt.c (doprnt):
6717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6718 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6719 Don't assume uid_t fits into fixnum.
6720 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6721 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6722 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6723 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6724 (general_insert_function)
6725 (Finsert_char, make_buffer_string, make_buffer_string_both)
6726 (update_buffer_properties, Fbuffer_substring)
6727 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6728 (Fsubst_char_in_region, check_translation)
6729 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6730 (transpose_markers, Ftranspose_regions):
6731 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6732 (clip_to_bounds): Move to lisp.h as an inline function).
6733 (Fconstrain_to_field): Don't assume integers are nonnegative.
6734 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6735 (Fsubst_char_in_region, Fsave_restriction):
6736 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6737 (Femacs_pid): Don't assume pid_t fits into fixnum.
6738 (lo_time): Use int, not EMACS_INT, when int suffices.
6739 (lisp_time_argument): Check for usec out of range.
6740 (Fencode_time): Don't assume fixnum fits in int.
6741 (Fuser_login_name, Fuser_full_name): Signal an error
6742 if a uid argument is out of range, rather than relying on
6743 undefined behavior.
6744 (Fformat_time_string): Remove now-unnecessary check.
6745 lisp_time_argument checks for out-of-range usec now.
6746 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6747 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6748 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6749 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6750 (init_cmdargs, Fdump_emacs):
6751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6752 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6753 the bottom (typically) 32 bits of the fixnum.
6754 * eval.c (specpdl_size, call_debugger):
6755 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6756 (when_entered_debugger, Fbacktrace_debug):
6757 Don't assume fixnum can fit in int.
6758 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6759 the object just before a buffer; this is not portable.
6760 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6761 (grow_specpdl, unbind_to):
6762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6763 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6764 (grow_specpdl): Simplify allocation by using xpalloc.
6765 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6766 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6767 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6769 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6770 (a_write, e_write):
6771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6772 (Fcopy_file, non_regular_nbytes, read_non_regular)
6773 (Finsert_file_contents):
6774 Use int, not EMACS_INT, where int is wide enough.
6775 (READ_BUF_SIZE): Verify that it fits in int.
6776 (Finsert_file_contents): Check that counts are in proper range,
6777 rather than assuming fixnums fit into ptrdiff_t etc.
6778 Don't assume fixnums fit into int.
6779 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6780 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6781 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6782 (string_char_to_byte, string_byte_to_char)
6783 (string_make_multibyte, string_to_multibyte)
6784 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6785 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6786 (substring_both, Fdelete, internal_equal, Ffillarray)
6787 (Fclear_string, mapcar1)
6788 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6789 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6790 (larger_vector, make_hash_table, maybe_resize_hash_table)
6791 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6792 (Fmaphash, secure_hash):
6793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6794 (concat): Check for string index and length overflow.
6795 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6796 (Frequire):
6797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6798 (larger_vector): New API (vec, incr_min, size_max) replaces old
6799 one (vec, new_size, init). This catches size overflow.
6800 INIT was removed because it was always Qnil.
6801 All callers changed.
6802 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6803 the upper bound on a hash table index size.
6804 (make_hash_table, maybe_resize_hash_table): Use it.
6805 (secure_hash): Computer start_byte and end_byte only after
6806 they're known to be in ptrdiff_t range.
6807 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6808 (Ffont_get_glyphs, Ffont_at):
6809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6810 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6811 (Flist_fonts, Fopen_font):
6812 Don't assume fixnum can fit in int.
6813 (check_gstring): Don't assume index can fit in int.
6814 (font_match_p): Check that fixnum is a character, not a nonnegative
6815 fixnum, since the later code needs to stuff it into an int.
6816 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6817 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6818 conversion overflow issues.
6819 (Fopen_font): Check for integer out of range.
6820 (Ffont_get_glyphs): Don't assume index can fit in int.
6821 * font.h: Adjust decls to match defn changes elsewhere.
6822 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6823 integer overflow.
6824 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6825 printmax_t, where ptrdiff_t is wide enough.
6826 (Finternal_char_font):
6827 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6828 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6829 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6830 (Fset_frame_position, x_set_frame_parameters)
6831 (x_set_line_spacing, x_set_border_width)
6832 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6833 Check that fixnums are in proper range for system types.
6834 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6835 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6836 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6837 Use SAFE_ALLOCA_LISP, not alloca.
6838 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6839 intptr_t is wide enough.
6840 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6841 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6842 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6843 Check for fixnum out of range.
6844 * ftfont.c (ftfont_list): Don't assume index fits in int.
6845 Check that fixnums are in proper range for system types.
6846 (ftfont_shape_by_flt):
6847 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6848 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6849 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6850 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6851 Check that fixnums are in proper range for system types.
6852 * gnutls.h: Adjust decls to match defn changes elsewhere.
6853 * gtkutil.c (xg_dialog_run):
6854 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6855 (update_frame_tool_bar):
6856 Check that fixnums are in proper range for system types.
6857 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6858 (lookup_image): Check that fixnums are in range for system types.
6859 * indent.c (last_known_column, last_known_column_point):
6860 (current_column_bol_cache):
6861 (skip_invisible, current_column, check_display_width):
6862 (check_display_width, scan_for_column, current_column_1)
6863 (Findent_to, Fcurrent_indentation, position_indentation)
6864 (indented_beyond_p, Fmove_to_column, compute_motion):
6865 (Fcompute_motion, Fvertical_motion):
6866 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6867 (last_known_column_modified): Use EMACS_INT, not int.
6868 (check_display_width):
6869 (Fcompute_motion):
6870 Check that fixnums and floats are in proper range for system types.
6871 (compute_motion): Don't assume index or fixnum fits in int.
6872 (compute_motion, Fcompute_motion):
6873 Use int, not EMACS_INT, when it is wide enough.
6874 (vmotion): Omit local var start_hpos that is always 0; that way
6875 we don't need to worry about overflow in expressions involving it.
6876 * indent.h: Adjust decls to match defn changes elsewhere.
6877 (struct position):
6878 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6879 Use int, not EMACS_INT, where int is wide enough.
6880 Remove unused members ovstring_chars_done and tab_offset;
6881 all uses removed.
6882 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6883 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6884 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6885 (make_gap, copy_text, insert, insert_and_inherit)
6886 (insert_before_markers, insert_before_markers_and_inherit)
6887 (insert_1, count_combining_before, count_combining_after)
6888 (insert_1_both, insert_from_string)
6889 (insert_from_string_before_markers, insert_from_string_1)
6890 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6891 (adjust_after_replace, adjust_after_insert, replace_range)
6892 (replace_range_2, del_range, del_range_1, del_range_byte)
6893 (del_range_both, del_range_2, modify_region)
6894 (prepare_to_modify_buffer, signal_before_change)
6895 (signal_after_change, Fcombine_after_change_execute):
6896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6897 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6898 (balance_an_interval, split_interval_right, split_interval_left)
6899 (find_interval, next_interval, update_interval)
6900 (adjust_intervals_for_insertion, delete_node, delete_interval)
6901 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6902 (static_offset_intervals, offset_intervals)
6903 (merge_interval_right, merge_interval_left, make_new_interval)
6904 (graft_intervals_into_buffer, temp_set_point_both)
6905 (temp_set_point, set_point, adjust_for_invis_intang)
6906 (set_point_both, move_if_not_intangible, get_property_and_range)
6907 (get_local_map, copy_intervals, copy_intervals_to_string)
6908 (compare_string_intervals, set_intervals_multibyte_1):
6909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6910 * intervals.h: Adjust decls to match defn changes elsewhere.
6911 (struct interval):
6912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6913 * keyboard.c (this_command_key_count, this_single_command_key_start)
6914 (before_command_key_count, before_command_echo_length, echo_now)
6915 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6916 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6917 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6918 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6919 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6920 (last_non_minibuf_size, last_point_position, echo_truncate)
6921 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6922 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6923 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6924 (stuff_buffered_input):
6925 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6926 (last_auto_save, command_loop_1, read_char):
6927 Use EMACS_INT, not int, to avoid integer overflow.
6928 (record_char): Avoid overflow in total_keys computation.
6929 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6930 * keyboard.h: Adjust decls to match defn changes elsewhere.
6931 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6932 (Fkey_description, Fdescribe_vector, Flookup_key):
6933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6934 (click_position): New function, to check that positions are in range.
6935 (Fcurrent_active_maps):
6936 (describe_command):
6937 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6938 (Faccessible_keymaps, Fkey_description):
6939 (preferred_sequence_p):
6940 Don't assume fixnum can fit into int.
6941 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6942 Check for integer overflow in size calculations.
6943 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6944 avoid mishandling large integers.
6945 * lisp.h: Adjust decls to match defn changes elsewhere.
6946 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6947 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6948 (struct Lisp_Marker):
6949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6950 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6951 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6952 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6953 All callers changed.
6954 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6955 Assume the arg has valid form, since it always does.
6956 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6957 unsigned integer system type.
6958 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6959 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6960 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6961 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6962 (duration_to_sec_usec): New decl.
6963 * lread.c (read_from_string_index, read_from_string_index_byte)
6964 (read_from_string_limit, readchar, unreadchar, openp)
6965 (read_internal_start, read1, oblookup):
6966 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6967 (Fload, readevalloop, Feval_buffer, Feval_region):
6968 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6969 (openp): Check for out-of-range argument to 'access'.
6970 (read1): Use int, not EMACS_INT, where int is wide enough.
6971 Don't assume fixnum fits into int.
6972 Fix off-by-one error that can read outside a buffer.
6973 (read_filtered_event): Use duration_to_sec_usec
6974 to do proper overflow checking on durations.
6975 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6976 in size calculation.
6977 (Fexecute_kbd_macro):
6978 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6979 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6980 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6981 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6982 (set_marker_both, set_marker_restricted_both, marker_position)
6983 (marker_byte_position, Fbuffer_has_markers_at):
6984 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6985 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6986 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6987 It now merely ensures that the menu is large enough, without
6988 necessarily growing it, as this avoids some integer overflow issues.
6989 All callers changed.
6990 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6992 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6993 Use SAFE_ALLOCA_LISP, not alloca.
6994 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6995 to EMACS_INT. Check that fixnums are in proper range for system types.
6996 * minibuf.c (minibuf_prompt_width, string_to_object)
6997 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6998 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6999 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7000 (get_minibuffer, read_minibuf_unwind):
7001 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7002 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7003 this simplifies overflow checking. All callers changed.
7004 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7005 (Ftest_completion):
7006 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7007 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7008 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7009 Check that fixnums are in proper range for system types.
7010 (Fx_create_frame, Fx_show_tip):
7011 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7012 * nsfont.m (ns_findfonts, nsfont_list_family):
7013 Don't assume fixnum fits in long.
7014 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7015 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7016 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7017 wide enough.
7018 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7019 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7020 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7021 (PRINTDECLARE, PRINTPREPARE):
7022 (strout, print_string):
7023 (print, print_preprocess, print_check_string_charset_prop)
7024 (print_object):
7025 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7026 (PRINTDECLARE):
7027 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7028 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7029 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7030 (printchar, strout): Use xpalloc to catch size calculation overflow.
7031 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7032 (print_error_message): Use SAFE_ALLOCA, not alloca.
7033 (print_object): Use int, not EMACS_INT, where int is wide enough.
7034 (print_depth, new_backquote_output, print_number_index):
7035 Use ptrdiff_t, not int, where int might not be wide enough.
7036 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7037 (Fset_process_window_size, Fformat_network_address)
7038 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7039 (sigchld_handler):
7040 Check that fixnums are in proper range for system types.
7041 (Fsignal_process): Simplify by avoiding a goto.
7042 Check for process-ids out of pid_t range rather than relying on
7043 undefined behavior.
7044 (process_tick, update_tick): Use EMACS_INT, not int.
7045 (Fformat_network_address, read_process_output, send_process)
7046 (Fprocess_send_region, status_notify):
7047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7048 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7049 (wait_reading_process_output, read_process_output, exec_sentinel):
7050 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7051 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7052 (Faccept_process_output): Use duration_to_sec_usec to do proper
7053 overflow checking on durations.
7054 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7055 Don't assume pid_t fits in int.
7056 * process.h (struct Lisp_Process): Members tick and update_tick
7057 are now of type EMACS_INT, not int.
7058 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7059 configured --with-wide-int.
7060 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7061 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7062 * search.c (looking_at_1, string_match_1):
7063 (fast_string_match, fast_c_string_match_ignore_case)
7064 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7065 (scan_newline, find_before_next_newline, search_command)
7066 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7067 (set_search_regs, wordify):
7068 (Freplace_match):
7069 (Fmatch_data):
7070 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7071 (string_match_1, search_buffer, set_search_regs):
7072 (Fmatch_data):
7073 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7074 (wordify): Check for overflow in size calculation.
7075 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7076 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7077 Check that fixnums are in proper range for system types.
7078 * sound.c (struct sound_device)
7079 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7080 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7081 (Fplay_sound_internal):
7082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7083 * syntax.c (struct lisp_parse_state, find_start_modiff)
7084 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7085 (Fparse_partial_sexp):
7086 Don't assume fixnums can fit in int.
7087 (struct lisp_parse_state, find_start_pos, find_start_value)
7088 (find_start_value_byte, find_start_begv)
7089 (update_syntax_table, char_quoted, dec_bytepos)
7090 (find_defun_start, prev_char_comend_first, back_comment):
7091 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7092 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7093 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7094 (Finternal_describe_syntax_value): Check that match_lisp is a
7095 character, not an integer, since the code stuffs it into int.
7096 (scan_words, scan_sexps_forward):
7097 Check that fixnums are in proper range for system types.
7098 (Fforward_word):
7099 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7100 (scan_sexps_forward):
7101 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7102 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7103 * syntax.h: Adjust decls to match defn changes elsewhere.
7104 (struct gl_state_s):
7105 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7106 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7107 MOST_POSITIVE_FIXNUM.
7108 * sysdep.c (wait_for_termination_1, wait_for_termination)
7109 (interruptible_wait_for_termination, mkdir):
7110 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7111 (emacs_read, emacs_write):
7112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7113 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7114 and double all fit in int.
7115 * term.c (set_tty_color_mode):
7116 Check that fixnums are in proper range for system types.
7117 * termhooks.h (struct input_event):
7118 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7119 * textprop.c (validate_interval_range, interval_of)
7120 (Fadd_text_properties, set_text_properties_1)
7121 (Fremove_text_properties, Fremove_list_of_text_properties)
7122 (Ftext_property_any, Ftext_property_not_all)
7123 (copy_text_properties, text_property_list, extend_property_ranges)
7124 (verify_interval_modification):
7125 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7126 (Fnext_single_char_property_change)
7127 (Fprevious_single_char_property_change):
7128 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7129 (copy_text_properties):
7130 Check for integer overflow in index calculation.
7131 * undo.c (last_boundary_position, record_point, record_insert)
7132 (record_delete, record_marker_adjustment, record_change)
7133 (record_property_change):
7134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7135 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7136 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7137 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7138 (Fx_hide_tip, Fx_file_dialog):
7139 * w32menu.c (set_frame_menubar):
7140 Use ptrdiff_t, not int, for consistency with rest of code.
7141 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7142 (select_window, Fdelete_other_windows_internal)
7143 (window_scroll_pixel_based, window_scroll_line_based)
7144 (Frecenter, Fset_window_configuration):
7145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7146 (Fset_window_hscroll, run_window_configuration_change_hook)
7147 (set_window_buffer, temp_output_buffer_show, scroll_command)
7148 (Fscroll_other_window, Frecenter):
7149 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7150 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7151 Don't assume fixnum fits in int.
7152 (Fset_window_scroll_bars):
7153 Check that fixnums are in proper range for system types.
7154 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7155 (string_pos, c_string_pos, number_of_chars, init_iterator)
7156 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7157 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7158 (compute_display_string_end, handle_face_prop)
7159 (face_before_or_after_it_pos, handle_invisible_prop)
7160 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7161 (display_prop_intangible_p, string_buffer_position_lim)
7162 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7163 (get_overlay_strings_1, get_overlay_strings)
7164 (iterate_out_of_display_property, forward_to_next_line_start)
7165 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7166 (get_next_display_element, set_iterator_to_next)
7167 (get_visually_first_element, compute_stop_pos_backwards)
7168 (handle_stop_backwards, next_element_from_buffer)
7169 (move_it_in_display_line_to, move_it_in_display_line)
7170 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7171 (add_to_log, message_dolog, message_log_check_duplicate)
7172 (message2, message2_nolog, message3, message3_nolog
7173 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7174 (current_message_1, truncate_echo_area, truncate_message_1)
7175 (set_message, set_message_1, store_mode_line_noprop)
7176 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7177 (text_outside_line_unchanged_p, check_point_in_composition)
7178 (reconsider_clip_changes)
7179 (redisplay_internal, set_cursor_from_row, try_scrolling)
7180 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7181 (redisplay_window, find_last_unchanged_at_beg_row)
7182 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7183 (trailing_whitespace_p, find_row_edges, display_line)
7184 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7185 (display_mode_element, store_mode_line_string)
7186 (pint2str, pint2hrstr, decode_mode_spec)
7187 (display_count_lines, display_string, draw_glyphs)
7188 (x_produce_glyphs, x_insert_glyphs)
7189 (rows_from_pos_range, mouse_face_from_buffer_pos)
7190 (fast_find_string_pos, mouse_face_from_string_pos)
7191 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7193 (safe_call, init_from_display_pos, handle_fontified_prop)
7194 (handle_single_display_spec, load_overlay_strings)
7195 (with_echo_area_buffer, setup_echo_area_for_printing)
7196 (display_echo_area, echo_area_display)
7197 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7198 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7199 (redisplay_window, dump_glyph_row, display_mode_line)
7200 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7201 (handle_display_spec, display_prop_string_p):
7202 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7203 (handle_single_display_spec, build_desired_tool_bar_string)
7204 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7205 (get_specified_cursor_type):
7206 Check that fixnums are in proper range for system types.
7207 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7208 (Flookup_image_map):
7209 Don't assume fixnums fit in int.
7210 (compare_overlay_entries):
7211 Avoid mishandling comparisons due to subtraction overflow.
7212 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7213 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7214 (handle_tool_bar_click):
7215 Use int, not unsigned, since we prefer signed and the signedness
7216 doesn't matter here.
7217 (get_next_display_element, next_element_from_display_vector):
7218 Use int, not EMACS_INT, when int is wide enough.
7219 (start_hourglass): Use duration_to_sec_usec to do proper
7220 overflow checking on durations.
7221 * xfaces.c (Fbitmap_spec_p):
7222 Check that fixnums are in proper range for system types.
7223 (compare_fonts_by_sort_order):
7224 Avoid mishandling comparisons due to subtraction overflow.
7225 (Fx_family_fonts, realize_basic_faces):
7226 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7227 (Fx_family_fonts):
7228 Don't assume fixnum fits in int.
7229 Use SAFE_ALLOCA_LISP, not alloca.
7230 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7231 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7232 (face_at_buffer_position, face_for_overlay_string)
7233 (face_at_string_position):
7234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7235 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7236 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7237 (Fx_show_tip):
7238 Check that fixnums are in proper range for system types.
7239 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7240 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7241 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7242 (Fx_change_window_property): Don't assume fixnums fit in int.
7243 * xfont.c (xfont_chars_supported):
7244 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7245 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7246 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7247 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7248 * xml.c (parse_region):
7249 * xrdb.c (magic_file_p):
7250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7251 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7252 (x_get_local_selection, x_reply_selection_request)
7253 (x_handle_selection_request, wait_for_property_change):
7254 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7255 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7256 short is wide enough.
7257 (x_send_client_event): Don't assume fixnum fits in int.
7258 * xterm.c (x_x_to_emacs_modifiers):
7259 Don't assume EMACS_INT overflows nicely into int.
7260 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7261 may come from Lisp.
7262 (handle_one_xevent): NATNUMP can eval its arg twice.
7263 (x_connection_closed):
7264 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7265 * xterm.h: Adjust decls to match defn changes elsewhere.
7266 (struct scroll_bar): Use struct vectorlike_header
7267 rather than rolling our own approximation.
7268 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7269
7270 2012-05-25 Glenn Morris <rgm@gnu.org>
7271
7272 * lisp.mk (lisp): Update for more files being compiled now.
7273
7274 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7275
7276 * lread.c: Remove `read_pure' which makes no difference.
7277 (read_pure): Remove var.
7278 (unreadpure): Remove function.
7279 (readevalloop): Don't call read_list with -1 flag.
7280 (read1, read_vector): Don't test read_pure any more.
7281 (read_list): Simplify.
7282
7283 * fileio.c, character.h: Minor style tweaks.
7284
7285 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7286
7287 * window.h (clip_changed): Remove useless declaration.
7288
7289 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7290
7291 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7292 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7293
7294 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7295
7296 Remove src/m/*.
7297 This directory predates autoconf and is no longer needed nowadays.
7298 Move its few remaining bits of functionality to where they're needed.
7299 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7300 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7301 * m/template.h: Remove.
7302 * Makefile.in (M_FILE): Remove. All uses removed.
7303 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7304 * lisp.h (USE_LSB_TAG):
7305 * mem-limits.h (EXCEEDS_LISP_PTR):
7306 Use VAL_MAX, not VALBITS, in #if.
7307 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7308 (EMACS_UINT): Define unconditionally now.
7309 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7310 (BITS_PER_EMACS_INT): New constants, replacing
7311 what used to be in config.h, but not useful in #if.
7312 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7313 define them any more.
7314 (VAL_MAX): New macro.
7315 (VALMASK): Use it.
7316 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7317 BITS_PER_EMACS_INT, in #if.
7318 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7319 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7320 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7321 * s/ms-w32.h (DATA_START):
7322 Move here from removed file m/intel386.h.
7323 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7324 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7325
7326 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7327
7328 Assume C89 or later.
7329 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7330 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7331 (xrealloc):
7332 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7333 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7334 * textprop.c, tparam.c (NULL): Remove.
7335 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7336 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7337 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7338 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7339 * xterm.c (input_signal_count): Assume volatile works.
7340
7341 2012-05-21 Ken Brown <kbrown@cornell.edu>
7342
7343 * xgselect.c (xg_select): Fix first argument in call to 'select'
7344 (bug#11508).
7345
7346 2012-05-20 Ken Brown <kbrown@cornell.edu>
7347
7348 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7349 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7350
7351 2012-05-19 Ken Brown <kbrown@cornell.edu>
7352
7353 * xfns.c (x_in_use): Remove `static' qualifier.
7354 * xterm.h (x_in_use): Declare.
7355 * xgselect.c: Include xterm.h.
7356 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7357 and `display_arg' (bug#9754).
7358
7359 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7360
7361 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7362
7363 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7364 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7365
7366 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7367
7368 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7369
7370 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7371 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7372
7373 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7374 reference to image_cache->refcount.
7375 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7376
7377 2012-05-17 Juri Linkov <juri@jurta.org>
7378
7379 * search.c (Fword_search_regexp, Fword_search_backward)
7380 (Fword_search_forward, Fword_search_backward_lax)
7381 (Fword_search_forward_lax): Move functions to isearch.el
7382 (bug#10145, bug#11381).
7383
7384 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7385
7386 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7387
7388 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7389
7390 * lread.c (init_obarray): Declare Qt and Qnil as special.
7391
7392 2012-05-14 Glenn Morris <rgm@gnu.org>
7393
7394 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7395 Put "libexec" before "bin", for the sake of init_callproc_1.
7396
7397 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7400
7401 * unexaix.c: Port to more-recent AIX compilers.
7402 (report_error, report_error_1, make_hdr, copy_sym)
7403 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7404 Make arguments const char *, not char *, to avoid violations of C
7405 standard and to fix some AIX warnings reported by Gilles Pion.
7406
7407 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7408
7409 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7410 already have overlays loaded.
7411 (handle_single_display_spec): Before returning without displaying
7412 fringe bitmap, synchronize the bidi iterator with the main display
7413 iterator, by calling iterate_out_of_display_property.
7414 (iterate_out_of_display_property): Detect buffer iteration by
7415 testing that it->string is a Lisp string.
7416 (get_next_display_element): When the current object is exhausted,
7417 and there's something on it->stack, call set_iterator_to_next to
7418 proceed with what's on the stack, instead of returning zero.
7419 (set_iterator_to_next): If called at the end of a Lisp string,
7420 proceed to consider_string_end without incrementing string
7421 position. Don't increment display vector index past the end of
7422 the display vector. (Bug#11417)
7423 (pos_visible_p): Don't report a position visible when move_it_to
7424 stopped at the last line of window, which happens to be scanned
7425 backwards by the bidi iteration. (Bug#11464)
7426
7427 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7428
7429 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7430 and right-margin display specs even if the spec is invalid or we
7431 are on a TTY, and thus unable to display on the fringes.
7432 That's because the text with the property will not be displayed anyway,
7433 so we need to signal to the caller that this is a "replacing"
7434 display spec. This fixes display when the spec is invalid or we
7435 are on a TTY.
7436
7437 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7438
7439 * unexaix.c (make_hdr): Fix typo in prototype.
7440 This bug broke the build on AIX. Problem reported by Gilles Pion.
7441
7442 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7443
7444 * keyboard.c (kbd_buffer_get_event): Read special events also in
7445 batch mode. (Bug#11415)
7446
7447 2012-05-12 Glenn Morris <rgm@gnu.org>
7448
7449 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7450
7451 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7452
7453 * lisp.mk (lisp): Add newcomment.elc.
7454
7455 2012-05-12 Glenn Morris <rgm@gnu.org>
7456
7457 * Makefile.in (MKDIR_P): New, set by configure.
7458 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7459
7460 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7461
7462 Remove unused function hourglass_started.
7463 * dispextern.h (hourglass_started):
7464 * w32fns.c (hourglass_started):
7465 * xdisp.c (hourglass_started): Remove.
7466
7467 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7468
7469 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7470 Update dependencies.
7471
7472 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7473
7474 * xgselect.c (xg_select): Put maxfds+1 into a var.
7475 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7476
7477 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7478
7479 2012-05-10 Dave Abrahams <dave@boostpro.com>
7480
7481 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7482 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7483
7484 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7485
7486 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7487 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7488 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7489 Initialize xd_registered_buses.
7490
7491 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7492
7493 Untag more efficiently if USE_LSB_TAG.
7494 This is based on a proposal by YAMAMOTO Mitsuharu in
7495 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7496 For an admittedly artificial (nth 8000 longlist) benchmark on
7497 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7498 Emacs's overall text size by 1%.
7499 * lisp.h (XUNTAG): New macro.
7500 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7501 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7502 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7503 * eval.c (Fautoload):
7504 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7505 * frame.h (XFRAME): Use XUNTAG.
7506
7507 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7508 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7509 Remove unportable assumptions about print widths of types like
7510 dbus_uint32_t.
7511 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7512 intptr_t when converting between pointer and integer, to avoid GCC
7513 warnings about wrong width.
7514
7515 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7516
7517 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7518 stack for each reader_thread, instead of defaulting to 8MB
7519 determined by the linker. This avoids failures in creating
7520 subprocesses on Windows 7, see the discussion in this thread:
7521 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7522
7523 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7524
7525 Fix up display of the *Minibuf-0* buffer in the mini window.
7526 * keyboard.c (read_char): Don't clear the echo area if there's no
7527 message to clear.
7528 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7529 contents of *Minibuf-0*) if there's no message displayed in its stead.
7530
7531 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7532
7533 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7534 batch mode.
7535
7536 2012-05-06 Chong Yidong <cyd@gnu.org>
7537
7538 * lisp.mk (lisp): Update.
7539
7540 2012-05-05 Jim Meyering <meyering@redhat.com>
7541
7542 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7543
7544 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7545
7546 * data.c (PUT_ERROR): New macro.
7547 (syms_of_data): Use it. Add new error type `user-error'.
7548 * undo.c (user_error): New function.
7549 (Fprimitive_undo): Use it.
7550 * print.c (print_error_message): Adjust print style for `user-error'.
7551 * keyboard.c (user_error): New function.
7552 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7553
7554 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7555
7556 Do not limit current-time-string to years 1000..9999.
7557 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7558 (Fcurrent_time_string): Support any year that is supported by the
7559 underlying localtime representation. Don't use asctime, as it
7560 has undefined behavior for years outside the range -999..9999.
7561
7562 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7563
7564 Fix race conditions involving setenv, gmtime, localtime, asctime.
7565 Without this fix, interrupts could mess up code that uses these
7566 nonreentrant functions, since setting TZ invalidates existing
7567 tm_zone or tzname values, and since most of these functions return
7568 pointers to static storage.
7569 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7570 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7571 Grow the critical sections to include not just invoking
7572 localtime/gmtime, but also accessing these functions' results
7573 including their tm_zone values if any, and any related TZ setting.
7574 (format_time_string): Last arg is now struct tm *, not struct tm **,
7575 so that the struct tm is saved in the critical section.
7576 All callers changed. Simplify allocation of initial buffer, partly
7577 motivated by the fact that memory allocation needs to be outside
7578 the critical section.
7579
7580 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7581
7582 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7583 with RESET_INTERVAL.
7584
7585 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7586 Remove duplicated buffer name initialization.
7587
7588 2012-05-02 Jim Meyering <jim@meyering.net>
7589
7590 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7591
7592 * xfns.c (x_window): Use xstrdup (Bug#11375).
7593
7594 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7595
7596 * xdisp.c (pos_visible_p): If already at a newline from the
7597 display string before the 'while' loop, don't walk back the glyphs
7598 from it3.glyph_row. Solves assertion violation when the display
7599 string begins with a newline (egg.el). (Bug#11367)
7600
7601 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7602
7603 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7604 Move to simple.el.
7605
7606 2012-05-01 Glenn Morris <rgm@gnu.org>
7607
7608 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7609 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7610 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7611 All were removed before 23.1.
7612
7613 * dispnew.c: Remove HAVE_LIBNCURSES test;
7614 it is always true on relevant platforms.
7615
7616 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7617 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7618
7619 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7620
7621 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7622
7623 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7624 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7625 Remove.
7626
7627 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7628
7629 Do not avoid creating empty evaporating overlays (Bug#9642).
7630 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7631 That is, do not delete an evaporating overlay if it becomes
7632 empty after its bounds are adjusted to fit within its buffer.
7633 This fix caused other problems, and I'm reverting it until we get
7634 to the bottom of them.
7635
7636 2012-04-27 Chong Yidong <cyd@gnu.org>
7637
7638 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7639
7640 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7641
7642 * xdisp.c (pos_visible_p): If the window start position is beyond
7643 ZV, start the display from buffer beginning. Prevents assertion
7644 violation in init_iterator when the minibuffer window is scrolled
7645 via the scroll bar.
7646
7647 * window.c (window_scroll_pixel_based): Likewise.
7648
7649 2012-04-27 Chong Yidong <cyd@gnu.org>
7650
7651 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7652
7653 2012-04-27 Glenn Morris <rgm@gnu.org>
7654
7655 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7656 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7657
7658 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7659
7660 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7661 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7662
7663 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7664
7665 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7666 display element, check also the underlying string or buffer
7667 character. (Bug#11341)
7668
7669 * w32menu.c: Include w32heap.h.
7670 (add_menu_item): If the call to AppendMenuW (via
7671 unicode_append_menu) fails, disable Unicode menus only if we are
7672 running on Windows 9X/Me.
7673
7674 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7675
7676 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7677 (xgetint): Add missing shift for LSB tags.
7678
7679 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7680
7681 * keyboard.c (read_char): Don't wipe echo area for select window
7682 events: These might get delayed via `mouse-autoselect-window'
7683 (Bug#11304).
7684
7685 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7686
7687 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7688 manipulation of :loaded-from data.
7689
7690 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7691
7692 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7693 now a cons (bug#11311).
7694
7695 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7696
7697 Do not create empty overlays with the evaporate property (Bug#9642).
7698 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7699 if it becomes empty after its bounds are adjusted to fit within
7700 its buffer. Without this fix, in a nonempty buffer (let ((o
7701 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7702 yields an empty overlay that has the evaporate property, which is
7703 not supposed to happen.
7704
7705 Fix minor GTK3 problems found by static checking.
7706 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7707 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7708 (struct _EmacsFixedClass, emacs_fixed_get_type):
7709 Move decls here from emacsgtkfixed.h, since they needn't be public.
7710 (emacs_fixed_get_type): Now static.
7711 (emacs_fixed_class_init): Omit unused local.
7712 (emacs_fixed_child_type): Remove; unused.
7713 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7714 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7715 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7716 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7717 (EMACS_FIXED_GET_CLASS): Remove; unused.
7718 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7719
7720 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7721 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7722
7723 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7724
7725 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7726 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7727 (__malloc_size_t, __malloc_ptrdiff_t):
7728 Remove. All uses removed, replaced by the definiens if needed,
7729 since we can assume C89 or better now.
7730 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7731 (protect_malloc_state, align, get_contiguous_space)
7732 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7733 (malloc_atfork_handler_child, malloc_enable_thread)
7734 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7735 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7736 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7737 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7738 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7739 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7740 Define using prototypes, not old style.
7741 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7742 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7743 (align): Don't assume that signed integer overflow wraps around.
7744 Omit unused local var.
7745 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7746 (_free_internal_nolock, memalign, mallochook, reallochook):
7747 Omit no-longer-needed casts.
7748 (valloc): Use getpagesize, not __getpagesize.
7749 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7750 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7751
7752 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7753
7754 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7755
7756 Move functions from C to Lisp. Make non-blocking method calls
7757 the default. Implement further D-Bus standard interfaces.
7758
7759 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7760 (QCdbus_request_name_allow_replacement)
7761 (QCdbus_request_name_replace_existing)
7762 (QCdbus_request_name_do_not_queue)
7763 (QCdbus_request_name_reply_primary_owner)
7764 (QCdbus_request_name_reply_in_queue)
7765 (QCdbus_request_name_reply_exists)
7766 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7767 (QCdbus_registered_serial, QCdbus_registered_method)
7768 (QCdbus_registered_signal): New Lisp objects.
7769 (XD_DEBUG_MESSAGE): Use sizeof.
7770 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7771 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7772 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7773 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7774 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7775 (xd_signature, xd_append_arg): Allow float for integer types.
7776 (xd_get_connection_references): New function.
7777 (xd_get_connection_address): Rename from xd_initialize.
7778 Return cached address.
7779 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7780 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7781 level.
7782 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7783 Return number of refcounts.
7784 (Fdbus_get_unique_name): Make stronger parameter check.
7785 (Fdbus_message_internal): New defun.
7786 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7787 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7788 (Fdbus_send_signal, Fdbus_register_service)
7789 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7790 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7791 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7792 (Vdbus_compiled_version, Vdbus_runtime_version)
7793 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7794 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7795 (Vdbus_message_type_signal): New defvars.
7796 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7797 Adapt docstring.
7798
7799 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7800
7801 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7802 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7803 Do not assume ptrdiff_t is the same width as 'int'.
7804
7805 * alloc.c: Handle unusual debugging option combinations.
7806 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7807 since the two debugging options are incompatible.
7808 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7809 is defined.
7810 (mem_init, mem_insert, mem_insert_fixup):
7811 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7812 (NEED_MEM_INSERT): Remove; no longer needed.
7813
7814 2012-04-22 Leo Liu <sdl.web@gmail.com>
7815
7816 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7817
7818 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7819
7820 * sysdep.c [__FreeBSD__]: Minor cleanups.
7821 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7822 Use Emacs indenting style more consistently. Avoid some casts.
7823 Use 'double' consistently rather than mixing 'float' and 'double'.
7824
7825 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7826
7827 * sysdep.c (list_system_processes, system_process_attributes):
7828 Add implementation for FreeBSD (Bug#5243).
7829
7830 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7831
7832 * lisp.mk (lisp): Update.
7833
7834 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7835
7836 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7837 It is never used otherwise.
7838
7839 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7840
7841 * print.c (print_preprocess): Only check print_depth if print-circle
7842 is nil.
7843 (print_object): Check for cycles even when print-circle is nil and
7844 print-gensym is t, but only check print_depth if print-circle is nil.
7845
7846 2012-04-20 Chong Yidong <cyd@gnu.org>
7847
7848 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7849 set the status to "failed" and ensure that sentinel is run.
7850
7851 2012-04-20 Glenn Morris <rgm@gnu.org>
7852
7853 * process.c (Fset_process_inherit_coding_system_flag)
7854 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7855 (Fmake_network_process, Fmake_serial_process): Doc fix.
7856
7857 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7858
7859 * xdisp.c (string_buffer_position_lim): Limit starting position to
7860 BEGV.
7861 (set_cursor_from_row): If called for a mode-line or header-line
7862 row, return zero immediately.
7863 (try_cursor_movement): If inside continuation line, don't back up
7864 farther than the first row after the header line, if any.
7865 Don't consider the header-line row as "partially visible", even if
7866 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7867
7868 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7869
7870 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7871 (bug#11238).
7872
7873 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7874 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7875
7876 configure: new option --enable-gcc-warnings (Bug#11207)
7877 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7878 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7879 (ALL_CFLAGS): Use new macros rather than old.
7880 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7881 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7882 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7883 -Wunused-result, -Wunused-variable. This should go away once
7884 the Emacs and Gnulib regex code is merged.
7885 (xmalloc, xrealloc): Now static.
7886
7887 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7888
7889 * dired.c (Fsystem_groups): Remove unused local.
7890
7891 2012-04-17 Glenn Morris <rgm@gnu.org>
7892
7893 * dired.c (Fsystem_users): Doc fix.
7894
7895 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7896
7897 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7898 (syms_of_dired): Add them.
7899
7900 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7901
7902 Fix minor alloc.c problems found by static checking.
7903 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7904 New extern decls, to avoid calling undeclared functions.
7905 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7906 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7907 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7908 (NEED_MEM_INSERT): New macro.
7909 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7910 Remove one incorrect comment and fix another.
7911
7912 Fix minor ralloc.c problems found by static checking.
7913 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7914 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7915 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7916 (r_alloc_sbrk): Now static.
7917
7918 Improve ralloc.c interface checking.
7919 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7920 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7921 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7922 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7923 [REL_ALLOC]: ... to here, to check interface.
7924 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7925 Remove decls. This fixes an "It stinks!".
7926
7927 * alloc.c (which_symbols): Fix alignment issue / type clash.
7928
7929 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7930
7931 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7932 (struct Lisp_Misc_Any): Likewise.
7933 (struct Lisp_Free): Likewise.
7934 * alloc.c (union aligned_Lisp_Symbol): Define.
7935 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7936 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7937 (union aligned_Lisp_Misc): Define.
7938 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7939 aligned_Lisp_Misc instead of union Lisp_Misc.
7940 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7941
7942 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7943
7944 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7945 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7946 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7947 * s/netbsd.h, s/sol2-6.h:
7948 Remove definition of GC_MARK_STACK, since the default now works.
7949 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7950 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7951 no longer the default.
7952 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7953
7954 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7955
7956 * lread.c (lisp_file_lexically_bound_p):
7957 Fix hang at ";-*-\n" (bug#11238).
7958
7959 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7960
7961 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7962 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7963
7964 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7965
7966 * nsterm.m (constrainFrameRect): Always constrain when there is only
7967 one screen (Bug#10962).
7968
7969 2012-04-13 Ken Brown <kbrown@cornell.edu>
7970
7971 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7972
7973 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7974
7975 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7976
7977 2012-04-11 Daniel Colascione <dancol@dancol.org>
7978
7979 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7980 against is gone. It's better to use vfork now so that when Cygwin
7981 gains a new, working vfork, we use it automatically (bug#10398).
7982
7983 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7984
7985 * window.c (save_window_save): Obey window-point-insertion-type.
7986
7987 2012-04-11 Glenn Morris <rgm@gnu.org>
7988
7989 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7990
7991 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7992
7993 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7994
7995 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7996
7997 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7998 (force_quit_count): New var.
7999 (handle_interrupt): Use it.
8000
8001 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8002
8003 * w32.c (w32_delayed_load): Record the full path of the library
8004 being loaded (bug#10424).
8005
8006 2012-04-09 Glenn Morris <rgm@gnu.org>
8007
8008 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8009 not just in the obarray, before snarfing them. (Bug#11036)
8010
8011 * Makefile.in ($(leimdir)/leim-list.el):
8012 Pass EMACS rather than BUILT_EMACS.
8013
8014 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8015
8016 * process.c (make_process):
8017 * process.h: Add integer `gnutls_handshakes_tried' member to
8018 process struct.
8019
8020 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8021 Add convenience `GNUTLS_LOG2i' macro.
8022
8023 * gnutls.c (gnutls_log_function2i): Convenience log function.
8024 (emacs_gnutls_read): Use new log functions,
8025 `gnutls_handshakes_tried' process member, and
8026 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8027 attempts per process (connection).
8028
8029 2012-04-09 Chong Yidong <cyd@gnu.org>
8030
8031 * eval.c (Fuser_variable_p, user_variable_p_eh)
8032 (lisp_indirect_variable): Functions deleted.
8033 (Fdefvar): Caller changed.
8034
8035 * callint.c (Finteractive, Fcall_interactively):
8036 * minibuf.c (Fread_variable): Callers changed.
8037
8038 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8039
8040 * xdisp.c (set_cursor_from_row): If the display string appears in
8041 the buffer at position that is closer to point than the position
8042 after the display string, display the cursor on the first glyph of
8043 the display string. Fixes cursor display when a 'display' text
8044 property immediately follows invisible text. (Bug#11094)
8045
8046 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8047
8048 composite.c: use 'double' consistently
8049 * composite.c (get_composition_id): Use 'double' consistently
8050 instead of converting 'float' to 'double' and vice versa; this is
8051 easier to understand and avoids a GCC warning.
8052
8053 2012-04-09 Glenn Morris <rgm@gnu.org>
8054
8055 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8056 preparation for dumping it with emacs. (Bug#4789)
8057 (leimdir): New variable.
8058 ($(leimdir)/leim-list.el): New rule.
8059 (emacs$(EXEEXT)): Depend on leim-list.el.
8060
8061 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8062 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8063 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8064
8065 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8066
8067 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8068 proper alignment.
8069
8070 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8071
8072 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8073 Remove unused local variable.
8074
8075 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8076
8077 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8078 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8079 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8080 objects, as mark_maybe_pointer will catch them otherwise.
8081 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8082 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8083
8084 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8085
8086 Fix typo that broke non-Windows builds.
8087 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8088
8089 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8090
8091 Support building on MS-Windows with libxml2.
8092
8093 * makefile.w32-in (OBJ2): Add xml.$(O).
8094 (GLOBAL_SOURCES): Add xml.c.
8095 ($(BLD)/xml.$(O)): New dependency list.
8096
8097 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8098 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8099 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8100 [!WINDOWSNT]: New macros.
8101 (init_libxml2_functions, libxml2_loaded_p): New functions.
8102 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8103 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8104 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8105 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8106 linked in).
8107 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8108 Call init_libxml2_functions before calling libxml2 functions.
8109 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8110
8111 * emacs.c: Don't include libxml/parser.h.
8112 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8113 xmlCleanupParser directly.
8114
8115 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8116
8117 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8118
8119 * indent.c (Fvertical_motion): If there is a display string at
8120 point, use it.vpos to compute how many lines to backtrack after
8121 move_it_to point. (Bug#11133)
8122
8123 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8124
8125 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8126 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8127 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8128 macros related to unification of CJK characters. For the details,
8129 see the discussion following the message here:
8130 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8131
8132 2012-04-04 Chong Yidong <cyd@gnu.org>
8133
8134 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8135
8136 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8137
8138 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8139 instead of alloca. (Bug#11138)
8140
8141 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8142
8143 * w32menu.c (is_simple_dialog): Properly check lisp types.
8144 (Bug#11141)
8145
8146 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8147
8148 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8149 position we get to after a call to move_it_to fails the
8150 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8151 only if we wind up in a string from display property. (Bug#11063)
8152
8153 * window.c (Fdelete_other_windows_internal): Invalidate the row
8154 and column information about mouse highlight, so that redisplay
8155 restores it after reallocating the glyph matrices. (Bug#7464)
8156
8157 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8158 string comes from a `display' text property, use the buffer
8159 position of that property as if we actually saw that position in
8160 the row's glyphs.
8161 (move_it_by_lines): Remove the assertion that
8162 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8163 violated when there's a before-string at the beginning of a line.
8164 (Bug#11063)
8165
8166 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8167
8168 * xdisp.c (append_space_for_newline): If the default face was
8169 remapped, use the remapped face for the appended newline.
8170 (extend_face_to_end_of_line): Use the remapped default face for
8171 extending the face to the end of the line.
8172 (display_line): Call extend_face_to_end_of_line when the default
8173 face was remapped. (Bug#11068)
8174
8175 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8176
8177 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8178
8179 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8180
8181 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8182
8183 2012-03-27 Glenn Morris <rgm@gnu.org>
8184
8185 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8186 Doc fixes.
8187
8188 2012-03-26 Kenichi Handa <handa@m17n.org>
8189
8190 * dispextern.h (struct glyph): Fix previous change. Change the
8191 bit length of glyphless.ch to 25 (Bug#11082).
8192
8193 2012-03-26 Chong Yidong <cyd@gnu.org>
8194
8195 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8196 (command_loop_1): Use it; inhibit selection update for
8197 handle-select-window too (Bug#8996).
8198
8199 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8200
8201 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8202
8203 2012-03-25 Kenichi Handa <handa@m17n.org>
8204
8205 * dispextern.h (struct glyph): Change the bit length of
8206 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8207
8208 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8209
8210 * s/ms-w32.h (tzname): Include time.h before redirecting to
8211 _tzname. Fixes the MSVC build. (Bug#9960)
8212
8213 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8214
8215 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8216 characters.
8217
8218 * xterm.c (XTread_socket): Only modify handling_signal if
8219 !SYNC_INPUT. (Bug#11080)
8220
8221 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8222
8223 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8224 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8225 when fetching a multibyte character consumes more bytes than
8226 CHAR_BYTES returns, due to unification of CJK characters in
8227 string_char. (Bug#11073)
8228
8229 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8230
8231 * process.c (wait_reading_process_output): Handle pty disconnect
8232 by refraining from sending oneself a SIGCHLD (bug#10933).
8233
8234 2012-03-22 Chong Yidong <cyd@gnu.org>
8235
8236 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8237
8238 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8239 Mark string as coming from a prefix property.
8240 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8241 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8242
8243 2012-03-21 Chong Yidong <cyd@gnu.org>
8244
8245 * xfaces.c (Vface_remapping_alist): Doc fix.
8246
8247 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8248
8249 * w32proc.c (Fw32_set_console_codepage)
8250 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8251 Doc fixes.
8252
8253 2012-03-20 Chong Yidong <cyd@gnu.org>
8254
8255 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8256 to reflect default non-nil value of redisplay-dont-pause.
8257
8258 2012-03-19 Kenichi Handa <handa@m17n.org>
8259
8260 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8261 it fit in a valid range (Bug#11003).
8262
8263 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8264
8265 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8266 that is not from display property, accept the row as a "cursor
8267 row" if one of the string's character has a non-nil `cursor'
8268 property. Fixes cursor positioning when there are newlines in
8269 overlay strings, e.g. in icomplete.el. (Bug#11035)
8270
8271 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8272
8273 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8274
8275 2012-03-12 Chong Yidong <cyd@gnu.org>
8276
8277 * eval.c (inhibit_lisp_code): Rename from
8278 inhibit_window_configuration_change_hook; move from window.c.
8279
8280 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8281 * window.c (run_window_configuration_change_hook)
8282 (syms_of_window): Callers changed.
8283
8284 2012-03-11 Chong Yidong <cyd@gnu.org>
8285
8286 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8287
8288 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8289
8290 2012-03-10 Chong Yidong <cyd@gnu.org>
8291
8292 * frame.c (other_visible_frames): Don't assume the selected frame
8293 is visible (Bug#10955).
8294
8295 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8296
8297 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8298
8299 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8300
8301 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8302 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8303 zero (Bug#10954).
8304
8305 2012-03-03 Glenn Morris <rgm@gnu.org>
8306
8307 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8308
8309 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8310
8311 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8312 position past the first glyph_row that ends at ZV. (Bug#10902)
8313 (redisplay_window, next_element_from_string): Fix typos in
8314 comments.
8315 (redisplay_window): Pass to move_it_vertically the margin in
8316 pixels, not in screen lines.
8317
8318 2012-03-02 Glenn Morris <rgm@gnu.org>
8319
8320 * buffer.c (buffer-list-update-hook): Doc fix.
8321
8322 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8323
8324 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8325 push_it before setting up the iterator for the first overlay
8326 string, even if we have an empty string loaded.
8327 (next_overlay_string): If there's an empty string on the iterator
8328 stack, pop the stack. (Bug#10903)
8329
8330 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8331
8332 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8333 Suggested by Stefan Monnier in
8334 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8335 * alloc.c (widen_to_Lisp_Object): New static function.
8336 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8337 and widening them to Lisp_Objects. This would work even if
8338 USE_LSB_TAG is defined and wide integers are used, which might
8339 happen in a future version of Emacs.
8340
8341 2012-02-25 Chong Yidong <cyd@gnu.org>
8342
8343 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8344 Doc fix.
8345
8346 * xselect.c (Fx_selection_exists_p): Doc fix.
8347 (x_clipboard_manager_save_all): Print an informative message
8348 before saving to clipboard manager.
8349
8350 2012-02-24 Chong Yidong <cyd@gnu.org>
8351
8352 * keyboard.c (process_special_events): Handle all X selection
8353 requests in kbd_buffer, not just the next one (Bug#8869).
8354
8355 2012-02-23 Chong Yidong <cyd@gnu.org>
8356
8357 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8358 call when setting menu-bar-lines and tool-bar-lines parameters.
8359 (unwind_create_frame_1): New helper function.
8360
8361 * window.c (inhibit_window_configuration_change_hook): New var.
8362 (run_window_configuration_change_hook): Obey it.
8363 (syms_of_window): Initialize it.
8364
8365 2012-02-22 Chong Yidong <cyd@gnu.org>
8366
8367 * xterm.c (x_draw_image_relief): Add missing type check for
8368 Vtool_bar_button_margin (Bug#10743).
8369
8370 2012-02-21 Chong Yidong <cyd@gnu.org>
8371
8372 * fileio.c (Vfile_name_handler_alist): Doc fix.
8373
8374 * buffer.c (Fget_file_buffer): Protect against invalid file
8375 handler return value.
8376
8377 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8378
8379 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8380 when computing $valmask.
8381
8382 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8383 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8384 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8385 It's useless in that case, and it can cause problems on hosts
8386 that allocate halves of EMACS_INT values separately.
8387 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8388 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8389 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8390 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8391 it avoids undefined behavior on hosts where shifting right by more
8392 than the word width has undefined behavior.
8393
8394 2012-02-19 Chong Yidong <cyd@gnu.org>
8395
8396 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8397 (Funhandled_file_name_directory, Ffile_name_as_directory)
8398 (Fdirectory_file_name, Fexpand_file_name)
8399 (Fsubstitute_in_file_name): Protect against invalid file handler
8400 return values (Bug#10845).
8401
8402 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8403
8404 * .gdbinit (pitx): Fix incorrect references to fields of the
8405 iterator stack.
8406
8407 2012-02-17 Chong Yidong <cyd@gnu.org>
8408
8409 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8410
8411 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8412
8413 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8414 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8415
8416 2012-02-15 Chong Yidong <cyd@gnu.org>
8417
8418 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8419 marked as special. Also, starting docstrings with * is obsolete.
8420
8421 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8422
8423 * gnutls.c (emacs_gnutls_write): Fix last change.
8424
8425 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8426
8427 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8428 send_process.
8429
8430 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8431
8432 * keymap.c (Fsingle_key_description): Handle char ranges.
8433
8434 2012-02-12 Chong Yidong <cyd@gnu.org>
8435
8436 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8437 as that creates a dangerous corner case.
8438
8439 * window.c (Fdelete_window_internal): Invalidate the mouse
8440 highlight (Bug#9904).
8441
8442 2012-02-12 Glenn Morris <rgm@gnu.org>
8443
8444 * xselect.c (Fx_own_selection_internal)
8445 (Fx_get_selection_internal, Fx_disown_selection_internal)
8446 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8447 * nsselect.m (Fx_own_selection_internal)
8448 (Fx_disown_selection_internal, Fx_selection_exists_p)
8449 (Fx_selection_owner_p, Fx_get_selection_internal):
8450 Sync docs and argument specs with the xselect.c versions.
8451
8452 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8453
8454 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8455
8456 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8457
8458 * w32select.c (Fx_selection_exists_p): Sync doc string and
8459 argument list with xselect.c. (Bug#10783)
8460
8461 * w16select.c (Fx_selection_exists_p): Sync doc string and
8462 argument list with xselect.c. (Bug#10783)
8463
8464 2012-02-10 Glenn Morris <rgm@gnu.org>
8465
8466 * fns.c (Fsecure_hash): Doc fix.
8467
8468 2012-02-09 Kenichi Handa <handa@m17n.org>
8469
8470 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8471
8472 2012-02-07 Chong Yidong <cyd@gnu.org>
8473
8474 * buffer.c (Fbuffer_local_variables)
8475 (buffer_lisp_local_variables): Handle unbound vars correctly;
8476 don't let Qunbound leak into Lisp.
8477
8478 2012-02-07 Glenn Morris <rgm@gnu.org>
8479
8480 * image.c (Fimagemagick_types): Doc fix.
8481
8482 * image.c (imagemagick-render-type): Change it from a lisp object
8483 to an integer. Move the doc here from the lisp manual.
8484 Treat all values not equal to 0 the same.
8485
8486 2012-02-06 Chong Yidong <cyd@gnu.org>
8487
8488 * doc.c (store_function_docstring): Avoid applying docstring of
8489 alias to base function (Bug#2603).
8490
8491 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8492
8493 * .gdbinit (pp1, pv1): Remove redundant defines.
8494 (pr): Use pp.
8495
8496 2012-02-04 Chong Yidong <cyd@gnu.org>
8497
8498 * nsterm.m: Declare a global (Bug#10694).
8499
8500 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8501
8502 * w32.c (get_emacs_configuration_options):
8503 Include --enable-checking, if specified, in the return value.
8504
8505 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8506
8507 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8508 after rounding frame sizes. (Bug#9723)
8509
8510 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8511
8512 * keyboard.c (adjust_point_for_property): Don't position point
8513 before BEGV. (Bug#10696)
8514
8515 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8516
8517 Handle overflow when computing char display width (Bug#9496).
8518 * character.c (char_width): Return EMACS_INT, not int.
8519 (char_width, c_string_width): Check for overflow when
8520 computing the width; this is possible now that individual
8521 characters can have unbounded width. Problem introduced
8522 by merge from Emacs 23 on 2012-01-19.
8523
8524 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8525
8526 * dbusbind.c (Fdbus_register_method): Mention the return value
8527 :ignore in the docstring.
8528
8529 2012-02-02 Glenn Morris <rgm@gnu.org>
8530
8531 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8532
8533 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8534 Unconditionally set to t. (Bug#10673)
8535 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8536 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8537 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8538
8539 2012-02-02 Kenichi Handa <handa@m17n.org>
8540
8541 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8542 0, do not call append_composite_glyph.
8543
8544 2012-02-02 Kenichi Handa <handa@m17n.org>
8545
8546 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8547 NULL (Bug#6988).
8548 (x_produce_glyphs): If the component of a composition is a null
8549 string, set it->pixel_width to 1 to avoid zero-width glyph.
8550
8551 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8552
8553 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8554 first 2 arguments are identical. This makes inserting large
8555 output from a subprocess an order of magnitude faster on
8556 MS-Windows, where all sbrk'ed memory is always contiguous.
8557
8558 2012-01-31 Glenn Morris <rgm@gnu.org>
8559
8560 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8561 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8562 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8563
8564 2012-01-29 Glenn Morris <rgm@gnu.org>
8565
8566 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8567
8568 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8569
8570 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8571
8572 2012-01-28 Chong Yidong <cyd@gnu.org>
8573
8574 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8575
8576 2012-01-26 Chong Yidong <cyd@gnu.org>
8577
8578 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8579
8580 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8581 repeat counts (Bug#10507).
8582
8583 2012-01-26 Glenn Morris <rgm@gnu.org>
8584
8585 * lread.c (syms_of_lread): Doc fix.
8586
8587 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8588
8589 * coding.c (encode_designation_at_bol): Change return value to
8590 EMACS_INT.
8591
8592 2012-01-25 Chong Yidong <cyd@gnu.org>
8593
8594 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8595
8596 2012-01-21 Chong Yidong <cyd@gnu.org>
8597
8598 * floatfns.c (Fcopysign): Make the second argument non-optional,
8599 since nil is not allowed anyway.
8600
8601 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8602
8603 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8604 (send_process): Likewise.
8605
8606 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8607
8608 * window.c (save_window_save, Fcurrent_window_configuration)
8609 (Vwindow_persistent_parameters): Do not use Qstate.
8610 Rewrite doc-strings.
8611
8612 2012-01-19 Kenichi Handa <handa@m17n.org>
8613
8614 * character.c (char_width): New function.
8615 (Fchar_width, c_string_width, lisp_string_width):
8616 Use char_width (Bug#9496).
8617
8618 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8619
8620 * window.c (Vwindow_persistent_parameters): New variable.
8621 (Fset_window_configuration, save_window_save): Handle persistent
8622 window parameters.
8623
8624 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8625
8626 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8627 thrashing the stack of the thread. (Bug#9087)
8628
8629 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8630
8631 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8632
8633 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8634
8635 * xdisp.c (rows_from_pos_range): Handle the case where the
8636 highlight ends on a newline. (Bug#10464)
8637 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8638 he end column for display of highlight that ends on a newline
8639 before a R2L line.
8640
8641 2012-01-11 Glenn Morris <rgm@gnu.org>
8642
8643 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8644 from load-path also when installation-directory is nil. (Bug#10208)
8645
8646 2012-01-10 Glenn Morris <rgm@gnu.org>
8647
8648 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8649
8650 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8651 Update template values to be closer to their typical values these days.
8652
8653 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8654
8655 * xdisp.c (rows_from_pos_range): Accept additional argument
8656 DISP_STRING, and accept any glyph in a row whose object is that
8657 string as eligible for mouse highlight. Fixes mouse highlight of
8658 display strings from overlays. (Bug#10464)
8659
8660 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8661
8662 emacs: fix an auto-save permissions race condition (Bug#10400)
8663 * fileio.c (auto_saving_dir_umask): New static var.
8664 (Fmake_directory_internal): Use it.
8665 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8666 creating the directory. The old code temporarily assigns
8667 too-generous permissions to the directory.
8668 (do_auto_save_eh): Clear it.
8669 (Fdo_auto_save): Catch all errors, not just file errors, so
8670 that the var is always cleared.
8671
8672 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8673
8674 * search.c (scan_buffer): Pass character positions to
8675 know_region_cache, not byte positions. (Bug#6540)
8676
8677 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8678
8679 * w32.c (sys_rename): Report EXDEV when rename of a directory
8680 fails because the target is on another logical disk. (Bug#10284)
8681
8682 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8683
8684 * xterm.c (x_embed_request_focus): New function.
8685
8686 * xterm.h: Add prototype.
8687
8688 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8689
8690 2012-01-05 Glenn Morris <rgm@gnu.org>
8691
8692 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8693
8694 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8695
8696 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8697 Load gnutls_transport_set_lowat only if GnuTLS version is below
8698 2.11.1.
8699 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8700 GnuTLS versions below 2.11.1.
8701
8702 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8703
8704 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8705 to the doc string advising against its use for altering the way
8706 windows are scrolled.
8707
8708 2011-12-28 Kenichi Handa <handa@m17n.org>
8709
8710 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8711 coding-system ASCII compatible only when it does not produce BOM
8712 on encoding (Bug#10383).
8713
8714 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8715
8716 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8717 can scroll.
8718 (create_and_show_popup_menu): Always use menu_position_func for
8719 Gtk3 (Bug#10361).
8720
8721 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8722
8723 * callint.c (Fcall_interactively): Don't truncate prompt string.
8724
8725 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8726
8727 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8728 property that ends at ZV, so that the bidi iteration could be
8729 resumed from there (after widening). (Bug#10360)
8730
8731 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8732
8733 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8734
8735 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8736
8737 * nsterm.m (x_free_frame_resources):
8738 Release f->output_data.ns->miniimage.
8739 (ns_index_color): Fix indentation. Do not retain
8740 color_table->colors[i].
8741
8742 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8743 before returning.
8744
8745 * nsfns.m (x_set_background_color): Assign return value from
8746 ns_index_color to face-background instead of NSColor*.
8747 (ns_implicitly_set_icon_type): Fix indentation.
8748 Change assignment in for loop to comparison.
8749
8750 * emacs.c (ns_pool): New variable.
8751 (main): Assign ns_pool.
8752 (Fkill_emacs): Call ns_release_autorelease_pool.
8753
8754 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8755 autorelease fdesc, release fdAttrs and tdict.
8756 (ns_get_covering_families): Release charset.
8757 (ns_findfonts): Release NSFontDescriptor created with new.
8758 (ns_uni_to_glyphs): Fix indentation.
8759 (setString): Release attrStr before assigning new value.
8760
8761 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8762
8763 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8764 and NS_IMPL_COCOA.
8765 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8766 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8767
8768 2011-12-18 David Reitter <reitter@cmu.edu>
8769
8770 * nsterm.m (ns_term_init): Subscribe for notifications
8771 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8772 to method trackingNotification in EmacsMenu.
8773
8774 * nsmenu.m (trackingMenu): New variable.
8775 (trackingNotification): New method (from Aquamacs).
8776 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8777 from Aquamacs (Bug#7030).
8778
8779 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8780
8781 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8782 (symbol_to_nsstring): Fix indentation.
8783 (ns_symbol_to_pb): New function.
8784 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8785 (Fns_rotate_cut_buffers_internal): Remove.
8786 (Fns_store_selection_internal): Rename from
8787 Fns_store_cut_buffer_internal.
8788 (ns_get_foreign_selection, Fx_own_selection_internal)
8789 (Fx_disown_selection_internal, Fx_selection_exists_p)
8790 (Fns_get_selection_internal, Fns_store_selection_internal):
8791 Use ns_symbol_to_pb and check if return value is nil.
8792 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8793 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8794 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8795 renamed to Sns_store_selection_internal.
8796 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8797 and remove this function.
8798 (ns_handle_selection_clear): Remove, never used.
8799 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8800 here.
8801
8802 2011-12-17 Ken Brown <kbrown@cornell.edu>
8803
8804 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8805 GID is unknown (Bug#10257).
8806
8807 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8808
8809 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8810 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8811 which caused a build failure on GNU/Linux IA-64. This problem was
8812 introduced by my 2011-10-07 patch.
8813
8814 2011-12-15 Juri Linkov <juri@jurta.org>
8815
8816 * image.c (imagemagick_error): New function. (Bug#10112)
8817 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8818 Use `imagemagick_error' where ImageMagick functions return
8819 `MagickFalse'.
8820 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8821 proper order.
8822
8823 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8824
8825 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8826 fill background (Bug#8992).
8827
8828 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8829
8830 * window.c (Vwindow_combination_resize)
8831 (Vwindow_combination_limit): Use t instead of non-nil in
8832 doc-strings.
8833 (Vrecenter_redisplay): Add first sentence of doc-string on
8834 separate line.
8835 (Frecenter): Fix doc-string typo.
8836
8837 2011-12-11 Kenichi Handa <handa@m17n.org>
8838
8839 * coding.c (Funencodable_char_position): Pay attention to the
8840 buffer text relocation (Bug#9389).
8841
8842 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8843
8844 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8845 gtk_init (Bug#10100).
8846
8847 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8848
8849 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8850 IT->string is nil. (Bug#10263)
8851
8852 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8853
8854 * nsterm.h (x_free_frame_resources): Declare.
8855
8856 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8857 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8858
8859 * nsterm.h (ns_get_defaults_value): Declare.
8860
8861 * nsterm.m (ns_default): Call ns_get_defaults_value.
8862
8863 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8864
8865 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8866 (Bug#10170)
8867
8868 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8869
8870 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8871 that where the value of an _OBJC_* symbol points to is in the .bss
8872 section (Bug#10240).
8873
8874 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8875
8876 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8877 after the loop to call ccl_driver at least once (Bug#8619).
8878
8879 2011-12-08 Kenichi Handa <handa@m17n.org>
8880
8881 * ftfont.c (get_adstyle_property): Fix previous change
8882 (Bug#10233).
8883
8884 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8885
8886 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8887 dirs from the default value of EMACSLOADPATH (bug#10208).
8888
8889 2011-12-07 Glenn Morris <rgm@gnu.org>
8890
8891 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8892 installation and source directories as well. (Bug#10208)
8893
8894 2011-12-06 Chong Yidong <cyd@gnu.org>
8895
8896 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8897
8898 2011-12-06 Glenn Morris <rgm@gnu.org>
8899
8900 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8901 as an error, not just -1. (Bug#10217)
8902
8903 2011-12-05 Chong Yidong <cyd@gnu.org>
8904
8905 * keyboard.c (process_special_events): New function.
8906 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8907
8908 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8909
8910 * coding.c (encode_designation_at_bol): Don't use uninitialized
8911 local variable (Bug#9318).
8912
8913 2011-12-05 Kenichi Handa <handa@m17n.org>
8914
8915 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8916 return Qnil (Bug#8046, Bug#10193).
8917
8918 2011-12-05 Kenichi Handa <handa@m17n.org>
8919
8920 * coding.c (encode_designation_at_bol): New args charbuf_end and
8921 dst. Return the number of produced bytes. Callers changed.
8922 (coding_set_source): Return how many bytes coding->source was
8923 relocated.
8924 (coding_set_destination): Return how many bytes
8925 coding->destination was relocated.
8926 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8927 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8928
8929 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8930
8931 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8932 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8933 macro (Bug#9318).
8934
8935 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8936
8937 The following changes are to fix Bug#9318.
8938
8939 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8940 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8941 (encode_coding_iso_2022, encode_coding_sjis)
8942 (encode_coding_big5, encode_coding_charset): Use the above macros.
8943
8944 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8945
8946 * lisp.h (process_quit_flag): Fix external declaration.
8947
8948 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8949
8950 Don't macro-inline non-performance-critical code.
8951 * eval.c (process_quit_flag): New function.
8952 * lisp.h (QUIT): Use it.
8953
8954 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8955
8956 * nsfns.m (get_geometry_from_preferences): New function.
8957 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8958
8959 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8960
8961 * emacs.c (Qkill_emacs): Define.
8962 (syms_of_emacs): Initialize it.
8963 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8964 Qquit_flag to `kill-emacs' instead.
8965 (quit_throw_to_read_char): Add parameter `from_signal'.
8966 All callers changed. Call Fkill_emacs if requested and safe.
8967 * lisp.h (QUIT): Call Fkill_emacs if requested.
8968
8969 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8970
8971 * widget.c (update_wm_hints): Return if wmshell is null.
8972 (widget_update_wm_size_hints): New function.
8973
8974 * widget.h (widget_update_wm_size_hints): Declare.
8975
8976 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8977 widget_update_wm_size_hints (Bug#10104).
8978
8979 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8980
8981 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8982 before a newline, prepare the bidi iterator for consuming the
8983 newline, and keep the current paragraph direction. (Bug#10183)
8984 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8985
8986 2011-12-02 Juri Linkov <juri@jurta.org>
8987
8988 * search.c (Fword_search_regexp): New Lisp function created from
8989 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8990 (Fword_search_backward, Fword_search_forward)
8991 (Fword_search_backward_lax, Fword_search_forward_lax):
8992 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8993 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8994
8995 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8996
8997 * fileio.c (Finsert_file_contents): Move after-change-function call
8998 to before the "handled:" label, since all "goto handled" appear in
8999 cases where the *-change-functions have already been properly called
9000 (bug#10117).
9001
9002 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9003
9004 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9005 waiting for input. (Bug#10169)
9006
9007 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9008
9009 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9010 verifies glyph row's hash code--we have just reallocated the
9011 glyphs, so their contents can be complete garbage. (Bug#10164)
9012
9013 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9014
9015 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9016
9017 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9018
9019 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9020 attributes are tested _before_ calling verify_row_hash, to protect
9021 against GCC re-ordering of the tests. (Bug#10164)
9022
9023 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9024
9025 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9026
9027 * xterm.c (handle_one_xevent): Only set async_visible and friends
9028 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9029 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9030 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9031
9032 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9033
9034 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9035 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9036 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9037 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9038 All uses changed to use GCPRO1 etc.
9039 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9040 Revert to old implementation (i.e., before 2011-03-11).
9041
9042 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9043
9044 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9045 of scroll runs so as to avoid assigning disabled bogus rows and
9046 unnecessary graphics copy operations.
9047
9048 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9049
9050 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9051 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9052 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9053 (malloc, free, realloc, calloc): Redirect to e_* only when
9054 compiling Emacs.
9055
9056 * lisp.h (GCTYPEBITS): Move before first use.
9057 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9058 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9059 this macro definition.
9060
9061 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9062 _MSC_VER.
9063
9064 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9065
9066 * gtkutil.c (xg_create_frame_widgets):
9067 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9068 present with Gtk+ 2.0.
9069
9070 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9071
9072 * fileio.c (Finsert_file_contents): Undo previous change; see
9073 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9074
9075 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9076
9077 Rename locals to avoid shadowing.
9078 * fileio.c (Finsert_file_contents):
9079 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9080 * process.c (wait_reading_process_output):
9081 Rename inner 'proc' to 'p' to avoid shadowing.
9082 Indent for consistency with usual Emacs style.
9083
9084 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9085
9086 * xdisp.c (redisplay_window): If cursor row is not fully visible
9087 after recentering, and scroll-conservatively is set to a large
9088 number, scroll window by a few more lines to make the cursor fully
9089 visible and out of scroll-margin. (Bug#10105)
9090 (start_display): Don't move to the next line if the display should
9091 start at a newline that is part of a display vector or an overlay
9092 string. (Bug#10119)
9093
9094 2011-11-24 Juri Linkov <juri@jurta.org>
9095
9096 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9097 after the `MagickPingImage' call. (Bug#10112)
9098
9099 2011-11-23 Chong Yidong <cyd@gnu.org>
9100
9101 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9102
9103 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9104
9105 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9106 making another buffer current. (Bug#10114)
9107
9108 2011-11-23 Glenn Morris <rgm@gnu.org>
9109
9110 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9111
9112 2011-11-23 Chong Yidong <cyd@gnu.org>
9113
9114 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9115 using it (Bug#5984).
9116
9117 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9118
9119 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9120 and header-lines, as they don't have one computed for them.
9121 (Bug#10098)
9122
9123 * .gdbinit (prow): Make displayed values more self-explaining.
9124 Add row's hash code.
9125
9126 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9127
9128 * process.c (wait_reading_process_output): Fix asynchrounous
9129 GnuTLS socket handling on some versions of the GnuTLS library.
9130 (wait_reading_process_output): Add comment and URL.
9131
9132 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9133
9134 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9135
9136 2011-11-21 Chong Yidong <cyd@gnu.org>
9137
9138 * window.c (Fnext_window, Fprevious_window): Doc fix.
9139
9140 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9141
9142 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9143
9144 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9145
9146 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9147
9148 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9149
9150 * window.c (Fset_window_combination_limit): Rename argument
9151 STATUS to LIMIT.
9152 (Vwindow_combination_limit): Remove "status" from doc-string.
9153
9154 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9155
9156 * m/ibms390.h: Remove.
9157 * m/ibms390x.h: Don't include "ibms390.h".
9158
9159 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9160
9161 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9162 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9163
9164 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9165
9166 * casetab.c (Fset_case_table):
9167 * charset.c (Fcharset_after): Fix typos.
9168
9169 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9170
9171 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9172 Otherwise, valgrind does not work on some platforms.
9173 Problem reported by Andreas Schwab in
9174 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9175 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9176 is set, removing the need for VIRT_ADDRESS_VARIES.
9177 (PURE_P): Use a more-efficient implementation that needs just one
9178 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9179 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9180 to 4 (xorl, subq, cmpq, setbe).
9181 * alloc.c (pure): Always extern now, since that's the
9182 VIRT_ADDR_VARIES behavior.
9183 (PURE_POINTER_P): Use a single comparison, not two, for
9184 consistency with the new puresize.h.
9185 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9186 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9187 Remove VIRT_ADDR_VARIES no longer needed.
9188
9189 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9190
9191 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9192 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9193 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9194 behave as if the cursor position were at the window margin.
9195
9196 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9197 and the cursor position is out of bounds, behave as if the cursor
9198 position were at the window margin. (Bug#10075)
9199
9200 2011-11-18 Chong Yidong <cyd@gnu.org>
9201
9202 * window.c (Fwindow_combination_limit): Make first argument
9203 non-optional, since it is meaningless for live windows like the
9204 selected window.
9205
9206 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9207
9208 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9209
9210 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9211
9212 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9213 (graft_intervals_into_buffer): Simplify.
9214
9215 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9216
9217 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9218 hash values of the two rows.
9219 (copy_row_except_pointers): Preserve the used[] arrays and the
9220 hash values of the two rows. (Bug#10035)
9221 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9222
9223 * xdisp.c (row_hash): New function, body extracted from
9224 compute_line_metrics.
9225 (compute_line_metrics): Call row_hash, instead of computing the
9226 hash code inline.
9227
9228 * dispnew.c (verify_row_hash): Call row_hash for computing the
9229 hash code of a row, instead of duplicating code from xdisp.c.
9230
9231 * dispextern.h (row_hash): Add prototype.
9232
9233 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9234
9235 * frame.c (delete_frame): Don't delete the terminal when the last
9236 X frame is closed if emacs is built with GTK toolkit.
9237
9238 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9239
9240 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9241
9242 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9243
9244 * window.c (Vwindow_splits): Rename to
9245 Vwindow_combination_resize. Suggested by Juri Linkov.
9246 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9247 of Vwindow_splits.
9248
9249 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9250
9251 * nsfns.m (Fns_font_name):
9252 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9253
9254 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9255
9256 * window.h (window): Rename slot "nest" to "combination_limit".
9257 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9258 (Fset_window_nest): Rename to Fset_window_combination_limit.
9259 (Vwindow_nest): Rename to Vwindow_combination_limit.
9260 (recombine_windows, make_parent_window, make_window)
9261 (Fsplit_window_internal, saved_window)
9262 (Fset_window_configuration, save_window_save): Rename all
9263 occurrences of window_nest to window_combination_limit.
9264
9265 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9266
9267 * image.c (imagemagick_load_image): Fix typo.
9268
9269 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9270
9271 * xdisp.c (display_line): Move the call to
9272 highlight_trailing_whitespace before the call to
9273 compute_line_metrics, since the latter needs to see the final
9274 faces of all the glyphs to compute ROW's hash value.
9275 Fixes assertion violations in row_equal_p. (Bug#10035)
9276
9277 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9278
9279 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9280 just return (bug#10044).
9281
9282 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9283
9284 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9285 with user-defined heap size. Bump the default size of the temacs
9286 heap to 27MB, to avoid memory warning when running temacs.
9287 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9288
9289 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9290 current_matrix and desired_matrix. (Bug#9990)
9291 (verify_row_hash) [XASSERTS]: New function.
9292 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9293 that the hash value of glyph rows is correct.
9294
9295 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9296
9297 * window.h (window): Remove splits slot.
9298 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9299 (Fdelete_other_windows_internal, make_parent_window)
9300 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9301 (Fset_window_configuration, save_window_save): Don't deal with
9302 split status of windows.
9303 (saved_window): Remove splits slot.
9304 (Vwindow_splits): Rewrite doc-string.
9305
9306 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9307
9308 * xfns.c (unwind_create_frame):
9309 * nsfns.m (unwind_create_frame):
9310 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9311 Vframe_list (Bug#9999).
9312
9313 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9314
9315 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9316
9317 2011-11-11 Kenichi Handa <handa@m17n.org>
9318
9319 * callproc.c (Fcall_process): Set the member dst_multibyte of
9320 process_coding.
9321
9322 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9323
9324 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9325 avoid a crash (bug#9496).
9326
9327 2011-11-09 Chong Yidong <cyd@gnu.org>
9328
9329 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9330 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9331
9332 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9333
9334 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9335
9336 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9337
9338 Avoid some portability problems by eschewing 'extern inline' functions.
9339 The trivial performance wins aren't worth the portability hassles; see
9340 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9341 et seq.
9342 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9343 (window_box_width, window_box_left, window_box_left_offset)
9344 (window_box_right, window_box_right_offset): Undo previous change,
9345 by removing the "extern"s.
9346 * intervals.c (adjust_intervals_for_insertion)
9347 (adjust_intervals_for_deletion): Undo previous change,
9348 making these static again.
9349 (offset_intervals, temp_set_point_both, temp_set_point)
9350 (copy_intervals_to_string): No longer inline.
9351 * xdisp.c (window_text_bottom_y, window_box_width)
9352 (window_box_height, window_box_left_offset)
9353 (window_box_right_offset, window_box_left, window_box_right)
9354 (window_box): No longer inline.
9355
9356 2011-11-08 Chong Yidong <cyd@gnu.org>
9357
9358 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9359 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9360 Signal an error if not a live window.
9361 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9362 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9363
9364 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9365
9366 * lisp.h (syms_of_abbrev): Remove declaration.
9367 Reported by CHENG Gao <chenggao@royau.me>.
9368
9369 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9370
9371 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9372 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9373 of temacs in GUI mode.
9374
9375 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9376
9377 * window.h: Declare delete_all_child_windows instead of
9378 delete_all_subwindows.
9379 * window.c (Fwindow_nest, Fset_window_nest)
9380 (Fset_window_new_total, Fset_window_new_normal)
9381 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9382 (delete_all_subwindows): Rename to delete_all_child_windows.
9383 (Fdelete_other_windows_internal, Fset_window_configuration):
9384 Call delete_all_child_windows instead of delete_all_subwindows.
9385 * frame.c (delete_frame): Call delete_all_child_windows instead
9386 of delete_all_subwindows.
9387
9388 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9389
9390 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9391 This is also needed for porting to any host where GC_MARK_STACK is
9392 not GC_MAKE_GCPROS_NOOPS.
9393 (which_symbols): Use it.
9394
9395 2011-11-07 Kenichi Handa <handa@m17n.org>
9396
9397 * coding.c (coding_set_destination): Check coding->src_pos only
9398 when coding->src_object is a buffer (bug#9910).
9399
9400 * process.c (send_process): Set the member src_multibyte of coding
9401 to 0 (bug#9911) when sending a unibyte text.
9402
9403 * callproc.c (Fcall_process): Set the member src_multibyte of
9404 process_coding to 0 (bug#9912).
9405
9406 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9407
9408 * xmenu.c (cleanup_widget_value_tree): New function.
9409 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9410 calling free_menubar_widget_value_tree directly (Bug#9830).
9411
9412 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9413
9414 Fix some portability problems with 'inline'.
9415 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9416 (window_box_width, window_box_left, window_box_left_offset)
9417 (window_box_right, window_box_right_offset): Declare extern.
9418 Otherwise, these inline functions do not conform to C99 and
9419 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9420 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9421 * intervals.c (adjust_intervals_for_insertion)
9422 (adjust_intervals_for_deletion): Now extern, because otherwise the
9423 extern inline functions 'offset_intervals' couldn't refer to it.
9424 (static_offset_intervals): Remove.
9425 (offset_intervals): Rewrite using the old contents of
9426 static_offset_intervals. The old version didn't conform to C99
9427 because an extern inline function contained a reference to an
9428 identifier with static linkage.
9429
9430 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9431
9432 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9433 GC.
9434
9435 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9436
9437 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9438 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9439 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9440 return Qleft_to_right.
9441
9442 2011-11-06 Chong Yidong <cyd@gnu.org>
9443
9444 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9445 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9446 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9447 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9448 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9449 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9450 (Fwindow_vscroll): Doc fix.
9451 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9452 argument, since it makes no sense to pass a live window and for
9453 consistency with window-child.
9454
9455 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9456
9457 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9458 support MSVC.
9459
9460 2011-11-05 Jason Rumney <jasonr@gnu.org>
9461
9462 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9463 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9464 fonts (Bug#6029).
9465 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9466 bitwise arithmetic preventing use of unicode-sip and non-truetype
9467 opentype fonts.
9468
9469 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9470
9471 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9472 "emacs"-only part.
9473
9474 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9475 initialization code to keep similarity to xfns.c after changes
9476 from 2011-11-05.
9477
9478 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9479
9480 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9481 (unwind_create_frame): New function (Bug#9943).
9482 (Fx_create_frame): Restructure code to be more similar to the one in
9483 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9484 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9485 Move terminal->reference_count++ just before making the frame official
9486 (Bug#9943).
9487
9488 * nsterm.m (x_free_frame_resources): New function.
9489 (x_destroy_window): Move code to x_free_frame_resources.
9490
9491 * xfns.c (unwind_create_frame): Fix comment.
9492 (Fx_create_frame, x_create_tip_frame):
9493 Move terminal->reference_count++ just before making the frame
9494 official. Move initialization of image_cache_refcount and
9495 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9496
9497 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9498
9499 Support MSVC build with newer versions of Visual Studio.
9500 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9501 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9502 nt/gmake.defs.
9503
9504 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9505 which are not supported by MSVC.
9506 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9507 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9508 bitfields.
9509 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9510 types in bitfields.
9511 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9512
9513 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9514
9515 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9516
9517 Support MSVC build with newer versions of Visual Studio.
9518 * w32.c: Don't include w32api.h for MSVC.
9519 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9520
9521 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9522 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9523 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9524 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9525 e_* cousins.
9526 (alloca) [_MSC_VER]: Define to _alloca.
9527
9528 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9529
9530 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9531
9532 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9533
9534 * xdisp.c (note_mouse_highlight): If either of
9535 previous/next-single-property-change returns nil, treat that as
9536 the beginning or the end of the buffer. (Bug#9955)
9537
9538 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9539
9540 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9541 label is not null (Bug#9951).
9542 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9543 may be NULL.
9544
9545 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9546
9547 * window.c (Fwindow_body_size): Mention in the doc string that the
9548 return value is in frame's canonical units. (Bug#9949)
9549
9550 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9551
9552 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9553
9554 * w32fns.c (unwind_create_frame): If needed, free the glyph
9555 matrices of the partially constructed frame. (Bug#9943)
9556 * xfns.c (unwind_create_frame): Likewise.
9557
9558 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9559
9560 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9561 Don't stop backward scan on the continuation glyph, even though
9562 its CHARPOS is positive.
9563 (mouse_face_from_buffer_pos, note_mouse_highlight):
9564 Rename cover_string to disp_string.
9565
9566 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9567
9568 * window.c (temp_output_buffer_show): Don't use
9569 Vtemp_buffer_show_specifiers.
9570 (Vtemp_buffer_show_specifiers): Remove unused variable.
9571
9572 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9573
9574 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9575 past the beginning of the current glyph matrix.
9576
9577 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9578
9579 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9580 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9581 HAVE_GTK3 (Bug#9869).
9582
9583 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9584 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9585
9586 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9587
9588 * xterm.c: Declare x_handle_net_wm_state to return int.
9589 (handle_one_xevent): Check if we are iconified but don't have
9590 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9591 (get_current_wm_state): Return non-zero if not hidden,
9592 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9593 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9594 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9595 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9596
9597 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9598
9599 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9600 so that this new function doesn't get optimized away by a
9601 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9602
9603 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9604
9605 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9606
9607 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9608
9609 Fix the `xbytecode' command.
9610 * .gdbinit (xprintbytestr): New command.
9611 (xwhichsymbols): Rename from `which'; all callers changed.
9612 (xbytecode): Print the byte-code string as well.
9613
9614 2011-10-29 Kim Storm <storm@cua.dk>
9615
9616 * alloc.c (which_symbols): New function.
9617
9618 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9619
9620 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9621 line. (Bug#9903)
9622
9623 2011-10-29 Glenn Morris <rgm@gnu.org>
9624
9625 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9626 Not clear what it was for, and it causes various bugs. (Bug#9839)
9627
9628 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9629
9630 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9631 possible random value that matches one of those tested as
9632 condition to clear the mouse face.
9633
9634 2011-10-28 Chong Yidong <cyd@gnu.org>
9635
9636 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9637
9638 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9639
9640 * window.c (make_window): Initialize phys_cursor_on_p.
9641
9642 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9643
9644 * lisp.h (struct Lisp_Symbol): Update comments.
9645
9646 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9647
9648 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9649
9650 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9651
9652 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9653 <oslsachem@gmail.com> for helping to debug this.
9654
9655 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9656 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9657 (g_b_init_get_glyph_outline_w): New static variables.
9658 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9659 (GetGlyphOutlineW_Proc): New typedefs.
9660 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9661 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9662 New functions.
9663 (w32font_open_internal, compute_metrics):
9664 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9665 instead of calling the "wide" APIs directly.
9666
9667 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9668
9669 * w32.h (syms_of_w32font): Add prototype.
9670
9671 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9672
9673 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9674 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9675 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9676 (Fmove_to_window_line): Doc fix.
9677
9678 2011-10-27 Chong Yidong <cyd@gnu.org>
9679
9680 * process.c (make_process): Set gnutls_state to NULL.
9681
9682 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9683 non-NULL, regardless of GNUTLS_INITSTAGE.
9684 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9685 an error. Set process slots as soon as we allocate them.
9686
9687 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9688
9689 2011-10-27 Chong Yidong <cyd@gnu.org>
9690
9691 * gnutls.c (emacs_gnutls_deinit): New function.
9692 Deallocate credentials structures as well as calling gnutls_deinit.
9693 (Fgnutls_deinit, Fgnutls_boot): Use it.
9694
9695 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9696 (deactivate_process): Call emacs_gnutls_deinit.
9697
9698 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9699
9700 * image.c (x_create_x_image_and_pixmap):
9701 * w32.c (sys_rename, w32_delayed_load):
9702 * w32font.c (fill_in_logfont):
9703 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9704
9705 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9706
9707 * w32fns.c (w32_default_color_map): New function,
9708 extracted from Fw32_default_color_map.
9709 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9710
9711 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9712
9713 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9714
9715 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9716
9717 * keyboard.c (test_undefined): New function (bug#9751).
9718 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9719
9720 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9721
9722 * sysdep.c (init_sys_modes): Fix the check for the controlling
9723 terminal (Bug#6649).
9724
9725 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9726
9727 * dispextern.h (struct bidi_it): New member next_en_type.
9728
9729 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9730 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9731 current character, check also for next_en_type being WEAK_EN.
9732 (bidi_resolve_weak): Don't enter the expensive loop if the current
9733 position is before next_en_pos. Record the bidi type of the first
9734 non-ET, non-BN character we find, in addition to its position.
9735 (bidi_level_of_next_char): Invalidate next_en_type when
9736 next_en_pos is over-stepped.
9737
9738 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9739
9740 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9741 * editfns.c: Rewrite current-time-zone so that it invokes
9742 the equivalent of (format-time-string "%Z") to get the time zone name.
9743 This fixes a bug when the time zone name contains characters that
9744 need converting from the system time locale to Emacs internal format.
9745 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9746 that patch fixed format-time-string to do the conversion, but
9747 I forgot to fix current-time-zone.
9748 (format_time_string): New function, containing most of
9749 what Fformat_time_string used to contain.
9750 (Fformat_time_string): Rewrite in terms of format_time_string.
9751 This doesn't change this function's behavior.
9752 (current-time-zone): Rewrite to use format_time_string.
9753 This fixes the bug reported by Michael Schierl in
9754 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9755 Jason Rumney's 2007-06-07 change worked around this bug, but
9756 didn't fix it.
9757 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9758
9759 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9760
9761 * xdisp.c (start_display): If the character at POS is displayed
9762 via a display vector, reset IT->current.dpvec_index to zero.
9763 (try_window_reusing_current_matrix): If a line ends in a display
9764 vector or the next line starts in a display vector, continue
9765 redrawing the window even though the character position of
9766 start_row was reached.
9767 (Bug#9771, part 2)
9768
9769 2011-10-18 Chong Yidong <cyd@gnu.org>
9770
9771 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9772 with nobreak-char-display too.
9773
9774 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9775
9776 Fix part 3 of bug#9771.
9777 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9778 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9779 non-neutral characters if the current character is a paragraph
9780 separator (a.k.a. Newline). This avoids running the same
9781 expensive loop twice, once when we consume the preceding newline
9782 and the other time when the line actually needs to be displayed.
9783 Avoid the loop when we see neutrals on the base embedding level
9784 following a character whose directionality is the same as the
9785 paragraph's. This avoids running the expensive loop when a line
9786 ends in a long sequence of neutrals, like control characters.
9787 Add assertion against STRONG_AL type. Slightly rearrange code
9788 that determines the type of a neutral given the first non-neutral
9789 that follows it.
9790 (bidi_level_of_next_char): Set next_en_pos to zero when
9791 invalidating its info.
9792
9793 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9794
9795 * xdisp.c (push_display_prop): Determine whether to record string
9796 or buffer position by IT->string, not by IT->method. Allow
9797 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9798 (move_it_vertically_backward): Don't look for character position
9799 immediately after the newline when in a continuation line.
9800 (Bug#9771, part 1)
9801
9802 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9803
9804 * window.c (coordinates_in_window): Rewrite and delabelize
9805 vertical border check. (Bug#5357) (Bug#9618)
9806
9807 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9808
9809 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9810 errors in XSetWindowBorder (bug#9310).
9811
9812 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9813
9814 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9815 avoid crash when xmalloc overrun checking is enabled.
9816
9817 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9818
9819 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9820 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9821 cursor motion with <left> and <right> arrow keys.
9822
9823 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9824 some callers set that themselves.
9825
9826 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9827
9828 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9829 display string and the previous row comes from the same string and
9830 is empty. (Bug#9739) (Bug#9738)
9831
9832 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9833
9834 * doc.c (get_doc_string): Encode file name (bug#9735).
9835
9836 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9837
9838 * bidi.c (bidi_level_of_next_char):
9839 * xdisp.c (get_visually_first_element): Remove old incorrect
9840 comments regarding the Unicode Line Separator character.
9841
9842 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9843
9844 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9845
9846 * alloc.c (Fgc_status): Do not access beyond zombies array
9847 boundary if nzombies > MAX_ZOMBIES.
9848 * alloc.c (dump_zombies): Add missing format specifier.
9849
9850 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9851
9852 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9853 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9854
9855 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9856 Some packages use them to denote characters with modifiers.
9857
9858 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9859
9860 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9861 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9862 matching a pp-number. Rename parameter var to var1.
9863
9864 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9865
9866 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9867
9868 2011-10-08 Glenn Morris <rgm@gnu.org>
9869
9870 * callint.c (Fcall_interactively): Give a more explicit error for the
9871 'c' case with a non-character input. (Bug#8479)
9872
9873 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9874
9875 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9876 lines.
9877 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9878 lines that are hscrolled on the left.
9879
9880 * dispnew.c (buffer_posn_from_coords): Account for a possible
9881 presence of header-line. (Bug#4426)
9882
9883 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9884
9885 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9886 Don't advertise functionality which we discourage or doesn't work.
9887
9888 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9889
9890 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9891 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9892 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9893 this makes Emacs dump core during garbage collection on rare
9894 occasions. sizeof is obviously inferior to offsetof here, so
9895 stick with offsetof.
9896 (GC_POINTER_ALIGNMENT): New macro.
9897 (mark_memory): Omit 3rd (offset) arg; caller changed.
9898 Don't assume EMACS_INT alignment is the same as pointer alignment.
9899
9900 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9901
9902 * keyboard.c (read_key_sequence_remapped): New var.
9903 (read_key_sequence): Compute remapping in the right buffer.
9904 (command_loop_1): Use read_key_sequence's remapping directly.
9905
9906 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9907
9908 * dired.c (file_name_completion): Don't expand file name.
9909 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9910 before checking file name handler.
9911
9912 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9913 they've been requested explicitly (bug#9591).
9914
9915 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9916
9917 * keymap.c (Fsingle_key_description): Use make_specified_string
9918 instead of build_string to build string from push_key_description.
9919 (Bug#5193)
9920
9921 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9922
9923 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9924 This fixes a Y2038 bug on 64-bit hosts.
9925 * buffer.c (reset_buffer):
9926 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9927 (Fclear_buffer_auto_save_failure):
9928 Use 0, not -1, to represent an unset failure time, since time_t
9929 might not be signed.
9930
9931 Remove dependency on glibc malloc internals.
9932 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9933 Move back here from lisp.h, but with their new implementations.
9934 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9935 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9936 * charset.c (charset_table_init): New static var.
9937 (syms_of_charset): Use it instead of xmalloc. This removes a
9938 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9939 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9940 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9941 Move back to alloc.c.
9942 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9943 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9944
9945 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9946
9947 * nsterm.m (windowDidResize): Call x_set_window_size only when
9948 ns_in_resize is true. Otherwise set pixelwidth/height and
9949 call change_frame_size (Bug#9628).
9950
9951 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9952
9953 Port --enable-checking=all to Fedora 14 x86-64.
9954 * charset.c (syms_of_charset): Also account for glibc malloc's
9955 internal overhead when calculating the initial malloc maximum.
9956
9957 Port --enable-checking=all to Fedora 14 x86.
9958 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9959 Move to lisp.h.
9960 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9961 (overrun_check_realloc, overrun_check_free):
9962 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9963 That way, xmalloc returns a properly-aligned pointer even if
9964 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9965 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9966 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9967 into account when calculating the initial malloc maximum.
9968 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9969 Move here from alloc.c, so that charset.c can use it too.
9970 Properly align; the old code wasn't right for common 32-bit hosts
9971 when configured with --enable-checking=all.
9972 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9973 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9974
9975 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9976
9977 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9978 use EDOM.
9979
9980 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9981
9982 * xdisp.c (compute_display_string_end): If there's no display
9983 string at CHARPOS, return -1.
9984
9985 * bidi.c (bidi_fetch_char): When compute_display_string_end
9986 returns a negative value, treat the character as a normal
9987 character not covered by a display string. (Bug#9624)
9988
9989 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9990
9991 * lread.c (Fread_from_string): Fix typo in docstring.
9992
9993 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9994
9995 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9996 newline, reseat the iterator instead of bidi-iterating there one
9997 character at a time. (Bug#9610)
9998 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9999 TO_CHARPOS if the bidi iterator is at base embedding level.
10000
10001 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10002
10003 * lread.c (readevalloop): Use correct code for NBSP.
10004 (read1): Likewise. (Bug#9608)
10005
10006 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10007
10008 * dbusbind.c (Fdbus_register_signal): When service is not
10009 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10010
10011 2011-09-25 Glenn Morris <rgm@gnu.org>
10012
10013 * buffer.c (truncate-lines): Doc fix.
10014
10015 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10016
10017 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10018 (Fset_window_next_buffers): Doc fix.
10019
10020 2011-09-24 Glenn Morris <rgm@gnu.org>
10021
10022 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10023
10024 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10025
10026 Fix minor problems found by static checking.
10027 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10028 * indent.c (Fvertical_motion): Fix == vs = typo.
10029
10030 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10031
10032 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10033 Default value is now t. Doc fix.
10034
10035 * indent.c (Fvertical_motion): Compute and apply the overshoot
10036 logic when moving up, not only when moving down. Fix the
10037 confusing name and values of the it_overshoot_expected variable;
10038 logic changes accordingly. (Bug#9254) (Bug#9549)
10039
10040 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10041 CHARPOS is covered by a display string which includes newlines.
10042 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10043 is covered by a display string with embedded newlines.
10044
10045 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10046
10047 * dbusbind.c (Fdbus_register_signal): Add match rule to
10048 Vdbus_registered_objects_table. (Bug#9581)
10049 (Fdbus_register_method, Vdbus_registered_objects_table):
10050 Fix docstring.
10051
10052 2011-09-24 Jim Meyering <meyering@redhat.com>
10053
10054 do not ignore write error for any output size
10055 The previous change was incomplete.
10056 While it makes emacs --batch detect the vast majority of stdout
10057 write failures, errors were still ignored whenever the output size is
10058 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10059 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10060 && echo FAIL: ignored write error
10061 FAIL: ignored write error
10062 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10063 && echo FAIL: ignored write error
10064 FAIL: ignored write error
10065 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10066
10067 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10068
10069 * emacs.c (Fkill_emacs): In noninteractive mode exit
10070 non-successfully if a write error occurred on stdout. (Bug#9574)
10071
10072 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10073
10074 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10075 the xassert test.
10076
10077 * dispextern.h (struct it): Update the comment documenting what
10078 can it->OBJECT be.
10079
10080 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10081
10082 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10083 a display string, extend search for cursor position to end of row.
10084 (find_row_edges): If the row ends in a newline from a display
10085 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10086 Handle the case of a display string with multiple newlines.
10087 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10088 non-empty line. Fixes confusing cursor motion with arrow keys at
10089 the beginning of a line that starts with whitespace.
10090
10091 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10092
10093 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10094 (bug#9493).
10095
10096 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10097
10098 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10099 boolean (Bug#9154).
10100
10101 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10102
10103 * xdisp.c (display_line): Record maximum and minimum buffer
10104 positions even if no glyphs were produced (e.g., by a zero-width
10105 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10106 buffer positions that will be removed from the glyph row because
10107 they don't fit.
10108 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10109 column is beyond frame width: don't subtract 1 "pixel" when
10110 computing width of the stretch.
10111 (reseat_at_next_visible_line_start): Undo the change made on
10112 2011-09-17 that saved paragraph information and restored it after
10113 the call to `reseat'. (Bug#9545)
10114
10115 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10116
10117 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10118 and turn window cursor on if cleared (Bug#9415).
10119
10120 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10121
10122 * search.c (boyer_moore): Take unibyte characters from pattern
10123 literally. (Bug#9458)
10124
10125 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10126
10127 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10128
10129 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10130
10131 Fix minor problem found by static checking.
10132 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10133 initialized, to pacify gcc -Wuninitialized.
10134
10135 * fileio.c: Report proper errno when syscall falls.
10136 (Finsert_file_contents): Save and restore errno,
10137 so that report_file_error outputs the correct diagnostic.
10138 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10139
10140 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10141
10142 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10143
10144 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10145
10146 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10147 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10148
10149 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10150
10151 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10152 about the current paragraph and restore it after the call to reseat.
10153
10154 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10155 (bidi_find_paragraph_start): Search back for paragraph beginning
10156 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10157 (bidi_move_to_visually_next): Only trigger paragraph-related
10158 computations when the last character is a newline or at EOB, not
10159 just any NEUTRAL_B. (Bug#9470)
10160
10161 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10162 truncated lines if point is covered by a display string. (Bug#9524)
10163
10164 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10165
10166 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10167 (cons_to_x_long): New function.
10168 (lisp_data_to_selection_data): Use it. Correct the test for
10169 short-versus-long data; it was negated. Break out of vector
10170 loop, for efficiency, when a long datum is discovered.
10171
10172 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10173
10174 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10175
10176 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10177
10178 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10179 GCC PR/17406) by declaring this function with external scope.
10180
10181 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10182
10183 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10184 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10185
10186 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10187
10188 * editfns.c (Fformat): Correctly handle text properties on "%%".
10189
10190 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10191
10192 * xterm.c (x_draw_composite_glyph_string_foreground):
10193 * w32term.c (x_draw_composite_glyph_string_foreground):
10194 * term.c (encode_terminal_code):
10195 * composite.c (composition_update_it, get_composition_id):
10196 * xdisp.c (get_next_display_element)
10197 (fill_composite_glyph_string): Add comments about special meaning
10198 of TAB characters in a composition.
10199
10200 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10201
10202 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10203 This occurs when processing a multibyte format.
10204 Problem reported by Wolfgang Jenker.
10205
10206 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10207
10208 * xdisp.c (try_cursor_movement): Only check for exact match if
10209 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10210
10211 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10212
10213 Remove unused external symbols.
10214 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10215 * xdisp.c (calc_pixel_width_or_height): Now static.
10216 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10217 * indent.c (check_display_width):
10218 * w32term.c: Fix comment to match code.
10219 * xterm.c, xterm.h (x_catching_errors): Remove.
10220
10221 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10222
10223 * xselect.c: Use signed conversions more consistently (Bug#9498).
10224 (selection_data_to_lisp_data): Assume incoming selection data are
10225 signed integers, not unsigned. This is to be consistent with
10226 outgoing selection data, which was modified to use signed integers
10227 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10228 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10229 expects long, not unsigned long.
10230
10231 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10232
10233 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10234 computation of loop end. Reported by Johan Bockgård
10235 <bojohan@gnu.org>.
10236
10237 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10238
10239 * frame.c (Fother_visible_frames_p): Function deleted.
10240
10241 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10242
10243 * indent.c (compute_motion): Process display vector front to back
10244 rather than the other way around. (Bug#2496)
10245
10246 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10247
10248 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10249
10250 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10251
10252 * minibuf.c (Fread_from_minibuffer): Doc fix.
10253
10254 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10255
10256 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10257 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10258
10259 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10260
10261 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10262 value for non-existent files.
10263
10264 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10265
10266 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10267 set its "size" to -1. This will set the modtime_size field of
10268 the corresponding buffer to -1, which is what
10269 verify-visited-file-modtime expects for files that do not exist.
10270 (Bug#9139)
10271
10272 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10273
10274 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10275 here ...
10276 * lisp.h: ... from here. push_key_description is no longer
10277 defined in keyboard.c, so its declaration should not be in
10278 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10279 logically belongs with push_key_description.
10280
10281 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10282
10283 * buffer.h: Include <sys/types.h> instead of <time.h>.
10284 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10285 Problem reported by Herbert J. Skuhra.
10286
10287 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10288
10289 * xml.c (parse_region): Make the parsing work for
10290 non-comment-starting XML files again (bug#9144).
10291
10292 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10293
10294 * image.c (gif_load): Fix calculation of bottom and right corner.
10295 (Bug#9468)
10296
10297 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10298
10299 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10300 redisplay in small windows.
10301
10302 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10303
10304 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10305
10306 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10307
10308 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10309 Operate on live windows only.
10310
10311 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10312
10313 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10314
10315 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10316
10317 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10318 only under bidi iteration.
10319
10320 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10321
10322 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10323
10324 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10325
10326 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10327 Without this fix, the command to link temacs failed due to an
10328 undefined symbol __builtin_isnan. This is because
10329 /usr/include/iso/math_c99.h #defines isnan(x) to
10330 __builtin_isnan(x), but the bundled gcc, which identifies itself
10331 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10332 a __builtin_isnan.
10333 * floatfns.c (isnan): #undef, and then #define to a clone of
10334 what's in data.c.
10335 (Fisnan): Always define, since it's always available now.
10336 (syms_of_floatfns): Always define isnan at the Lisp level.
10337
10338 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10339
10340 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10341
10342 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10343
10344 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10345 The previous code assumed that file offsets (off_t values) fit in
10346 EMACS_INT variables, which is not true on typical 32-bit hosts.
10347 The code messed up by falsely reporting buffer overflow in cases
10348 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10349 when "big" contains more than 2**29 bytes, even though this
10350 inserts just one byte and does not overflow the buffer.
10351 (Finsert_file_contents): Store file offsets as off_t
10352 values, not as EMACS_INT values. Check for overflow when
10353 converting between EMACS_INT and off_t. When checking for
10354 buffer overflow or for overlap, take the offsets into account.
10355 Don't use EMACS_INT for small values where int suffices.
10356 When checking for overlap, fix a typo: ZV was used where
10357 ZV_BYTE was intended.
10358 (Fwrite_region): Don't assume off_t fits into 'long'.
10359 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10360
10361 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10362
10363 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10364
10365 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10366
10367 sprintf-related integer and memory overflow issues (Bug#9412).
10368
10369 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10370 (esprintf, exprintf, evxprintf): New functions.
10371 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10372 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10373 (modify_event_symbol): Do not assume that the length of
10374 name_alist_or_stem is safe to alloca and fits in int.
10375 (Fexecute_extended_command): Likewise for function name and binding.
10376 (Frecursion_depth): Wrap around reliably on integer overflow.
10377 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10378 since some callers pass EMACS_INT values.
10379 (Fsingle_key_description): Don't crash if symbol name contains more
10380 than MAX_ALLOCA bytes.
10381 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10382 (get_minibuffer): Arg is now EMACS_INT, not int.
10383 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10384 (esprintf, exprintf, evxprintf): New decls.
10385 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10386
10387 * dbusbind.c (signature_cat): New function.
10388 (xd_signature, Fdbus_register_signal):
10389 Do not overrun buffer; instead, report string overflow.
10390
10391 * dispnew.c (add_window_display_history): Don't overrun buffer.
10392 Truncate instead; this is OK since it's just a log.
10393
10394 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10395 even if the time zone offset is outlandishly large.
10396 Don't mishandle offset == INT_MIN.
10397
10398 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10399 when creating daemon; the previous buffer-overflow check was incorrect.
10400
10401 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10402 which has the guts of the old verror function.
10403
10404 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10405 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10406
10407 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10408 (font_unparse_xlfd): Don't blindly alloca long strings.
10409 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10410 fits in int, when using sprintf. Use single snprintf to count
10411 length of string rather than counting it via multiple sprintfs;
10412 that's simpler and more reliable.
10413 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10414 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10415 sprintf, in case result does not fit in int.
10416
10417 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10418 (fontset_from_font): Print it.
10419
10420 * frame.c (tty_frame_count): Now printmax_t, not int.
10421 (make_terminal_frame, set_term_frame_name): Print it.
10422 (x_report_frame_params): In X, window IDs are unsigned long,
10423 not signed long, so print them as unsigned.
10424 (validate_x_resource_name): Check for implausibly long names,
10425 and don't assume name length fits in 'int'.
10426 (x_get_resource_string): Don't blindly alloca invocation name;
10427 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10428 not fit in int.
10429
10430 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10431 (xg_check_special_colors, xg_set_geometry):
10432 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10433
10434 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10435 Use esprintf, not sprintf, in case result does not fit in int.
10436
10437 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10438 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10439 it as a large positive number.
10440 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10441 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10442
10443 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10444 in case result does not fit in int.
10445
10446 * print.c (float_to_string): Detect width overflow more reliably.
10447 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10448 buffer overrun. Don't assume list length fits in 'int'. Treat
10449 print length of 0 as 0, not as infinity; to be consistent with other
10450 uses of print length in this function. Don't overflow print length
10451 index. Don't assume hash table size fits in 'long', or that
10452 vectorlike size fits in 'unsigned long'.
10453
10454 * process.c (make_process): Use printmax_t, not int, to format
10455 process-name gensyms.
10456
10457 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10458
10459 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10460 to avoid potential buffer overrun.
10461
10462 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10463 if X resource line is longer than 512 bytes.
10464
10465 * xfns.c (x_window): Make sprintf buffer a bit bigger
10466 to avoid potential buffer overrun.
10467
10468 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10469
10470 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10471
10472 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10473
10474 Integer overflow fixes for scrolling, etc.
10475 Without these, Emacs silently mishandles large integers sometimes.
10476 For example, "C-u 4294967297 M-x recenter" was treated as if
10477 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10478
10479 * xdisp.c (try_window_id): Check Emacs fixnum range before
10480 converting to 'int'.
10481
10482 * window.c (window_scroll_line_based, Frecenter):
10483 Check that an Emacs fixnum is in range before assigning it to 'int'.
10484 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10485 values converted from Emacs fixnums.
10486 (Frecenter): Don't wrap around a line count if it is out of 'int'
10487 range; instead, treat it as an extreme value.
10488 (Fset_window_configuration, compare_window_configurations):
10489 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10490
10491 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10492 that can exceed INT_MAX. Check that EMACS_INT value is in range
10493 before assigning it to the (possibly-narrower) index.
10494 (match_limit): Don't assume that a fixnum can fit in 'int'.
10495
10496 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10497 exceed INT_MAX.
10498
10499 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10500 (Fvertical_motion): Don't wrap around LINES values that don't fit
10501 in 'int'. Instead, treat them as extreme values. This is good
10502 enough for windows, which can't have more than INT_MAX lines anyway.
10503
10504 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10505
10506 * Require libxml/parser.h to avoid compilation warning.
10507
10508 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10509
10510 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10511 since this reportedly can destroy thread storage.
10512
10513 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10514
10515 * syntax.c (find_defun_start): Update all cache variables if
10516 exiting early (Bug#9401).
10517
10518 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10519
10520 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10521
10522 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10523 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10524 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10525
10526 * term.c (tty_append_glyph): New function.
10527 (produce_stretch_glyph): Static function and its prototype deleted.
10528
10529 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10530 Add prototypes.
10531
10532 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10533
10534 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10535 when checking :margin (Bug#9390).
10536 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10537 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10538 so that the name doesn't mislead. All uses changed.
10539
10540 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10541
10542 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10543 set_tty_hooks.
10544
10545 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10546
10547 * xdisp.c (move_it_to): Don't bail out early when reaching
10548 position beyond to_charpos, if we are scanning backwards.
10549 (move_it_vertically_backward): When DY == 0, make sure we get to
10550 the first character in the line after the newline.
10551
10552 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10553
10554 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10555 (ccl_driver): Do not generate an out-of-range pointer.
10556 (Fccl_execute_on_string): Remove unnecessary check for
10557 integer overflow, noted by Stefan Monnier in
10558 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10559 Remove a FIXME that didn't need fixing.
10560 Simplify the newly-introduced buffer reallocation code.
10561
10562 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10563
10564 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10565
10566 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10567
10568 Integer and memory overflow issues (Bug#9196).
10569
10570 * doc.c (get_doc_string): Rework so that
10571 get_doc_string_buffer_size is the actual buffer size, rather than
10572 being 1 less than the actual buffer size; this makes xpalloc more
10573 convenient.
10574
10575 * image.c (x_allocate_bitmap_record, cache_image):
10576 * xselect.c (Fx_register_dnd_atom):
10577 Simplify previous changes by using xpalloc.
10578
10579 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10580 since either will do and ptrdiff_t is convenient with xpalloc.
10581
10582 * charset.c (charset_table_size)
10583 (struct charset_sort_data.priority): Now ptrdiff_t.
10584 (charset_compare): Don't overflow if priorities differ greatly.
10585 (Fsort_charsets): Don't assume list length fits in int.
10586 Check for size-calculation overflow when allocating sort data.
10587 (syms_of_charset): Allocate an initial charset table that is
10588 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10589
10590 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10591
10592 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10593 The actual value is always <= INT_MAX, and leaving it unsigned made
10594 overflow checking harder.
10595
10596 * dispextern.h (struct glyph_matrix.rows_allocated)
10597 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10598 with xpalloc. The values are still always <= INT_MAX.
10599
10600 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10601
10602 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10603 (SAFE_NALLOCA): New macro.
10604
10605 * region-cache.c (struct boundary.pos, find_cache_boundary)
10606 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10607 (set_cache_region, invalidate_region_cache)
10608 (revalidate_region_cache, know_region_cache, region_cache_forward)
10609 (region_cache_backward, pp_cache):
10610 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10611 so that ptrdiff_t * can be passed to xpalloc.
10612 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10613 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10614 (pp_cache): Don't assume cache_len fits in int.
10615 * region-cache.h: Adjust extern decls to match.
10616
10617 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10618 EMACS_INT, since either will do, for xpalloc.
10619
10620 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10621 (xnmalloc, xnrealloc, xpalloc): New functions.
10622
10623 * bidi.c (bidi_shelve_header_size): New constant.
10624 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10625 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10626
10627 * bidi.c (bidi_cache_shrink):
10628 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10629 (overlay_strings):
10630 Don't update size of array until after memory allocation succeeds,
10631 because xmalloc/xrealloc may not return.
10632 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10633 now that we have proper integer overflow checking.
10634 (record_overlay_string, overlay_strings): Catch overflows when
10635 calculating size of overlay_str_buf.
10636
10637 * callproc.c (Fcall_process): Check for size overflow when
10638 calculating size of args2.
10639 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10640 Normally we prefer signed values, but sticking with ptrdiff_t would
10641 require adding more-complicated checks.
10642
10643 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10644 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10645 Redo buffer-overflow calculations to avoid integer overflow.
10646 Add a FIXME comment where memory seems to be over-allocated.
10647
10648 * character.c (Fstring): Check for size-calculation overflow.
10649
10650 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10651 unnecessary integer overflow. Check for size overflow.
10652 (encode_coding_object): Don't update size until xmalloc succeeds.
10653
10654 * composite.c (get_composition_id): Check for overflow in glyph
10655 length calculations.
10656
10657 Integer and memory overflow fixes for display code.
10658 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10659 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10660 (scrolling_window): Check for overflow in size calculations.
10661 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10662 Don't assume glyph table len fits in int.
10663 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10664 (row_table_size): Now ptrdiff_t, not int.
10665 (scrolling_window): Avoid overflow in size calculations.
10666 Don't update size until allocation succeeds.
10667 * fns.c (concat): Check for overflow in size calculations.
10668 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10669 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10670 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10671
10672 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10673 (get_doc_string): Check for size calculation overflow.
10674 Don't update size until allocation succeeds.
10675 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10676 EMACS_INT, where ptrdiff_t will do.
10677 (Fsubstitute_command_keys): Check for string overflow.
10678
10679 * editfns.c (set_time_zone_rule): Don't assume environment length
10680 fits in int.
10681 (message_length): Now ptrdiff_t, not int.
10682 (Fmessage_box): Don't update size until allocation succeeds.
10683 Don't assume message length fits in int.
10684 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10685
10686 * emacs.c (main): Do not reallocate argv, since there is a null at
10687 the end that can be overwritten, and this way there's no need to
10688 worry about size-calculation overflow.
10689 (sort_args): Check for size-calculation overflow.
10690
10691 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10692 alloc succeeds.
10693 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10694
10695 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10696 (x_set_scroll_bar_width, x_figure_window_size):
10697 Check for integer overflow.
10698 (x_set_alpha): Do not assume XINT fits in int.
10699
10700 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10701 This is for the members text_lines, text_cols, total_lines, total_cols,
10702 where the system imposes an 'int' limit.
10703
10704 * fringe.c (Fdefine_fringe_bitmap):
10705 Don't update size until alloc works.
10706
10707 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10708 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10709
10710 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10711 Check for size-calculation overflow.
10712 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10713 do, as we prefer signed integers.
10714 (id_to_widget.max_size, id_to_widget.used)
10715 (xg_store_widget_in_map, xg_remove_widget_from_map)
10716 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10717 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10718 Use and return ptrdiff_t, not int.
10719 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10720 * gtkutil.h: Change prototypes to match the above.
10721
10722 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10723 are duplicate now that they've been promoted to lisp.h.
10724 (x_allocate_bitmap_record, x_alloc_image_color)
10725 (make_image_cache, cache_image, xpm_load):
10726 Don't update size until alloc is done.
10727 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10728 (x_detect_edges):
10729 Check for size calculation overflow.
10730 (ct_colors_allocated_max): New constant.
10731 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10732 overflow.
10733
10734 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10735 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10736 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10737 Use ptrdiff_t, not int, to count maps.
10738 (read_char_minibuf_menu_prompt): Check for overflow in size
10739 calculations. Don't update size until allocation succeeds.
10740 Redo calculations to avoid overflow.
10741 * keyboard.h: Change prototypes to match the above.
10742
10743 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10744 to count maps.
10745 (current_minor_maps): Check for size calculation overflow.
10746 * keymap.h: Change prototypes to match the above.
10747
10748 * lread.c (read1, init_obarray): Don't update size until alloc done.
10749
10750 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10751 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10752
10753 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10754 Now ptrdiff_t, not int.
10755 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10756 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10757
10758 * process.c (Fnetwork_interface_list): Check for overflow
10759 in size calculation.
10760
10761 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10762
10763 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10764 overflow. Don't bother calling xmalloc when xrealloc will do.
10765
10766 * search.c (Freplace_match): Check for size calculation overflow.
10767 (Fset_match_data): Don't assume list lengths fit in 'int'.
10768
10769 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10770 for command line length. Do not attempt to address one before the
10771 beginning of an array, as that's not portable.
10772
10773 * term.c (max_frame_lines): Remove; unused.
10774 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10775 not int.
10776 (encode_terminal_code, calculate_costs): Check for size
10777 calculation overflow.
10778 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10779 table lengths and related sizes. Don't update size until alloc
10780 done. Redo calculations to avoid overflow.
10781 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10782
10783 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10784 subtracting pointers.
10785 (gobble_line): Check for overflow more carefully. Don't update size
10786 until alloc done.
10787
10788 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10789 Don't update size until alloc done.
10790 Redo size calculations to avoid overflow.
10791 Check for size calculation overflow.
10792 (main) [DEBUG]: Fix typo in invoking tparam1.
10793
10794 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10795 Use ptrdiff_t, not int, for sizes.
10796 (store_mode_line_noprop_char): Don't update size until alloc done.
10797
10798 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10799 Use ptrdiff_t, not int, for sizes.
10800 (Finternal_make_lisp_face, cache_face):
10801 Check for size calculation overflow.
10802 (cache_face): Treat size calculation overflows as if they were
10803 memory exhaustion (the usual treatment), rather than aborting.
10804
10805 * xfns.c (x_encode_text, x_set_name_internal)
10806 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10807 sizes, since they can exceed INT_MAX in size. Check for size
10808 calculation overflow.
10809
10810 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10811 (xg_select): Check for size calculation overflow.
10812 Don't update size until alloc done.
10813
10814 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10815 as sprintf is limited to int lengths.
10816
10817 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10818 (X_LONG_MIN): New macros.
10819 Use them to make the following changes clearer.
10820 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10821 This change doesn't affect the value now, but it may help remind
10822 future maintainers not to raise the value too much later.
10823 (SELECTION_QUANTUM): Remove, replacing with ...
10824 (selection_quantum): ... new function, which avoids overflow.
10825 All uses changed.
10826 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10827 assumption that selection length fits in 'int'.
10828 (x_reply_selection_request, x_handle_selection_request)
10829 (x_get_window_property, receive_incremental_selection)
10830 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10831 (lisp_data_to_selection_data, clean_local_selection_data):
10832 Use ptrdiff_t, not int, to record length of selection.
10833 (x_reply_selection_request, x_get_window_property)
10834 (receive_incremental_selection, x_property_data_to_lisp):
10835 Redo calculations to avoid overflow.
10836 (x_reply_selection_request): When sending hint, ceiling it at
10837 X_LONG_MAX rather than relying on wraparound overflow to send
10838 something.
10839 (x_get_window_property, receive_incremental_selection)
10840 (lisp_data_to_selection_data, x_property_data_to_lisp):
10841 Check for size-calculation overflow.
10842 (x_get_window_property, receive_incremental_selection)
10843 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10844 Don't store size until memory allocation succeeds.
10845 (x_get_window_property): Plug memory leak on memory exhaustion.
10846 Don't double-block input; malloc is safe here. Don't assume 2**34
10847 - 4 fits in unsigned long. Add an xassert to check
10848 XGetWindowProperty overflow. Be more careful about overflow
10849 calculations, and distinguish size from memory overflow better.
10850 (receive_incremental_selection): When tracing, don't assume
10851 unsigned int is less than INT_MAX.
10852 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10853 harmful) conversions of unsigned short to int.
10854 (lisp_data_to_selection_data): Don't assume that integers
10855 in the range -65535 through -1 fit in an X unsigned short.
10856 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10857 result parameters unless successful. Rely on cons_to_unsigned
10858 to report problems with elements; the old code wasn't right anyway.
10859 (x_check_property_data): Check for int overflow; we cannot use
10860 a wider type due to X limits.
10861 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10862
10863 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10864
10865 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10866 (x_term_init): Check for size calculation overflow.
10867 (x_color_cells): Don't store size until memory allocation succeeds.
10868 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10869 Don't assume alloca size is less than MAX_ALLOCA.
10870 (x_term_init): Don't assume length fits in int (sprintf is limited
10871 to int size).
10872
10873 Use ptrdiff_t for composition IDs.
10874 * character.c (lisp_string_width):
10875 * composite.c (composition_table_size, n_compositions)
10876 (get_composition_id, composition_gstring_from_id):
10877 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10878 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10879 * window.c (Frecenter):
10880 Use ptrdiff_t, not int, for composition IDs.
10881 * composite.c (get_composition_id): Check for integer overflow.
10882 * composite.h: Adjust prototypes to match the above changes.
10883
10884 Use ptrdiff_t for hash table indexes.
10885 * category.c (hash_get_category_set):
10886 * ccl.c (ccl_driver):
10887 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10888 * coding.c (coding_system_charset_list, detect_coding_system):
10889 * coding.h (struct coding_system.id):
10890 * composite.c (get_composition_id, gstring_lookup_cache):
10891 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10892 * image.c (xpm_get_color_table_h):
10893 * lisp.h (hash_lookup, hash_put):
10894 * minibuf.c (Ftest_completion):
10895 Use ptrdiff_t for hash table indexes, not int (which is too
10896 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10897 32-bit --with-wide-int hosts).
10898
10899 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10900 Add a FIXME comment about memory leaks.
10901 (syms_of_charset): Don't assume xmalloc returns.
10902
10903 Don't assume that stated character widths fit in int.
10904 * character.c (Fchar_width, c_string_width, lisp_string_width):
10905 * character.h (CHAR_WIDTH):
10906 * indent.c (MULTIBYTE_BYTES_WIDTH):
10907 Use sanitize_char_width to avoid undefined and/or bad behavior
10908 with outlandish widths.
10909 * character.h (sanitize_tab_width): Rename from sanitize_width,
10910 now that we have two such functions. All uses changed.
10911 (sanitize_char_width): New inline function.
10912
10913 Don't assume that tab-width fits in int.
10914 * character.h (sanitize_width): New inline function.
10915 (SANE_TAB_WIDTH): New macro.
10916 (ASCII_CHAR_WIDTH): Use it.
10917 * indent.c (sane_tab_width): Remove. All uses replaced by
10918 SANE_TAB_WIDTH (current_buffer).
10919 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10920
10921 * fileio.c: Integer overflow issues with file modes.
10922 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10923
10924 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10925 Remove unreachable code.
10926 (read_hex, load_charset_map_from_file): Check for integer overflow.
10927
10928 * xterm.c: Don't go over XClientMessageEvent limit.
10929 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10930 (x_send_scroll_bar_event): Likewise. Check that the size does not
10931 exceed limits imposed by XClientMessageEvent, as well as the usual
10932 ptrdiff_t and size_t limits.
10933
10934 * keyboard.c: Overflow, signedness and related fixes.
10935 (make_lispy_movement): Use same integer type in forward decl
10936 that is used in the definition.
10937 (read_key_sequence, keyremap_step):
10938 Change bufsize argument back to int, undoing my 2011-03-30 change.
10939 We prefer signed types, and int is wide enough here.
10940 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10941 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10942 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10943 length, not size_t. Use ptrdiff_t for index, not int.
10944 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10945 possibility of integer overflow.
10946
10947 Overflow, signedness and related fixes for images.
10948
10949 * dispextern.h (struct it.stack[0].u.image.image_id)
10950 (struct_it.image_id, struct image.id, struct image_cache.size)
10951 (struct image_cache.used, struct image_cache.ref_count):
10952 * gtkutil.c (update_frame_tool_bar):
10953 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10954 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10955 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10956 * nsmenu.m (update_frame_tool_bar):
10957 * xdisp.c (calc_pixel_width_or_height):
10958 * xfns.c (image_cache_refcount):
10959 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10960 on typical 64-bit hosts.
10961
10962 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10963 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10964 Omit unnecessary casts to int.
10965 (parse_image_spec): Check that integers fall into 'int' range
10966 when the callers expect that.
10967 (image_ascent): Redo ascent calculation to avoid int overflow.
10968 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10969 (lookup_image): Remove unnecessary tests.
10970 (xbm_image_p): Locals are now of int, not EMACS_INT,
10971 since parse_image_check makes sure they fit into int.
10972 (png_load, gif_load, svg_load_image):
10973 Prefer int to unsigned where either will do.
10974 (tiff_handler): New function, combining the cores of the
10975 old tiff_error_handler and tiff_warning_handler.
10976 This function is rewritten to use vsnprintf and thereby avoid
10977 stack buffer overflows. It uses only the features of vsnprintf
10978 that are common to both POSIX and native Microsoft.
10979 (tiff_error_handler, tiff_warning_handler): Use it.
10980 (tiff_load, gif_load, imagemagick_load_image):
10981 Don't assume :index value fits in 'int'.
10982 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10983 (imagemagick_load_image): Check that crop parameters fit into
10984 the integer types that MagickCropImage accepts. Don't assume
10985 Vimagemagick_render_type has a nonnegative value. Don't assume
10986 size_t fits in 'long'.
10987 (gs_load): Use printmax_t to print the widest integers possible.
10988 Check for integer overflow when computing image height and width.
10989
10990 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10991
10992 * xdisp.c (redisplay_window): Don't force window start if point
10993 will be invisible in the resulting window. (Bug#9324)
10994
10995 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10996
10997 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10998 the display spec is of the form `(space ...)'.
10999 (handle_display_spec): Return the value returned by
11000 handle_single_display_spec, not just 1 or zero.
11001 (handle_single_display_spec): If the display spec is of the form
11002 `(space ...)', and specifies display in the text area, return 2
11003 rather than 1.
11004 (try_cursor_movement): Check for the need to scroll more
11005 accurately, and prefer exact match for point under bidi.
11006 Don't advance `row' beyond the last row of the window.
11007
11008 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11009 into disp_prop; all users changed.
11010
11011 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11012 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11013 for the text covered by the display property.
11014
11015 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11016
11017 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11018 Change return value to nil.
11019 (Frecord_buffer): Delete unused function.
11020
11021 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11022
11023 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11024 buffers, return left-to-right.
11025 (set_cursor_from_row): Consider candidate row a win if its glyph
11026 represents a newline and point is on that newline. Fixes cursor
11027 positioning on the newline at EOL of R2L text within L2R
11028 paragraph, and vice versa.
11029 (try_cursor_movement): Check continued rows, in addition to
11030 continuation rows. Fixes unwarranted scroll when point enters a
11031 continued line of R2L text within an L2R paragraph, or vice versa.
11032 (cursor_row_p): Consider the case of point being equal to
11033 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11034 from the end of a short line to the beginning of a continued line
11035 of R2L text within L2R paragraph.
11036 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11037 composed characters.
11038
11039 * bidi.c (bidi_check_type): Use xassert.
11040 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11041 members.
11042
11043 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11044
11045 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11046 a character.
11047
11048 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11049
11050 * nsfont.m (ns_otf_to_script): Fix typo.
11051
11052 2011-08-22 Kenichi Handa <handa@m17n.org>
11053
11054 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11055 extra slot even if the purpose is char-code-property-table.
11056
11057 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11058
11059 * xdisp.c (redisplay_window): When computing centering_position,
11060 account for the height of the header line. (Bug#8874)
11061
11062 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11063 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11064 candidate is selected by the mouse, and that candidate has a
11065 composed character under the mouse.
11066
11067 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11068 coordinates reported by pos-visible-in-window-p for a composed
11069 character in column zero.
11070
11071 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11072
11073 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11074
11075 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11076
11077 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11078 consider it a hit if to_charpos is anywhere in the range of the
11079 composed buffer positions.
11080
11081 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11082
11083 * image.c (gif_load): Don't assume that each subimage has the same
11084 dimensions as the base image. Handle disposal method that is
11085 "undefined" by the gif spec (Bug#9335).
11086
11087 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11088
11089 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11090 (Fcondition_case): Document `debug' symbol in error handler.
11091
11092 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11093
11094 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11095 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11096 from an Org mode buffer to a Speedbar frame.
11097
11098 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11099 a composition, take its buffer position from IT->cmp_it.charpos.
11100 Fixes cursor positioning at the beginning of a line that begins
11101 with a composed character.
11102
11103 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11104
11105 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11106 character bidirectional type, use STRONG_L instead. Fixes crashes
11107 in a buffer produced by `describe-categories'.
11108
11109 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11110 members before the level stack, so they would be saved and
11111 restored when copying iterator state. Fixes incorrect reordering
11112 around TABs covered by display properties.
11113
11114 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11115
11116 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11117
11118 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11119
11120 * eval.c (internal_condition_case, internal_condition_case_1)
11121 (internal_condition_case_2, internal_condition_case_n):
11122 Remove unnecessary aborts (Bug#9081).
11123
11124 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11125
11126 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11127 has no `load' handler, try opening the file locally. (Bug#9311)
11128
11129 2011-08-16 Ken Brown <kbrown@cornell.edu>
11130
11131 * gmalloc.c: Expand comment.
11132
11133 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11134
11135 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11136 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11137
11138 2011-08-16 Ken Brown <kbrown@cornell.edu>
11139
11140 Fix memory allocation problems in Cygwin build (Bug#9273).
11141
11142 * unexcw.c ( __malloc_initialized): Declare external variable.
11143 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11144
11145 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11146 New variables.
11147 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11148 dumped emacs.
11149 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11150 in the static heap.
11151 [CYGWIN] (special_realloc): New function.
11152 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11153 requests to realloc storage in the static heap.
11154
11155 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11156
11157 * bidi.c (bidi_initialize): Remove unused local.
11158
11159 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11160
11161 * bidimirror.h:
11162 * biditype.h: Remove file.
11163 * makefile.w32-in ($(BLD)/bidi.$(O)):
11164 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11165
11166 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11167
11168 * chartab.c: Improve commentary for the uniprop_table API.
11169
11170 * bidi.c (bidi_paragraph_init): Support zero value of
11171 bidi_ignore_explicit_marks_for_paragraph_level.
11172 (bidi_initialize): Use uniprop_table instead of including
11173 biditype.h and bidimirror.h.
11174
11175 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11176 coordinates of the iterator when restoring from ppos_it.
11177 (Bug#9296)
11178
11179 2011-08-14 Kenichi Handa <handa@m17n.org>
11180
11181 * process.c (create_process): Call setup_process_coding_systems
11182 after the pid of the process is set to -1 (Bug#8162).
11183
11184 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11185
11186 * xdisp.c (move_it_in_display_line_to): Don't invoke
11187 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11188 ppos_it. Fixes vertical cursor motion when line beginning is
11189 covered by an image. (Bug#9296)
11190
11191 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11192
11193 * nsterm.h (ns_run_ascript): Declare.
11194 (NSAPP_DATA2_RUNASSCRIPT): Define.
11195
11196 * nsfns.m (as_script, as_result, as_status): New static variables.
11197 (ns_run_ascript): New function.
11198 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11199 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11200 the event loop. Get status from as_status (Bug#7276).
11201
11202 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11203 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11204 the event loop (Bug#7276).
11205
11206 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11207
11208 * gnutls.c (QCgnutls_bootprop_priority)
11209 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11210 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11211 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11212 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11213 (QCgnutls_bootprop_verify_hostname_error)
11214 (QCgnutls_bootprop_callbacks_verify): Rename from
11215 Qgnutls_bootprop_..., all uses changed.
11216
11217 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11218 uses changed.
11219
11220 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11221
11222 * xfaces.c (Qframe_set_background_mode): Now static.
11223 * dispextern.h (Qframe_set_background_mode): Remove decl.
11224
11225 * process.c (Fnetwork_interface_info): Declare local only if needed.
11226
11227 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11228
11229 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11230 (Fnetwork_interface_list): Allocate in increments of bytes instead
11231 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11232 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11233 sockaddr.
11234 (struct ifflag_def): notrailers is smart on OSX.
11235 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11236 Get hardware address with getifaddrs if available.
11237
11238 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11239
11240 * xdisp.c (iterate_out_of_display_property): xassert that
11241 IT->position is set to within IT->object's boundaries. Break from
11242 the loop as soon as EOB is reached; avoids infloops in redisplay
11243 when IT->position is set up wrongly due to some bug.
11244 Set IT->current to match the bidi iterator unconditionally.
11245 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11246 entry. Force push_it to save on the stack the current
11247 buffer/string position, to be restored by pop_it. Fix flags in
11248 the iterator structure wrt the object coming from a display
11249 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11250 properties. (Bug#9284)
11251
11252 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11253
11254 * fontset.c (fontset_get_font_group): Add proper type checks.
11255 (Bug#9172)
11256
11257 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11258
11259 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11260 and LC_VERSION_MIN_MACOSX.
11261 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11262 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11263
11264 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11265
11266 * xdisp.c (forward_to_next_line_start): Allow to use the
11267 no-display-properties-and-no-overlays under bidi display.
11268 Set disp_pos in the bidi iterator to avoid searches for display
11269 properties and overlays.
11270
11271 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11272
11273 * editfns.c (Fset_time_zone_rule): Document relationship with the
11274 setenv function.
11275
11276 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11277 the font entity extracted from the cache (Bug#8109).
11278
11279 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11280
11281 * composite.c (autocmp_chars): Don't reset point. That is done by
11282 restore_point_unwind (Bug#5984).
11283
11284 2011-08-07 Juri Linkov <juri@jurta.org>
11285
11286 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11287 to show the arg `TIME' instead of `TIMEVAL'.
11288
11289 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11290
11291 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11292 display property strides EOL and includes a newline, as in
11293 longlines-mode. (Bug#9254)
11294 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11295 word-wrap under bidirectional display. (Bug#9224)
11296
11297 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11298 is non-zero, even if the data buffer is NULL. Fixes a crash in
11299 vertical-motion with longlines-mode. (Bug#9254)
11300
11301 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11302
11303 * bidi.c <bidi_cache_total_alloc>: Now static.
11304 (bidi_initialize): Initialize bidi_cache_total_alloc.
11305
11306 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11307 cache. (Bug#9221)
11308
11309 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11310 amount allocated this far in `bidi_cache_total_alloc'.
11311 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11312 non-zero, only free the data buffer without restoring the cache
11313 contents. All callers changed.
11314
11315 * dispextern.h (bidi_unshelve_cache): Update prototype.
11316
11317 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11318 (move_it_in_display_line, move_it_to)
11319 (move_it_vertically_backward, move_it_by_lines): Replace the call
11320 to xfree to an equivalent call to bidi_unshelve_cache.
11321 (move_it_in_display_line_to): Fix logic of returning
11322 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11323
11324 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11325
11326 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11327 came from a string character with a `cursor' property. (Bug#9229)
11328
11329 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11330
11331 * Makefile.in (LIB_PTHREAD): New variable.
11332 (LIBES): Add LIB_PTHREAD (Bug#9216).
11333
11334 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11335 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11336
11337 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11338
11339 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11340
11341 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11342
11343 * xterm.c (x_find_topmost_parent): New function.
11344 (x_set_frame_alpha): Find topmost parent window with
11345 x_find_topmost_parent and set the property there also (bug#9181).
11346 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11347
11348 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11349
11350 * callproc.c (Fcall_process): Avoid vfork clobbering
11351 the local vars buffer, coding_systems, current_dir.
11352
11353 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11354
11355 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11356
11357 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11358
11359 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11360 so that it is not optimized away.
11361
11362 * xdisp.c (compute_display_string_pos): Remove unused local.
11363
11364 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11365
11366 Fix slow cursor motion and scrolling in large buffers with
11367 selective display, like Org Mode buffers. (Bug#9218)
11368
11369 * dispextern.h (struct bidi_it): New member disp_prop_p.
11370
11371 * xdisp.c: Remove one-slot cache of display string positions.
11372 (compute_display_string_pos): Accept an additional argument
11373 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11374 for a display string or property. If found, set DISP_PROP_P
11375 non-zero.
11376
11377 * bidi.c (bidi_fetch_char): Accept an additional argument
11378 DISP_PROP_P, and pass it to compute_display_string_pos.
11379 Only handle text covered by a display string if DISP_PROP_P is returned
11380 non-zero. All callers of bidi_fetch_char changed.
11381
11382 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11383
11384 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11385
11386 2010-12-03 Don March <don@ohspite.net>
11387
11388 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11389 last character M-[char] is translated to ESC [char] (bug#7541).
11390
11391 2011-08-02 Kenichi Handa <handa@m17n.org>
11392
11393 * lisp.h (uniprop_table): Extern it.
11394
11395 * chartab.c (uniprop_table): Make it non-static.
11396
11397 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11398
11399 * xdisp.c (forward_to_next_line_start): Accept additional argument
11400 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11401 on the newline.
11402 (reseat_at_next_visible_line_start): Use the bidi iterator state
11403 returned by forward_to_next_line_start to restore the state of
11404 it->bidi_it after backing up to previous newline. (Bug#9212)
11405
11406 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11407
11408 * regex.c (re_comp): Protoize.
11409 (re_exec): Fix return type.
11410 (regexec): Fix type of `ret'. (Bug#9203)
11411
11412 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11413
11414 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11415 This is needed if max-image-size is a floating-point number.
11416
11417 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11418
11419 * print.c (print_object): Print empty symbol as ##.
11420
11421 * lread.c (read1): Read ## as empty symbol.
11422
11423 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11424
11425 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11426 setting frame foreground color (Bug#9175).
11427 (x_set_background_color): Likewise.
11428
11429 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11430 contents (Bug#9176).
11431 (EmacsTooltip -init): Remove bezels and add shadows to
11432 tooltip windows.
11433
11434 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11435 or scroll bar (Bug#8470).
11436
11437 * nsfont.m (nsfont_open): Remove assignment to voffset and
11438 unnecessary vars hshink, expand, hd, full_height, min_height.
11439 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11440
11441 * nsterm.h (nsfont_info): Remove voffset field.
11442
11443 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11444
11445 Implement strike-through and overline on NextStep (Bug#8863).
11446
11447 * nsfont.m (nsfont_open): Use underline position provided by font,
11448 instead of hard-coded value of 2.
11449 (nsfont_draw): Call ns_draw_text_decoration instead.
11450
11451 * nsterm.h: Add declaration for ns_draw_text_decoration.
11452
11453 * nsterm.m (ns_draw_text_decoration): New function for drawing
11454 underline, overline, and strike-through.
11455 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11456 ns_draw_text_decoration. Change treatment of cursor drawing to
11457 accommodate underlining, etc.
11458
11459 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11460
11461 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11462 default.
11463
11464 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11465
11466 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11467 Without this fix, if a signal arrives just after memory fills up,
11468 'malloc' might be invoked reentrantly.
11469
11470 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11471 In other words, assume that every image size is allowed, on non-X
11472 hosts. This assumption is probably wrong, but it lets Emacs compile.
11473
11474 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11475
11476 * regex.c (re_iswctype): Convert return values to boolean.
11477
11478 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11479
11480 * xdisp.c (compute_display_string_pos): Don't use cached display
11481 string position if the buffer had its restriction changed.
11482 (Bug#9184)
11483
11484 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11485
11486 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11487
11488 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11489
11490 Integer signedness and overflow and related fixes. (Bug#9079)
11491
11492 * bidi.c: Integer size and overflow fixes.
11493 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11494 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11495 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11496 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11497 (bidi_find_other_level_edge):
11498 Use ptrdiff_t instead of EMACS_INT where either will do.
11499 This works better on 32-bit hosts configured --with-wide-int.
11500 (bidi_cache_ensure_space): Check for size-calculation overflow.
11501 Use % rather than repeated addition, for better worst-case speed.
11502 Don't set bidi_cache_size until after xrealloc returns, because it
11503 might not return.
11504 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11505 (bidi_cache_ensure_space): Also check that the bidi cache size
11506 does not exceed that of the largest Lisp string or buffer. See Eli
11507 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11508
11509 * alloc.c (__malloc_size_t): Remove.
11510 All uses replaced by size_t. See Andreas Schwab's note
11511 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11512
11513 * image.c: Improve checking for integer overflow.
11514 (check_image_size): Assume that f is nonnull, since
11515 it is always nonnull in practice. This is one less thing to
11516 worry about when checking for integer overflow later.
11517 (x_check_image_size): New function, which checks for integer
11518 overflow issues inside X.
11519 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11520 This removes the need for a memory_full check.
11521 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11522 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11523 (xbm_read_bitmap_data): Change locals back to 'int', since
11524 their values must fit in 'int'.
11525 (xpm_load_image, png_load, tiff_load):
11526 Invoke x_create_x_image_and_pixmap earlier,
11527 to avoid much needless work if the image is too large.
11528 (tiff_load): Treat overly large images as if
11529 x_create_x_image_and_pixmap failed, not as malloc failures.
11530 (gs_load): Use x_check_image_size.
11531
11532 * gtkutil.c: Omit integer casts.
11533 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11534 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11535
11536 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11537
11538 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11539 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11540 would wrongly return t on a 64-bit host.
11541
11542 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11543 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11544 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11545 and therefore cause GCC to emit a bogus diagnostic in some cases.
11546
11547 * image.c: Integer signedness and overflow and related fixes.
11548 This is not an exhaustive set of fixes, but it's time to
11549 record what I've got.
11550 (lookup_pixel_color, check_image_size): Remove redundant decls.
11551 (check_image_size): Don't assume that arbitrary EMACS_INT values
11552 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11553 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11554 (tiff_load, imagemagick_load_image):
11555 Check for overflow in size calculations.
11556 (x_create_x_image_and_pixmap): Remove unnecessary test for
11557 xmalloc returning NULL; that can't happen.
11558 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11559 (xpm_color_bucket): Use better integer hashing function.
11560 (xpm_cache_color): Don't possibly over-allocate memory.
11561 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11562 (gif_memory_source):
11563 Use ptrdiff_t, not int or size_t, to record sizes.
11564 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11565 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11566 either works, as we prefer signed integers.
11567 (tiff_read_from_memory, tiff_write_from_memory):
11568 Return tsize_t, not size_t, since that's what the TIFF API wants.
11569 (tiff_read_from_memory): Don't fail simply because the read would
11570 go past EOF; instead, return a short read.
11571 (tiff_load): Omit no-longer-needed casts.
11572 (Fimagemagick_types): Don't assume size fits into 'int'.
11573
11574 Improve hashing quality when configured --with-wide-int.
11575 * fns.c (hash_string): New function, taken from sxhash_string.
11576 Do not discard information about ASCII character case; this
11577 discarding is no longer needed.
11578 (sxhash-string): Use it. Change sig to match it. Caller changed.
11579 * lisp.h: Declare it.
11580 * lread.c (hash_string): Remove, since we now use fns.c's version.
11581 The fns.c version returns a wider integer if --with-wide-int is
11582 specified, so this should help the quality of the hashing a bit.
11583
11584 * emacs.c: Integer overflow minor fix.
11585 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11586 Define only if GNU_LINUX.
11587 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11588
11589 * dispnew.c: Integer signedness and overflow fixes.
11590 Remove unnecessary forward decls, that were a maintenance hassle.
11591 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11592 All uses changed.
11593 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11594 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11595 (prepare_desired_row, line_draw_cost):
11596 Use int, not unsigned, where either works.
11597 (save_current_matrix, restore_current_matrix):
11598 Use ptrdiff_t, not size_t, where either works.
11599 (init_display): Check for overflow more accurately, and without
11600 relying on undefined behavior.
11601
11602 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11603 Remove, replacing with the new symbols in lisp.h. All uses changed.
11604 * fileio.c (make_temp_name):
11605 * filelock.c (lock_file_1, lock_file):
11606 * xdisp.c (message_dolog):
11607 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11608 Use pMd etc. instead.
11609 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11610 replacing the pWIDE etc. symbols removed from editfns.c.
11611
11612 * keyboard.h (num_input_events): Now uintmax_t.
11613 This is (very slightly) less likely to mess up due to wraparound.
11614 All uses changed.
11615
11616 * buffer.c: Integer signedness fixes.
11617 (alloc_buffer_text, enlarge_buffer_text):
11618 Use ptrdiff_t rather than size_t when either will do, as we prefer
11619 signed integers.
11620
11621 * alloc.c: Integer signedness and overflow fixes.
11622 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11623 (__malloc_size_t): Default to size_t, not to int.
11624 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11625 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11626 Prefer ptrdiff_t to size_t when either would do, as we prefer
11627 signed integers.
11628 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11629 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11630 Now const. Initialize with values that are in range even if char
11631 is signed.
11632 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11633 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11634 These functions do the right thing with sizes > 2**32.
11635 (check_depth): Now ptrdiff_t, not int.
11636 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11637 Adjust to new way of storing sizes. Check for size overflow bugs
11638 in rest of code.
11639 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11640 slightly wrong anyway, as it missed one instance of
11641 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11642 (refill_memory_reserve): Omit needless cast to size_t.
11643 (mark_object_loop_halt): Mark as externally visible.
11644
11645 * xselect.c: Integer signedness and overflow fixes.
11646 (Fx_register_dnd_atom, x_handle_dnd_message):
11647 Use ptrdiff_t, not size_t, since we prefer signed.
11648 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11649 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11650 x_dnd_atoms_size and x_dnd_atoms_length.
11651
11652 * doprnt.c: Prefer signed to unsigned when either works.
11653 * eval.c (verror):
11654 * doprnt.c (doprnt):
11655 * lisp.h (doprnt):
11656 * xdisp.c (vmessage):
11657 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11658 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11659 prefer signed arithmetic to avoid comparison confusion.
11660 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11661 but is a bit tricky.
11662
11663 Assume freestanding C89 headers, string.h, stdlib.h.
11664 * data.c, doprnt.c, floatfns.c, print.c:
11665 Include float.h unconditionally.
11666 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11667 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11668 * regex.c: Likewise for stddef.h, string.h.
11669 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11670 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11671 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11672 (STDC_HEADERS): Remove obsolete defines.
11673 * sysdep.c: Include limits.h unconditionally.
11674
11675 Assume support for memcmp, memcpy, memmove, memset.
11676 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11677 * regex.c (memcmp, memcpy):
11678 Remove; we assume C89 now.
11679
11680 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11681 (__malloc_safe_bcopy): Remove; no longer needed.
11682
11683 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11684 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11685 well either way, and we prefer signed to unsigned.
11686
11687 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11688
11689 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11690 closes the connection while we're reading (bug#9182).
11691
11692 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11693
11694 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11695 are specified (Bug#9168).
11696
11697 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11698
11699 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11700 Found by GCC static checking and --with-wide-int on a 32-bit host.
11701
11702 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11703
11704 * xdisp.c (compute_display_string_pos): Fix logic of caching
11705 previous display string position. Initialize cached_prev_pos to
11706 -1. Fixes slow-down at the beginning of a buffer.
11707
11708 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11709
11710 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11711 for attrs[LFACE_FONTSET_INDEX].
11712
11713 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 * xml.c (parse_region): Remove unused local
11716 that was recently introduced.
11717
11718 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11719
11720 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11721 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11722
11723 * xdisp.c (move_it_in_display_line_to): Record the best matching
11724 position for TO_CHARPOS while scanning the line, and restore it on
11725 exit if none of the characters scanned was an exact match.
11726 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11727 when exact match is impossible due to invisible text, and the
11728 lines are truncated.
11729
11730 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11731
11732 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11733 for OSX >= 10.7.
11734
11735 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11736
11737 Fix a significant slow-down of cursor motion with C-n, C-p,
11738 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11739 auto-repeat under bidi redisplay in fontified buffers.
11740 * xdisp.c (compute_stop_pos_backwards): New function.
11741 (next_element_from_buffer): Call compute_stop_pos_backwards to
11742 find a suitable prev_stop when we find ourselves before
11743 base_level_stop.
11744 (reseat): Don't look for prev_stop, as that could mean a very long
11745 run.
11746 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11747 <cached_disp_overlay_modiff>: Cache for last found display string
11748 position.
11749 (compute_display_string_pos): Return the cached position if asked
11750 about the same buffer in the same area of character positions, and
11751 the buffer wasn't changed since the time the display string
11752 position was cached.
11753
11754 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11755
11756 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11757 is an integer, which is important for empty lines. (Bug#9149)
11758
11759 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11760
11761 * frame.c (Fmodify_frame_parameters): In tty case, update the
11762 default face if necessary (Bug#4238).
11763
11764 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11765
11766 * editfns.c (Fstring_to_char): No need to explain what a character
11767 is in the docstring (Bug#6576).
11768
11769 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11770
11771 * xml.c (parse_region): Make sure we always return a tree.
11772
11773 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11774
11775 * xml.c (parse_region): If a document contains only comments,
11776 return that, too.
11777
11778 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11779
11780 * xml.c (make_dom): Return comments, too.
11781
11782 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11783
11784 Port to OpenBSD.
11785 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11786 and the surrounding thread.
11787 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11788 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11789 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11790 timer goes off.
11791 * s/openbsd.h (BROKEN_SIGIO): Define.
11792 * unexelf.c (unexec) [__OpenBSD__]:
11793 Don't update the .mdebug section of the Alpha COFF symbol table.
11794
11795 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11796
11797 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11798 (bug#8460).
11799
11800 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11801
11802 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11803 This fixes some race conditions on the permissions of any newly
11804 created file.
11805
11806 * alloc.c (valid_pointer_p): Use pipe, not open.
11807 This fixes some permissions issues when debugging.
11808
11809 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11810 If fchown fails to set both uid and gid, try to set just gid,
11811 as that is sometimes allowed. Adjust the file's mode to eliminate
11812 setuid or setgid bits that are inappropriate if fchown fails.
11813
11814 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11815
11816 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11817 to compare Lisp_Objects.
11818 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11819 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11820 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11821
11822 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11823
11824 * lread.c (read_integer): Unread even EOF character.
11825 (read1): Likewise. Properly record start position of symbol.
11826
11827 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11828 symbol character follows.
11829
11830 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11831
11832 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11833 This works around a problem with the previous change to Fcopy_file.
11834 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11835 and without this change, GCC might complain about discarding
11836 fchown's return value.
11837
11838 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11839
11840 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11841
11842 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11843
11844 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11845
11846 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11847
11848 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11849 it's used from the C level.
11850
11851 * process.c: Use the same condition for POLL_FOR_INPUT in both
11852 keyboard.c and process.c (bug#1858).
11853
11854 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11855
11856 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11857 (Fgnutls_boot): Use it.
11858
11859 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11860
11861 * doc.c (Fsubstitute_command_keys): Revert last change.
11862
11863 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11864
11865 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11866 quotes the next character, and doesn't affect other longer
11867 sequences (bug#8935).
11868
11869 * lread.c (syms_of_lread): Clarify that is isn't only
11870 `eval-buffer' and `eval-defun' that's affected by
11871 `lexical-binding' (bug#8460).
11872
11873 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11874
11875 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11876 bidi redisplay when a line includes both an image and is truncated.
11877
11878 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11879
11880 Fix minor problems found by static checking.
11881 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11882 (elsz): Now a signed constant, not a size_t var. We prefer signed
11883 types to unsigned, to avoid integer comparison confusion. Without
11884 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11885 "cannot optimize loop, the loop counter may overflow", a symptom
11886 of the confusion.
11887 * indent.c (Fvertical_motion): Mark locals as initialized.
11888 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11889
11890 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11891
11892 * search.c (Fre_search_backward): Mention `case-fold-search' in
11893 all the re_search_* functions (bug#8138).
11894
11895 * keyboard.c (Fopen_dribble_file): Document when the file is
11896 closed (bug#8056).
11897
11898 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11899
11900 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11901 bidi_cache_idx.
11902
11903 Support bidi reordering of display and overlay strings.
11904 * xdisp.c (compute_display_string_pos)
11905 (compute_display_string_end): Accept additional argument STRING.
11906 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11907 (reseat_to_string): Initialize bidi_it->string.s and
11908 bidi_it->string.schars.
11909 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11910 NULL (avoids a crash in bidi_paragraph_init).
11911 Initialize itb.string.lstring.
11912 (init_iterator): Call bidi_init_it only of a valid
11913 buffer position was specified. Initialize paragraph_embedding to
11914 L2R.
11915 (reseat_to_string): Initialize the bidi iterator.
11916 (display_string): If we need to ignore text properties of
11917 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11918 original value of -1 will not work with bidi.)
11919 (compute_display_string_pos): First arg is now struct
11920 `text_pos *'; all callers changed. Support display properties on
11921 Lisp strings.
11922 (compute_display_string_end): Support display properties on Lisp
11923 strings.
11924 (init_iterator, reseat_1, reseat_to_string): Initialize the
11925 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11926 when iterating on a string not from display properties).
11927 (compute_display_string_pos, compute_display_string_end):
11928 Fix calculation of the object to scan. Fixes an error when using
11929 arrow keys.
11930 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11931 base_level_stop; instead, set base_level_stop to BEGV.
11932 Fixes crashes in vertical-motion.
11933 (next_element_from_buffer): Improve commentary for when
11934 the iterator is before prev_stop.
11935 (init_iterator): Initialize bidi_p from the default value of
11936 bidi-display-reordering, not from buffer-local value. Use the
11937 buffer-local value only if initializing for buffer iteration.
11938 (handle_invisible_prop): Support invisible properties on strings
11939 that are being bidi-reordered.
11940 (set_iterator_to_next): Support bidi reordering of C strings and
11941 Lisp strings.
11942 (next_element_from_string): Support bidi reordering of Lisp
11943 strings.
11944 (handle_stop_backwards): Support Lisp strings as well.
11945 (display_string): Support display of R2L glyph rows.
11946 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11947 (init_iterator): Don't initialize it->bidi_p for strings
11948 here.
11949 (reseat_to_string): Initialize it->bidi_p for strings here.
11950 (next_element_from_string, next_element_from_c_string)
11951 (next_element_from_buffer): Add xassert's for correspondence
11952 between IT's object being iterated and it->bidi_it.string
11953 structure.
11954 (face_before_or_after_it_pos): Support bidi iteration.
11955 (next_element_from_c_string): Handle the case of the first string
11956 character that is not the first one in the visual order.
11957 (get_visually_first_element): New function, refactored from common
11958 parts of next_element_from_buffer, next_element_from_string, and
11959 next_element_from_c_string.
11960 (tool_bar_lines_needed, redisplay_tool_bar)
11961 (display_menu_bar): Force left-to-right direction. Add a FIXME
11962 comment for making that be controlled by a user option.
11963 (push_it, pop_it): Save and restore the state of the
11964 bidi iterator. Save and restore the bidi_p flag.
11965 (pop_it): Iterate out of display property for string iteration as
11966 well.
11967 (iterate_out_of_display_property): Support iteration over strings.
11968 (handle_single_display_spec): Set up it->bidi_it for iteration
11969 over a display string, and call bidi_init_it.
11970 (handle_single_display_spec, next_overlay_string)
11971 (get_overlay_strings_1, push_display_prop): Set up the bidi
11972 iterator for displaying display or overlay strings.
11973 (forward_to_next_line_start): Don't use the shortcut if
11974 bidi-iterating.
11975 (back_to_previous_visible_line_start): If handle_display_prop
11976 pushed the iterator stack, restore the internal state of the bidi
11977 iterator by calling bidi_pop_it same number of times.
11978 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11979 and we are bidi-iterating, don't decrement the iterator position;
11980 instead, set the first_elt flag in the bidi iterator, to produce
11981 the same effect.
11982 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11983 (push_display_prop): xassert that we are iterating a buffer.
11984 (push_it, pop_it): Save and restore paragraph_embedding member.
11985 (handle_single_display_spec, next_overlay_string)
11986 (get_overlay_strings_1, reseat_1, reseat_to_string)
11987 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11988 correctly. Don't assume unibyte strings are not bidi-reordered.
11989 (compute_display_string_pos)
11990 (compute_display_string_end): Fix handling the case of C string.
11991 (push_it, pop_it): Save and restore from_disp_prop_p.
11992 (handle_single_display_spec, push_display_prop): Set the
11993 from_disp_prop_p flag.
11994 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11995 (pop_it): Call iterate_out_of_display_property only if we are
11996 popping after iteration over a string that came from a display
11997 property. Fix a typo in popping stretch info. Add an assertion
11998 for verifying that the iterator position is in sync with the bidi
11999 iterator.
12000 (handle_single_display_spec, get_overlay_strings_1)
12001 (push_display_prop): Fix initialization of paragraph direction for
12002 string when that of the parent object is not yet determined.
12003 (reseat_1): Call bidi_init_it to resync the bidi
12004 iterator with IT's position. (Bug#7616)
12005 (find_row_edges): If ROW->start.pos gives position
12006 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12007 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12008 Reset the from_disp_prop_p flag.
12009 (SAVE_IT, RESTORE_IT): New macros.
12010 (pos_visible_p, face_before_or_after_it_pos)
12011 (back_to_previous_visible_line_start)
12012 (move_it_in_display_line_to, move_it_in_display_line)
12013 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12014 (try_scrolling, redisplay_window, display_line): Use them when
12015 saving a temporary copy of the iterator and restoring it back.
12016 (back_to_previous_visible_line_start, reseat_1)
12017 (init_iterator): Empty the bidi cache "stack".
12018 (move_it_in_display_line_to): If iterator ended up at
12019 EOL, but we never saw any buffer positions smaller than
12020 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12021 motion in bidi-reordered lines.
12022 (move_it_in_display_line_to): Record prev_method and prev_pos
12023 immediately before the call to set_iterator_to_next. Fixes cursor
12024 motion in bidi-reordered lines with stretch glyphs and strings
12025 displayed in margins. (Bug#8133) (Bug#8867)
12026 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12027 TO_CHARPOS.
12028 (pos_visible_p): Support positions in bidi-reordered lines.
12029 Save and restore bidi cache.
12030
12031 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12032 (bidi_paragraph_info): Delete unused struct.
12033 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12034 (bidi_cache_start): New variable.
12035 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12036 to zero.
12037 (bidi_cache_fetch_state, bidi_cache_search)
12038 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12039 (bidi_cache_find, bidi_peek_at_next_level)
12040 (bidi_level_of_next_char, bidi_find_other_level_edge)
12041 (bidi_move_to_visually_next): Compare cache index with
12042 bidi_cache_start rather than with zero.
12043 (bidi_fetch_char): Accept new argument STRING; all callers
12044 changed. Support iteration over a string. Support strings with
12045 display properties. Support unibyte strings. Fix the type of
12046 `len' according to what STRING_CHAR_AND_LENGTH expects.
12047 (bidi_paragraph_init, bidi_resolve_explicit_1)
12048 (bidi_resolve_explicit, bidi_resolve_weak)
12049 (bidi_level_of_next_char, bidi_move_to_visually_next):
12050 Support iteration over a string.
12051 (bidi_set_sor_type, bidi_resolve_explicit_1)
12052 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12053 can now be zero (for strings); special values 0 and -1 were
12054 changed to -1 and -2, respectively.
12055 (bidi_char_at_pos): New function.
12056 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12057 Call it instead of FETCH_MULTIBYTE_CHAR.
12058 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12059 initialized to valid values.
12060 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12061 values.
12062 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12063 the test for valid cached positions. Fix the logic for looking up
12064 the sentinel state in the cache. GCPRO the Lisp string we are
12065 iterating.
12066 (bidi_push_it, bidi_pop_it): New functions.
12067 (bidi_initialize): Initialize the bidi cache start stack pointer.
12068 (bidi_cache_ensure_space): New function, refactored from part of
12069 bidi_cache_iterator_state. Don't assume the required size is just
12070 one BIDI_CACHE_CHUNK away.
12071 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12072 (bidi_count_bytes, bidi_char_at_pos): New functions.
12073 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12074 always valid if bidi_cache_idx is valid.
12075 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12076 is valid if it's going to be used.
12077 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12078 (bidi_cache_fetch_state, bidi_cache_search)
12079 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12080 (bidi_cache_iterator_state, bidi_cache_find)
12081 (bidi_find_other_level_edge, bidi_cache_start_stack):
12082 All variables related to cache indices are now EMACS_INT.
12083
12084 * dispextern.h (struct bidi_string_data): New structure.
12085 (struct bidi_it): New member `string'. Make flag members be 1-bit
12086 fields, and put them last in the struct.
12087 (compute_display_string_pos, compute_display_string_end):
12088 Update prototypes.
12089 (bidi_push_it, bidi_pop_it): Add prototypes.
12090 (struct iterator_stack_entry): New members bidi_p,
12091 paragraph_embedding, and from_disp_prop_p.
12092 (struct it): Member bidi_p is now a bit field 1 bit wide.
12093 (bidi_shelve_cache, bidi_unshelve_cache):
12094 Declare prototypes.
12095
12096 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12097 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12098 and vector-like objects.
12099
12100 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12101 cache around display iteration.
12102
12103 * window.c (Fwindow_end, window_scroll_pixel_based)
12104 (displayed_window_lines, Frecenter): Save and restore the bidi
12105 cache around display iteration.
12106
12107 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12108
12109 * editfns.c (Fdelete_region): Clarify the use of the named
12110 parameters (bug#6788).
12111
12112 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12113
12114 * indent.c (Fvertical_motion): Set and restore w->pointm when
12115 saving and restoring the window's buffer (Bug#9006).
12116
12117 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12118
12119 * editfns.c (Fstring_to_char): Clarify just what is returned
12120 (bug#6576). Text by Eli Zaretskii.
12121
12122 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12123
12124 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12125
12126 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12127
12128 * buffer.c (mmap_find): Fix a typo.
12129
12130 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12131
12132 Fix execution of x selection hooks.
12133 * xselect.c (Qx_lost_selection_functions)
12134 (Qx_sent_selection_functions): New vars.
12135 (syms_of_xselect): DEFSYM them.
12136 (x_handle_selection_request): Pass Qx_sent_selection_functions
12137 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12138 (x_handle_selection_clear,x_clear_frame_selections):
12139 Pass Qx_lost_selection_functions rather than
12140 Vx_lost_selection_functions to Frun_hook_with_args.
12141
12142 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12143
12144 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12145 The old code sometimes used this field without initializing it.
12146
12147 * alloc.c (gc_sweep): Don't read past end of array.
12148 In theory, the old code could also have corrupted Emacs internals,
12149 though it'd be very unlikely.
12150
12151 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12152
12153 * character.c (Fcharacterp): Don't advertise optional ignored
12154 argument. (Bug#4026)
12155
12156 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12157
12158 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12159 key" (bug#4257).
12160
12161 * window.c (Fset_window_start): Doc fix (bug#4199).
12162 (Fset_window_hscroll): Ditto.
12163
12164 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12165
12166 Fix minor new problems caught by GCC 4.6.1.
12167 * term.c (init_tty): Remove unused local.
12168 * xsettings.c (store_monospaced_changed): Define this function only
12169 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12170 not used otherwise.
12171
12172 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12173
12174 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12175
12176 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12177
12178 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12179 are the mini-buffer and the echo area (bug#3320).
12180
12181 * term.c (init_tty): Remove support for supdup, c10 and perq
12182 terminals, which are no longer supported (bug#1482).
12183
12184 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12185
12186 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12187
12188 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12189
12190 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12191 for non-popups (Bug#3642).
12192
12193 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12194
12195 * alloc.c (reset_malloc_hooks): Protoize.
12196 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12197 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12198 * cm.c (losecursor): Likewise.
12199 * data.c (fmod): Likewise.
12200 * dispnew.c (swap_glyphs_in_rows): Likewise.
12201 * emacs.c (memory_warning_signal): Likewise.
12202 * floatfns.c (float_error): Likewise.
12203 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12204 (otf_open, font_otf_capability, generate_otf_features)
12205 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12206 Likewise.
12207 * image.c (pbm_read_file): Likewise.
12208 * indent.c (string_display_width): Likewise.
12209 * intervals.c (check_for_interval, search_for_interval)
12210 (inc_interval_count, count_intervals, root_interval)
12211 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12212 * lread.c (defalias): Likewise.
12213 * ralloc.c (r_alloc_check): Likewise.
12214 * regex.c (set_image_of_range_1, set_image_of_range)
12215 (regex_grow_registers): Likewise.
12216 * sysdep.c (strerror): Likewise.
12217 * termcap.c (valid_filename_p, tprint, main): Likewise.
12218 * tparam.c (main): Likewise.
12219 * unexhp9k800.c (run_time_remap, save_data_space)
12220 (update_file_ptrs, read_header, write_header, calculate_checksum)
12221 (copy_file, copy_rest, display_header): Likewise.
12222 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12223 Likewise.
12224 * xdisp.c (check_it): Likewise.
12225 * xfaces.c (register_color, unregister_color, unregister_colors):
12226 Likewise.
12227 * xfns.c (print_fontset_result): Likewise.
12228 * xrdb.c (member, fatal, main): Likewise.
12229
12230 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12231
12232 Fix minor problems found by static checking (Bug#9031).
12233 * chartab.c (char_table_set_range, map_sub_char_table):
12234 Remove unused locals.
12235 (uniprop_table): Now static.
12236 * composite.c (_work_char): Remove unused static var.
12237
12238 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12239
12240 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12241
12242 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12243
12244 * gtkutil.c (qttip_cb): Remove code without function.
12245
12246 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12247
12248 * w32.c (pthread_sigmask): New stub.
12249
12250 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12251
12252 Use pthread_sigmask, not sigprocmask (Bug#9010).
12253 sigprocmask is portable only for single-threaded applications, and
12254 Emacs can be multi-threaded when it uses GTK.
12255 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12256 (LIBES): Use it.
12257 * callproc.c (Fcall_process):
12258 * process.c (create_process):
12259 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12260 Use pthread_sigmask, not sigprocmask.
12261
12262 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12263
12264 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12265 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12266 wrong (Bug#8591).
12267
12268 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12269
12270 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12271 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12272 (xg_hide_tooltip): Fix comment.
12273
12274 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12275 in registerServicesMenuSendTypes.
12276 (validRequestorForSendType): Don't check ns_return_types.
12277
12278 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12279 ns_return_type.
12280
12281 2011-07-08 Jason Rumney <jasonr@gnu.org>
12282
12283 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12284 SH_SHOW for hidden windows (Bug#5482).
12285
12286 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12287 frame struct members of non-existent frames (Bug#6284).
12288
12289 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12290
12291 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12292 variable firstTime not needed on OSX >= 10.6.
12293 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12294 >= 10.5. Use setKnobProportion, setDoubleValue.
12295
12296 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12297 (MAC_OS_X_VERSION_10_5): Define if not defined.
12298 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12299 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12300 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12301
12302 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12303 cString and lossyCString on OSX >= 10.4.
12304
12305 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12306 sizeToFit on OSX >= 10.2.
12307
12308 * nsimage.m (allocInitFromFile): Don't use deprecated method
12309 bestRepresentationForDevice on OSX >= 10.6.
12310
12311 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12312 to avoid warning.
12313
12314 * emacs.c: Declare unexec_init_emacs_zone.
12315
12316 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12317
12318 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12319
12320 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12321 on svcsMenu (Bug#8842).
12322
12323 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12324 ns_return_types.
12325 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12326
12327 * nsterm.m (QUTF8_STRING): Declare.
12328 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12329 (validRequestorForSendType): Return type is (id).
12330 Change indexOfObjectIdenticalTo to indexOfObject.
12331 Check if we have local selection before returning self (Bug#8842).
12332 (writeSelectionToPasteboard): Put local selection into paste board
12333 if we have a local selection (Bug#8842).
12334 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12335
12336 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12337 (ns_get_local_selection): Declare.
12338
12339 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12340
12341 * keymap.c (describe_map_tree): Don't insert a double newline at
12342 the end of the buffer (bug#1169) and return whether we inserted
12343 something.
12344
12345 * callint.c (Fcall_interactively): Change "reading args" to
12346 "providing args" to try to clarify what it does (bug#1010).
12347
12348 2011-07-07 Kenichi Handa <handa@m17n.org>
12349
12350 * composite.c (composition_compute_stop_pos): Ignore a static
12351 composition starting before CHARPOS (Bug#8915).
12352
12353 * xdisp.c (handle_composition_prop): Likewise.
12354
12355 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12356
12357 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12358 (Bug#9015)
12359
12360 2011-07-07 Kenichi Handa <handa@m17n.org>
12361
12362 * character.h (unicode_category_t): New enum type.
12363
12364 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12365 (Qchar_code_property_table): New variable.
12366 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12367 (UNIPROP_COMPRESSED_FORM_P): New macros.
12368 (char_table_ascii): Uncompress the compressed values.
12369 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12370 Uncompress the compressed values.
12371 (sub_char_table_ref_and_range): Likewise.
12372 (char_table_ref_and_range): Uncompress the compressed values.
12373 (sub_char_table_set): New arg is_uniprop. Callers changed.
12374 Uncompress the compressed values.
12375 (sub_char_table_set_range): Args changed. Callers changed.
12376 (char_table_set_range): Adjuted for the above change.
12377 (map_sub_char_table): Delete args default_val and parent. Add arg
12378 top. Give decoded values to a Lisp function.
12379 (map_char_table): Adjust for the above change. Give decoded
12380 values to a Lisp function. Gcpro more variables.
12381 (uniprop_table_uncompress)
12382 (uniprop_decode_value_run_length): New functions.
12383 (uniprop_decoder, uniprop_decoder_count): New variables.
12384 (uniprop_get_decoder, uniprop_encode_value_character)
12385 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12386 New functions.
12387 (uniprop_encoder, uniprop_encoder_count): New variables.
12388 (uniprop_get_encoder, uniprop_table)
12389 (Funicode_property_table_internal, Fget_unicode_property_internal)
12390 (Fput_unicode_property_internal): New functions.
12391 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12392 Sunicode_property_table_internal, Sget_unicode_property_internal,
12393 and Sput_unicode_property_internal. Defvar_lisp
12394 char-code-property-alist.
12395
12396 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12397 Vunicode_category_table.
12398
12399 * font.c (font_range): Adjust for the change of
12400 Vunicode_category_table.
12401
12402 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12403
12404 * m/iris4d.h: Remove file, move contents ...
12405 * s/irix6-5.h: ... here.
12406
12407 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12408
12409 Remove unportable assumption about struct layout (Bug#8884).
12410 * alloc.c (mark_buffer):
12411 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12412 (clone_per_buffer_values): Don't assume that
12413 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12414 This isn't true in general, and it's particularly not true
12415 if Emacs is configured with --with-wide-int.
12416 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12417 New macros, used in the buffer.c change.
12418
12419 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12420
12421 * xsettings.c: Use both GConf and GSettings if both are available.
12422 (store_config_changed_event): Add comment.
12423 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12424 (store_tool_bar_style_changed): New functions.
12425 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12426 (struct xsettings): Move font inside HAVE_XFT.
12427 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12428 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12429 Move inside HAVE_XFT.
12430 (something_changed_gsettingsCB): Rename from something_changedCB.
12431 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12432 also.
12433 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12434 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12435 (something_changed_gconfCB): Rename from something_changedCB.
12436 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12437 (parse_settings): Move check for font inside HAVE_XFT.
12438 (read_settings, apply_xft_settings): Add comment.
12439 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12440 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12441 call store_font_name_changed.
12442 (xft_settings_event): Add comment.
12443 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12444 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12445 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12446 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12447 (xsettings_initialize): Call init_gsettings last.
12448 (xsettings_get_system_font, xsettings_get_system_normal_font):
12449 Add comment.
12450
12451 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12452
12453 Random fixes. E.g., (random) never returned negative values.
12454 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12455 subseconds part to the entropy, as that's a bit more random.
12456 Prefer signed to unsigned, since the signedness doesn't matter and
12457 in general we prefer signed. When given a limit, use a
12458 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12459 latter isn't right if USE_2_TAGS_FOR_INTS.
12460 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12461 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12462
12463 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12464
12465 * textprop.c (text_property_stickiness):
12466 Obey Vtext_property_default_nonsticky.
12467 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12468 * w32fns.c (syms_of_w32fns):
12469 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12470
12471 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12472
12473 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12474 This is more efficient than Ffile_directory_p and avoids a minor race.
12475
12476 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12477
12478 * buffer.c (Foverlay_put): Say what the return value is
12479 (bug#7835).
12480
12481 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12482 is a directory before asking whether to use the file name
12483 (bug#7564).
12484 (barf_or_query_if_file_exists): Make the "File is a directory"
12485 error be more correct.
12486
12487 * fns.c (Frequire): Remove the mention of the .gz files, since
12488 that's installation-specific, but keep the mention of
12489 `get-load-suffixes'.
12490
12491 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12492
12493 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12494 Report string overflow if the output is too long.
12495
12496 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12497
12498 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12499 (syms_of_gnutls): Remove duplicate DEFSYM for
12500 Qgnutls_bootprop_verify_hostname_error, an error for
12501 Qgnutls_bootprop_verify_error (which is no longer used).
12502
12503 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12504 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12505 Also (re)move comments that are misplaced or no longer relevant.
12506
12507 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12508
12509 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12510
12511 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12512
12513 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12514 and background color parameters if they have been changed.
12515
12516 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12517
12518 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12519
12520 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12521
12522 * xsettings.c (SYSTEM_FONT): Define only when used.
12523 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12524
12525 * keymap.c (access_keymap_1): Now static.
12526
12527 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12528
12529 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12530 leave any prefix arg for the up event (Bug#1586).
12531
12532 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12533
12534 * lread.c (syms_of_lread): Mention single symbols defined by
12535 `defvar' or `defconst' (bug#7154).
12536
12537 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12538 (Frequire): Mention get-load-suffixes.
12539
12540 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12541
12542 * window.h (window): Remove clone_number slot.
12543 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12544 Remove.
12545 (make_parent_window, make_window, saved_window)
12546 (Fset_window_configuration, save_window_save): Don't deal with
12547 clone numbers.
12548 * buffer.c (Qclone_number): Remove declaration.
12549 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12550
12551 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12552
12553 Add multiple inheritance to keymaps.
12554 * keymap.c (Fmake_composed_keymap): New function.
12555 (Fset_keymap_parent): Simplify.
12556 (fix_submap_inheritance): Remove.
12557 (access_keymap_1): New function extracted from access_keymap to handle
12558 embedded parents and handle lists of maps.
12559 (access_keymap): Use it.
12560 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12561 (Fcopy_keymap): Handle embedded parents.
12562 (Fcommand_remapping, define_as_prefix): Simplify.
12563 (Fkey_binding): Simplify.
12564 (syms_of_keymap): Move minibuffer-local-completion-map,
12565 minibuffer-local-filename-completion-map,
12566 minibuffer-local-must-match-map, and
12567 minibuffer-local-filename-must-match-map to Elisp.
12568 (syms_of_keymap): Defsubr make-composed-keymap.
12569 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12570 (parse_menu_item): Trivial simplification.
12571
12572 2011-07-01 Glenn Morris <rgm@gnu.org>
12573
12574 * Makefile.in (SETTINGS_LIBS): Fix typo.
12575
12576 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12577
12578 * coding.c (Fencode_coding_string): Record the last coding system
12579 used, as the function doc string says (bug#8738).
12580
12581 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12582
12583 * xsettings.c (store_monospaced_changed): Take new font as arg and
12584 check for change against current_mono_font.
12585 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12586 (emacs_settings_constructor, emacs_settings_get_property)
12587 (emacs_settings_set_property, emacs_settings_class_init)
12588 (emacs_settings_init, gsettings_obj): Remove.
12589 (something_changedCB): New function for HAVE_GSETTINGS.
12590 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12591 with value as argument.
12592 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12593 g_settings_new (Bug#8967). Do not create gsettings_obj.
12594 Remove calls to g_settings_bind. Connect something_changedCB to
12595 "changed".
12596
12597 * xgselect.c: Add defined (HAVE_GSETTINGS).
12598 (xgselect_initialize): Ditto.
12599
12600 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12601 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12602 xg_select.
12603
12604 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12605
12606 * eval.c (struct backtrace): Simplify and port the data structure.
12607 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12608 signed bit field, as this assumption is not portable and it makes
12609 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12610 "char debug_on_exit : 1" as this is not portable either; instead,
12611 use the portable "unsigned int debug_on_exit : 1". Remove unused
12612 member evalargs. Remove obsolete comments about cc bombing out.
12613
12614 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12615
12616 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12617 Let HAVE_GSETTINGS override HAVE_GCONF.
12618 (store_monospaced_changed): New function.
12619 (EMACS_SETTINGS): A new type derived from GObject to handle
12620 GSettings notifications.
12621 (emacs_settings_constructor, emacs_settings_get_property)
12622 (emacs_settings_set_property, emacs_settings_class_init):
12623 New functions.
12624 (gsettings_client, gsettings_obj): New variables.
12625 (GSETTINGS_SCHEMA): New define.
12626 (something_changedCB): Call store_monospaced_changed.
12627 (init_gsettings): New function.
12628 (xsettings_initialize): Call init_gsettings.
12629 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12630 to NULL.
12631
12632 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12633 GCONF_CFLAGS/LIBS.
12634
12635 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12636
12637 * window.c (resize_root_window, grow_mini_window)
12638 (shrink_mini_window): Rename Qresize_root_window to
12639 Qwindow_resize_root_window and Qresize_root_window_vertically to
12640 Qwindow_resize_root_window_vertically.
12641
12642 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12643
12644 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12645
12646 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12647
12648 * makefile.w32-in: Redesign dependencies so they reflect more
12649 clearly which files are directly included by each source file,
12650 and not through other includes.
12651
12652 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12653
12654 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12655 (sort_overlays, overlay_strings): When an overlay's clone number
12656 matches the window's clone number process the overlay even if
12657 the overlay's window property doesn't match the current window.
12658
12659 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12660 (Fwindow_hchild): Rename to Fwindow_left_child.
12661 (Fwindow_next): Rename to Fwindow_next_sibling.
12662 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12663 (resize_window_check): Rename to window_resize_check.
12664 (resize_window_apply): Rename to window_resize_apply.
12665 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12666 (Fdelete_other_windows_internal, resize_frame_windows)
12667 (Fsplit_window_internal, Fdelete_window_internal)
12668 (grow_mini_window, shrink_mini_window)
12669 (Fresize_mini_window_internal): Fix callers accordingly.
12670
12671 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12672
12673 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12674 (emacs_fixed_set_min_size): Remove.
12675 (emacs_fixed_new): Take frame as argument.
12676
12677 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12678 (_EmacsFixedPrivate): Remove minwidth/height.
12679 Add struct frame *f.
12680 (emacs_fixed_init): Initialize priv->f.
12681 (get_parent_class, emacs_fixed_set_min_size): Remove.
12682 (emacs_fixed_new): Set priv->f to argument.
12683 (emacs_fixed_get_preferred_width)
12684 (emacs_fixed_get_preferred_height): Use min_width/height from
12685 frames size_hint to set minimum and natural (Bug#8919).
12686 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12687 and use min_width/height from frames size_hint to set
12688 min_width/height (Bug#8919).
12689
12690 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12691 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12692 Fix indentation.
12693
12694 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12695
12696 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12697 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12698 called at ZV.
12699
12700 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12701
12702 * process.c (wait_reading_process_output): Bypass select if
12703 waiting for a cell while ignoring keyboard input, and input is
12704 pending. Suggested by Jan Djärv (Bug#8869).
12705
12706 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12707
12708 Use gnulib's dup2 module instead of rolling our own.
12709 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12710
12711 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12712
12713 * dispnew.c (scrolling_window): Before scrolling, turn off a
12714 mouse-highlight in the window being scrolled.
12715
12716 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12717
12718 Move DEFSYM to lisp.h and use everywhere.
12719
12720 * character.h (DEFSYM): Move declaration...
12721 * lisp.h (DEFSYM): ...here.
12722
12723 * gnutls.c:
12724 * minibuf.c:
12725 * w32menu.c:
12726 * w32proc.c:
12727 * w32select.c: Don't include character.h.
12728
12729 * alloc.c (syms_of_alloc):
12730 * buffer.c (syms_of_buffer):
12731 * bytecode.c (syms_of_bytecode):
12732 * callint.c (syms_of_callint):
12733 * casefiddle.c (syms_of_casefiddle):
12734 * casetab.c (init_casetab_once):
12735 * category.c (init_category_once, syms_of_category):
12736 * ccl.c (syms_of_ccl):
12737 * cmds.c (syms_of_cmds):
12738 * composite.c (syms_of_composite):
12739 * dbusbind.c (syms_of_dbusbind):
12740 * dired.c (syms_of_dired):
12741 * dispnew.c (syms_of_display):
12742 * doc.c (syms_of_doc):
12743 * editfns.c (syms_of_editfns):
12744 * emacs.c (syms_of_emacs):
12745 * eval.c (syms_of_eval):
12746 * fileio.c (syms_of_fileio):
12747 * fns.c (syms_of_fns):
12748 * frame.c (syms_of_frame):
12749 * fringe.c (syms_of_fringe):
12750 * insdel.c (syms_of_insdel):
12751 * keymap.c (syms_of_keymap):
12752 * lread.c (init_obarray, syms_of_lread):
12753 * macros.c (syms_of_macros):
12754 * msdos.c (syms_of_msdos):
12755 * print.c (syms_of_print):
12756 * process.c (syms_of_process):
12757 * search.c (syms_of_search):
12758 * sound.c (syms_of_sound):
12759 * syntax.c (init_syntax_once, syms_of_syntax):
12760 * terminal.c (syms_of_terminal):
12761 * textprop.c (syms_of_textprop):
12762 * undo.c (syms_of_undo):
12763 * w32.c (globals_of_w32):
12764 * window.c (syms_of_window):
12765 * xdisp.c (syms_of_xdisp):
12766 * xfaces.c (syms_of_xfaces):
12767 * xfns.c (syms_of_xfns):
12768 * xmenu.c (syms_of_xmenu):
12769 * xsettings.c (syms_of_xsettings):
12770 * xterm.c (syms_of_xterm): Use DEFSYM.
12771
12772 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12773
12774 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12775
12776 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12777
12778 Integer and buffer overflow fixes (Bug#8873).
12779
12780 * print.c (printchar, strout): Check for string overflow.
12781 (PRINTPREPARE, printchar, strout):
12782 Don't set size unless allocation succeeds.
12783
12784 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12785 for sizes. Check for string overflow more accurately.
12786 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12787
12788 * macros.c: Integer and buffer overflow fixes.
12789 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12790 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12791 Use ptrdiff_t, not int, for sizes.
12792 Don't increment bufsize until after realloc succeeds.
12793 Check for size-calculation overflow.
12794 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12795
12796 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12797
12798 * lread.c: Integer overflow fixes.
12799 (read_integer): Radix is now EMACS_INT, not int,
12800 to improve quality of diagnostics for out-of-range radices.
12801 Calculate buffer size correctly for out-of-range radices.
12802 (read1): Check for integer overflow in radices, and in
12803 read-circle numbers.
12804 (read_escape): Avoid int overflow.
12805 (Fload, openp, read_buffer_size, read1)
12806 (substitute_object_recurse, read_vector, read_list, map_obarray):
12807 Use ptrdiff_t, not int, for sizes.
12808 (read1): Use EMACS_INT, not int, for sizes.
12809 Check for size overflow.
12810
12811 * image.c (cache_image): Check for size arithmetic overflow.
12812
12813 * lread.c: Integer overflow issues.
12814 (saved_doc_string_size, saved_doc_string_length)
12815 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12816 Now ptrdiff_t, not int.
12817 (read1): Don't assume doc string length fits in int. Check for
12818 out-of-range doc string lengths.
12819 (read_list): Don't assume file position fits in int.
12820 (read_escape): Check for hex character overflow.
12821
12822 2011-06-22 Leo Liu <sdl.web@gmail.com>
12823
12824 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12825 Move to minibuffer.el.
12826
12827 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12828
12829 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12830 The following patches are for when GLYPH_DEBUG && !XASSERT.
12831 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12832 * dispnew.c (flush_stdout):
12833 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12834 Mark as externally visible.
12835 * dispnew.c (check_window_matrix_pointers): Now static.
12836 * dispnew.c (window_to_frame_vpos):
12837 * xfns.c (unwind_create_frame):
12838 * xterm.c (x_check_font): Remove unused local.
12839 * scroll.c (CHECK_BOUNDS):
12840 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12841 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12842 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12843 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12844 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12845 Now static.
12846 (debug_method_add): Use va_list and vsprintf rather than relying
12847 on undefined behavior with wrong number of arguments.
12848 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12849 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12850 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12851 since we're not interested in debugging glyphs with old libraries.
12852 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12853 GCC 4.6.0's static checking.
12854
12855 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12856
12857 Integer overflow and signedness fixes (Bug#8873).
12858 A few related buffer overrun fixes, too.
12859
12860 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12861
12862 * dispextern.h (struct face.stipple):
12863 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12864 (x_bitmap_mask, x_allocate_bitmap_record)
12865 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12866 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12867 (x_create_bitmap_from_xpm_data):
12868 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12869 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12870 (.bitmaps_last):
12871 * xfaces.c (load_pixmap):
12872 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12873 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12874 (.bitmaps_last, struct x_output.icon_bitmap):
12875 Use ptrdiff_t, not int, for bitmap indexes.
12876 (x_allocate_bitmap_record): Check for size overflow.
12877 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12878
12879 Use ptrdiff_t, not int, for overlay counts.
12880 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12881 * editfns.c (overlays_around, get_pos_property):
12882 * textprop.c (get_char_property_and_overlay):
12883 * xdisp.c (next_overlay_change, note_mouse_highlight):
12884 * xfaces.c (face_at_buffer_position):
12885 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12886 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12887 (Fnext_overlay_change, Fprevious_overlay_change)
12888 (mouse_face_overlay_overlaps, Foverlays_in):
12889 Use ptrdiff_t, not int, for sizes.
12890 (overlays_at, overlays_in): Check for size-calculation overflow.
12891
12892 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12893
12894 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12895 (x_session_initialize): Do not assume string length fits in int.
12896
12897 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12898 This is unlikely, but can occur if DPI is outlandish.
12899
12900 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12901 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12902
12903 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12904 * xrdb.c (magic_file_p, search_magic_path):
12905 Omit last arg SUFFIX; it was always 0. All callers changed.
12906 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12907
12908 * xfont.c (xfont_match): Avoid need for strlen.
12909
12910 * xfns.c: Don't assume strlen fits in int.
12911 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12912
12913 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12914 not unsigned long, as we prefer signed integers. All callers changed.
12915 Detect integer overflow in repeat count.
12916 (message_dolog): Don't assume print length fits in 39 bytes.
12917 (display_mode_element): Don't assume strlen fits in int.
12918
12919 * termcap.c: Don't assume sizes fit in int and never overflow.
12920 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12921 (gobble_line): Check for size-calculation overflow.
12922
12923 * minibuf.c (Fread_buffer):
12924 * lread.c (intern, intern_c_string):
12925 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12926 Don't assume string length fits in int.
12927
12928 * keyboard.c (parse_tool_bar_item):
12929 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12930
12931 * font.c: Don't assume string length fits in int.
12932 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12933 Use ptrdiff_t, not int.
12934 (font_intern_prop): Don't assume string length fits in int.
12935 Don't assume integer property fits in fixnum.
12936 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12937
12938 * filelock.c: Fix some buffer overrun and integer overflow issues.
12939 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12940 Reformulate so as not to need the command string.
12941 Invoke gzip -cd rather than gunzip, as it's more portable.
12942 (lock_info_type, lock_file_1, lock_file):
12943 Don't assume pid_t and time_t fit in unsigned long.
12944 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12945 (current_lock_owner): Prefer signed type for sizes.
12946 Use memcpy, not strncpy, where memcpy is what is really wanted.
12947 Don't assume (via atoi) that time_t and pid_t fit in int.
12948 Check for time_t and/or pid_t out of range, e.g., via a network share.
12949 Don't alloca where an auto var works fine.
12950
12951 * fileio.c: Fix some integer overflow issues.
12952 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12953 Don't assume string length fits in int.
12954 (directory_file_name): Don't assume string length fits in long.
12955 (make_temp_name): Don't assume pid fits in int, or that its print
12956 length is less than 20.
12957
12958 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12959
12960 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12961
12962 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12963
12964 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12965 We prefer signed integers, even for size calculations.
12966
12967 * emacs.c: Don't assume string length fits in 'int'.
12968 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12969 (main): Don't invoke strlen when not needed.
12970
12971 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12972 (XD_DEBUG_MESSAGE): Don't waste a byte.
12973
12974 * callproc.c (getenv_internal_1, getenv_internal)
12975 (Fgetenv_internal):
12976 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12977
12978 * lread.c (invalid_syntax): Omit length argument.
12979 All uses changed. This doesn't fix a bug, but it simplifies the
12980 code away from its former Hollerith-constant appearance, and it's
12981 one less 'int' to worry about when looking at integer-overflow issues.
12982 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12983
12984 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12985 This didn't break anything, but it didn't help either.
12986 It's confusing to put a bogus integer in a place where the actual
12987 value does not matter.
12988 (LIST_END_P): Remove unused macro and its bogus comment.
12989 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12990
12991 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12992 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12993 implementation.
12994 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12995 We prefer signed types, and the value cannot exceed the EMACS_INT
12996 range anyway (because otherwise the length would not be representable).
12997 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12998 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12999 This avoids a GCC warning when WIDE_EMACS_INT.
13000
13001 * indent.c (sane_tab_width): New function.
13002 (current_column, scan_for_column, Findent_to, position_indentation)
13003 (compute_motion): Use it. This is just for clarity.
13004 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13005
13006 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13007
13008 * lisp.h (lint_assume): New macro.
13009 * composite.c (composition_gstring_put_cache):
13010 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13011
13012 * editfns.c, insdel.c:
13013 Omit unnecessary forward decls, to simplify future changes.
13014
13015 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13016
13017 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13018
13019 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13020 Use much-faster test for byte-length change.
13021 Don't assume string byte-length fits in 'int'.
13022 Check that character arg fits in 'int'.
13023 (mapcar1): Declare byte as byte, for clarity.
13024
13025 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13026
13027 * fns.c (concat): Catch string overflow earlier.
13028 Do not rely on integer wraparound.
13029
13030 * dispextern.h (struct it.overlay_strings_charpos)
13031 (struct it.selective): Now EMACS_INT, not int.
13032 * xdisp.c (forward_to_next_line_start)
13033 (back_to_previous_visible_line_start)
13034 (reseat_at_next_visible_line_start, next_element_from_buffer):
13035 Don't arbitrarily truncate the value of 'selective' to int.
13036
13037 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13038
13039 * composite.c: Don't truncate sizes to 'int'.
13040 (composition_gstring_p, composition_reseat_it)
13041 (composition_adjust_point): Use EMACS_INT, not int.
13042 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13043 not EMACS_UINT, for indexes.
13044
13045 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13046
13047 * buffer.c: Include <verify.h>.
13048 (struct sortvec.priority, struct sortstr.priority):
13049 Now EMACS_INT, not int.
13050 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13051 (struct sortstr.size, record_overlay_string)
13052 (struct sortstrlist.size, struct sortlist.used):
13053 Don't truncate size to int.
13054 (record_overlay_string): Check for size-calculation overflow.
13055 (init_buffer_once): Check at compile-time, not run-time.
13056
13057 2011-06-22 Jim Meyering <meyering@redhat.com>
13058
13059 Don't leak an XBM-image-sized buffer
13060 * image.c (xbm_load): Free the image buffer after using it.
13061
13062 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13063
13064 Port to Sun C.
13065 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13066 that Sun C diagnosed.
13067 * fns.c (secure_hash): Fix pointer signedness issue.
13068 * intervals.c (static_offset_intervals): New function.
13069 (offset_intervals): Use it.
13070
13071 2011-06-21 Leo Liu <sdl.web@gmail.com>
13072
13073 * deps.mk (fns.o):
13074 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13075 sha512.h.
13076
13077 * fns.c (secure_hash): Rename from crypto_hash_function and change
13078 the first arg to accept symbols.
13079 (Fsecure_hash): New primitive.
13080 (syms_of_fns): New symbols.
13081
13082 2011-06-20 Deniz Dogan <deniz@dogan.se>
13083
13084 * process.c (Fset_process_buffer): Clarify return value in
13085 docstring.
13086
13087 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13088
13089 * dispnew.c (add_window_display_history): Use BVAR.
13090
13091 * xdisp.c (debug_method_add): Use BVAR.
13092 (check_window_end, dump_glyph_matrix, dump_glyph)
13093 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13094
13095 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13096 Likewise.
13097
13098 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13099 check till after the cache is created in init_frame_faces.
13100
13101 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13102
13103 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13104
13105 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13106
13107 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13108 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13109 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13110
13111 Improve buffer-overflow checking (Bug#8873).
13112 * fileio.c (Finsert_file_contents):
13113 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13114 Remove the old (too-loose) buffer overflow checks.
13115 They weren't needed, since make_gap checks for buffer overflow.
13116 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13117 The old code merely checked for Emacs fixnum overflow, and relied
13118 on undefined (wraparound) behavior. The new code avoids undefined
13119 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13120
13121 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13122 Tune. Don't use wider integers than needed. Don't use alloca.
13123 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13124
13125 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13126
13127 * insdel.c, lisp.h (buffer_overflow): New function.
13128 (insert_from_buffer_1, replace_range, replace_range_2):
13129 * insdel.c (make_gap_larger):
13130 * editfns.c (Finsert_char):
13131 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13132
13133 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13134
13135 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13136
13137 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13138
13139 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13140 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13141
13142 * fileio.c: Don't assume EMACS_INT fits in off_t.
13143 (emacs_lseek): New static function.
13144 (Finsert_file_contents, Fwrite_region): Use it.
13145 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13146
13147 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13148
13149 * fns.c: Don't overflow int when computing a list length.
13150 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13151 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13152 truncation on 64-bit hosts. Check for QUIT every
13153 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13154 faster and is responsive enough.
13155 (Flength): Report an error instead of overflowing an integer.
13156 (Fsafe_length): Return a float if the value is not representable
13157 as a fixnum. This shouldn't happen except in contrived situations.
13158 (Fnthcdr, Fsort): Don't assume list length fits in int.
13159 (Fcopy_sequence): Don't assume vector length fits in int.
13160
13161 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13162 (header_size, word_size): New constants.
13163 (allocate_vectorlike): Don't check size overflow here.
13164 (allocate_vector): Check it here instead, since this is the only
13165 caller of allocate_vectorlike that could cause overflow.
13166 Check that the new vector's length is representable as a fixnum.
13167
13168 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13169 The previous code was bogus. For example, next_almost_prime (32)
13170 returned 39, which is undesirable as it is a multiple of 3; and
13171 next_almost_prime (24) returned 25, which is a multiple of 5 so
13172 why was the code bothering to check for multiples of 7?
13173
13174 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13175
13176 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13177
13178 Variadic C functions now count arguments with ptrdiff_t.
13179 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13180 Back then I didn't know that the Emacs coding style prefers signed int.
13181 Also, in the meantime I found a few more instances where arguments
13182 were being counted with int, which may truncate counts on 64-bit
13183 machines, or EMACS_INT, which may be unnecessarily wide.
13184 * lisp.h (struct Lisp_Subr.function.aMANY)
13185 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13186 Arg counts are now ptrdiff_t, not size_t.
13187 All variadic functions and their callers changed accordingly.
13188 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13189 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13190 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13191 * callint.c (Fcall_interactively): Check arg count for overflow,
13192 to avoid potential buffer overrun. Use signed char, not 'int',
13193 for 'varies' array, so that we needn't bother to check its size
13194 calculation for overflow.
13195 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13196 * eval.c (apply_lambda):
13197 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13198 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13199 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13200
13201 * callint.c (Fcall_interactively): Don't use index var as event count.
13202
13203 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13204 * mem-limits.h (SIZE): Remove; no longer used.
13205
13206 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13207
13208 Remove unnecessary casts.
13209 * xterm.c (x_term_init):
13210 * xfns.c (x_set_border_pixel):
13211 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13212 These aren't needed now that we assume ANSI C.
13213
13214 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13215 It's more likely to cause problems (due to unsigned overflow)
13216 than to cure them.
13217
13218 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13219
13220 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13221
13222 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13223
13224 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13225
13226 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13227
13228 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13229
13230 GLYPH_CODE_FACE returns EMACS_INT, not int.
13231 * dispextern.h (merge_faces):
13232 * xfaces.c (merge_faces):
13233 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13234 Don't assume EMACS_INT fits in int.
13235
13236 * character.h (CHAR_VALID_P): Remove unused parameter.
13237 * fontset.c, lisp.h, xdisp.c: All uses changed.
13238
13239 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13240
13241 * fns.c (concat): Minor tuning based on overflow analysis.
13242 This doesn't fix any bugs. Use int to hold character, instead
13243 of constantly refetching from Emacs object. Use XFASTINT, not
13244 XINT, for value known to be a character. Don't bother comparing
13245 a single byte to 0400, as it's always less.
13246
13247 * floatfns.c (Fexpt):
13248 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13249
13250 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13251 for characters.
13252
13253 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13254
13255 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13256 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13257 incorrectly succeed when S was a string, because 4294967386 was
13258 truncated before it was used.
13259
13260 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13261 Otherwise, an out-of-range integer could cause undefined behavior
13262 on a 64-bit host.
13263
13264 * composite.c: Use int, not EMACS_INT, for characters.
13265 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13266 EMACS_INT, for values that are known to be in character range.
13267 This doesn't fix any bugs but is the usual style inside Emacs and
13268 may generate better code on 32-bit machines.
13269
13270 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13271 This is for reasons similar to the recent CHAR_STRING fix.
13272 * charset.c (Fencode_char): Check that character arg is actually
13273 a character. Pass an int to ENCODE_CHAR.
13274 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13275 wider than 'int', as a compile-time check to prevent future regressions
13276 in this area.
13277
13278 * character.c (char_string): Remove unnecessary casts.
13279
13280 Make sure a 64-bit char is never passed to CHAR_STRING.
13281 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13282 by silently ignoring the top 32 bits, allowing some values
13283 that were far too large to be valid characters.
13284 * character.h: Include <verify.h>.
13285 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13286 arguments are no wider than unsigned, as a compile-time check
13287 to prevent future regressions in this area.
13288 * data.c (Faset):
13289 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13290 (Fsubst_char_in_region):
13291 * fns.c (concat):
13292 * xdisp.c (decode_mode_spec_coding):
13293 Adjust to CHAR_STRING's new requirement.
13294 * editfns.c (Finsert_char, Fsubst_char_in_region):
13295 * fns.c (concat): Check that character args are actually
13296 characters. Without this test, these functions did the wrong
13297 thing with wildly out-of-range values on 64-bit hosts.
13298
13299 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13300 These casts should not be needed on 32-bit hosts, either.
13301 * keyboard.c (read_char):
13302 * lread.c (Fload): Remove casts to unsigned.
13303
13304 * lisp.h (UNSIGNED_CMP): New macro.
13305 This fixes comparison bugs on 64-bit hosts.
13306 (ASCII_CHAR_P): Use it.
13307 * casefiddle.c (casify_object):
13308 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13309 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13310 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13311 * dispextern.h (FACE_FROM_ID):
13312 * keyboard.c (read_char): Use UNSIGNED_CMP.
13313
13314 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13315 not to EMACS_INT, to avoid GCC warning.
13316
13317 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13318
13319 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13320 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13321 isn't needed on 32-bit machines.
13322
13323 * buffer.c (Fgenerate_new_buffer_name):
13324 Use EMACS_INT for count, not int.
13325 (advance_to_char_boundary): Return EMACS_INT, not int.
13326
13327 * data.c (Qcompiled_function): Now static.
13328
13329 * window.c (window_body_lines): Now static.
13330
13331 * image.c (gif_load): Rename local to avoid shadowing.
13332
13333 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13334 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13335 * alloc.c (make_save_value): Integer argument is now of type
13336 ptrdiff_t, not int.
13337 (mark_object): Use ptrdiff_t, not int.
13338 * lisp.h (pD): New macro.
13339 * print.c (print_object): Use it.
13340
13341 * alloc.c: Use EMACS_INT, not int, to count objects.
13342 (total_conses, total_markers, total_symbols, total_vector_size)
13343 (total_free_conses, total_free_markers, total_free_symbols)
13344 (total_free_floats, total_floats, total_free_intervals)
13345 (total_intervals, total_strings, total_free_strings):
13346 Now EMACS_INT, not int. All uses changed.
13347 (Fgarbage_collect): Compute overall total using a double, so that
13348 integer overflow is less likely to be a problem. Check for overflow
13349 when converting back to an integer.
13350 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13351 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13352 These were 'int' variables that could overflow on 64-bit hosts;
13353 they were never used, so remove them instead of repairing them.
13354 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13355 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13356 Previously, this ceilinged at INT_MAX, but that doesn't work on
13357 64-bit machines.
13358 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13359
13360 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13361 (allocate_vectorlike): Check for ptrdiff_t overflow.
13362 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13363 when a (possibly-narrower) signed value would do just as well.
13364 We prefer using signed arithmetic, to avoid comparison confusion.
13365
13366 * alloc.c: Catch some string size overflows that we were missing.
13367 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13368 for convenience in STRING_BYTES_MAX.
13369 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13370 The definition here is exact; the one in lisp.h was approximate.
13371 (allocate_string_data): Check for string overflow. This catches
13372 some instances we weren't catching before. Also, it catches
13373 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13374 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13375 and ptrdiff_t and EMACS_INT are both 64 bits.
13376
13377 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13378 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13379 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13380
13381 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13382
13383 * alloc.c (Fmake_string): Check for out-of-range init.
13384
13385 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13386
13387 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13388
13389 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13390
13391 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13392 xg_get_default_scrollbar_width.
13393
13394 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13395 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13396 (style_changed_cb): Call update_theme_scrollbar_width and call
13397 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13398 all frames (Bug#8505).
13399 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13400 Call gtk_window_set_resizable if HAVE_GTK3.
13401 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13402 and height if HAVE_GTK3 (Bug#8505).
13403 (scroll_bar_width_for_theme): New variable.
13404 (update_theme_scrollbar_width): New function.
13405 (xg_get_default_scrollbar_width): Move code to
13406 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13407 (xg_initialize): Call update_theme_scrollbar_width.
13408
13409 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13410
13411 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13412
13413 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13414
13415 * frame.c (make_frame): Call other_buffer_safely instead of
13416 other_buffer.
13417
13418 * window.c (temp_output_buffer_show): Call display_buffer with
13419 second argument Vtemp_buffer_show_specifiers and reset latter
13420 immediately after the call.
13421 (Vtemp_buffer_show_specifiers): New variable.
13422 (auto_window_vscroll_p, next_screen_context_lines)
13423 (Vscroll_preserve_screen_position): Remove leading asterisks from
13424 doc-strings.
13425
13426 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13427
13428 Fix minor problems found by GCC 4.6.0 static checking.
13429 * buffer.c (Qclone_number): Remove for now, as it's unused.
13430 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13431 (record_buffer): Remove unused local.
13432 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13433 (set_frame_buffer_list): Remove; unused.
13434 * frame.h (other_visible_frames): Remove decl.
13435 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13436 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13437 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13438 if HAVE_GPM.
13439 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13440 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13441 Define only if HAVE_GPM.
13442 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13443 (update_hints_inhibit): Remove; never set. All uses removed.
13444 * widgetprv.h (emacsFrameClassRec): Remove decl.
13445 * window.c (delete_deletable_window): Now returns void, since it
13446 wasn't returning anything.
13447 (compare_window_configurations): Remove unused locals.
13448 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13449 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13450 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13451 the same widths as pointers. This follows up on the 2011-05-06 patch.
13452 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13453 * xterm.h: Likewise.
13454 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13455
13456 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13457
13458 * makefile.w32-in: Update dependencies.
13459 (LISP_H): Add lib/intprops.h.
13460
13461 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13462
13463 * image.c (gif_load): Add animation frame delay to the metadata.
13464 (syms_of_image): Use DEFSYM. New symbol `delay'.
13465
13466 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13467
13468 * window.c (delete_deletable_window): Re-add.
13469 (Fset_window_configuration): Rewrite to handle dead buffers and
13470 consequently deletable windows.
13471 (window_tree, Fwindow_tree): Remove. Supply functionality in
13472 window.el.
13473 (compare_window_configurations): Simplify code.
13474
13475 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13476
13477 * image.c (imagemagick_load_image): Fix type mismatch.
13478 (Fimagemagick_types): Likewise.
13479
13480 * window.h (replace_buffer_in_windows): Declare.
13481
13482 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13483
13484 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13485 Qclone_number. Remove external declaration of Qdelete_window.
13486 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13487 code.
13488 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13489 Run Qbuffer_list_update_hook if allowed.
13490 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13491 buffer list implementation.
13492 (other_buffer_safely): New function.
13493 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13494 calls to replace_buffer_in_windows and
13495 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13496 if allowed.
13497 (record_buffer): Inhibit quitting and rewrite using quittable
13498 functions. Run Qbuffer_list_update_hook if allowed.
13499 (Frecord_buffer, Funrecord_buffer): New functions.
13500 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13501 Move switch-to-buffer to window.el.
13502 (bury-buffer): Move to window.el.
13503 (Vbuffer_list_update_hook): New variable.
13504
13505 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13506 section.
13507
13508 * window.h (resize_frame_windows): Move up in code.
13509 (Fwindow_frame): Remove EXFUN.
13510 (replace_buffer_in_all_windows): Remove prototype.
13511 (replace_buffer_in_windows_safely): Add prototype.
13512
13513 * window.c: Declare Qdelete_window static again. Move down
13514 declaration of select_count.
13515 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13516 (Fother_window): Move to window.el.
13517 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13518 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13519 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13520 window.el.
13521 (replace_buffer_in_windows): Implement by calling
13522 Qreplace_buffer_in_windows.
13523 (replace_buffer_in_all_windows): Remove with some functionality
13524 moved into replace_buffer_in_windows_safely.
13525 (replace_buffer_in_windows_safely): New function.
13526 (select_window_norecord, select_frame_norecord): Move in front
13527 of run_window_configuration_change_hook. Remove now obsolete
13528 declarations.
13529 (Fset_window_buffer): Rewrite doc-string.
13530 Call Qrecord_window_buffer.
13531 (keys_of_window): Move binding for other-window to window.el.
13532
13533 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13534
13535 * dispextern.h (struct image): Replace data member, whose int_val
13536 and ptr_val fields were not used by anything, with a single
13537 lisp_val object.
13538
13539 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13540 (gif_clear_image, gif_load, imagemagick_load_image)
13541 (gs_clear_image, gs_load): Callers changed.
13542
13543 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13544
13545 * buffer.h: Include <time.h>, for time_t.
13546 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13547
13548 Fix minor problems found by static checking.
13549
13550 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13551
13552 Make identifiers static if they are not used in other modules.
13553 * data.c (Qcompiled_function, Qframe, Qvector):
13554 * image.c (QimageMagick, Qsvg):
13555 * minibuf.c (Qmetadata):
13556 * window.c (resize_window_check, resize_root_window): Now static.
13557 * window.h (resize_window_check, resize_root_window): Remove decls.
13558
13559 * window.c (window_deletion_count, delete_deletable_window):
13560 Remove; unused.
13561 (window_body_lines): Now static.
13562 (Fdelete_other_windows_internal): Mark vars as initialized.
13563 Make sure 'resize_failed' is initialized.
13564 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13565 (resize_window_apply): Remove unused local.
13566 * window.h (delete_deletable_window): Remove decl.
13567
13568 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13569 (imagemagick_load_image): Fix pointer signedness problem by changing
13570 last arg from unsigned char * to char *. All uses changed.
13571 Also, fix a local for similar reasons.
13572 Remove unused locals. Remove locals to avoid shadowing.
13573 (fn_rsvg_handle_free): Remove; unused.
13574 (svg_load, svg_load_image): Fix pointer signedness problem.
13575 (imagemagick_load_image): Don't use garbage pointer image_wand.
13576
13577 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13578
13579 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13580
13581 * image.c (gif_load): Fix omitted cast error introduced by
13582 2011-06-06 change.
13583
13584 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13585
13586 * window.h (resize_proportionally, orig_total_lines)
13587 (orig_top_line): Remove from window structure.
13588 (set_window_height, set_window_width, change_window_heights)
13589 (Fdelete_window): Remove prototypes.
13590 (resize_frame_windows): Remove duplicate declaration.
13591
13592 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13593
13594 * window.h (resize_frame_windows, resize_window_check)
13595 (delete_deletable_window, resize_root_window)
13596 (resize_frame_windows): Declare prototypes.
13597
13598 * window.c (resize_window_apply): Make definition be "static" to
13599 match the prototype.
13600
13601 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13602
13603 * window.c: Remove declarations of Qwindow_size_fixed,
13604 window_min_size_1, window_min_size_2, window_min_size,
13605 size_window, window_fixed_size_p, enlarge_window, delete_window.
13606 Remove static from declaration of Qdelete_window, it's
13607 temporarily needed by Fbury_buffer.
13608 (replace_window): Don't assign orig_top_line and
13609 orig_total_lines.
13610 (Fdelete_window, delete_window): Remove. Window deletion is
13611 handled by window.el.
13612 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13613 Replace Fdelete_window calls with calls to Qdelete_window.
13614 (Fdelete_other_windows): Remove. Deleting other windows is
13615 handled by window.el.
13616 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13617 handled in window.el.
13618 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13619 Window minimum sizes are handled in window.el.
13620 (shrink_windows, size_window, set_window_height)
13621 (set_window_width, change_window_heights, window_height)
13622 (window_width, CURBEG, CURSIZE, enlarge_window)
13623 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13624 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13625 handled in window.el.
13626 (make_dummy_parent): Rename to make_parent_window and give it a
13627 second argument horflag.
13628 (make_window): Don't set resize_proportionally any more.
13629 (Fsplit_window): Remove. Windows are split in window.el.
13630 (save_restore_action, save_restore_orig_size)
13631 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13632 Resize mini windows in window.el.
13633 (grow_mini_window, shrink_mini_window): Implement by calling
13634 Qresize_root_window_vertically, resize_window_check and
13635 resize_window_apply.
13636 (saved_window, Fset_window_configuration, save_window_save):
13637 Do not handle orig_top_line, orig_total_lines, and
13638 resize_proportionally.
13639 (window_min_height, window_min_width): Move to window.el.
13640 (keys_of_window): Move bindings for delete-other-windows,
13641 split-window, delete-window and enlarge-window to window.el.
13642
13643 * buffer.c: Temporarily extern Qdelete_window.
13644 (Fbury_buffer): Temporarily call Qdelete_window instead of
13645 Fdelete_window (Fbury_buffer will move to window.el soon).
13646
13647 * frame.c (set_menu_bar_lines_1): Remove code handling
13648 orig_top_line and orig_total_lines.
13649
13650 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13651 set_window_height but set heights directly.
13652 (change_frame_size_1): Use resize_frame_windows.
13653
13654 * xdisp.c (init_xdisp): Don't use set_window_height but set
13655 heights directly.
13656
13657 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13658 Use resize_frame_windows instead of change_window_heights and run
13659 run_window_configuration_change_hook.
13660
13661 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13662 instead of change_window_heights and run
13663 run_window_configuration_change_hook.
13664
13665 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13666
13667 * window.c (replace_window): Rename second argument REPLACEMENT to
13668 NEW. New third argument SETFLAG. Rewrite.
13669 (delete_window, make_dummy_parent): Call replace_window with
13670 third argument 1.
13671 (window_list_1): Move down in code.
13672 (run_window_configuration_change_hook): Move set_buffer part
13673 before select_frame_norecord part in order to unwind correctly.
13674 Rename count1 to count.
13675 (recombine_windows, delete_deletable_window, resize_root_window)
13676 (Fdelete_other_windows_internal)
13677 (Frun_window_configuration_change_hook, make_parent_window)
13678 (resize_window_check, resize_window_apply, Fresize_window_apply)
13679 (resize_frame_windows, Fsplit_window_internal)
13680 (Fdelete_window_internal, Fresize_mini_window_internal):
13681 New functions.
13682 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13683
13684 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13685
13686 * window.h (window): Add some new members to window structure -
13687 normal_lines, normal_cols, new_total, new_normal, clone_number,
13688 splits, nest, prev_buffers, next_buffers.
13689 (WINDOW_TOTAL_SIZE): Move here from window.c.
13690 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13691
13692 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13693 Remove.
13694 (make_dummy_parent): Set new members of windows structure.
13695 (make_window): Move down in code. Handle new members of window
13696 structure.
13697 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13698 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13699 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13700 (Fset_window_prev_buffers, Fwindow_next_buffers)
13701 (Fset_window_next_buffers, Fset_window_clone_number):
13702 New functions.
13703 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13704 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13705 Doc-string fixes.
13706 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13707 Argument WINDOW can be now internal window too.
13708 (Fwindow_use_time): Move up in code.
13709 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13710 Rewrite doc-string.
13711 (Fset_window_configuration, saved_window)
13712 (Fcurrent_window_configuration, save_window_save): Handle new
13713 members of window structure.
13714 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13715 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13716 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13717 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13718 Qget_mru_window, Qresize_root_window,
13719 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13720 Qauto_buffer_name; staticpro them.
13721
13722 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13723
13724 * window.c (Fwindow_total_size, Fwindow_left_column)
13725 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13726 (Fwindow_list_1): New functions.
13727 (window_box_text_cols): Replace with window_body_cols.
13728 (Fwindow_width, Fscroll_left, Fscroll_right):
13729 Use window_body_cols instead of window_box_text_cols.
13730 (delete_window, Fset_window_configuration):
13731 Call delete_all_subwindows with window as argument.
13732 (delete_all_subwindows): Take a window as argument and not a
13733 structure. Rewrite.
13734 (window_loop): Remove handling of GET_LRU_WINDOW and
13735 GET_LARGEST_WINDOW.
13736 (Fget_lru_window, Fget_largest_window): Move to window.el.
13737
13738 * window.h: Extern window_body_cols instead of
13739 window_box_text_cols. delete_all_subwindows now takes a
13740 Lisp_Object as argument.
13741
13742 * indent.c (compute_motion, Fcompute_motion):
13743 Use window_body_cols instead of window_box_text_cols.
13744
13745 * frame.c (delete_frame): Call delete_all_subwindows with root
13746 window as argument.
13747
13748 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13749
13750 * fns.c (Fputhash): Document return value.
13751
13752 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13753
13754 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13755
13756 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13757
13758 Cons<->int and similar integer overflow fixes (Bug#8794).
13759
13760 Check for overflow when converting integer to cons and back.
13761 * charset.c (Fdefine_charset_internal, Fdecode_char):
13762 Use cons_to_unsigned to catch overflow.
13763 (Fencode_char): Use INTEGER_TO_CONS.
13764 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13765 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13766 * data.c (long_to_cons, cons_to_long): Remove.
13767 (cons_to_unsigned, cons_to_signed): New functions.
13768 These signal an error for invalid or out-of-range values.
13769 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13770 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13771 * font.c (Ffont_variation_glyphs):
13772 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13773 * lisp.h: Include <intprops.h>.
13774 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13775 (cons_to_signed, cons_to_unsigned): New decls.
13776 (long_to_cons, cons_to_long): Remove decls.
13777 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13778 (Fprimitive_undo): Use CONS_TO_INTEGER.
13779 * xfns.c (Fx_window_property): Likewise.
13780 * xselect.c: Include <limits.h>.
13781 (x_own_selection, selection_data_to_lisp_data):
13782 Use INTEGER_TO_CONS.
13783 (x_handle_selection_request, x_handle_selection_clear)
13784 (x_get_foreign_selection, Fx_disown_selection_internal)
13785 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13786 (lisp_data_to_selection_data): Use cons_to_unsigned.
13787 (x_fill_property_data): Use cons_to_signed.
13788 Report values out of range.
13789
13790 Check for buffer and string overflow more precisely.
13791 * buffer.h (BUF_BYTES_MAX): New macro.
13792 * lisp.h (STRING_BYTES_MAX): New macro.
13793 * alloc.c (Fmake_string):
13794 * character.c (string_escape_byte8):
13795 * coding.c (coding_alloc_by_realloc):
13796 * doprnt.c (doprnt):
13797 * editfns.c (Fformat):
13798 * eval.c (verror):
13799 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13800 since they may not be the same number.
13801 * editfns.c (Finsert_char):
13802 * fileio.c (Finsert_file_contents):
13803 Likewise for BUF_BYTES_MAX.
13804
13805 * image.c: Use ptrdiff_t, not int, for sizes.
13806 (slurp_file): Switch from int to ptrdiff_t.
13807 All uses changed.
13808 (slurp_file): Check that file size fits in both size_t (for
13809 malloc) and ptrdiff_t (for sanity and safety).
13810
13811 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13812 if b->modtime has its maximal value.
13813
13814 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13815
13816 Don't assume time_t can fit into int.
13817 * buffer.h (struct buffer.modtime): Now time_t, not int.
13818 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13819 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13820
13821 Minor fixes for signed vs unsigned integers.
13822 * character.h (MAYBE_UNIFY_CHAR):
13823 * charset.c (maybe_unify_char):
13824 * keyboard.c (read_char, reorder_modifiers):
13825 XINT -> XFASTINT, since the integer must be nonnegative.
13826 * ftfont.c (ftfont_spec_pattern):
13827 * keymap.c (access_keymap, silly_event_symbol_error):
13828 XUINT -> XFASTINT, since the integer must be nonnegative.
13829 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13830 since it makes no difference and we prefer signed.
13831 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13832 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13833 nonnegative.
13834
13835 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13836
13837 * window.h (Fwindow_frame): Declare.
13838
13839 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13840
13841 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13842 (SPARE_MEMORY): Always define.
13843 (LARGE_REQUEST): Remove.
13844 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13845
13846 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13847
13848 * lisp.h: Move EXFUNS for Fframe_root_window,
13849 Fframe_first_window and Fset_frame_selected_window to window.h.
13850
13851 * window.h: Move EXFUNS for Fframe_root_window,
13852 Fframe_first_window and Fset_frame_selected_window here from
13853 lisp.h.
13854
13855 * frame.c (Fwindow_frame, Fframe_first_window)
13856 (Fframe_root_window, Fframe_selected_window)
13857 (Fset_frame_selected_window): Move to window.c.
13858 (Factive_minibuffer_window): Move to minibuf.c.
13859 (Fother_visible_frames_p): New function.
13860
13861 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13862
13863 * window.c (decode_window, decode_any_window): Move up in code.
13864 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13865 (inhibit_frame_unsplittable): Remove unused variable.
13866 (Fwindow_buffer): Move up and rewrite doc-string.
13867 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13868 (Fwindow_prev): New functions.
13869 (Fwindow_frame): Move here from frame.c. Accept any window as
13870 argument.
13871 (Fframe_root_window, Fframe_first_window)
13872 (Fframe_selected_window): Move here from frame.c. Accept frame
13873 or arbitrary window as argument. Update doc-strings.
13874 (Fminibuffer_window): Move up in code.
13875 (Fwindow_minibuffer_p): Move up in code and simplify.
13876 (Fset_frame_selected_window): Move here from frame.c.
13877 Marginal rewrite.
13878 (Fselected_window, select_window, Fselect_window): Move up in
13879 code. Minor doc-string fixes.
13880
13881 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13882
13883 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13884 Do not assume that spare memory exists; that assumption is valid
13885 only if SYSTEM_MALLOC.
13886 (LARGE_REQUEST): New macro, so that the issue of large requests
13887 is separated from the issue of spare memory.
13888
13889 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13890
13891 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13892 format. (Bug#8806)
13893
13894 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13895
13896 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13897 before statements.
13898
13899 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13900
13901 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13902
13903 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13904
13905 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13906 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13907
13908 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13909
13910 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13911
13912 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13913
13914 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13915 (x_clipboard_manager_save): Add return value.
13916 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13917 New error handlers.
13918 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13919 Obey Vx_select_enable_clipboard_manager. Catch errors in
13920 x_clipboard_manager_save (Bug#8779).
13921 (Vx_select_enable_clipboard_manager): New variable.
13922 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13923
13924 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13925
13926 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13927
13928 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13929
13930 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13931 in the current matrix if keep_current_p is non-zero.
13932
13933 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13934
13935 * bidi.c (bidi_level_of_next_char): Fix last change.
13936
13937 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13938
13939 Support bidi reordering of text covered by display properties.
13940
13941 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13942 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13943 (bidi_cache_search, bidi_cache_iterator_state)
13944 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13945 (bidi_level_of_next_char, bidi_move_to_visually_next):
13946 Support character positions inside a run of characters covered by a
13947 display string.
13948 (bidi_paragraph_init, bidi_resolve_explicit_1)
13949 (bidi_level_of_next_char): Call bidi_fetch_char and
13950 bidi_fetch_char_advance instead of FETCH_CHAR and
13951 FETCH_CHAR_ADVANCE.
13952 (bidi_init_it): Initialize new members.
13953 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13954 definitions.
13955 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13956 instead of using explicit *_CHAR codes.
13957 (bidi_resolve_explicit, bidi_resolve_weak):
13958 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13959 bidirectional text is supported only in multibyte buffers.
13960 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13961 it to initialize the frame_window_p member of struct bidi_it.
13962 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13963 (bidi_resolve_explicit, bidi_resolve_weak)
13964 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13965 bidi_it->nchars is non-positive.
13966 (bidi_level_of_next_char): Don't try to lookup the cache for the
13967 next/previous character if nothing is cached there yet, or if we
13968 were just reseat()'ed to a new position.
13969
13970 * xdisp.c (set_cursor_from_row): Set start and stop points
13971 according to the row's direction when priming the loop that looks
13972 for the glyph on which to display cursor.
13973 (single_display_spec_intangible_p): Function deleted.
13974 (display_prop_intangible_p): Reimplement to call
13975 handle_display_spec instead of single_display_spec_intangible_p.
13976 Accept 3 additional arguments needed by handle_display_spec.
13977 This fixes incorrect cursor motion across display property with complex
13978 values: lists, `(when COND...)' forms, etc.
13979 (single_display_spec_string_p): Support property values that are
13980 lists with the argument STRING its top-level element.
13981 (display_prop_string_p): Fix the condition for processing a
13982 property that is a list to be consistent with handle_display_spec.
13983 (handle_display_spec): New function, refactored from the
13984 last portion of handle_display_prop.
13985 (compute_display_string_pos): Accept additional argument
13986 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13987 value of a `display' property is a "replacing spec".
13988 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13989 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13990 the display property, but just return a value indicating whether
13991 the display property will replace the characters it covers.
13992 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13993 frame_window_p members of struct bidi_it.
13994 (compute_display_string_pos, compute_display_string_end):
13995 New functions.
13996 (push_it): Accept second argument POSITION, where pop_it should
13997 jump to continue iteration.
13998 (reseat_1): Initialize bidi_it.disp_pos.
13999
14000 * keyboard.c (adjust_point_for_property): Adjust the call to
14001 display_prop_intangible_p to its new signature.
14002
14003 * dispextern.h (struct bidi_it): New member frame_window_p.
14004 (bidi_init_it): Update prototypes.
14005 (display_prop_intangible_p): Update prototype.
14006 (compute_display_string_pos, compute_display_string_end):
14007 Declare prototypes.
14008 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14009 EMACS_INT.
14010
14011 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14012
14013 Malloc failure behavior now depends on size of allocation.
14014 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14015 * lisp.h: Change signatures accordingly.
14016 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14017 All callers changed. (Bug#8762)
14018
14019 * gnutls.c: Use Emacs's memory allocators.
14020 Without this change, the gnutls library would invoke malloc etc.
14021 directly, which causes problems on non-SYNC_INPUT hosts, and which
14022 runs afoul of improving memory_full behavior. (Bug#8761)
14023 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14024 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14025 xfree instead of the default malloc, realloc, free.
14026 (Fgnutls_boot): No need to check for memory allocation failure,
14027 since xmalloc does that for us.
14028
14029 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14030 * category.c (hash_get_category_set):
14031 * ccl.c (ccl_driver):
14032 * charset.c (Fdefine_charset_internal):
14033 * charset.h (struct charset.hash_index):
14034 * composite.c (get_composition_id, gstring_lookup_cache)
14035 (composition_gstring_put_cache):
14036 * composite.h (struct composition.hash_index):
14037 * dispextern.h (struct image.hash):
14038 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14039 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14040 (hashfn_equal, hashfn_user_defined, make_hash_table)
14041 (maybe_resize_hash_table, hash_lookup, hash_put)
14042 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14043 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14044 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14045 * image.c (make_image, search_image_cache, lookup_image)
14046 (xpm_put_color_table_h):
14047 * lisp.h (struct Lisp_Hash_Table):
14048 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14049 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14050 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14051 * alloc.c (allocate_vectorlike):
14052 Check for overflow in vector size calculations.
14053 * ccl.c (ccl_driver):
14054 Check for overflow when converting EMACS_INT to int.
14055 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14056 need to be updated by these changes.
14057 * fns.c (make_hash_table, maybe_resize_hash_table):
14058 Check for integer overflow with large hash tables.
14059 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14060 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14061 (SXHASH_REDUCE): New macro.
14062 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14063 Use it instead of discarding useful hash info with large hash values.
14064 (sxhash_float): New function.
14065 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14066 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14067 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14068 Rewrite to use FIXNUM_BITS, as this simplifies things.
14069 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14070 Adjust signatures to match updated version of code.
14071 (consing_since_gc): Now EMACS_INT, since a single hash table can
14072 use more than INT_MAX bytes.
14073
14074 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14075
14076 Make it possible to build with GCC-4.6+ -O2 -flto.
14077
14078 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14079
14080 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14081
14082 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14083 Call minibuffer-inactive-mode.
14084
14085 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14086
14087 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14088 Update dependencies.
14089
14090 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14091
14092 * data.c (init_data): Remove code for UTS, this system is not
14093 supported anymore.
14094
14095 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14096
14097 Don't force ./temacs to start in terminal mode.
14098
14099 * frame.c (make_initial_frame): Initialize faces in all cases, not
14100 only when CANNOT_DUMP is defined.
14101 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14102
14103 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14104
14105 * dispnew.c (add_window_display_history): Use const for the string
14106 pointer. Remove declaration, not needed.
14107
14108 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14109
14110 Use 'inline', not 'INLINE'.
14111 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14112 * alloc.c, fontset.c (INLINE): Remove.
14113 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14114 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14115 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14116 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14117 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14118
14119 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14120
14121 Make it possible to run ./temacs.
14122
14123 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14124 syms_of_callproc does the same thing. Remove test for
14125 "initialized", do it in the caller.
14126 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14127
14128 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14129
14130 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14131 (read_minibuf): Use get_minibuffer.
14132 (syms_of_minibuf): Use DEFSYM.
14133 (Qmetadata): New var.
14134 * data.c (Qbuffer): Don't make it static.
14135 (syms_of_data): Use DEFSYM.
14136
14137 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14138
14139 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14140 (CCL_CODE_MIN): New macro.
14141
14142 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14143
14144 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14145
14146 * eval.c (Qdebug): Now static.
14147 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14148 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14149 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14150
14151 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14152
14153 * image.c: Various fixes to ImageMagick code comments.
14154 (Fimagemagick_types): Doc fix.
14155
14156 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14157
14158 Minor fixes prompted by GCC 4.6.0 warnings.
14159
14160 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14161
14162 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14163 (x_clipboard_manager_save_all): Move extern decl to ...
14164 * xterm.h: ... here, so that it can be checked for consistency.
14165
14166 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14167
14168 * xselect.c (x_clipboard_manager_save_frame)
14169 (x_clipboard_manager_save_all): New functions.
14170 (Fx_clipboard_manager_save): Lisp function deleted.
14171
14172 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14173 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14174
14175 * xterm.h: Update prototype.
14176
14177 2011-05-28 William Xu <william.xwl@gmail.com>
14178
14179 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14180 exiting (Bug#8239).
14181
14182 2011-05-28 Jim Meyering <meyering@redhat.com>
14183
14184 Avoid a sign-extension bug in crypto_hash_function.
14185 * fns.c (to_uchar): Define.
14186 (crypto_hash_function): Use it to convert some newly-signed
14187 variables to unsigned, to avoid sign-extension bugs. For example,
14188 without this change, (md5 "truc") would evaluate to
14189 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14190 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14191 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14192
14193 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14194
14195 Integer overflow fixes.
14196
14197 * dbusbind.c: Serial number integer overflow fixes.
14198 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14199 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14200 to hold a serial number that is too large for a fixnum.
14201 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14202 Check for serial numbers out of range. Decode any serial number
14203 that was so large that it became a float. (Bug#8722)
14204
14205 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14206 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14207 Use XFASTINT rather than XUINT when numbers are nonnegative.
14208 (xd_append_arg, Fdbus_method_return_internal):
14209 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14210 arguments, check that Lisp number is nonnegative, rather than
14211 silently wrapping negative numbers around. (Bug#8722)
14212 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14213 (Bug#8722)
14214
14215 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14216
14217 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14218
14219 ccl: Add integer overflow checks.
14220 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14221 (IN_INT_RANGE): New macros.
14222 (ccl_driver): Use them to check for integer overflow when
14223 decoding a CCL program. Many of the new checks are whether XINT (x)
14224 fits in int; it doesn't always, on 64-bit hosts. The new version
14225 doesn't catch all possible integer overflows, but it's an
14226 improvement. (Bug#8719)
14227
14228 * alloc.c (make_event_array): Use XINT, not XUINT.
14229 There's no need for unsigned here.
14230
14231 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14232 This follows up to the 2011-05-06 change that substituted uintptr_t
14233 for EMACS_INT. This case wasn't caught back then.
14234
14235 Rework Fformat to avoid integer overflow issues.
14236 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14237 now (part of C89). Include <verify.h>.
14238 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14239 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14240 (Fformat): Avoid the prepass trying to compute sizes; it was only
14241 approximate and thus did not catch overflow reliably. Instead, walk
14242 through the format just once, formatting and computing sizes as we go,
14243 checking for integer overflow at every step, and allocating a larger
14244 buffer as needed. Keep track separately whether the format is
14245 multibyte. Keep only the most-recently calculated precision, rather
14246 than them all. Record whether each argument has been converted to
14247 string. Use EMACS_INT, not int, for byte and char and arg counts.
14248 Support field widths and precisions larger than INT_MAX. Avoid
14249 sprintf's undefined behavior with conversion specifications such as %#d
14250 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14251 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14252 formatting out-of-range floating point numbers with int
14253 formats. (Bug#8668)
14254
14255 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14256
14257 * data.c: Avoid integer truncation in expressions involving floats.
14258 * data.c: Include <intprops.h>.
14259 (arith_driver): When there's an integer overflow in an expression
14260 involving floating point, convert the integers to floating point
14261 so that the resulting value does not suffer from catastrophic
14262 integer truncation. For example, on a 64-bit host (* 4
14263 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14264 Do not rely on undefined behavior after integer overflow.
14265
14266 merge count_size_as_multibyte, parse_str_to_multibyte
14267 * character.c, character.h (count_size_as_multibyte):
14268 Rename from parse_str_to_multibyte; all uses changed.
14269 Check for integer overflow.
14270 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14271 since it's now a duplicate of the other. This is more of
14272 a character than a buffer op, so better that it's in character.c.
14273 * fns.c, print.c: Adjust to above changes.
14274
14275 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14276
14277 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14278
14279 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14280
14281 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14282 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14283 (x_clipboard_manager_save): Now static.
14284 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14285
14286 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14287 (crypto_hash_function): Now static.
14288 Fix pointer signedness problems. Avoid unnecessary initializations.
14289
14290 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14291
14292 * termhooks.h (Vselection_alist): Make it terminal-local.
14293
14294 * terminal.c (create_terminal): Initialize it.
14295
14296 * xselect.c: Support for clipboard managers.
14297 (Vselection_alist): Move to termhooks.h as terminal-local var.
14298 (LOCAL_SELECTION): New macro.
14299 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14300 (symbol_to_x_atom): Remove gratuitous arg.
14301 (x_handle_selection_request, lisp_data_to_selection_data)
14302 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14303 (x_own_selection, x_get_local_selection, x_convert_selection):
14304 New arg, specifying work frame. Use terminal-local Vselection_alist.
14305 (some_frame_on_display): Delete unused function.
14306 (Fx_own_selection_internal, Fx_get_selection_internal)
14307 (Fx_disown_selection_internal, Fx_selection_owner_p)
14308 (Fx_selection_exists_p): New optional frame arg.
14309 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14310 (x_handle_selection_clear): Don't treat other terminals with the
14311 same keyboard specially. Use the terminal-local Vselection_alist.
14312 (x_clear_frame_selections): Use Frun_hook_with_args.
14313
14314 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14315
14316 * xterm.h: Add support for those atoms.
14317
14318 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14319
14320 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14321 (converted_selections, conversion_fail_tag): New global variables.
14322 (x_selection_request_lisp_error): Free the above.
14323 (x_get_local_selection): Remove unnecessary code.
14324 (x_reply_selection_request): Args changed; handle arbitrary array
14325 of converted selections stored in converted_selections.
14326 Separate the XChangeProperty and SelectionNotify steps.
14327 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14328 (x_convert_selection): New function.
14329 (x_handle_selection_event): Simplify.
14330 (x_get_foreign_selection): Don't ignore incoming requests while
14331 waiting for an answer; this will fail when we implement
14332 SAVE_TARGETS, and seems unnecessary anyway.
14333 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14334 (Vx_sent_selection_functions): Doc fix.
14335
14336 2011-05-26 Leo Liu <sdl.web@gmail.com>
14337
14338 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14339
14340 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14341
14342 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14343
14344 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14345 for fringe update if it has periodic bitmap.
14346 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14347 and fringe_bitmap_periodic_p.
14348
14349 * fringe.c (get_fringe_bitmap_data): New function.
14350 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14351 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14352 row. Mark glyph row for fringe update if periodicity changed.
14353
14354 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14355 for fringe update unless it has periodic bitmap.
14356
14357 2011-05-25 Kenichi Handa <handa@m17n.org>
14358
14359 * xdisp.c (get_next_display_element): Set correct it->face_id for
14360 a static composition.
14361
14362 2011-05-24 Leo Liu <sdl.web@gmail.com>
14363
14364 * deps.mk (fns.o):
14365 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14366
14367 * fns.c (crypto_hash_function, Fsha1): New function.
14368 (Fmd5): Use crypto_hash_function.
14369 (syms_of_fns): Add Ssha1.
14370
14371 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14372
14373 * gnutls.c: Remove unused macros.
14374 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14375 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14376 Remove macros that are defined and never used.
14377 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14378
14379 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14380
14381 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14382 (Fx_get_selection_internal): Minor cleanup.
14383 (Fx_own_selection_internal): Rename arguments for consistency with
14384 select.el.
14385
14386 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14387
14388 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14389
14390 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14391
14392 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14393
14394 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14395
14396 * dispnew.c (scrolling_window): Don't exclude the case that the
14397 last enabled row in the desired matrix touches the bottom boundary.
14398
14399 2011-05-21 Glenn Morris <rgm@gnu.org>
14400
14401 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14402 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14403 and add some more files.
14404
14405 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14406
14407 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14408 report_file_error introduced by the change from 2011-05-07.
14409
14410 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14411
14412 * systime.h (Time): Define only if emacs is defined.
14413 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14414 where the include path doesn't have X11/X.h by default. See
14415 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14416
14417 2011-05-20 Kenichi Handa <handa@m17n.org>
14418
14419 * composite.c (find_automatic_composition): Fix previous change.
14420
14421 2011-05-20 Glenn Morris <rgm@gnu.org>
14422
14423 * lisp.mk: New file, split from Makefile.in.
14424 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14425 (shortlisp): Remove.
14426 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14427
14428 2011-05-19 Glenn Morris <rgm@gnu.org>
14429
14430 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14431 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14432 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14433 (lisp): Set the order to that of loadup.el.
14434 (shortlisp): Make it a copy of $lisp.
14435 (SOME_MACHINE_LISP): Remove.
14436 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14437 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14438
14439 2011-05-18 Kenichi Handa <handa@m17n.org>
14440
14441 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14442 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14443 (find_automatic_composition): Mostly rewrite for efficiency.
14444
14445 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14446
14447 * makefile.w32-in: Update dependencies.
14448
14449 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14450
14451 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14452 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14453
14454 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14455
14456 Fix some integer overflow issues, such as string length overflow.
14457
14458 * insdel.c (count_size_as_multibyte): Check for string overflow.
14459
14460 * character.c (lisp_string_width): Check for string overflow.
14461 Use EMACS_INT, not int, for string indexes and lengths; in
14462 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14463 the resulting string length overflows an EMACS_INT; instead,
14464 report a string overflow if no precision given. When checking for
14465 precision exhaustion, use a check that cannot possibly have
14466 integer overflow. (Bug#8675)
14467 * character.h (lisp_string_width): Adjust to new signature.
14468
14469 * alloc.c (string_overflow): New function.
14470 (Fmake_string): Use it. This doesn't change behavior, but saves
14471 a few bytes and will simplify future changes.
14472 * character.c (string_escape_byte8): Likewise.
14473 * lisp.h (string_overflow): New decl.
14474
14475 Fixups, following up to the user-interface timestamp change.
14476 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14477 for UI timestamps, instead of unsigned long.
14478 * msdos.c (mouse_get_pos): Likewise.
14479 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14480 * w32gui.h (Time): Define by including "systime.h" rather than by
14481 declaring it ourselves. (Bug#8664)
14482
14483 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14484 * image.c (clear_image_cache): Likewise.
14485
14486 * term.c (term_mouse_position): Don't assume time_t wraparound.
14487
14488 Be more systematic about user-interface timestamps.
14489 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14490 and sometimes 'EMACS_UINT', to represent these timestamps.
14491 This change causes it to use 'Time' uniformly, as that's what X uses.
14492 This makes the code easier to follow, and makes it easier to catch
14493 integer overflow bugs such as Bug#8664.
14494 * frame.c (Fmouse_position, Fmouse_pixel_position):
14495 Use Time, not unsigned long, for user-interface timestamps.
14496 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14497 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14498 * keyboard.h (last_event_timestamp): Likewise.
14499 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14500 * menu.h (xmenu_show): Likewise.
14501 * term.c (term_mouse_position): Likewise.
14502 * termhooks.h (struct input_event.timestamp): Likewise.
14503 (struct terminal.mouse_position_hook): Likewise.
14504 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14505 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14506 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14507 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14508 what it was before.
14509 * menu.h, termhooks.h: Include "systime.h", for Time.
14510
14511 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14512 Don't assume that the difference between two unsigned long values
14513 can fit into an integer. At this point, we know button_down_time
14514 <= event->timestamp, so the difference must be nonnegative, so
14515 there's no need to cast the result if double-click-time is
14516 nonnegative, as it should be; check that it's nonnegative, just in
14517 case. This bug is triggered when events are more than 2**31 ms
14518 apart (about 25 days). (Bug#8664)
14519
14520 * xselect.c (last_event_timestamp): Remove duplicate decl.
14521 (x_own_selection): Remove needless cast to unsigned long.
14522
14523 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14524 that always fit in int. Use a sentinel instead of a counter, to
14525 avoid a temp and to allay GCC's concerns about possible int overflow.
14526 * frame.h (struct frame): Use int for menu_bar_items_used
14527 instead of EMACS_INT, since it always fits in int.
14528
14529 * menu.c (grow_menu_items): Check for int overflow.
14530
14531 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14532
14533 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14534 Before, the code was not consistent. These values cannot exceed
14535 2**31 - 1 so there's no need to make them unsigned.
14536 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14537 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14538 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14539 as modifiers.
14540 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14541
14542 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14543 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14544 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14545 presumably because the widths might not match.
14546
14547 * window.c (size_window): Avoid needless test at loop start.
14548
14549 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14550
14551 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14552
14553 2011-05-12 Drew Adams <drew.adams@oracle.com>
14554
14555 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14556
14557 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14558
14559 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14560 `width' to `bar_area_x' and `bar_area_width', respectively.
14561 (x_scroll_run): Take account of fringe background extension.
14562
14563 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14564 Rename local vars `left' and `width' to `bar_area_x' and
14565 `bar_area_width', respectively.
14566 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14567 background extension.
14568
14569 2011-05-10 Jim Meyering <meyering@redhat.com>
14570
14571 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14572
14573 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14574
14575 * image.c (Finit_image_library): Return t for built-in image types,
14576 like pbm and xbm. (Bug#8640)
14577
14578 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14579
14580 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14581
14582 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14583
14584 * w32console.c (Fset_screen_color): Doc fix.
14585 (Fget_screen_color): New function.
14586 (syms_of_ntterm): Defsubr it.
14587
14588 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14589 unlink the temporary file if Fcall_process didn't create it in the
14590 first place.
14591 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14592 child process will be redirected to a file specified with `:file'.
14593 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14594 cue to call_process_cleanup not to close that handle.
14595
14596 2011-05-07 Ben Key <bkey76@gmail.com>
14597
14598 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14599 one of two shell specific rules, either bootstrap-temacs-CMD or
14600 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14601 to the previous implementation of the bootstrap-temacs rule.
14602 The bootstrap-temacs-CMD rule is similar to the previous
14603 implementation of the bootstrap-temacs rule except that it
14604 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14605 variable.
14606
14607 These changes, along with some changes to nt/configure.bat,
14608 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14609 earlier fix to add support for --cflags and --ldflags options
14610 that include quotes so that it works whether make uses cmd or
14611 sh as the shell.
14612
14613 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14614
14615 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14616 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14617 is a constant.
14618 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14619 a string. Handle both cases.
14620 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14621 (Fdbus_register_method): Use Qinvalid_function.
14622
14623 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14624
14625 * makefile.w32-in: Update dependencies.
14626 (LISP_H): Add inttypes.h and stdin.h.
14627 (PROCESS_H): Add unistd.h.
14628
14629 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14630
14631 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14632 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14633
14634 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14635
14636 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14637
14638 * term.c (vfatal): Remove stray call to va_end.
14639 It's not needed and the C Standard doesn't allow it here anyway.
14640
14641 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14642 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14643
14644 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14645 bytes.
14646
14647 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14648
14649 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14650
14651 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14652
14653 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14654
14655 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14656
14657 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14658 * charset.c (Fdefine_charset_internal): Don't initialize
14659 charset.code_space[15]. The value was garbage, on hosts with
14660 32-bit int (Bug#8600).
14661
14662 * lread.c (read_integer): Be more consistent with string-to-number.
14663 Use string_to_number to do the actual conversion; this avoids
14664 rounding errors and fixes some other screwups. Without this fix,
14665 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14666 (digit_to_number): Move earlier, for benefit of read_integer.
14667 Return -1 if the digit is out of range for the base, -2 if it is
14668 not a digit in any supported base. (Bug#8602)
14669
14670 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14671
14672 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14673 to match comment at start of function. This also removes a
14674 GCC warning about overflow in a 32+64-bit port.
14675
14676 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14677
14678 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14679 Reported by Stefan Monnier in
14680 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14681 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14682 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14683
14684 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14685 (EMACS_UINTPTR): Likewise, with uintptr_t.
14686
14687 * lisp.h: Prefer 64-bit EMACS_INT if available.
14688 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14689 on 32-bit hosts that have 64-bit int, so that they can access
14690 large files.
14691 However, temporarily disable this change unless the temporary
14692 symbol WIDE_EMACS_INT is defined.
14693
14694 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14695
14696 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14697 This removes an assumption that EMACS_INT and long are the same
14698 width as pointers. The assumption is true for Emacs porting targets
14699 now, but we want to make other targets possible.
14700 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14701 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14702 In the rest of the code, change types of integers that hold casted
14703 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14704 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14705 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14706 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14707 No need to cast type when ORing.
14708 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14709 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14710 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14711 assume EMACS_INT is the same width as char *.
14712 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14713 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14714 Remove no-longer-needed casts.
14715 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14716 (xg_tool_bar_help_callback, xg_make_tool_item):
14717 Use EMACS_INTPTR to hold an integer
14718 that will be cast to void *; this can avoid a GCC warning
14719 if EMACS_INT is not the same width as void *.
14720 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14721 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14722 (current_message_1, set_message_1):
14723 Use a local to convert to proper width without a cast.
14724 * xmenu.c (dialog_selection_callback): Likewise.
14725
14726 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14727 Also, don't assume VALBITS / RAND_BITS is less than 5,
14728 and don't rely on undefined behavior when shifting a 1 left into
14729 the sign bit.
14730 * lisp.h (get_random): Change signature to match.
14731
14732 * lread.c (hash_string): Use size_t, not int, for hash computation.
14733 Normally we prefer signed values; but hashing is special, because
14734 it's better to use unsigned division on hash table sizes so that
14735 the remainder is nonnegative. Also, size_t is the natural width
14736 for hashing into memory. The previous code used 'int', which doesn't
14737 retain enough info to hash well into very large tables.
14738 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14739
14740 * dbusbind.c: Don't possibly lose pointer info when converting.
14741 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14742 Use XPNTR rather than XHASH, so that the high-order bits of
14743 the pointer aren't lost when converting through void *.
14744
14745 * eval.c (Fautoload): Don't double-shift a pointer.
14746
14747 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14748
14749 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14750
14751 * gnutls.c (DEF_GNUTLS_FN):
14752 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14753
14754 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14755
14756 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14757 marker. (Bug#8610)
14758
14759 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14760
14761 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14762 New version that can reserve upto 2GB of heap space.
14763
14764 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14765
14766 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14767
14768 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14769
14770 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14771 `gnutls_certificate_set_x509_key_file'.
14772
14773 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14774
14775 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14776 Update dependencies.
14777
14778 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14779
14780 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14781 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14782 Remove unused parameter `fildes'.
14783 * process.c (read_process_output, send_process): Don't pass it.
14784
14785 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14786
14787 Fix previous change: the library cache is defined in w32.c.
14788 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14789 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14790
14791 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14792
14793 Implement dynamic loading of GnuTLS on Windows.
14794
14795 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14796 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14797 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14798 Declare.
14799
14800 * gnutls.c (Qgnutls_dll): Define.
14801 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14802 (gnutls_*): Declare function pointers.
14803 (init_gnutls_functions): New function to initialize function pointers.
14804 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14805 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14806 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14807 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14808 (emacs_gnutls_write, emacs_gnutls_read)
14809 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14810 (Fgnutls_available_p): New function.
14811 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14812 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14813 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14814
14815 * image.c: Include w32.h.
14816 (Vimage_type_cache): Delete.
14817 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14818 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14819 (w32_delayed_load): Move to w32.c.
14820
14821 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14822
14823 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14824 (w32_delayed_load): Move from image.c. When loading a library, record
14825 its filename in the :loaded-from property of the library id.
14826 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14827 Initialize and staticpro them.
14828 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14829
14830 * process.c: Include lisp.h before w32.h, not after.
14831 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14832 instead of gnutls_record_check_pending.
14833
14834 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14835
14836 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14837
14838 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14839 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14840 as passed in.
14841
14842 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14843
14844 * xterm.c (x_set_frame_alpha): Do not set property on anything
14845 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14846
14847 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14848
14849 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14850
14851 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14852
14853 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14854 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14855 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14856 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14857 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14858 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14859 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14860 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14861 (Qgnutls_bootprop_callbacks_verify): Make static.
14862
14863 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14864
14865 * callproc.c: Indentation fixup.
14866
14867 * sysdep.c (wait_for_termination_1): Make static.
14868 (wait_for_termination, interruptible_wait_for_termination):
14869 Move after wait_for_termination_1.
14870
14871 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14872
14873 * sysdep.c (interruptible_wait_for_termination): New function
14874 which is like wait_for_termination, but allows keyboard
14875 interruptions.
14876
14877 * callproc.c (Fcall_process): Add (:file "file") as an option for
14878 the STDOUT buffer.
14879 (Fcall_process_region): Ditto.
14880
14881 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14882
14883 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14884 rather than `XVECTOR (FOO)->size'.
14885
14886 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14887 inttypes.h, as a gnulib replacement is used if it not available in
14888 system headers.
14889
14890 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14891
14892 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14893 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14894 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14895
14896 * coding.c (coding_alloc_by_realloc): Error out if destination
14897 will grow beyond MOST_POSITIVE_FIXNUM.
14898 (decode_coding_emacs_mule): Abort if there isn't enough place in
14899 charbuf for the composition carryover bytes. Reserve an extra
14900 space for up to 2 characters produced in a loop.
14901 (decode_coding_iso_2022): Abort if there isn't enough place in
14902 charbuf for the composition carryover bytes.
14903
14904 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14905
14906 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14907 aborting when %lld or %lll format is passed.
14908 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14909 %llo or %llx format is passed. (Bug#8545)
14910
14911 * window.c (window_scroll_line_based): Use a marker instead of
14912 simple variables to record original value of point. (Bug#7952)
14913
14914 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14915 produced by %s or %c overflows available buffer space. (Bug#8545)
14916
14917 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14918
14919 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14920 (SIZE_MAX): Move defn after all includes, as they might #define it.
14921
14922 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14923
14924 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14925
14926 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14927
14928 * keyboard.c (Qdelayed_warnings_hook): Define.
14929 (command_loop_1): Run `delayed-warnings-hook'
14930 if Vdelayed_warnings_list is non-nil.
14931 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14932 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14933
14934 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14935
14936 * doprnt.c (doprnt): Don't return value smaller than the buffer
14937 size if the message was truncated. (Bug#8545).
14938
14939 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14940
14941 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14942 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14943
14944 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14945
14946 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14947
14948 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14949
14950 * makefile.w32-in: Update dependencies.
14951
14952 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14953
14954 Improve `doprnt' and its usage. (Bug#8545)
14955 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14956 `format_end'. Remove support for %l as a conversion specifier.
14957 Don't use xrealloc. Improve diagnostics when the %l size modifier
14958 is used. Update the commentary.
14959
14960 * eval.c (verror): Simplify calculation of size_t.
14961
14962 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14963 messages.
14964
14965 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14966
14967 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14968 change.
14969
14970 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14971
14972 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14973 This makes this file independent of the recent pseudovector change.
14974
14975 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14976
14977 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14978
14979 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14980 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14981 Remove unused local.
14982 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14983
14984 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14985 GCC 4.6.0 optimizes based on type-based alias analysis.
14986 For example, if b is of type struct buffer * and v of type struct
14987 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14988 != &v->size, and therefore "v->size = 1; b->size = 2; return
14989 v->size;" must therefore return 1. This assumption is incorrect
14990 for Emacs, since it type-puns struct Lisp_Vector * with many other
14991 types. To fix this problem, this patch adds a new type struct
14992 vectorlike_header that documents the constraints on layout of vectors
14993 and pseudovectors, and helps optimizing compilers not get fooled
14994 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14995 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14996 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14997 the size member.
14998 (XSETPVECTYPE): Rewrite in terms of new macro.
14999 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15000 This is a bit clearer, and further avoids the possibility of
15001 undesirable aliasing.
15002 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15003 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15004 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15005 since Lisp_Subr is a special case (no "next" field).
15006 (ASIZE): Now uses header.size rather than size.
15007 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15008 to avoid the hassle of writing XVECTOR (foo)->header.size.
15009 (struct vectorlike_header): New type.
15010 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15011 object, to help avoid aliasing.
15012 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15013 (SUBRP): Likewise, since Lisp_Subr is a special case.
15014 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15015 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15016 (struct Lisp_Hash_Table): Combine first two members into a single
15017 struct vectorlike_header member. All uses of "size" and "next" members
15018 changed to be "header.size" and "header.next".
15019 * buffer.h (struct buffer): Likewise.
15020 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15021 * frame.h (struct frame): Likewise.
15022 * process.h (struct Lisp_Process): Likewise.
15023 * termhooks.h (struct terminal): Likewise.
15024 * window.c (struct save_window_data, struct saved_window): Likewise.
15025 * window.h (struct window): Likewise.
15026 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15027 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15028 * buffer.c (init_buffer_once): Likewise.
15029 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15030 special case.
15031 * process.c (Fformat_network_address): Use local var for size,
15032 for brevity.
15033
15034 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15035
15036 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15037 * data.c (atof): Remove decl; no longer used or needed.
15038 (digit_to_number): Move to lread.c.
15039 (Fstring_to_number): Use new string_to_number function, to be
15040 consistent with how the Lisp reader treats infinities and NaNs.
15041 Do not assume that floating-point numbers represent EMACS_INT
15042 without losing information; this is not true on most 64-bit hosts.
15043 Avoid double-rounding errors, by insisting on integers when
15044 parsing non-base-10 numbers, as the documentation specifies.
15045 * lisp.h (string_to_number): New decl, replacing ...
15046 (isfloat_string): Remove.
15047 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15048 (read1): Do not accept +. and -. as integers; this
15049 appears to have been a coding error. Similarly, do not accept
15050 strings like +-1e0 as floating point numbers. Do not report
15051 overflow for integer overflows unless the base is not 10 which
15052 means we have no simple and reliable way to continue.
15053 Break out the floating-point parsing into a new
15054 function string_to_number, so that Fstring_to_number parses
15055 floating point numbers consistently with the Lisp reader.
15056 (digit_to_number): Move here from data.c. Make it static inline.
15057 (E_CHAR, EXP_INT): Remove, replacing with ...
15058 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15059 (string_to_number): New function, replacing isfloat_string.
15060 This function checks for valid syntax and produces the resulting
15061 Lisp float number too. Rework it so that string-to-number
15062 no longer mishandles examples like "1.0e+". Use strtoumax,
15063 so that overflow for non-base-10 numbers is reported only when
15064 there's no portable and simple way to convert to floating point.
15065
15066 * textprop.c (set_text_properties_1): Rewrite for clarity,
15067 and to avoid GCC warning about integer overflow.
15068
15069 * intervals.h (struct interval): Use EMACS_INT for members
15070 where EMACS_UINT might cause problems. See
15071 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15072 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15073 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15074 All uses changed.
15075 (offset_intervals): Tell GCC not to worry about length overflow
15076 when negating a negative length.
15077
15078 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15079 (overrun_check_free): Likewise.
15080
15081 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15082 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15083 word size.
15084
15085 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15086 (gnutls_make_error): Rename local to avoid shadowing.
15087 (gnutls_emacs_global_deinit): ifdef out; not used.
15088 (Fgnutls_boot): Use const for pointer to readonly storage.
15089 Comment out unused local. Fix pointer signedness problems.
15090
15091 * lread.c (openp): Don't stuff size_t into an 'int'.
15092 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15093 about possible signed overflow.
15094
15095 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15096 (GDK_KEY_g): Don't define if already defined.
15097 (xg_prepare_tooltip): Avoid pointer signedness problem.
15098 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15099
15100 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15101 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15102
15103 * xfns.c (Fx_window_property): Simplify a bit,
15104 to make a bit faster and to avoid GCC 4.6.0 warning.
15105 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15106
15107 * fns.c (internal_equal): Don't assume size_t fits in int.
15108
15109 * alloc.c (compact_small_strings): Tighten assertion a little.
15110
15111 Replace pEd with more-general pI, and fix some printf arg casts.
15112 * lisp.h (pI): New macro, generalizing old pEd macro to other
15113 conversion specifiers. For example, use "...%"pI"d..." rather
15114 than "...%"pEd"...".
15115 (pEd): Remove. All uses replaced with similar uses of pI.
15116 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15117 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15118 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15119 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15120 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15121 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15122 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15123 64-bit hosts.
15124 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15125 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15126 * print.c (safe_debug_print, print_object): Likewise.
15127 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15128 to int.
15129 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15130 avoiding the 0 flag, which is not portable.
15131 * process.c (Fmake_network_process): Use pI to avoid cast.
15132 * region-cache.c (pp_cache): Likewise.
15133 * xdisp.c (decode_mode_spec): Likewise.
15134 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15135 behavior on 64-bit hosts with printf arg.
15136 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15137 (x_stop_queuing_selection_requests): Likewise.
15138 (x_get_window_property): Don't truncate byte count to an 'int'
15139 when tracing.
15140
15141 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15142 here, since it parses constructs like leading '-' and spaces,
15143 which are not wanted; and it overflows with large numbers.
15144 Instead, simply match F[0-9]+, which is what is wanted anyway.
15145
15146 * alloc.c: Remove unportable assumptions about struct layout.
15147 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15148 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15149 (allocate_vectorlike, make_pure_vector): Use the new macros,
15150 plus offsetof, to remove unportable assumptions about struct layout.
15151 These assumptions hold on all porting targets that I know of, but
15152 they are not guaranteed, they're easy to remove, and removing them
15153 makes further changes easier.
15154
15155 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15156 This doesn't fix a bug but makes the code clearer.
15157 (string_overrun_cookie): Now const. Use initializers that
15158 don't formally overflow signed char, to avoid warnings.
15159 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15160 can cause Emacs to crash when string overrun checking is enabled.
15161 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15162 multiple of sizeof (EMACS_INT); it need not be, if
15163 alignof(EMACS_INT) < sizeof (EMACS_INT).
15164 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15165
15166 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15167
15168 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15169
15170 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15171
15172 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15173 supposed to be handshaking. (Bug#8556)
15174 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15175
15176 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15177
15178 * lisp.h (Qdebug): List symbol.
15179 * eval.c (Qdebug): Restore global linkage.
15180 * keyboard.c (debug-on-event): New variable.
15181 (handle_user_signal): Break into debugger when debug-on-event
15182 matches the current signal symbol.
15183
15184 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15185
15186 * alloc.c (check_sblock, check_string_bytes)
15187 (check_string_free_list): Convert to standard C.
15188
15189 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15190
15191 * w32.c (emacs_gnutls_push): Fix typo.
15192
15193 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15194
15195 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15196 "cast to pointer from integer of different size".
15197
15198 Improve doprnt and its use in verror. (Bug#8545)
15199 * doprnt.c (doprnt): Document the set of format control sequences
15200 supported by the function. Use SAFE_ALLOCA instead of always
15201 using `alloca'.
15202
15203 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15204 is one byte too soon. Don't use xrealloc; instead xfree and
15205 xmalloc anew.
15206
15207 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15208
15209 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15210 callbacks stage.
15211
15212 * gnutls.c: Renamed global_initialized to
15213 gnutls_global_initialized. Added internals for the
15214 :verify-hostname-error, :verify-error, and :verify-flags
15215 parameters of `gnutls-boot' and documented those parameters in the
15216 docstring. Start callback support.
15217 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15218 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15219 on error. Return error code.
15220 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15221 (emacs_gnutls_read): Likewise.
15222 (Fgnutls_boot): Return handshake error code.
15223 (emacs_gnutls_handle_error): New function.
15224 (wsaerror_to_errno): Likewise.
15225
15226 * w32.h (emacs_gnutls_pull): Add prototype.
15227 (emacs_gnutls_push): Likewise.
15228
15229 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15230 (emacs_gnutls_push): Likewise.
15231
15232 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15233
15234 * process.c (wait_reading_process_output): Check if GnuTLS
15235 buffered some data internally if no FDs are set for TLS
15236 connections.
15237
15238 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15239 (LIBS): Link to USER_LIBS.
15240 ($(BLD)/gnutls.$(0)): New target.
15241
15242 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15243
15244 * xdisp.c (handle_single_display_spec): Rename the
15245 display_replaced_before_p argument into display_replaced_p, to
15246 make it consistent with the commentary. Fix typos in the
15247 commentary.
15248
15249 * textprop.c (syms_of_textprop): Remove dead code.
15250 (copy_text_properties): Delete obsolete commentary about an
15251 interface that was deleted long ago. Fix typos in the description
15252 of arguments.
15253
15254 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15255 to changes in oldXMenu/XMenu.h from 2011-04-16.
15256 <menu_help_message, prev_menu_help_message>: Constify.
15257 (IT_menu_make_room): menu->help_text is now `const char **';
15258 adjust.
15259
15260 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15261 to changes in oldXMenu/XMenu.h from 2011-04-16.
15262 (struct XMenu): Declare `help_text' `const char **'.
15263
15264 * xfaces.c <Qunspecified>: Make extern again.
15265
15266 * syntax.c: Include sys/types.h before including regex.h, as
15267 required by POSIX.
15268
15269 * doc.c (get_doc_string): Improve the format passed to `error'.
15270
15271 * doprnt.c (doprnt): Improve commentary.
15272
15273 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15274
15275 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15276 them with etags.
15277
15278 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15279 changes in globals.h immediately force recompilation.
15280 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15281 $(CURDIR)/s/ms-w32.h.
15282 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15283
15284 * character.c (Fchar_direction): Function deleted.
15285 (syms_of_character): Don't defsubr it.
15286 <char-direction-table>: Deleted.
15287
15288 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15289
15290 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15291 * doprnt.c: Include limits.h.
15292 (SIZE_MAX): New macro.
15293 (doprnt): Return a size_t value. 2nd arg is now size_t.
15294 Many local variables are now size_t instead of int or unsigned.
15295 Improve overflow protection. Support `l' modifier for integer
15296 conversions. Support %l conversion. Don't assume an EMACS_INT
15297 argument for integer conversions and for %c.
15298
15299 * lisp.h (doprnt): Restore prototype.
15300
15301 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15302 $(SRC)/character.h.
15303
15304 * Makefile.in (base_obj): Add back doprnt.o.
15305
15306 * deps.mk (doprnt.o): Add back prerequisites.
15307 (callint.o): Depend on character.h.
15308
15309 * eval.c (internal_lisp_condition_case): Include the handler
15310 representation in the error message.
15311 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15312 when breaking from the loop.
15313
15314 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15315
15316 * callint.c (Fcall_interactively): When displaying error message
15317 about invalid control letter, pass the character's codepoint, not
15318 a pointer to its multibyte form. Improve display of the character
15319 in octal and display also its hex code.
15320
15321 * character.c (char_string): Use %x to display the (unsigned)
15322 codepoint of an invalid character, to avoid displaying a bogus
15323 negative value.
15324
15325 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15326 `error', not SYMBOL_NAME itself.
15327
15328 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15329 character arguments to `error'.
15330
15331 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15332 to `error' in error message about FINAL_CHAR argument. Make sure
15333 FINAL_CHAR is a character, and use %c when it is passed as
15334 argument to `error'.
15335
15336 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15337
15338 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15339
15340 * w32.c: Include <time.h>.
15341 (sys_localtime): New function.
15342
15343 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15344
15345 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15346
15347 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15348
15349 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15350
15351 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15352 zombies (Bug#8467).
15353
15354 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15355
15356 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15357 gl_state.e_property when gl_state.object is Qt.
15358
15359 * insdel.c (make_gap_larger): Remove limitation of buffer size
15360 to <= INT_MAX.
15361
15362 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15363
15364 * xdisp.c (lookup_glyphless_char_display)
15365 (produce_glyphless_glyph): Handle cons cell entry in
15366 glyphless-char-display.
15367 (Vglyphless_char_display): Document it.
15368
15369 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15370 glyphless-char-display.
15371
15372 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15373
15374 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15375
15376 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15377
15378 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15379 definition for no-X builds.
15380
15381 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15382
15383 Static checks with GCC 4.6.0 and non-default toolkits.
15384
15385 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15386
15387 * process.c (keyboard_bit_set): Define only if SIGIO.
15388 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15389 (send_process): Repair possible setjmp clobbering.
15390
15391 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15392
15393 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15394
15395 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15396
15397 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15398 Define only if needed.
15399
15400 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15401 by pacifying GCC about it. Maybe it's time to retire it?
15402 * xfaces.c (USG, __TIMEVAL__): Likewise.
15403
15404 * dispextern.h (struct redisplay_interface): Rename param
15405 to avoid shadowing.
15406 * termhooks.h (struct terminal): Likewise.
15407 * xterm.c (xembed_send_message): Likewise.
15408
15409 * insdel.c (make_gap_smaller): Define only if
15410 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15411
15412 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15413 it.
15414
15415 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15416 so that we aren't warned about unused symbols.
15417
15418 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15419
15420 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15421
15422 * xfns.c (x_real_positions): Mark locals as initialized.
15423
15424 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15425
15426 * xterm.c: Fix problems found by static analysis with other toolkits.
15427 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15428 (x_dispatch_event): Declare static if USE_GTK, and
15429 define if USE_GTK || USE_X_TOOLKIT.
15430 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15431 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15432 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15433 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15434
15435 * xmenu.c (menu_help_callback): Pointer type fixes.
15436 Use const pointers when pointing at readonly data. Avoid pointer
15437 signedness clashes.
15438 (FALSE): Remove unused macro.
15439 (update_frame_menubar): Remove unused decl.
15440
15441 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15442
15443 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15444 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15445 (single_menu_item): Rename local to avoid shadowing.
15446
15447 * keyboard.c (make_lispy_event): Remove unused local var.
15448
15449 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15450 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15451
15452 * bitmaps: Change bitmaps from unsigned char back to the X11
15453 compatible char. Avoid the old compiler warnings about
15454 out-of-range initializers by using, for example, '\xab' rather
15455 than 0xab.
15456
15457 * xgselect.c (xgselect_initialize): Check vs interface
15458 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15459
15460 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15461
15462 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15463 to read-only memory.
15464
15465 * fns.c (vector): Remove; this old hack is no longer needed.
15466
15467 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15468 Remove unused var.
15469 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15470
15471 * xrdb.c (x_load_resources): Omit unused local.
15472
15473 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15474 (x_window): Rename locals to avoid shadowing.
15475 (USG): Use the kludged USG macro, to pacify gcc.
15476
15477 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15478 (x_term_init): Remove local to avoid shadowing.
15479
15480 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15481
15482 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15483 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15484
15485 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15486
15487 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15488
15489 Fix regex.c, syntax.c and friends for buffers > 2GB.
15490 * syntax.h (struct gl_state_s): Declare character position members
15491 EMACS_INT.
15492
15493 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15494
15495 * textprop.c (verify_interval_modification, interval_of):
15496 Declare arguments EMACS_INT.
15497
15498 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15499 EMACS_INT.
15500
15501 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15502
15503 * indent.c (Fvertical_motion): Local variable it_start is now
15504 EMACS_INT.
15505
15506 * regex.c (re_match, re_match_2, re_match_2_internal)
15507 (bcmp_translate, regcomp, regexec, print_double_string)
15508 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15509 (re_compile_pattern, re_exec): Declare arguments and local
15510 variables `size_t' and `ssize_t' and return values `regoff_t', as
15511 appropriate.
15512 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15513 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15514 <compile_stack_type>: `size' and `avail' are now `size_t'.
15515
15516 * regex.h <regoff_t>: Use ssize_t, not int.
15517 (re_search, re_search_2, re_match, re_match_2): Arguments that
15518 specify buffer/string position and length are now ssize_t and
15519 size_t. Return type is regoff_t.
15520
15521 2011-04-16 Ben Key <bkey76@gmail.com>
15522
15523 * nsfont.m: Fixed bugs in ns_get_family and
15524 ns_descriptor_to_entity that were caused by using free to
15525 deallocate memory blocks that were allocated by xmalloc (via
15526 xstrdup). This caused Emacs to crash when compiled with
15527 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15528 --enable-checking=xmallocoverrun). xfree is now used to
15529 deallocate these memory blocks.
15530
15531 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15532
15533 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15534
15535 emacs_write: Accept and return EMACS_INT for sizes.
15536 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15537 et seq.
15538 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15539 Accept and return EMACS_INT.
15540 (emacs_gnutls_write): Return the number of bytes written on
15541 partial writes.
15542 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15543 (emacs_read, emacs_write): Remove check for negative size, as the
15544 Emacs source code has been audited now.
15545 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15546 (emacs_read, emacs_write): Use it.
15547 * process.c (send_process): Adjust to the new signatures of
15548 emacs_write and emacs_gnutls_write. Do not attempt to store
15549 a byte offset into an 'int'; it might overflow.
15550 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15551
15552 * sound.c: Don't assume sizes fit in 'int'.
15553 (struct sound_device.period_size, alsa_period_size):
15554 Return EMACS_INT, not int.
15555 (struct sound_device.write, vox_write, alsa_write):
15556 Accept EMACS_INT, not int.
15557 (wav_play, au_play): Use EMACS_INT to store sizes and to
15558 record read return values.
15559
15560 2011-04-15 Ben Key <bkey76@gmail.com>
15561
15562 * keyboard.c (Qundefined): Don't declare static since it is used
15563 in nsfns.m.
15564 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15565 static since they are used in nsfont.m.
15566
15567 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15568
15569 * process.c (Qprocessp): Don't declare static.
15570 * lisp.h (Qprocessp): Declare again.
15571
15572 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15573
15574 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15575
15576 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15577
15578 Improve C-level modularity by making more things 'static'.
15579
15580 Don't publish debugger-only interfaces to other modules.
15581 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15582 (verify_bytepos, count_markers): Move decls to the only modules
15583 that need them.
15584 * region-cache.h (pp_cache): Likewise.
15585 * window.h (check_all_windows): Likewise.
15586 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15587
15588 * sysdep.c (croak): Now static, if
15589 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15590 * syssignal.h (croak): Declare only if not static.
15591
15592 * alloc.c (refill_memory_reserve): Now static if
15593 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15594 * lisp.h (refill_memory_reserve): Declare only if not static.
15595
15596 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15597 Define only if USE_LUCID.
15598
15599 * xrdb.c (x_customization_string, x_rm_string): Now static.
15600
15601 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15602 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15603
15604 * xdisp.c (draw_row_with_mouse_face): Now static.
15605 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15606
15607 * window.h (check_all_windows): Mark externally visible.
15608
15609 * window.c (window_deletion_count): Now static.
15610
15611 * undo.c: Make symbols static if they're not exported.
15612 (last_undo_buffer, last_boundary_position, pending_boundary):
15613 Now static.
15614
15615 * textprop.c (interval_insert_behind_hooks): Now static.
15616 (interval_insert_in_front_hooks): Likewise.
15617
15618 * term.c: Make symbols static if they're not exported.
15619 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15620 (max_frame_lines, tty_set_terminal_modes):
15621 (tty_reset_terminal_modes, tty_turn_off_highlight):
15622 (get_tty_terminal): Now static.
15623 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15624 * termhooks.h (term_mouse_moveto): Do not declare if
15625 HAVE_WINDOW_SYSTEM.
15626 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15627 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15628
15629 * sysdep.c: Make symbols static if they're not exported.
15630 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15631 Now static.
15632 (sigprocmask_set, full_mask): Remove; unused.
15633 (wait_debugging): Mark as visible.
15634 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15635 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15636
15637 * syntax.c (syntax_temp): Define only if !__GNUC__.
15638
15639 * sound.c (current_sound_device, current_sound): Now static.
15640
15641 * search.c (searchbufs, searchbuf_head): Now static.
15642
15643 * scroll.c (scroll_cost): Remove; unused.
15644 * dispextern.h (scroll_cost): Remove decl.
15645
15646 * region-cache.h (pp_cache): Mark as externally visible.
15647
15648 * process.c: Make symbols static if they're not exported.
15649 (process_tick, update_tick, create_process, chan_process):
15650 (Vprocess_alist, proc_buffered_char, datagram_access):
15651 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15652 (deactivate_process): Mark defn as static, as well as decl.
15653 * lisp.h (create_process): Remove decl.
15654 * process.h (chan_process, Vprocess_alist): Remove decls.
15655
15656 * print.c: Make symbols static if they're not exported.
15657 (print_depth, new_backquote_output, being_printed, print_buffer):
15658 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15659 (print_interval, print_number_index, initial_stderr_stream):
15660 Now static.
15661 * lisp.h (Fprinc): Remove decl.
15662 (debug_output_compilation_hack): Mark as externally visible.
15663
15664 * sysdep.c (croak): Move decl from here to syssignal.h.
15665 * syssignal.h (croak): Put it here, so the API can be checked when
15666 'croak' is called from dissociate_if_controlling_tty.
15667
15668 * minibuf.c: Make symbols static if they're not exported.
15669 (minibuf_save_list, choose_minibuf_frame): Now static.
15670 * lisp.h (choose_minibuf_frame): Remove decl.
15671
15672 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15673
15674 * lread.c: Make symbols static if they're not exported.
15675 (read_objects, initial_obarray, oblookup_last_bucket_number):
15676 Now static.
15677 (make_symbol): Remove; unused.
15678 * lisp.h (initial_obarray, make_symbol): Remove decls.
15679
15680 * keyboard.c: Make symbols static if they're not exported.
15681 (single_kboard, recent_keys_index, total_keys, recent_keys):
15682 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15683 (this_single_command_key_start, echoing, last_auto_save):
15684 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15685 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15686 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15687 (Vlispy_mouse_stem, double_click_count):
15688 Now static.
15689 (force_auto_save_soon): Define only if SIGDANGER.
15690 (ignore_mouse_drag_p): Now static if
15691 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15692 (print_help): Remove; unused.
15693 (stop_character, last_timer_event): Mark as externally visible.
15694 * keyboard.h (ignore_mouse_drag_p): Declare only if
15695 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15696 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15697 * lisp.h (echoing): Remove decl.
15698 (force_auto_save_soon): Declare only if SIGDANGER.
15699 * xdisp.c (redisplay_window): Simplify code, to make it more
15700 obvious that ignore_mouse_drag_p is not accessed if !defined
15701 USE_GTK && !defined HAVE_NS.
15702
15703 * intervals.c: Make symbols static if they're not exported.
15704 (merge_properties_sticky, merge_interval_right, delete_interval):
15705 Now static.
15706 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15707
15708 * insdel.c: Make symbols static if they're not exported.
15709 However, leave prepare_to_modify_buffer alone. It's never
15710 called from outside this function, but that appears to be a bug.
15711 (combine_after_change_list, combine_after_change_buffer):
15712 (adjust_after_replace, signal_before_change): Now static.
15713 (adjust_after_replace_noundo): Remove; unused.
15714 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15715 (signal_before_change): Remove decls.
15716
15717 * indent.c (val_compute_motion, val_vmotion): Now static.
15718
15719 * image.c: Make symbols static if they're not exported.
15720 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15721 if USE_GTK.
15722 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15723 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15724
15725 * fringe.c (standard_bitmaps): Now static.
15726 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15727
15728 * frame.c: Make symbols static if they're not exported.
15729 (x_report_frame_params, make_terminal_frame): Now static.
15730 (get_frame_param): Now static, unless HAVE_NS.
15731 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15732 (x_get_resource_string): Remove; not used.
15733 * frame.h (make_terminal_frame, x_report_frame_params):
15734 (x_get_resource_string); Remove decls.
15735 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15736 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15737
15738 * font.c, fontset.c: Make symbols static if they're not exported.
15739 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15740 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15741 * font.c (font_close_object): Now static.
15742 * font.h (font_close_object): Remove.
15743 * fontset.c (FONTSET_OBJLIST): Remove.
15744 (free_realized_fontset) #if-0 the body, which does nothing.
15745 (face_suitable_for_char_p): #if-0, as it's never called.
15746 * fontset.h (face_suitable_for_char_p): Remove decl.
15747 * xfaces.c (face_at_string_position):
15748 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15749 since 0 is always ASCII.
15750
15751 * fns.c (weak_hash_tables): Now static.
15752
15753 * fileio.c: Make symbols static if they're not exported.
15754 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15755 (Vwrite_region_annotation_buffers): Now static.
15756
15757 * eval.c: Make symbols static if they're not exported.
15758 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15759 * lisp.h (backtrace_list): Remove decl.
15760
15761 * emacs.c: Make symbols static if they're not exported.
15762 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15763 (fatal_error_code, fatal_error_signal_hook, standard_args):
15764 Now static.
15765 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15766 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15767 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15768 * lisp.h (fatal_error_signal_hook): Remove decl.
15769 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15770
15771 * editfns.c: Move a (normally-unused) function to its only use.
15772 * editfns.c, lisp.h (get_operating_system_release): Remove.
15773 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15774 worth the hassle of breaking this out.
15775
15776 * xterm.c: Make symbols static if they're not exported.
15777 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15778 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15779 (x_destroy_window, x_delete_display):
15780 Now static.
15781 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15782 (x_mouse_leave): Remove; unused.
15783 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15784 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15785 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15786 Remove decls.
15787 (x_mouse_leave): Declare only if WINDOWSNT.
15788 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15789 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15790 USE_X_TOOLKIT.
15791
15792 * ftxfont.c: Make symbols static if they're not exported.
15793 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15794 HAVE_FREETYPE.
15795 * font.h (ftxfont_driver): Likewise.
15796
15797 * xfns.c: Make symbols static if they're not exported.
15798 (x_last_font_name, x_display_info_for_name):
15799 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15800 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15801 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15802 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15803 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15804 (last_show_tip_args): Now static.
15805 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15806 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15807 (x_screen_planes): Remove; unused.
15808 * dispextern.h (x_screen_planes): Remove decl.
15809
15810 * dispnew.c: Make symbols static if they're not exported.
15811 * dispextern.h (redraw_garbaged_frames, scrolling):
15812 (increment_row_positions): Remove.
15813 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15814 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15815 Now static.
15816 (redraw_garbaged_frames): Remove; unused.
15817
15818 * xfaces.c: Make symbols static if they're not exported.
15819 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15820 Remove decls.
15821 * xterm.h (defined_color): Remove decls.
15822 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15823 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15824 (menu_face_changed_default, defined_color, free_realized_face):
15825 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15826 (ascii_face_of_lisp_face): Remove; unused.
15827
15828 * xdisp.c: Make symbols static if they're not exported.
15829 * dispextern.h (scratch_glyph_row, window_box_edges):
15830 (glyph_to_pixel_coords, set_cursor_from_row):
15831 (get_next_display_element, set_iterator_to_next):
15832 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15833 (show_mouse_face): Remove decls
15834 * frame.h (message_buf_print): Likewise.
15835 * lisp.h (pop_message, set_message, check_point_in_composition):
15836 Likewise.
15837 * xterm.h (set_vertical_scroll_bar): Likewise.
15838 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15839 (message_buf_print, scratch_glyph_row, displayed_buffer):
15840 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15841 (get_next_display_element, show_mouse_face, window_box_edges):
15842 (frame_to_window_pixel_xy, check_point_in_composition):
15843 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15844 (glyph_to_pixel_coords): Remove; unused.
15845
15846 * dired.c (file_name_completion): Now static.
15847
15848 * dbusbind.c (xd_in_read_queued_messages): Now static.
15849
15850 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15851 * data.c (circular_list_error): Remove.
15852
15853 * commands.h (last_point_position, last_point_position_buffer):
15854 (last_point_position_window): Remove decls.
15855 * keyboard.c: Make these variables static.
15856
15857 * coding.h (coding, code_convert_region, encode_coding_gap):
15858 Remove decls.
15859 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15860 (iso_code_class, detect_coding, code_convert_region): Now static.
15861 (encode_coding_gap): Remove; unused.
15862
15863 * chartab.c (chartab_chars, chartab_bits): Now static.
15864
15865 * charset.h (charset_iso_8859_1): Remove decl.
15866 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15867 Now static.
15868
15869 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15870 * ccl.c (Vccl_program_table): Now static.
15871 (check_ccl_update): Remove; unused.
15872
15873 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15874 * category.h: ... from here.
15875 * category.c (check_category_table, set_category_set): Now static.
15876
15877 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15878 * lisp.h: Remove these decls.
15879
15880 * buffer.c (buffer_count): Remove unused var.
15881
15882 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15883 so that it's not optimized away.
15884 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15885 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15886 exported only to the debugger.
15887
15888 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15889 * atimer.h (run_all_atimers): Remove; not exported.
15890
15891 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15892 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15893 was inaccessible from Lisp.
15894 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15895 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15896
15897 alloc.c: Import and export fewer symbols, and remove unused items.
15898 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15899 is defined.
15900 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15901 it's not optimized away by whole-program optimization.
15902 (message_enable_multibyte, free_misc): Remove.
15903 (catchlist, handlerlist, mark_backtrace):
15904 Declare only if BYTE_MARK_STACK.
15905 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15906 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15907 (message_enable_multibyte): Remove decl.
15908 (free_misc, interval_free_list, float_block, float_block_index):
15909 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15910 (cons_free_list, last_marked_index):
15911 Now static.
15912 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15913 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15914 (mark_backtrace): Define only if BYTE_MARK_STACK.
15915 * xdisp.c (message_enable_multibyte): Now static.
15916
15917 Declare Lisp_Object Q* variables to be 'static' if not exported.
15918 This makes it easier for human readers (and static analyzers)
15919 to see whether these variables are used from other modules.
15920 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15921 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15922 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15923 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15924 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15925 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15926 * xmenu.c, xselect.c:
15927 Declare Q* vars static if they are not used in other modules.
15928 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15929 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15930 Remove decls of unexported vars.
15931 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15932
15933 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15934
15935 Make Emacs functions such as Fatom 'static' by default.
15936 This makes it easier for human readers (and static analyzers)
15937 to see whether these functions can be called from other modules.
15938 DEFUN now defines a static function. To make the function external
15939 so that it can be used in other C modules, use the new macro DEFUE.
15940 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15941 (Finit_image_library):
15942 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15943 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15944 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15945 Remove decls, since these functions are now static.
15946 (Funintern, Fget_internal_run_time): New decls, since these functions
15947 were already external.
15948
15949 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15950 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15951 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15952 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15953 * keyboard.c, keymap.c, lread.c:
15954 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15955 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15956 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15957 Mark functions with DEFUE instead of DEFUN,
15958 if they are used in other modules.
15959 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15960 decls for now-static functions.
15961 * buffer.h (Fdelete_overlay): Remove decl.
15962 * callproc.c (Fgetenv_internal): Mark as internal.
15963 * composite.c (Fremove_list_of_text_properties): Remove decl.
15964 (Fcomposition_get_gstring): New forward static decl.
15965 * composite.h (Fcomposite_get_gstring): Remove decl.
15966 * dired.c (Ffile_attributes): New forward static decl.
15967 * doc.c (Fdocumntation_property): New forward static decl.
15968 * eval.c (Ffetch_bytecode): New forward static decl.
15969 (Funintern): Remove extern decl; now in .h file where it belongs.
15970 * fileio.c (Fmake_symbolic_link): New forward static decl.
15971 * image.c (Finit_image_library): New forward static decl.
15972 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15973 * intervals.h (Fprevious_property_change):
15974 (Fremove_list_of_text_properties): Remove decls.
15975 * keyboard.c (Fthis_command_keys): Remove decl.
15976 (Fcommand_execute): New forward static decl.
15977 * keymap.c (Flookup_key): New forward static decl.
15978 (Fcopy_keymap): Now static.
15979 * keymap.h (Flookup_key): Remove decl.
15980 * process.c (Fget_process): New forward static decl.
15981 (Fprocess_datagram_address): Mark as internal.
15982 * syntax.c (Fsyntax_table_p): New forward static decl.
15983 (skip_chars): Remove duplicate decl.
15984 * textprop.c (Fprevious_property_change): New forward static decl.
15985 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15986 Now internal.
15987 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15988 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15989
15990 * editfns.c (Fformat): Remove unreachable code.
15991
15992 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15993
15994 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15995 change. (Bug#8496)
15996
15997 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15998
15999 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16000 when at ZV. (Bug#8487)
16001
16002 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16003
16004 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16005 (Bug#8437)
16006 * keyboard.c (parse_tool_bar_item): Likewise.
16007 * sound.c (sound_cleanup, alsa_close): Likewise.
16008 * termcap.c (tgetent): Likewise.
16009 * xfns.c (x_default_font_parameter): Likewise.
16010 * xsettings.c (read_and_apply_settings): Likewise.
16011
16012 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16013 (overrun_check_free): Protoize.
16014
16015 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16016
16017 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16018 since callers should never pass a negative size.
16019 Change the signature to match that of plain 'read' and 'write'; see
16020 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16021 * lisp.h: Update prototypes of emacs_write and emacs_read.
16022
16023 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16024
16025 * xdisp.c (redisplay_window): Don't try to determine the character
16026 position of the scroll margin if the window start point w->startp
16027 is outside the buffer's accessible region. (Bug#8468)
16028
16029 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16030
16031 Fix write-region and its subroutines for buffers > 2GB.
16032 * fileio.c (a_write, e_write): Modify declaration of arguments and
16033 local variables to support buffers larger than 2GB.
16034 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16035
16036 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16037 argument, local variables, and return value.
16038
16039 * lisp.h: Update prototypes of emacs_write and emacs_read.
16040
16041 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16042
16043 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16044
16045 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16046
16047 Fix more problems found by GCC 4.6.0's static checks.
16048
16049 * xdisp.c (vmessage): Use a better test for character truncation.
16050
16051 * charset.c (load_charset_map): <, not <=, for optimization,
16052 and to avoid potential problems with integer overflow.
16053 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16054 * casetab.c (set_identity, shuffle): Likewise.
16055 * editfns.c (Fformat): Likewise.
16056 * syntax.c (skip_chars): Likewise.
16057
16058 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16059 This also lets GCC 4.6.0 generate slightly better loop code.
16060
16061 * callint.c (Fcall_interactively): <, not <=, for optimization.
16062 (Fcall_interactively): Count the number of arguments produced,
16063 not the number of arguments given. This is simpler and lets GCC
16064 4.6.0 generate slightly better code.
16065
16066 * ftfont.c: Distingish more carefully between FcChar8 and char.
16067 The previous code passed unsigned char * to a functions like
16068 strlen and xstrcasecmp that expect char *, which does not
16069 conform to the C standard.
16070 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16071 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16072 char * when the C standard requires it.
16073
16074 * keyboard.c (read_char): Remove unused var.
16075
16076 * eval.c: Port to Windows vsnprintf (Bug#8435).
16077 Include <limits.h>.
16078 (SIZE_MAX): Define if the headers do not.
16079 (verror): Do not give up if vsnprintf returns a negative count.
16080 Instead, grow the buffer. This ports to Windows vsnprintf, which
16081 does not conform to C99. Problem reported by Eli Zaretskii.
16082 Also, simplify the allocation scheme, by avoiding the need for
16083 calling realloc, and removing the ALLOCATED variable.
16084
16085 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16086
16087 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16088 But keep the doprint source code for now, as we might revamp it
16089 and use it again (Bug#8435).
16090 * lisp.h (doprnt): Remove.
16091 * Makefile.in (base_obj): Remove doprnt.o.
16092 * deps.mk (doprnt.o): Remove.
16093
16094 error: Print 32- and 64-bit integers portably (Bug#8435).
16095 Without this change, on typical 64-bit hosts error ("...%d...", N)
16096 was used to print both 32- and 64-bit integers N, which relied on
16097 undefined behavior.
16098 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16099 * lisp.h (error, verror): Mark as printf-like functions.
16100 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16101 Report overflow in size calculations when allocating printf buffer.
16102 Do not truncate output string at its first null byte.
16103 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16104 Truncate the output at a character boundary, since vsnprintf does not
16105 do that.
16106 * charset.c (check_iso_charset_parameter): Convert internal
16107 character to string before calling 'error', since %c now has the
16108 printf meaning.
16109 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16110 overflow when computing char to be passed to 'error'. Do not
16111 pass Lisp_Object to 'error'; pass the integer instead.
16112 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16113 formatted with plain %d.
16114
16115 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16116
16117 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16118
16119 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16120
16121 * xterm.c (x_catch_errors): Remove duplicate declaration.
16122
16123 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16124
16125 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16126
16127 2011-04-10 Jim Meyering <meyering@redhat.com>
16128
16129 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16130 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16131 return ssize_t not "int", and use size_t as the buffer length.
16132 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16133 * gnutls.h: Update declarations.
16134 * process.c (read_process_output): Use ssize_t, to match.
16135 (send_process): Likewise.
16136
16137 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16138
16139 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16140
16141 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16142
16143 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16144 Use unsigned char, to match FcChar8 type definition.
16145
16146 * xterm.c (handle_one_xevent):
16147 * xmenu.c (create_and_show_popup_menu):
16148 * xselect.c (x_decline_selection_request)
16149 (x_reply_selection_request): Avoid type-punned deref of X events.
16150
16151 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16152
16153 Fix some uses of `int' instead of EMACS_INT.
16154 * search.c (string_match_1, fast_string_match)
16155 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16156 (scan_buffer, find_next_newline_no_quit)
16157 (find_before_next_newline, search_command, Freplace_match)
16158 (Fmatch_data): Make some `int' variables be EMACS_INT.
16159
16160 * xdisp.c (display_count_lines): 3rd argument and return value now
16161 EMACS_INT. All callers changed.
16162 (pint2hrstr): Last argument is now EMACS_INT.
16163
16164 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16165 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16166 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16167 (decode_coding_utf_16, decode_coding_emacs_mule)
16168 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16169 (decode_coding_ccl, decode_coding_charset)
16170 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16171 (decode_coding_iso_2022, decode_coding_emacs_mule)
16172 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16173 <char_offset, last_offset>: Declare EMACS_INT.
16174 (encode_coding_utf_8, encode_coding_utf_16)
16175 (encode_coding_emacs_mule, encode_invocation_designation)
16176 (encode_designation_at_bol, encode_coding_iso_2022)
16177 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16178 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16179 Declare EMACS_INT.
16180 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16181 (encode_invocation_designation): Last argument P_NCHARS is now
16182 EMACS_INT.
16183 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16184 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16185
16186 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16187 All users changed.
16188
16189 * ccl.c (Fccl_execute_on_string): Declare some variables
16190 EMACS_INT.
16191
16192 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16193
16194 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16195
16196 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16197
16198 * process.c (Fformat_network_address): Doc fix.
16199
16200 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16201
16202 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16203
16204 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16205
16206 * keyboard.c (read_char): Call Lisp function help-form-show,
16207 instead of using internal_with_output_to_temp_buffer.
16208 (Qhelp_form_show): New var.
16209 (syms_of_keyboard): Use DEFSYM macro.
16210
16211 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16212
16213 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16214
16215 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16216
16217 * process.c (Flist_processes): Remove to Lisp.
16218 (list_processes_1): Delete.
16219
16220 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16221
16222 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16223
16224 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16225
16226 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16227
16228 Fix more problems found by GCC 4.6.0's static checks.
16229
16230 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16231
16232 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16233
16234 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16235
16236 * xdisp.c (vmessage): Mark as a printf-like function.
16237
16238 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16239
16240 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16241
16242 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16243 printf-like functions.
16244 (tiff_load): Add casts to remove these marks before passing them
16245 to system-supplied API.
16246
16247 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16248
16249 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16250 This avoids several warnings with gcc -Wstrict-overflow.
16251 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16252 directly, rather than having caller test rule sign. This avoids
16253 some unnecessary tests.
16254 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16255 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16256 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16257
16258 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16259 (xfont_open): Avoid unnecessary tests.
16260
16261 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16262
16263 * composite.h, composite.c (composition_gstring_put_cache):
16264 Use EMACS_INT, not int, for length.
16265
16266 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16267 breaking out part of COMPOSITION_DECODE_RULE.
16268 (COMPOSITION_DECODE_RULE): Use it.
16269 * composite.c (get_composition_id): Remove unused local vars,
16270 by using the new macro.
16271
16272 * textprop.c (set_text_properties_1): Change while to do-while,
16273 since the condition is always true at first.
16274
16275 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16276 (interval_deletion_adjustment): Return unsigned value.
16277 All uses changed.
16278
16279 * process.c (list_processes_1, create_pty, read_process_output):
16280 (exec_sentinel): Remove vars that were set but not used.
16281 (create_pty): Remove unnecessary "volatile"s.
16282 (Fnetwork_interface_info): Avoid possibility of int overflow.
16283 (read_process_output): Do adaptive read buffering even if carryover.
16284 (read_process_output): Simplify nbytes computation if buffered.
16285
16286 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16287
16288 * syntax.c (scan_words): Remove var that was set but not used.
16289 (update_syntax_table): Use unsigned instead of int.
16290
16291 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16292 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16293 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16294
16295 * print.c (print_error_message): Avoid int overflow.
16296
16297 * font.c (font_list_entities): Redo for clarity,
16298 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16299
16300 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16301 (font_score): Avoid potential overflow in diff calculation.
16302
16303 * fns.c (substring_both): Remove var that is set but not used.
16304 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16305
16306 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16307
16308 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16309 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16310 can always succeed if overflow has undefined behavior.
16311
16312 * search.c (boyer_moore, wordify): Remove vars set but not used.
16313 (wordify): Omit three unnecessary tests.
16314
16315 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16316 All callers changed. This avoids the need for an unused var.
16317
16318 * casefiddle.c (casify_region): Remove var that is set but not used.
16319
16320 * dired.c (file_name_completion): Remove var that is set but not used.
16321
16322 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16323
16324 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16325 (Finsert_file_contents): Remove unnecessary code checking fd.
16326
16327 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16328 Check for integer overflow on size calculations.
16329
16330 * buffer.c (Fprevious_overlay_change): Remove var that is set
16331 but not used.
16332
16333 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16334 Remove vars that are set but not used.
16335 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16336 (timer_check_2): Mark vars as initialized.
16337
16338 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16339
16340 * image.c (lookup_image): Remove var that is set but not used.
16341 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16342
16343 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16344 that are set but not used.
16345
16346 * xfns.c (make_invisible_cursor): Don't return garbage
16347 if XCreateBitmapFromData fails (Bug#8410).
16348
16349 * xselect.c (x_get_local_selection, x_handle_property_notify):
16350 Remove vars that are set but not used.
16351
16352 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16353 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16354
16355 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16356 Remove var that is set but not used.
16357 (scroll_bar_windows_size): Now size_t, not int.
16358 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16359 Check for overflow.
16360
16361 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16362 (map_tty_color) [!defined MSDOS]: Likewise.
16363
16364 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16365
16366 * coding.c: Remove vars that are set but not used.
16367 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16368 All callers changed.
16369 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16370 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16371 (decode_coding_charset): Remove vars that are set but not used.
16372
16373 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16374 that is set but not used.
16375
16376 * print.c (print_object): Remove var that is set but not used.
16377
16378 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16379 The gnulib version avoids calling malloc in the usual case,
16380 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16381 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16382 * filelock.c (current_lock_owner): Likewise.
16383 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16384 * sysdep.c: Include allocator.h, careadlinkat.h.
16385 (emacs_no_realloc_allocator): New static constant.
16386 (emacs_readlink): New function.
16387 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16388 ../lib/careadlinkat.h.
16389
16390 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16391
16392 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16393 first non-nil return value).
16394
16395 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16396
16397 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16398 if not defined (Bug#8403).
16399
16400 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16401
16402 * xdisp.c (display_count_lines): Remove parameter `start',
16403 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16404 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16405 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16406 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16407 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16408 and thereabouts. All callers changed.
16409 (get_per_char_metric): Remove parameter `f', unused since
16410 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16411
16412 2011-04-02 Jim Meyering <meyering@redhat.com>
16413
16414 do not dereference NULL upon failed strdup
16415 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16416 (ns_get_family): Likewise.
16417
16418 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16419
16420 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16421
16422 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16423
16424 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16425 later (Bug#8403).
16426
16427 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16428
16429 Add lexical binding.
16430
16431 * window.c (Ftemp_output_buffer_show): New fun.
16432 (Fsave_window_excursion):
16433 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16434
16435 * lread.c (lisp_file_lexically_bound_p): New function.
16436 (Fload): Bind Qlexical_binding.
16437 (readevalloop): Remove `evalfun' arg.
16438 Bind Qinternal_interpreter_environment.
16439 (Feval_buffer): Bind Qlexical_binding.
16440 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16441 Mark as dynamic.
16442 (syms_of_lread): Declare `lexical-binding'.
16443
16444 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16445
16446 * keyboard.c (eval_dyn): New fun.
16447 (menu_item_eval_property): Use it.
16448
16449 * image.c (parse_image_spec): Use Ffunctionp.
16450
16451 * fns.c (concat, mapcar1): Accept byte-code-functions.
16452
16453 * eval.c (Fsetq): Handle lexical vars.
16454 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16455 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16456 (FletX, Flet): Obey lexical binding.
16457 (Fcommandp): Handle closures.
16458 (Feval): New `lexical' arg.
16459 (eval_sub): New function extracted from Feval. Use it almost
16460 everywhere where Feval was used. Look up vars in lexical env.
16461 Handle closures.
16462 (Ffunctionp): Move from subr.el.
16463 (Ffuncall): Handle closures.
16464 (apply_lambda): Remove `eval_flags'.
16465 (funcall_lambda): Handle closures and new byte-code-functions.
16466 (Fspecial_variable_p): New function.
16467 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16468 but without exporting it to Lisp.
16469
16470 * doc.c (Fdocumentation, store_function_docstring):
16471 * data.c (Finteractive_form): Handle closures.
16472
16473 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16474 interactive spec.
16475
16476 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16477 New byte-codes.
16478 (exec_byte_code): New function extracted from Fbyte_code to handle new
16479 calling convention for byte-code-functions. Add new byte-codes.
16480
16481 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16482
16483 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16484
16485 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16486
16487 * xdisp.c (redisplay_internal): Fix prototype.
16488
16489 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16490
16491 * xdisp.c (SCROLL_LIMIT): New macro.
16492 (try_scrolling): Use it when setting scroll_limit.
16493 Limit scrolling to 100 screen lines.
16494 (redisplay_window): Even when falling back on "recentering",
16495 position point in the window according to scroll-conservatively,
16496 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16497
16498 (try_scrolling): When point is above the window, allow searching
16499 as far as scroll_max, or one screenful, to compute vertical
16500 distance from PT to the scroll margin position. This prevents
16501 try_scrolling from unnecessarily failing when
16502 scroll-conservatively is set to a value slightly larger than the
16503 window height. Clean up the case of PT below the margin at bottom
16504 of window: scroll_max can no longer be INT_MAX. When aggressive
16505 scrolling is in use, don't let point enter the opposite scroll
16506 margin as result of the scroll.
16507 (syms_of_xdisp) <scroll-conservatively>: Document the
16508 threshold of 100 lines for never-recentering scrolling.
16509
16510 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16511
16512 * dispextern.h (move_it_by_lines):
16513 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16514 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16515 (message_log_check_duplicate): Remove parameters `prev_bol' and
16516 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16517 (redisplay_internal): Remove parameter `preserve_echo_area',
16518 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16519
16520 * indent.c (Fvertical_motion):
16521 * window.c (window_scroll_pixel_based, Frecenter):
16522 Don't pass `need_y_p' to `move_it_by_lines'.
16523
16524 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16525
16526 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16527 steal a few bits to be more compact.
16528 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16529 Remove unneeded casts.
16530
16531 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16532
16533 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16534
16535 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16536 binding" message (bug#7967).
16537
16538 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16539
16540 Fix more problems found by GCC 4.6.0's static checks.
16541
16542 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16543 Remove unused local var.
16544
16545 * editfns.c (Fmessage_box): Remove unused local var.
16546
16547 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16548 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16549 Omit unused local vars.
16550 * window.c (shrink_windows): Omit unused local var.
16551 * menu.c (digest_single_submenu): Omit unused local var.
16552 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16553 Omit unused local var.
16554
16555 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16556 Don't assume string length fits in int.
16557 (keyremap_step, read_key_sequence): Use size_t for sizes.
16558 (read_key_sequence): Don't check last_real_key_start redundantly.
16559
16560 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16561 instead of alloca (Bug#8344).
16562
16563 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16564 (Fbacktrace_frame): Don't assume nframes fits in int.
16565
16566 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16567
16568 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16569 concerns.
16570
16571 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16572
16573 * cm.c (calccost): Turn while-do into do-while, for clarity.
16574
16575 * keyboard.c (syms_of_keyboard): Use the same style as later
16576 in this function when indexing through an array. This also
16577 works around GCC bug 48267.
16578
16579 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16580
16581 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16582
16583 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16584 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16585
16586 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16587 This avoids undefined behavior on integer overflow, and is a bit
16588 more convenient anyway since it is compared to a size_t variable.
16589
16590 Variadic C functions now count arguments with size_t, not int.
16591 This avoids an unnecessary limitation on 64-bit machines, which
16592 caused (substring ...) to crash on large vectors (Bug#8344).
16593 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16594 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16595 All variadic functions and their callers changed accordingly.
16596 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16597 * data.c (arith_driver, float_arith_driver): Likewise.
16598 * editfns.c (general_insert_function): Likewise.
16599 * eval.c (struct backtrace.nargs, interactive_p)
16600 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16601 (funcall_lambda, mark_backtrace): Likewise.
16602 * fns.c (concat): Likewise.
16603 * frame.c (x_set_frame_parameters): Likewise.
16604 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16605 0 if not found, not -1. All callers changed.
16606
16607 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16608 (stack_copy_size): Now size_t, not int.
16609 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16610
16611 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16612
16613 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16614 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16615 All callers changed.
16616
16617 * lisp.h (multibyte_char_to_unibyte):
16618 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16619 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16620 * character.h (CHAR_TO_BYTE8):
16621 * cmds.c (internal_self_insert):
16622 * editfns.c (general_insert_function):
16623 * keymap.c (push_key_description):
16624 * search.c (Freplace_match):
16625 * xdisp.c (message_dolog, set_message_1): All callers changed.
16626
16627 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16628
16629 * keyboard.c (safe_run_hook_funcall): New function.
16630 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16631 don't set the hook to nil, but remove the offending function instead.
16632 (Qcommand_hook_internal): Remove, unused.
16633 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16634 Vcommand_hook_internal.
16635
16636 * eval.c (enum run_hooks_condition): Remove.
16637 (funcall_nil, funcall_not): New functions.
16638 (run_hook_with_args): Call each function through a `funcall' argument.
16639 Remove `cond' argument, now redundant.
16640 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16641 (Frun_hook_with_args_until_failure): Adjust accordingly.
16642 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16643
16644 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16645
16646 * dispextern.h (string_buffer_position): Remove declaration.
16647
16648 * print.c (strout): Remove parameter `multibyte', unused since
16649 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16650
16651 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16652 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16653 All callers changed.
16654
16655 * w32.c (_wsa_errlist): Use braces for struct initializers.
16656
16657 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16658 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16659 All callers changed.
16660 (string_buffer_position): Likewise. Also, make static (it's never
16661 used outside xdisp.c).
16662 (cursor_row_p): Remove parameter `w', unused since
16663 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16664 (decode_mode_spec): Remove parameter `precision', introduced during
16665 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16666 All callers changed.
16667
16668 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16669
16670 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16671
16672 2011-03-27 Anders Lindgren <andlind@gmail.com>
16673
16674 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16675 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16676 (ns_update_auto_hide_menu_bar): New functions.
16677 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16678 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16679 ns_constrain_all_frames.
16680 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16681 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16682
16683 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16684
16685 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16686
16687 2011-03-27 Glenn Morris <rgm@gnu.org>
16688
16689 * syssignal.h: Replace RETSIGTYPE with void.
16690 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16691 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16692 Replace SIGTYPE with void everywhere.
16693 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16694 * s/template.h (SIGTYPE): Remove commented out definition.
16695
16696 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16697
16698 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16699 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16700
16701 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16702
16703 * w32.c (read_unc_volume): Use parameter `henum', instead of
16704 global variable `wget_enum_handle'.
16705
16706 * keymap.c (describe_vector): Remove parameters `indices' and
16707 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16708 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16709
16710 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16711
16712 * keyboard.c (timer_check): Remove parameter `do_it_now',
16713 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16714 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16715 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16716
16717 * keyboard.c (read_char):
16718 * w32menu.c (w32_menu_display_help):
16719 * xmenu.c (show_help_event, menu_help_callback):
16720 Adjust calls to `show_help_echo'.
16721
16722 * gtkutil.c (xg_maybe_add_timer):
16723 * keyboard.c (readable_events):
16724 * process.c (wait_reading_process_output):
16725 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16726
16727 * insdel.c (adjust_markers_gap_motion):
16728 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16729 (gap_left, gap_right): Don't call it.
16730
16731 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16732
16733 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16734 incurred during fontification.
16735
16736 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16737
16738 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16739 (DEFVAR_PER_BUFFER): Don't pass it.
16740
16741 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16742 (scrolling_window): Don't pass it.
16743
16744 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16745
16746 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16747
16748 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16749 and `suffix'.
16750 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16751 of variables specific to SELinux and computation of `encoded_absname'.
16752
16753 * image.c (XPutPixel): Remove unused variable `height'.
16754
16755 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16756
16757 * unexw32.c (get_section_info): Remove unused variable `section'.
16758
16759 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16760 (system_process_attributes): Remove unused variable `sess'.
16761 (sys_read): Remove unused variable `err'.
16762
16763 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16764 (w32_wnd_proc): Remove unused variable `isdead'.
16765 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16766 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16767 (x_create_tip_frame): Remove unused variable `tem'.
16768
16769 * w32inevt.c (w32_console_read_socket):
16770 Remove unused variable `no_events'.
16771
16772 * w32term.c (x_draw_composite_glyph_string_foreground):
16773 Remove unused variable `width'.
16774
16775 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16776
16777 * w32term.c (x_set_glyph_string_clipping):
16778 Don't pass uninitialized region to CombineRgn.
16779
16780 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16781
16782 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16783 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16784 (Fx_close_connection): Remove unused variable `i'.
16785
16786 * w32font.c (w32font_draw): Return number of glyphs.
16787 (w32font_open_internal): Remove unused variable `i'.
16788 (w32font_driver): Add missing initializer.
16789
16790 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16791 (fill_in_menu): Remove unused variable `items_added'.
16792
16793 * w32term.c (last_mouse_press_frame): Remove static global variable.
16794 (w32_clip_to_row): Remove unused variable `f'.
16795 (x_delete_terminal): Remove unused variable `i'.
16796
16797 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16798 (NOTHING): Remove unused static global variable.
16799 (uniscribe_check_otf): Remove unused variable `table'.
16800 (uniscribe_font_driver): Add missing initializers.
16801
16802 2011-03-23 Julien Danjou <julien@danjou.info>
16803
16804 * term.c (Fsuspend_tty, Fresume_tty):
16805 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16806 * window.c (temp_output_buffer_show):
16807 * insdel.c (signal_before_change):
16808 * frame.c (Fhandle_switch_frame):
16809 * fileio.c (Fdo_auto_save):
16810 * emacs.c (Fkill_emacs):
16811 * editfns.c (save_excursion_restore):
16812 * cmds.c (internal_self_insert):
16813 * callint.c (Fcall_interactively):
16814 * buffer.c (Fkill_all_local_variables):
16815 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16816 Use Frun_hooks.
16817 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16818 unconditionally since it does the check itself.
16819
16820 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16821
16822 Fix more problems found by GCC 4.5.2's static checks.
16823
16824 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16825 the first time through the loop, since we know p0 < p1 then.
16826 This also avoids a gcc -Wstrict-overflow warning.
16827
16828 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16829 leading to a memory leak, possible in functions like
16830 load_charset_map_from_file that can allocate an unbounded number
16831 of objects (Bug#8318).
16832
16833 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16834 that could (at least in theory) be that large.
16835
16836 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16837 This is less likely to overflow, and avoids undefined behavior if
16838 overflow does occur. All callers changed. Use strtoul to scan
16839 for the unsigned long integer.
16840 (pint2hrstr): Simplify and tune code slightly.
16841 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16842
16843 * scroll.c (do_scrolling): Work around GCC bug 48228.
16844 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16845
16846 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16847 This also avoids a warning with gcc -Wstrict-overflow.
16848 (validate_x_resource_name): Simplify count usage.
16849 This also avoids a warning with gcc -Wstrict-overflow.
16850
16851 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16852 fail (Bug#8306).
16853
16854 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16855
16856 * process.c (Fmake_network_process): Use socklen_t, not int,
16857 where POSIX says socklen_t is required in portable programs.
16858 This fixes a porting bug on hosts like 64-bit HP-UX, where
16859 socklen_t is wider than int (Bug#8277).
16860 (Fmake_network_process, server_accept_connection):
16861 (wait_reading_process_output, read_process_output):
16862 Likewise.
16863
16864 * process.c: Rename or move locals to avoid shadowing.
16865 (list_processes_1, Fmake_network_process):
16866 (read_process_output_error_handler, exec_sentinel_error_handler):
16867 Rename or move locals.
16868 (Fmake_network_process): Define label "retry_connect" only if needed.
16869 (Fnetwork_interface_info): Fix pointer signedness.
16870 (process_send_signal): Add cast to avoid pointer signedness problem.
16871 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16872 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16873
16874 Make tparam.h and terminfo.c consistent.
16875 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16876 Include tparam.h instead, since it declares them.
16877 * cm.h (PC): Remove extern decl; tparam.h now does this.
16878 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16879 * terminfo.c: Include tparam.h, to check interfaces.
16880 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16881 (tparam): Adjust signature to match interface in tparam.h;
16882 this removes some undefined behavior. Check that outstring and len
16883 are zero, which they always are with Emacs.
16884 * tparam.h (PC, BC, UP): New extern decls.
16885
16886 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16887 (xftfont_open): Rename locals to avoid shadowing.
16888
16889 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16890 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16891 (OTF_TAG_SYM): Omit macro if not needed.
16892 (ftfont_list): Remove unused local.
16893 (get_adstyle_property, ftfont_pattern_entity):
16894 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16895 Rename locals to avoid shadowing.
16896
16897 * xfont.c (xfont_list_family): Mark var as initialized.
16898
16899 * xml.c (make_dom): Now static.
16900
16901 * composite.c (composition_compute_stop_pos): Rename local to
16902 avoid shadowing.
16903 (composition_reseat_it): Remove unused locals.
16904 (find_automatic_composition, composition_adjust_point): Likewise.
16905 (composition_update_it): Mark var as initialized.
16906 (find_automatic_composition): Mark vars as initialized,
16907 with a FIXME (Bug#8290).
16908
16909 character.h: Rename locals to avoid shadowing.
16910 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16911 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16912 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16913 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16914 to avoid shadowing.
16915
16916 * textprop.c (property_change_between_p): Remove; unused.
16917
16918 * intervals.c (interval_start_pos): Now static.
16919
16920 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16921
16922 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16923 Rename locals to avoid shadowing.
16924
16925 * sound.c (wav_play, au_play, Fplay_sound_internal):
16926 Fix pointer signedness.
16927 (alsa_choose_format): Remove unused local var.
16928 (wav_play): Initialize a variable to 0, to prevent undefined
16929 behavior (Bug#8278).
16930
16931 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16932
16933 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16934
16935 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16936 clobbering (Bug#8298).
16937 * sysdep.c (sys_subshell): Likewise.
16938 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16939
16940 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16941 This should get cleaned up, so that child_setup has the
16942 same signature on all platforms.
16943
16944 * callproc.c (call_process_cleanup): Now static.
16945 (relocate_fd): Rename locals to avoid shadowing.
16946
16947 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16948
16949 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16950 not to be necessary, and produces flickering.
16951
16952 2011-03-20 Glenn Morris <rgm@gnu.org>
16953
16954 * config.in: Remove file.
16955
16956 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16957
16958 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16959 are now in src/globals.h.
16960 (syms_of_minibuf): Remove spurious & from previous change.
16961
16962 2011-03-20 Leo Liu <sdl.web@gmail.com>
16963
16964 * minibuf.c (completing-read-function): New variable.
16965 (completing-read-default): Rename from completing-read.
16966 (completing-read): Call completing-read-function.
16967
16968 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16969
16970 * xfaces.c (Fx_load_color_file):
16971 Read color file from absolute filename (bug#8250).
16972
16973 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16974
16975 * makefile.w32-in: Update dependencies.
16976
16977 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16978
16979 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16980
16981 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16982
16983 Fix more problems found by GCC 4.5.2's static checks.
16984
16985 * process.c (make_serial_process_unwind, send_process_trap):
16986 (sigchld_handler): Now static.
16987
16988 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16989 That way, the code declares only the vars that it needs.
16990 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16991 * s/cygwin.h (PTY_ITERATION): Likewise.
16992 * s/darwin.h (PTY_ITERATION): Likewise.
16993 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16994
16995 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16996 * process.c (allocate_pty): Don't declare stb unless it's needed.
16997
16998 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16999 (CONSTANTLIM): Remove; unused.
17000 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17001 Define only if needed.
17002
17003 * unexelf.c (unexec): Name an expression,
17004 to avoid gcc -Wbad-function-cast warning.
17005 Use a different way to cause a compilation error if anyone uses
17006 n rather than nn, a way that does not involve shadowing.
17007 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17008
17009 * deps.mk (unexalpha.o): Remove; unused.
17010
17011 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17012 * unexec.h: New file.
17013 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17014 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17015 Depend on unexec.h.
17016 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17017 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17018 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17019 Change as necessary to match prototype in unexec.h.
17020
17021 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17022 shadowing.
17023 (back_comment, skip_chars): Mark vars as initialized.
17024
17025 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17026 Rename locals to avoid shadowing.
17027
17028 * lread.c (read1): Rewrite so as not to use empty "else".
17029 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17030
17031 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17032
17033 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17034 warning when compiling print.c.
17035
17036 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17037 instead of using an uninitialized var.
17038 (font_sort_entities): Mark var as initialized.
17039
17040 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17041
17042 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17043 pointers to constants.
17044 (font_parse_fcname): Remove unused vars.
17045 (font_delete_unmatched): Now static.
17046 (font_get_spec): Remove; unused.
17047 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17048 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17049 Rename or move locals to avoid shadowing.
17050
17051 * fns.c (require_nesting_list, require_unwind): Now static.
17052 (Ffillarray): Rename locals to avoid shadowing.
17053
17054 * floatfns.c (domain_error2): Define only if needed.
17055 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17056
17057 * alloc.c (mark_backtrace): Move decl from here ...
17058 * lisp.h: ... to here, so that it can be checked.
17059
17060 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17061 (Fdefvar): Rewrite so as not to use empty "else".
17062 (lisp_indirect_variable): Name an expression,
17063 to avoid gcc -Wbad-function-cast warning.
17064 (Fdefvar): Rename locals to avoid shadowing.
17065
17066 * callint.c (quotify_arg, quotify_args): Now static.
17067 (Fcall_interactively): Rename locals to avoid shadowing.
17068 Use const pointer when appropriate.
17069
17070 * lisp.h (get_system_name, get_operating_system_release):
17071 Move decls here, to check interfaces.
17072 * process.c (get_operating_system_release): Move decl to lisp.h.
17073 * xrdb.c (get_system_name): Likewise.
17074 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17075 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17076 some of which prompt warnings from gcc -Wbad-function-cast.
17077 (Fformat_time_string, Fencode_time, Finsert_char):
17078 (Ftranslate_region_internal, Fformat):
17079 Rename or remove local vars to avoid shadowing.
17080 (Ftranslate_region_internal): Mark var as initialized.
17081
17082 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17083 avoid shadowing.
17084
17085 * lisp.h (eassert): Check that the argument compiles, even if
17086 ENABLE_CHECKING is not defined.
17087
17088 * data.c (Findirect_variable): Name an expression, to avoid
17089 gcc -Wbad-function-cast warning.
17090 (default_value, arithcompare, arith_driver, arith_error): Now static.
17091 (store_symval_forwarding): Rename local to avoid shadowing.
17092 (Fmake_variable_buffer_local, Fmake_local_variable):
17093 Mark variables as initialized.
17094 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17095
17096 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17097 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17098 Rename locals to avoid shadowing.
17099 (mark_stack): Move local variables into the #ifdef region where
17100 they're used.
17101 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17102 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17103 needed otherwise.
17104 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17105 (GC_STRING_CHARS): Remove; not used.
17106 (Fmemory_limit): Cast sbrk's returned value to char *.
17107
17108 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17109 avoids undefined behavior in theory.
17110
17111 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17112
17113 Use functions, not macros, for up- and down-casing (Bug#8254).
17114 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17115 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17116 to use the following functions instead of these macros.
17117 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17118 EMACS_INT, since callers assume the returned value fits in int.
17119 (upcase1): Likewise, for UPCASE_TABLE.
17120 (uppercasep, lowercasep, upcase): New static inline functions.
17121 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17122 the race-condition problem in the old DOWNCASE.
17123
17124 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17125 Rename locals to avoid shadowing.
17126 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17127 (regex_compile, re_search_2, re_match_2_internal):
17128 Remove unused local vars.
17129 (FREE_VAR): Rewrite so as not to use empty "else",
17130 which gcc can warn about.
17131 (regex_compile, re_match_2_internal): Mark locals as initialized.
17132 (RETALLOC_IF): Define only if needed.
17133 (WORDCHAR_P): Likewise. This one is never needed, but is used
17134 only in a comment talking about a compiler bug, so put inside
17135 the #if 0 of that comment.
17136 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17137 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17138 Remove; unused.
17139
17140 * search.c (boyer_moore): Rename locals to avoid shadowing.
17141 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17142 (PREV_CHAR_BOUNDARY): Likewise.
17143
17144 * search.c (simple_search): Remove unused var.
17145
17146 * dired.c (compile_pattern): Move decl from here ...
17147 * lisp.h: ... to here, so that it can be checked.
17148 (struct re_registers): New forward decl.
17149
17150 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17151
17152 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17153 All uses changed.
17154 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17155 Rename locals to avoid shadowing.
17156 (Fvertical_motion): Mark locals as initialized.
17157
17158 * casefiddle.c (casify_object, casify_region): Now static.
17159 (casify_region): Mark local as initialized.
17160
17161 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17162
17163 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17164 New macros, so that the caller can use some names other than
17165 gcpro1, gcpro2, etc.
17166 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17167 of the new macros.
17168 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17169 argument, for consistency with GCPRO2_VAR, etc: it is now the
17170 prefix of the variable, not the variable itself. All uses
17171 changed.
17172 * dired.c (directory_files_internal, file_name_completion):
17173 Rename locals to avoid shadowing.
17174
17175 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17176 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17177 dired.c's scmp function, had undefined behavior.
17178 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17179 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17180 * buffer.h: ... to here, because these macros use current_buffer,
17181 and the new implementation with inline functions needs to have
17182 current_buffer in scope now, rather than later when the macros
17183 are used.
17184 (downcase, upcase1): New static inline functions.
17185 (DOWNCASE, UPCASE1): Reimplement using these functions.
17186 This avoids undefined behavior in expressions like
17187 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17188 from race conditions in accessing the global variables
17189 case_temp1 and case_temp2.
17190 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17191 * lisp.h (case_temp1, case_temp2): Remove their decls.
17192 * character.h (ASCII_CHAR_P): Move from here ...
17193 * lisp.h: ... to here, so that the inline functions mentioned
17194 above can use them.
17195
17196 * dired.c (directory_files_internal_unwind): Now static.
17197
17198 * fileio.c (file_name_as_directory, directory_file_name):
17199 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17200 Now static.
17201 (file_name_as_directory): Use const pointers when appropriate.
17202 (Fexpand_file_name): Likewise. In particular, newdir might
17203 point at constant storage, so make it a const pointer.
17204 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17205 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17206 signedness issues.
17207 (Fset_file_times, Finsert_file_contents, auto_save_error):
17208 Rename locals to avoid shadowing.
17209
17210 * minibuf.c (choose_minibuf_frame_1): Now static.
17211 (Ftry_completion, Fall_completions): Rename or remove locals
17212 to avoid shadowing.
17213
17214 * marker.c (bytepos_to_charpos): Remove; unused.
17215
17216 * lisp.h (verify_bytepos, count_markers): New decls,
17217 so that gcc does not warn that these functions aren't declared.
17218
17219 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17220 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17221 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17222 (copy_text): Remove unused local var.
17223
17224 * filelock.c (within_one_second): Now static.
17225 (lock_file_1): Rename local to avoid shadowing.
17226
17227 * buffer.c (fix_overlays_before): Mark locals as initialized.
17228 (fix_start_end_in_overlays): Likewise. This function should be
17229 simplified by using pointers-to-pointers, but that's a different
17230 matter.
17231 (switch_to_buffer_1): Now static.
17232 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17233 (report_overlay_modification): Rename locals to avoid shadowing.
17234
17235 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17236 Fix pointer signedness issue.
17237 (sys_subshell): Mark local as volatile if checking for lint,
17238 to suppress a gcc -Wclobbered warning that does not seem to be right.
17239 (MAXPATHLEN): Define only if needed.
17240
17241 * process.c (serial_open, serial_configure): Move decls from here ...
17242 * systty.h: ... to here, so that they can be checked.
17243
17244 * fns.c (get_random, seed_random): Move extern decls from here ...
17245 * lisp.h: ... to here, so that they can be checked.
17246
17247 * sysdep.c (reset_io): Now static.
17248 (wait_for_termination_signal): Remove; unused.
17249
17250 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17251 (copy_keymap_item, append_key, push_text_char_description):
17252 Now static.
17253 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17254 (DENSE_TABLE_SIZE): Remove; unused.
17255 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17256 (describe_map_tree):
17257 Rename locals to avoid shadowing.
17258
17259 * keyboard.c: Declare functions static if they are not used elsewhere.
17260 (echo_char, echo_dash, cmd_error, top_level_2):
17261 (poll_for_input, handle_async_input): Now static.
17262 (read_char, kbd_buffer_get_event, make_lispy_position):
17263 (make_lispy_event, make_lispy_movement, apply_modifiers):
17264 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17265 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17266 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17267 (read_key_sequence, read_char): Mark locals as initialized.
17268 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17269
17270 * keyboard.h (make_ctrl_char): New decl.
17271 (mark_kboards): Move decl here ...
17272 * alloc.c (mark_kboards): ... from here.
17273
17274 * lisp.h (force_auto_save_soon): New decl.
17275
17276 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17277 (DEFINE_DUMMY_FUNCTION): New macro.
17278 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17279 Use it.
17280 (main): Add casts to avoid warnings
17281 if GCC considers string literals to be constants.
17282
17283 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17284
17285 * dbusbind.c: Pointer signedness fixes.
17286 (xd_signature, xd_append_arg, xd_initialize):
17287 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17288 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17289 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17290 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17291
17292 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17293 if GCC considers string literals to be constants.
17294 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17295
17296 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17297
17298 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17299 (print_preprocess, print_object): New macro to fix last change.
17300
17301 * print.c (print_preprocess): Don't forget font objects.
17302
17303 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17304
17305 * emacs.c (USAGE3): Doc fixes.
17306
17307 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17308
17309 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17310 structure.
17311
17312 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17313
17314 * lisp.h (VWindow_system, Qfile_name_history):
17315 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17316 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17317 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17318
17319 * w32select.c: Don't #include "keyboard.h".
17320 (run_protected): Add extern declaration for waiting_for_input.
17321
17322 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17323 * w32console.c (detect_input_pending, read_input_pending)
17324 (encode_terminal_code):
17325 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17326 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17327 (w32_system_caret_y, Qfile_name_history):
17328 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17329 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17330 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17331 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17332 * w32proc.c (Qlocal, report_file_error):
17333 * w32term.c (Vwindow_system, updating_frame):
17334 * w32uniscribe.c (initialized, uniscribe_font_driver):
17335 Remove unneeded extern declarations.
17336
17337 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17338
17339 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17340
17341 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17342
17343 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17344 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17345 These macros can no longer be used for assignment.
17346
17347 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17348 Assign struct members directly, instead of using BUF_BEGV etc.
17349 (record_buffer_markers, fetch_buffer_markers): New functions for
17350 recording and fetching special buffer markers.
17351 (set_buffer_internal_1, set_buffer_temp): Use them.
17352
17353 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17354
17355 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17356
17357 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17358 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17359
17360 * xdisp.c (hscroll_window_tree):
17361 (reconsider_clip_changes): Use PT instead of BUF_PT.
17362
17363 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17364
17365 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17366 $(EMACS_ROOT)/lib/intprops.h.
17367
17368 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17369
17370 Fix more problems found by GCC 4.5.2's static checks.
17371
17372 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17373 to unsigned char * to avoid compiler diagnostic.
17374 (xg_free_frame_widgets): Make it clear that a local variable is
17375 needed only if USE_GTK_TOOLTIP.
17376 (gdk_window_get_screen): Make it clear that this macro is needed
17377 only if USE_GTK_TOOLTIP.
17378 (int_gtk_range_get_value): New function, which avoids a diagnostic
17379 from gcc -Wbad-function-cast.
17380 (xg_set_toolkit_scroll_bar_thumb): Use it.
17381 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17382 diagnostic from gcc -Wbad-function-cast.
17383 (get_utf8_string, xg_get_file_with_chooser):
17384 Rename locals to avoid shadowing.
17385 (create_dialog): Move locals to avoid shadowing.
17386
17387 * xgselect.c (xg_select): Remove unused var.
17388
17389 * image.c (four_corners_best): Mark locals as initialized.
17390 (gif_load): Initialize transparent_p to zero (Bug#8238).
17391 Mark another local as initialized.
17392 (my_png_error, my_error_exit): Mark with NO_RETURN.
17393
17394 * image.c (clear_image_cache): Now static.
17395 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17396 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17397 (x_edge_detection): Remove unnecessary cast that
17398 gcc -Wbad-function-cast diagnoses.
17399 (gif_load): Fix pointer signedness.
17400 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17401 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17402
17403 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17404
17405 Improve quality of tests for time stamp overflow.
17406 For example, without this patch (encode-time 0 0 0 1 1
17407 1152921504606846976) returns the obviously-bogus value (-948597
17408 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17409 reports time overflow. See
17410 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17411 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17412 * editfns.c: Include limits.h and intprops.h.
17413 (TIME_T_MIN, TIME_T_MAX): New macros.
17414 (time_overflow): Move earlier, to before first use.
17415 (hi_time, lo_time): New functions, for an accurate test for
17416 out-of-range times.
17417 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17418 (Fget_internal_run_time): Don't assume time_t fits in int.
17419 (make_time): Use list2 instead of Fcons twice.
17420 (Fdecode_time): More accurate test for out-of-range times.
17421 (check_tm_member): New function.
17422 (Fencode_time): Use it, to test for out-of-range times.
17423 (lisp_time_argument): Don't rely on undefined left-shift and
17424 right-shift behavior when checking for time stamp overflow.
17425
17426 * editfns.c (time_overflow): New function, refactoring common code.
17427 (Fformat_time_string, Fdecode_time, Fencode_time):
17428 (Fcurrent_time_string): Use it.
17429
17430 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17431 * dired.c (make_time): Move to ...
17432 * editfns.c (make_time): ... here.
17433 * systime.h: Note the move.
17434
17435 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17436
17437 * fringe.c (update_window_fringes): Remove unused variables.
17438
17439 * unexmacosx.c (copy_data_segment): Also copy __got section.
17440 (Bug#8223)
17441
17442 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17443
17444 * termcap.c [MSDOS]: Include "msdos.h".
17445 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17446 Constify `char *' arguments and their references according to
17447 prototypes in tparam.h.
17448
17449 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17450
17451 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17452 Adapt all references accordingly.
17453
17454 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17455
17456 2011-03-11 Tom Tromey <tromey@redhat.com>
17457
17458 * buffer.c (syms_of_buffer): Remove obsolete comment.
17459
17460 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17461
17462 * termhooks.h (encode_terminal_code): Declare prototype.
17463
17464 * msdos.c (encode_terminal_code): Don't declare prototype.
17465
17466 * term.c (encode_terminal_code): Now external again, used by
17467 w32console.c and msdos.c.
17468
17469 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17470 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17471
17472 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17473
17474 Fix some minor problems found by GCC 4.5.2's static checks.
17475
17476 * fringe.c (update_window_fringes): Mark locals as initialized
17477 (Bug#8227).
17478 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17479
17480 * alloc.c (mark_fringe_data): Move decl from here ...
17481 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17482 to check its interface.
17483 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17484
17485 * fontset.c (free_realized_fontset): Now static.
17486 (Fset_fontset_font): Rename local to avoid shadowing.
17487 (fontset_font): Mark local as initialized.
17488 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17489
17490 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17491
17492 * xselect.c (x_disown_buffer_selections): Remove; not used.
17493 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17494 (x_own_selection, Fx_disown_selection_internal): Rename locals
17495 to avoid shadowing.
17496 (x_handle_dnd_message): Remove local to avoid shadowing.
17497
17498 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17499 so that the caller can use some name other than gcpro1.
17500 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17501 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17502 (Fx_backspace_delete_keys_p):
17503 Use them to avoid shadowing, and rename vars to avoid shadowing.
17504 (x_decode_color, x_set_name, x_window): Now static.
17505 (Fx_create_frame): Add braces to silence GCC warning.
17506 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17507 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17508 Remove unused locals.
17509 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17510 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17511 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17512 macros.
17513
17514 * xterm.h (x_mouse_leave): New decl.
17515
17516 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17517 Remove unused functions.
17518 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17519 (x_calc_absolute_position): Now static.
17520 (XTread_socket): Don't define label "out" unless it's used.
17521 Don't declare local "event" unless it's used.
17522 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17523 unless they are used.
17524 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17525 (x_fatal_error_signal): Remove; not used.
17526 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17527 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17528 (x_error_catcher, x_connection_closed, x_error_handler):
17529 (x_error_quitter, xembed_send_message, x_iconify_frame):
17530 (my_log_handler): Rename locals to avoid shadowing.
17531 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17532 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17533
17534 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17535 Rename or move locals to avoid shadowing.
17536 (tty_defined_color, merge_face_heights): Now static.
17537 (free_realized_faces_for_fontset): Remove; not used.
17538 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17539 does not deduce is never used uninitialized.
17540 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17541 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17542
17543 * terminal.c (store_terminal_param): Now static.
17544
17545 * xmenu.c (menu_highlight_callback): Now static.
17546 (set_frame_menubar): Remove unused local.
17547 (xmenu_show): Rename parameter to avoid shadowing.
17548 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17549 since they might point to immutable storage.
17550 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17551 since it's unused otherwise.
17552
17553 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17554 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17555 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17556 avoids a gcc -Wuninitialized diagnostic.
17557 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17558 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17559 does not deduce are never used uninitialized.
17560
17561 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17562
17563 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17564 * window.c (window_loop, size_window):
17565 (run_window_configuration_change_hook, enlarge_window): Likewise.
17566
17567 * window.c (display_buffer): Now static.
17568 (size_window): Mark variables that gcc -Wuninitialized
17569 does not deduce are never used uninitialized.
17570 * window.h (check_all_windows): New decl, to forestall
17571 gcc -Wmissing-prototypes diagnostic.
17572 * dispextern.h (bidi_dump_cached_states): Likewise.
17573
17574 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17575 shadowing.
17576 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17577 Include <limits.h>.
17578 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17579 and to avoid gcc -Wuninitialized warning.
17580 (load_charset_map): Mark variables that gcc -Wuninitialized
17581 does not deduce are never used uninitialized.
17582 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17583
17584 * coding.c (coding_set_source, coding_set_destination):
17585 Use "else { /* comment */ }" rather than "else /* comment */;"
17586 for clarity, and to avoid gcc -Wempty-body warning.
17587 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17588 a block, when the outer 'i' will do.
17589 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17590 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17591 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17592 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17593 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17594 Rename locals to avoid shadowing.
17595 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17596 * coding.c (emacs_mule_char, encode_invocation_designation):
17597 Now static, since they're not used elsewhere.
17598 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17599 (decode_coding_object, encode_coding_object, detect_coding_system):
17600 (decode_coding_emacs_mule): Mark variables that gcc
17601 -Wuninitialized does not deduce are never used uninitialized.
17602 (detect_coding_iso_2022): Initialize a local variable that might
17603 be used uninitialized. Leave a FIXME because it's not clear that
17604 this initialization is needed. (Bug#8211)
17605 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17606 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17607 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17608 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17609 Remove unused macros.
17610
17611 * category.c (hash_get_category_set): Remove unused local var.
17612 (copy_category_table): Now static, since it's not used elsewhere.
17613 * character.c (string_count_byte8): Likewise.
17614
17615 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17616 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17617
17618 * chartab.c (copy_sub_char_table): Now static, since it's not used
17619 elsewhere.
17620 (sub_char_table_ref_and_range, char_table_ref_and_range):
17621 Rename locals to avoid shadowing.
17622 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17623
17624 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17625 (BIDI_BOB): Remove unused macro.
17626
17627 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17628 deduce are never used uninitialized.
17629 * term.c (encode_terminal_code): Likewise.
17630
17631 * term.c (encode_terminal_code): Now static. Remove unused local.
17632
17633 * tparam.h: New file.
17634 * term.c, tparam.h: Include it.
17635 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17636 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17637 Move these decls to tparam.h, and make them agree with what
17638 is actually in tparam.c. The previous trick of using incompatible
17639 decls in different modules does not conform to the C standard.
17640 All callers of tparam changed to use tparam's actual API.
17641 * tparam.c (tparam1, tparam, tgoto):
17642 Use const pointers where appropriate.
17643
17644 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17645 * cm.h (struct cm): Likewise.
17646 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17647 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17648 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17649 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17650 (turn_on_face, init_tty): Likewise.
17651 * termchar.h (struct tty_display_info): Likewise.
17652
17653 * term.c (term_mouse_position): Rename local to avoid shadowing.
17654
17655 * alloc.c (mark_ttys): Move decl from here ...
17656 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17657
17658 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17659
17660 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17661
17662 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17663
17664 * search.c (compile_pattern_1): Remove argument regp, unused since
17665 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17666 (compile_pattern): Don't pass it.
17667
17668 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17669
17670 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17671 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17672 for ! HAVE_GTK3.
17673 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17674
17675 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17676
17677 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17678 gdk_window_get_screen, gdk_window_get_geometry,
17679 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17680 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17681 (xg_get_pixbuf_from_pixmap): New function.
17682 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17683 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17684 Call xg_get_pixbuf_from_pixmap instead of
17685 gdk_pixbuf_get_from_drawable.
17686 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17687 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17688 (xg_check_special_colors): Use GtkStyleContext and its functions
17689 for HAVE_GTK3.
17690 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17691 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17692 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17693 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17694 Call gtk_widget_get_preferred_size.
17695 (xg_frame_resized): gdk_window_get_geometry only takes 5
17696 parameters.
17697 (xg_win_to_widget, xg_event_is_for_menubar):
17698 Call gdk_x11_window_lookup_for_display.
17699 (xg_set_widget_bg): New function.
17700 (delete_cb): New function.
17701 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17702 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17703 (xg_set_background_color): Call xg_set_widget_bg.
17704 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17705 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17706 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17707 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17708 if ! HAVE_GTK3.
17709 (update_frame_tool_bar): Call gtk_widget_hide.
17710 (xg_initialize): Use GDK_KEY_g.
17711
17712 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17713 if ! HAVE_GTK3
17714 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17715
17716 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17717 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17718 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17719
17720 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17721
17722 * w32xfns.c (select_palette): Check success of RealizePalette against
17723 GDI_ERROR, not zero.
17724
17725 See ChangeLog.11 for earlier changes.
17726
17727 ;; Local Variables:
17728 ;; coding: utf-8
17729 ;; End:
17730
17731 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17732
17733 This file is part of GNU Emacs.
17734
17735 GNU Emacs is free software: you can redistribute it and/or modify
17736 it under the terms of the GNU General Public License as published by
17737 the Free Software Foundation, either version 3 of the License, or
17738 (at your option) any later version.
17739
17740 GNU Emacs is distributed in the hope that it will be useful,
17741 but WITHOUT ANY WARRANTY; without even the implied warranty of
17742 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17743 GNU General Public License for more details.
17744
17745 You should have received a copy of the GNU General Public License
17746 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.